Live data from Hacker News

The quest to decode the Mandelbrot set

quantamagazine.org

81–90 of 91 posts

Re: The quest to decode the Mandelbrot set

#81

Earlier quoted context omitted.

I remember as a teen I did mine in 68000 assembly on a Commodore Amiga to get it reasonable fast considering it was running on a 16 MHz CPU — i would say a few seconds to draw the canonical image — but IIRC it reached pretty fast the limit of math precision. At that time I didn't know what was a complex number, but was fascinated by the whole concept of fractals and how complex structures could be created with a rela…

A few seconds? Wow! I did a science fair project on the Mandelbrot set using my Amiga 2000, and it took me a good 45+ minutes to generate a single 320x200 color image. IIRC, I wrote the generator in some variant of Pascal, and was so happy with the performance increase over Basic on my C=128... I ran in to the precision limit pretty quickly, same as you. I didn't understand computers well enough to know that's what t…

If I'm not confusing it with something else, I seem to recall that when zooming on the set the calculation was nearly instantaneous. As you said, good times! ^__^

I still have that A500 but who knows where I put those floppies, I'm tempted to turn it on but I'm scared the PSU will blow itself...

Re: The quest to decode the Mandelbrot set

#82
>"When computers revealed all those smaller copies of the Mandelbrot set within itself, Douady and Hubbard wanted to explain their presence. They ended up turning to what’s known as renormalization theory, a technique that physicists use to tame infinities in the study of quantum field theories, and to connect different scales in the study of phase transitions."

https://en.wikipedia.org/wiki/Renormalization

Rampant conjecture/speculation: In the future, perhaps some Mathematician might discover a link between Renormalization Theory -- and the Digits Of Pi... since they seem related...

More specifically, between Renormalization Theory -- and algorithms for the Digits of Pi.

Of which, one notable one is The Chudnovsky algorithm:

https://en.wikipedia.org/wiki/Chudnovsky_algorithm

Which leads to Binary Splitting:

https://en.wikipedia.org/wiki/Binary_splitting

Which leads to Hypergeometric Series:

https://en.wikipedia.org/wiki/Hypergeometric_function#The_hy...

Which leads to Gauss' continued fraction:

https://wikimedia.org/api/rest_v1/media/math/render/svg/4d54...

https://en.wikipedia.org/wiki/Hypergeometric_function#:~:tex...

https://en.wikipedia.org/wiki/Gauss%27s_continued_fraction

Which leads to Analytic continuation of 3F2, 4F3 and higher functions:

https://fredrikj.net/blog/2009/12/analytic-continuation-of-3...

Which leads to my brain hurting ("Put down that Math book and step away from the Math!" ) -- because I can't handle all of this Math for now! :-) :-)

But there is this very cool picture there:

https://3.bp.blogspot.com/_rh0QblLk0C0/SzEG9q5FxaI/AAAAAAAAA...

Re: The quest to decode the Mandelbrot set

#83

Making a program to render a view of the Mandelbrot set is a fun exercise, I recommend it. I found a viewer that works in the browser: > Mandelbrot Viewer is a universal (desktop and mobile) vanilla JS implementation of a plain Mandelbrot set renderer – supporting mouse, touch and keyboard interaction. https://mandelbrot.silversky.dev/

If you want to keep zooming in the browser and have snappy gpu accelerated performance while basically never hitting “reached limit of numerical precision,” check out https://mandeljs.hgreer.com . The math to make this possible gets pretty funky: I go over the tricks I used at https://www.hgreer.com/JavascriptMandelbrot/

That really is very fast!

(I don't know if this is a known compromise of your technique (I couldn't find it mentioned), but I occassionally get a ring of varying thickness centred in the render with an inverted coluring to the rest of the pixels, or sometimes a solid colour. It varies is size and comes and goes without an obvious correlation to zoom level.)

Re: The quest to decode the Mandelbrot set

#84
post #78

Earlier quoted context omitted.

Thanks for taking the time to explain that. So, in terms I find easier to understand, MLC would mean that if I: -take any rectanglular section of the complex plain that includes part or all of the Mandelbrot set -draw the Mandelbrot set in black -pick an arbitary black point and colour it red -recursively colour every black point touching a red point (flood fill) Then every black point would be recoloured red. And th…

No, that's not right. Do those first four steps. You wouldn't (necessarily) cover every black point in your rectangle. Choose a remaining black point and flood fill from that, say green. Keep on doing this with different colours until you've covered every black point in your rectangle. You have a bunch of regions of different colours. Now, if the different coloured regions are all nicely separate, then your set is lo…

I think I understand now. Much appreciated! 'Locally connected' seems like quite poor terminology.

Re: The quest to decode the Mandelbrot set

#85

Earlier quoted context omitted.

If you want to keep zooming in the browser and have snappy gpu accelerated performance while basically never hitting “reached limit of numerical precision,” check out https://mandeljs.hgreer.com . The math to make this possible gets pretty funky: I go over the tricks I used at https://www.hgreer.com/JavascriptMandelbrot/

That really is very fast! (I don't know if this is a known compromise of your technique (I couldn't find it mentioned), but I occassionally get a ring of varying thickness centred in the render with an inverted coluring to the rest of the pixels, or sometimes a solid colour. It varies is size and comes and goes without an obvious correlation to zoom level.)

Yeah, I've been chasing that for a while. I've traced it to subnormal float handling. Here's the scenario: if you multiply the 32 bit float float 1 x 2^-127 by 1/8, you can't get 1x2^-130 because 130 isn't representable in a 8 bit exponent. On the CPU or a modern GPU, this is special cased to result in a "subnormal" float: .125 x 2^-127. However, this adds a ton of extra complexitity to the FPU. Old GPUs just gave up and say "It's zero." WebGL standardized on the old GPU behavior, so a modern GPU running webgl sets a flag to behave like the old GPUs.

I'm representing complex numbers as (real_mantissa + i * imag_mantissa) * 2^exp where real_mantissa and imag_mantissa are themselves 32 bit floats, and I can reduce the frequency of the colored rings in my shader by keeping the mantissas around ~1000 instead of ~1 (and reducing the exponent to keep the value the same) so that they are less likely to go subnormal, but I can't seem to get rid of the colored rings entirely.

I don't actually know the pathway through the code from subnormal underflow -> colored rings, but if you run a CUDA renderer with the same algorithm, the rings appear when you set the flag for "round subnormal floats to zero."

Re: The quest to decode the Mandelbrot set

#86
post #75

A very interesting cast of underdog characters appears in the article. You’ve got one guy with a relentless spirit to continue with mathematics in is spare time after being blacklisted from mainstream academia because of antisemitism. Another is a childhood prodigy, who set the record for the youngest American IMO team member, but got burned out as an adult and went into finance but found his way back through the men…

Note that the article refers to Soviet antisemitism: Jews were denied academic jobs, and they couldn't move abroad to work in their field, either. Not really related to mathematics as such (and definitely not about the mathematical community rejecting an antisemite).

> they couldn't move abroad to work in their field

Nobody could do that, Jews or not.

Re: The quest to decode the Mandelbrot set

#87

Earlier quoted context omitted.

A few seconds? Wow! I did a science fair project on the Mandelbrot set using my Amiga 2000, and it took me a good 45+ minutes to generate a single 320x200 color image. IIRC, I wrote the generator in some variant of Pascal, and was so happy with the performance increase over Basic on my C=128... I ran in to the precision limit pretty quickly, same as you. I didn't understand computers well enough to know that's what t…

If I'm not confusing it with something else, I seem to recall that when zooming on the set the calculation was nearly instantaneous. As you said, good times! ^__^ I still have that A500 but who knows where I put those floppies, I'm tempted to turn it on but I'm scared the PSU will blow itself...

A500 PSUs (particularly the 2nd one) are the most reliable and powerful.

The A500 themselves are built like tanks. Chances are it just works.

But watch out for trapdoor expansion. Most likely has a varta barrel battery in it, which will eventually leak and damage the expansion, and possibly also the computer itself.

I would recommend opening that trapdoor and removing/inspecting anything installed there as soon as possible.

These barrel batteries are only used to keep RTC, and the board will be fine w/o.

Re: The quest to decode the Mandelbrot set

#88

Earlier quoted context omitted.

I did some research on this on the side for my dissertation, but never published it. The fact centers approximate the boundary generalises to almost any point in the plane as a consequence of normality of some sequences, and generalises to most families of complex iteration under very mild conditions. I’ve had a preprint that I never felt like finishing for something like 15 years lying around.

If you ever decide to put it out as-is, I'd love to read it!

I should probably brush it up and just upload it to Arxiv. But then I need ok from my advisor, and maybe she’d rather not (since she’d be a coauthor of that..). I’ll try again, thanks for the encouragement.

Re: The quest to decode the Mandelbrot set

#89

Making a program to render a view of the Mandelbrot set is a fun exercise, I recommend it. I found a viewer that works in the browser: > Mandelbrot Viewer is a universal (desktop and mobile) vanilla JS implementation of a plain Mandelbrot set renderer – supporting mouse, touch and keyboard interaction. https://mandelbrot.silversky.dev/

If you want to keep zooming in the browser and have snappy gpu accelerated performance while basically never hitting “reached limit of numerical precision,” check out https://mandeljs.hgreer.com . The math to make this possible gets pretty funky: I go over the tricks I used at https://www.hgreer.com/JavascriptMandelbrot/

Wow nice! Though I seem to get artifacts both in Brave and Firefox on Android: https://imgur.com/a/vo2ZVOQ

https://mandeljs.hgreer.com/?;re=-0.751165720536567020384363...

Re: The quest to decode the Mandelbrot set

#90

Making a program to render a view of the Mandelbrot set is a fun exercise, I recommend it. I found a viewer that works in the browser: > Mandelbrot Viewer is a universal (desktop and mobile) vanilla JS implementation of a plain Mandelbrot set renderer – supporting mouse, touch and keyboard interaction. https://mandelbrot.silversky.dev/

I did it in High School on my crappy TI programmable calculator. Took for ever to calculate but it worked.
Post reply on HN