## The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!

 Pages: 1 2 3 [4] 5 6 ... 17   Go Down
 Author Topic: SuperFractalThing: Arbitrary precision mandelbrot set rendering in Java.  (Read 67339 times) Description: 0 Members and 1 Guest are viewing this topic.
cKleinhuis
Fractal Senior

Posts: 7044

formerly known as 'Trifox'

 « Reply #45 on: May 24, 2013, 03:42:46 PM »

the irony is that floating points can be used when the absolute zoom level is very deep, resulting in a very small surround area,
as far as i understand it, the floats can be enough when the distance to the known point is small enough
but it is just a guess!!!
 Logged

---

divide and conquer - iterate and rule - chaos is No random!
mrflay
Alien

Posts: 36

 « Reply #46 on: May 25, 2013, 06:30:55 PM »

I've uploaded a new version to my website (version 0.3).

Changes:
Fix hang when trying to recreate claude's image in reply 38
Fix mandelbrot set going white when super sampling is turned off.
Out of memory exception checking when creating the png, when exporting an image
Show system memory in the export dialog.
 Logged
mrflay
Alien

Posts: 36

 « Reply #47 on: May 25, 2013, 07:02:32 PM »

Wow, nice technique!  I reimplemented the maths in OpenCL to run it on GPU (or CPU if you have no GPU that supports double precision):

https://gitorious.org/maximus/fractal-bits/trees/master/mandelbrot-delta-cl

Example output (25mins render time at 8192x8192 then downscaled):

http://mathr.co.uk/misc/2013-05-23_opencl_mandelbrot_perturbation_de.png

Coordinates
-1.744462934349396211092633065532440162654657162058301205300011967233679112768696718643911450570050500237635116030934362e+00 +
-2.204215166614661298784067716126285236126642700430015281578297171107705673910697920586811821018057499939594440402773182e-02 i
@  4e-99 period 5308

There are some white blobs that shouldn't be there - it's not maximum iteration count being reached, but something else (inappropriate reference point for those pixels? over/underflow somewhere?  mystery...)

25 minutes seems a bit slow. My i7 running SFT java can do that in about 7 minutes. Are you using the series approximation technique?
$\Delta_n = A_n\delta + B_n\delta^2 + C_n\delta^3$

Here's a link to the sft image
https://www.box.com/s/bbgj5nrey0veauf98vzc

Your white blobs occur because the blobby points move too far away from the reference point, causing the calculation to lose precision.  The points can't be distinguished from each other, so they come out the same colour. SFT mainly uses one reference point per image. However with this image SFT automatically uses two, which fixes the blobs.

I've attached a txt file that can be loaded into SFT.

Kalles Fraktaler
Fractal Senior

Posts: 1458

 « Reply #48 on: May 26, 2013, 10:42:53 AM »

Mrflay, thank you for your excellent maths!
Next step, for me atleast, is to use scaling to be able to zoom beyond e308.
I am able to multiply the variables with a constant that I later divide away. However that constant is also a double datatype, limited to e308, so I am only pushing the limit to e616 or something (atleast in theory).
But I want it to be unlimited!

Maybe I have to create a datatype with the same precision as double but with unlimited exponent. However a custom datatype will always get slower.
 Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
Dinkydau
Fractal Senior

Posts: 1616

 « Reply #49 on: May 26, 2013, 02:12:26 PM »

All the names I wanted on youtube was already used so eventually I just hitted the keyboard, I am using the same name here since most of my youtube movies are fractal zooms
You may regard the images as 200x200 pixels with the Mandelbrot pixel in the middle
And yes, the reference Mandelbrot pixel continues to be calculated in my test until all the SFT pixels are set, so in my opinion it should not matter if the SFT pixels are much deeper. However, you have a good point here and my opinion is wrong - if I use the deepest pixel as reference the fractal gets really good even in complex regions:
<Quoted Image Removed>
So, in order to make a general Mandelbrot explorer - how can the deepest pixel in an image be chosen prior calculation?
Or maybe we can just live with the errors it gets when just choose the pixel in the middle?
From what I understood, it doesn't matter where the reference point is that you're using, It doesn't actually have to be inside the region of the image, right? So could it be possible to make something like a max iterations slider, a slider to determine how many iterations the reference point should have? It may be very difficult to find which pixel in a grid needs the most iterations prior to rendering, but it may be easier to use reference points such as those between the circle and the cardoid of the main mandelbrot set. By approaching the real axis from above there, you could find points with as many iterations as you want.
 Logged

claude
Fractal Bachius

Posts: 563

 « Reply #50 on: May 26, 2013, 03:06:22 PM »

25 minutes seems a bit slow. My i7 running SFT java can do that in about 7 minutes. Are you using the series approximation technique?
<Quoted Image Removed>

No - I was using iteration because I also wanted to compute the derivative for distance estimator colouring (I didn't manage yet to solve the maths to get a similar more-direct approximation):

$Delta_{n+1} = 2 X_n Delta_n + Delta_n^2 + Delta_0$

I haven't checked the SFT source code yet - maybe you already do this - but with the series approximation it might work to use binary search for the lowest N that escapes, should be O(log(N)) time!

Quote
Your white blobs occur because the blobby points move too far away from the reference point, causing the calculation to lose precision.  The points can't be distinguished from each other, so they come out the same colour.  SFT mainly uses one reference point per image. However with this image SFT automatically uses two, which fixes the blobs.

I see - so automatically check when points might become indistinguishable, and retry with additional reference points.
 Logged
claude
Fractal Bachius

Posts: 563

 « Reply #51 on: May 26, 2013, 03:22:58 PM »

From what I understood, it doesn't matter where the reference point is that you're using, It doesn't actually have to be inside the region of the image, right?

X_0 should be "close enough" to your region so that each Y_0 - X_0 are representable to sufficient accuracy in the lower precision type.  Otherwise you could just pick X_0 = 0+0i as your reference!

Quote
It may be very difficult to find which pixel in a grid needs the most iterations prior to rendering

My idea would be to find the centre of a hyperbolic component (Jordan curve technique to find detect period, Newton's method to find location).  These points don't escape at all..

But would the periodicity mess up the series approximation?
 Logged
Dinkydau
Fractal Senior

Posts: 1616

 « Reply #52 on: May 26, 2013, 04:37:23 PM »

X_0 should be "close enough" to your region so that each Y_0 - X_0 are representable to sufficient accuracy in the lower precision type.  Otherwise you could just pick X_0 = 0+0i as your reference!

My idea would be to find the centre of a hyperbolic component (Jordan curve technique to find detect period, Newton's method to find location).  These points don't escape at all..

But would the periodicity mess up the series approximation?

I was thinking of how it would be to make an extremely high resolution render of the whole mandelbrot set. Then you could use such a reference point as between the circle and cardoid; it's accurate and within the region. Rendering a deep zoomed image would then be similar to rendering just a portion of that extremely high resolution image of the whole set. The math in the document from mr. Flay makes it looks easier than it is, I see.
 « Last Edit: May 26, 2013, 04:41:37 PM by Dinkydau » Logged

claude
Fractal Bachius

Posts: 563

 « Reply #53 on: May 26, 2013, 04:57:14 PM »

with the series approximation it might work to use binary search for the lowest N that escapes, should be O(log(N)) time!

Just tried this, fails miserably because the series approximation is only valid while C d^3 remains small compared to A d and B d^2 (as mentioned in the SFT maths PDF...).
 Logged
mrflay
Alien

Posts: 36

 « Reply #54 on: May 27, 2013, 12:11:40 AM »

Hi, it would be nice if you could compile a standalone jar file for desktop use for those like myself who have no clue what to do to compile this code into a useable application.

Thanks.

There is now a runnable jar here:
https://sourceforge.net/projects/suprfractalthng/

I've also separated out the JNLP source code so it should be easier for people to build it (Just ignore the SuperFractalThingJNLP file)
 Logged
Dinkydau
Fractal Senior

Posts: 1616

 « Reply #55 on: May 27, 2013, 12:48:26 AM »

Awesome! The program works so much better for me now.
 Logged

blob
Strange Attractor

Posts: 272

 « Reply #56 on: May 27, 2013, 02:40:49 AM »

Thanks!
 Logged
Kalles Fraktaler
Fractal Senior

Posts: 1458

 « Reply #57 on: May 27, 2013, 12:43:07 PM »

There is now a runnable jar here:
https://sourceforge.net/projects/suprfractalthng/

I've also separated out the JNLP source code so it should be easier for people to build it (Just ignore the SuperFractalThingJNLP file)

I am sorry, I am totally ignorant when it comes to Java, and this is probably not the right forum to ask this stupid question.
However, if anyone would be kind to help me, I would much appreciate it.

From my command prompt:

C:\>java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing)
 Logged

Want to create DEEP Mandelbrot fractals 100 times faster than the commercial programs, for FREE? One hour or one minute? Three months or one day? Try Kalles Fraktaler http://www.chillheimer.de/kallesfraktaler
blob
Strange Attractor

Posts: 272

 « Reply #58 on: May 27, 2013, 01:41:05 PM »

I am sorry, I am totally ignorant when it comes to Java, and this is probably not the right forum to ask this stupid question.
However, if anyone would be kind to help me, I would much appreciate it.

From my command prompt:

C:\>java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing)
If Java is properly installed, all you need to do is double click on the jar file in Windows Explorer.
 Logged
knighty
Fractal Iambus

Posts: 819

 « Reply #59 on: May 27, 2013, 02:21:43 PM »

Hi,
Interesting thread! All this looks extremely cool but I'm having troubles to run the application. Either the jar and the applet. I'm getting this error:
Code:
Exception in thread "main" java.lang.NumberFormatException: For input string: "1á024"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at SuperFractalThing.GetIterations(SuperFractalThing.java:493)
at SftComponent.UpdateImage(SftComponent.java:201)
at SftComponent.CreateImage(SftComponent.java:57)
at SuperFractalThing.initComponents(SuperFractalThing.java:623)
at SuperFractalThing.start(SuperFractalThing.java:148)
at SuperFractalThing.main(SuperFractalThing.java:132)

In the applet it says the exeption occures for the string "1 024" (with a space). I tried with firefox and chrome always with the same error. I've also tried to change the number format in the configuration panel but no success. :-/

BTW, your formula (in the document) looks like a Taylor expansion at zn.
fn(z+e) = fn(z) + d/dc fn(z) *e + 1/2 d²/dc² fn(z) *e² +... = zn + d/dc zn *e + 1/2 d²/dc² zn *e² +...
Right?
 Logged
 Pages: 1 2 3 [4] 5 6 ... 17   Go Down