Logo by Pauldelbrot - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. December 05, 2025, 03:41:29 AM


Login with username, password and session length


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


Pages: 1 ... 12 13 [14] 15 16 ... 24   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: *Continued* SuperFractalThing: Arbitrary precision mandelbrot set rendering in Java.  (Read 59561 times)
0 Members and 3 Guests are viewing this topic.
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #195 on: August 12, 2016, 02:12:49 PM »

the code is available, and yes most of it is written in assembly to try to achieve as much performance as possible.  though some drawbacks to that are being buggy, unmaintainable, and nonportable.
in any case, i only mentioned it to point out that some of these algorithms may not be as perfect as they maybe could be, and to encourage any intelligent and honest conversation that might be had here with regard to our understanding of them and what further progress might be made.
Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #196 on: August 12, 2016, 11:38:03 PM »

since nobody else seems interested, i guess i'll try implementing knighty's wall of math and report back with any success stories, though i dont know if i will be able to decipher it.  it would be neat if you guys could dumb it down once in a while for us non-math folk.  wink  for instance, i dont know what R0 should be.  i dont know what E is.  i dont know what this means:  "E = [0,1]*exp(i*]-infinity, +infinity[".  and im not sure how all this is supposed to be used either.  is this intended for the checking against arbitrary points to determine the number of iterations to then skip for all points in the image, like how people have been doing?  or is this R thing supposed to be used during the initialization of each point, where if an error tolerance is exceeded you just try that point again later with another reference point?

That would be great!

E is an error symbol. "E = [0,1]*exp(i*]-infinity, +infinity[" is just a way to say "E is the unit disc centered at 0". One doesn't need to worry about it when writing the code. The only formula needed is:

Rn+1 = |Bn|2 + 2*(|zn|*Rn + |An|*|Cn|) + 2*|tmax|*(|An|*Rn + |Bn|*|Cn|) + |tmax2|*(|Cn|2 + 2*|Bn|*Rn) + 2*|tmax3|*|Cn|*Rn + |tmax4|*Rn2

Rn+1*|tmax|4 is the radius of the disc interval. It is the maximal error that we do by neglecting the higher order terms of the series approximation (truncation error).
R0 = 0. Simply because there is no truncation error. It remaines equal to zero until the third iteration (or so wink)

The question that we are asking is: What is the maximal allowed error on y that corresponds to some allowed error on x?
In other words :
|Deltay| <= |y'|* |Deltax|

Here |Deltax| will be some fraction of the size of the area corresponding to a pixel. It depends on the resolution and the zoom factor.
y will correspond to Delta_n and y' to the derivative of Delta_n (Wich is: An + 2*Bn*t + 3*Cn*t2)
|Deltay| is simply given by Rn
Therefore, the accuracy of the series approximation is sufficient if the following condition is met:
Rn <= Delta_n'* |Deltat|

I did some mistakes here. Good news: It should be:
Rn*|tmax|4 <= |\Delta_n'|* |\Delta t|
Because the trucation error is Rn*|tmax|4 not Rn.
As it is that formula have to be computed for each pixel because
\Delta_n'=An + 2*Bn*t + 3*Cn*t2
is function of t.
But we are interested in its minimal absolute value among all the values of t spanning the zoomed area. A lower bound can be computed using interval arthmetics. I'll come back tomorrow after doing the compuations and checking them. cheesy

PS: For deep enought zooms, the bottelneck is mainly in the computation of the references. It is possible to avoid unnecessary computations by reusing the reference until glitches occure. For example, if the reference is centered on the root of a minibrot, one can still use that same reference when zooming near that minibrot. It is also possible to refine a refrence using perturbation (+ Newton).
« Last Edit: August 13, 2016, 10:19:02 PM by knighty » Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #197 on: August 13, 2016, 10:37:12 PM »

Ok!
The last formula for cheking if the series appriximation is good at iteration n should be:

Rn*|tmax|4 <= (|An| - 2*|Bn|*|tmax| - 3*|Cn|*|tmax|2)* |\Delta t|

Where:

Rn*|tmax|4  is an upper bound on the truncation error.

(|An| - 2*|Bn|*|tmax| - 3*|Cn|*|tmax|2) is a lower bound on the absolute value of the derivative. As it is, it can be negative which means that the derivative could be 0 somewhere so the approximation's quality is likely to be too low.

|\Delta t| is related to the "radius" that corresponds to a pixel.

|tmax| is the maximal distance between the reference point and any point of the rendered area.
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #198 on: August 14, 2016, 12:25:20 AM »

cool, thanks for your work on this!  i'll [try to] check it out  grin

for extrapolating your formulas to an arbitrary number of terms, i see the pattern here:

Rn*|tmax|4 <= (|An| - 2*|Bn|*|tmax| - 3*|Cn|*|tmax|2)* |\Delta t|

but this one im not sure:

Rn+1 = |Bn|2 + 2*(|zn|*Rn + |An|*|Cn|) + 2*|tmax|*(|An|*Rn + |Bn|*|Cn|) + |tmax2|*(|Cn|2 + 2*|Bn|*Rn) + 2*|tmax3|*|Cn|*Rn + |tmax4|*Rn2

maybe i just need to look at it longer
« Last Edit: August 14, 2016, 05:25:53 AM by quaz0r » Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #199 on: August 14, 2016, 10:50:31 AM »

A, B and C are 3 terms, but KF, and MM are using arbitrary many terms.
And therefore we can render magnum opus thousands or ten-thousands times faster than FX...
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
http://www.facebook.com/kallesfraktaler
stardust4ever
Fractal Bachius
*
Posts: 513



« Reply #200 on: August 14, 2016, 11:02:59 AM »

A, B and C are 3 terms, but KF, and MM are using arbitrary many terms.
And therefore we can render magnum opus thousands or ten-thousands times faster than FX...
hehe... evil
Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #201 on: August 14, 2016, 03:01:12 PM »

One can get the formula of R for any number of terms in the series approximation.
The formula is given for a 3-terms only for simplicity and in order to test the idea.
Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #202 on: August 16, 2016, 03:46:01 AM »

 cheesy  cheesy  cheesy

it works, and it works WELL!  it is taking me farther than the old method of checking when the last term grows larger than the others by a certain amount yada yada, and is even skipping a few more than my experiment with using series acceleration error as the check (which itself was better than the other thing)!  and everything rendering fine as far as i can tell so far.  awesome!  dancing banana dancing chilli

noting though that my program is currently setup to use a minimum of 8 terms, so hopefully it still bails soon enough when using the same number of terms.

also i wasnt sure what \Delta t is supposed to be, so i made it the distance between adjacent points.
Logged
Pauldelbrot
Fractal Senior
******
Posts: 2592



pderbyshire2
« Reply #203 on: August 16, 2016, 04:20:36 AM »

cheesy  cheesy  cheesy

it works, and it works WELL!  it is taking me farther than the old method of checking when the last term grows larger than the others by a certain amount yada yada, and is even skipping a few more than my experiment with using series acceleration error as the check (which itself was better than the other thing)!  and everything rendering fine as far as i can tell so far.  awesome!  dancing banana dancing chilli

noting though that my program is currently setup to use a minimum of 8 terms, so hopefully it still bails soon enough when using the same number of terms.

also i wasnt sure what <Quoted Image Removed> is supposed to be, so i made it the distance between adjacent points.

Do you have (pseudo) code?
Logged

claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #204 on: August 16, 2016, 05:11:26 AM »

cool, thanks for your work on this!  i'll [try to] check it out  grin

for extrapolating your formulas to an arbitrary number of terms, i see the pattern here:

Rn*|tmax|4 <= (|An| - 2*|Bn|*|tmax| - 3*|Cn|*|tmax|2)* |<Quoted Image Removed>|

but this one im not sure:

m = 1
Rn+1 = |An|2 + 2*|zn|*Rn + 2*|tmax|*|An|*Rn + |tmax2| * Rn2

m = 2
Rn+1 = 2*|zn|*Rn +2*|An|*|Bn| + |tmax|*(2*|An|*|Rn|+|Bn|2) + |tmax2|*2*|Bn|*Rn + |tmax3|*Rn2

m = 3 (from above quote)
Rn+1 = |Bn|2 + 2*(|zn|*Rn + |An|*|Cn|) + 2*|tmax|*(|An|*Rn + |Bn|*|Cn|) + |tmax2|*(|Cn|2 + 2*|Bn|*Rn) + 2*|tmax3|*|Cn|*Rn + |tmax4|*Rn2

Quote
maybe i just need to look at it longer
trying the same here cheesy  mostly on paper doing boring algebra to get a feel for how it works (results above for m=1,2)

writing with indices helps, addition of letters is awkward - something like z_n \to a_0 ; A_n \to a_1 ; B_n \to a_2 ; C_n \to a_3 ; R_n -> a_{m+1} ; \ldots
(omitting the n that occurs everywhere seems to make sense too for this part of the algebra scribbling on paper)

cool stuff knighty!


UPDATE
Using the notation from my blog post, https://mathr.co.uk/blog/2016-03-06_simpler_series_approximation.html
Recall the coefficients are
a_{1,n+1} = 2 z_n a_{1,n} + 1
a_{k,n+1} = 2 z_n a_{k,n} + \sum_{j=1}^{k-1} a_{j,n} a_{k-j,n}
Use m "a" terms, so the coefficient of the truncated part starting \left<\left<c\right>\right>^{m+1} is R_n \hat{1}  (using hat for disc interval), and writing T for tmax, and aliasing z_n = a_0 and R_n = a_{m+1}, I think it boils down to this:

R_{n+1} = \sum_{j=0}^{m+1} \left( \sum_{k=j}^{m+1} |a_k| |a_{m+1 + j - k}| \right) |T|^{j}

note this includes some terms twice multiplied in opposite orders, could be implemented by multiplying by 2 instead of repeated calculations
« Last Edit: August 16, 2016, 05:40:41 AM by claude » Logged
quaz0r
Fractal Molossus
**
Posts: 652



« Reply #205 on: August 16, 2016, 05:43:28 AM »

Quote
Do you have (pseudo) code?

truncError = 0;
series approx loop {
    calculate_series_coefficients(A, B, C);
    truncError = |B|2 + 2*(|z|*truncError + |A|*|C|) + 2*|tmax|*(|A|*truncError + |B|*|C|) + |tmax2|*(|C|2 + 2*|B|*truncError) + 2*|tmax3|*|C|*truncError + |tmax4|*truncError2;
    if ((truncError * |tmax|4) > ((|A| - 2*|B|*|tmax| - 3*|C|*|tmax|2) * |\Delta t|)) {
        // this is the iteration i'll initialize all other points at
        anything_else_you_do_when_you_bail_on_series_approx();
    }
}

i just kinda copy pasted what was already here, maybe that doesnt help much grin

z is the reference Zn
tmax i just set to the sidelength of the image for simplicity
\Delta t i set to the distance between points

im not sure if thats all right but thats what i did just now and it seems to work.

update:  continued testing the last hour or two with no problems.  manual zooming for a while and also tested an ultradeep location.
« Last Edit: August 16, 2016, 06:42:11 AM by quaz0r » Logged
Pauldelbrot
Fractal Senior
******
Posts: 2592



pderbyshire2
« Reply #206 on: August 16, 2016, 07:18:09 AM »

truncError = 0;
series approx loop {
    calculate_series_coefficients(A, B, C);
    truncError = |B|2 + 2*(|z|*truncError + |A|*|C|) + 2*|tmax|*(|A|*truncError + |B|*|C|) + |tmax2|*(|C|2 + 2*|B|*truncError) + 2*|tmax3|*|C|*truncError + |tmax4|*truncError2;
    if ((truncError * |tmax|4) > ((|A| - 2*|B|*|tmax| - 3*|C|*|tmax|2) * |<Quoted Image Removed>|)) {
        // this is the iteration i'll initialize all other points at
        anything_else_you_do_when_you_bail_on_series_approx();
    }
}

i just kinda copy pasted what was already here, maybe that doesnt help much grin

z is the reference Zn
tmax i just set to the sidelength of the image for simplicity
<Quoted Image Removed> i set to the distance between points

im not sure if thats all right but thats what i did just now and it seems to work.

update:  continued testing the last hour or two with no problems.  manual zooming for a while and also tested an ultradeep location.

Thanks.

This looks like it's for just three terms though...
Logged

quaz0r
Fractal Molossus
**
Posts: 652



« Reply #207 on: August 16, 2016, 07:34:33 AM »

Quote
This looks like it's for just three terms though

indeed, you guys are the mathematicians, i await your brilliance to shed further light on the matter..  smiley
it looks like claude may have posted a formula for arbitrary number of terms there, though i have a hard time decoding that math stuff
Logged
claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #208 on: August 16, 2016, 11:52:08 AM »

Rn+1 = |Bn|2 + 2*(|zn|*Rn + |An|*|Cn|) + 2*|tmax|*(|An|*Rn + |Bn|*|Cn|) + |tmax2|*(|Cn|2 + 2*|Bn|*Rn) + 2*|tmax3|*|Cn|*Rn + |tmax4|*Rn2

Rn+1*|tmax|4 is the radius of the disc interval. It is the maximal error that we do by neglecting the higher order terms of the series approximation

Hm, with Rn depending on |tmax| like that, it makes it harder to cache the series approximation coefficients when zooming around a still-good primary reference...

Running some tests with order m=16 now, seems promising so far it skips at most 1 period of the reference? while other skipping methods allow skipping beyond that.  (I got rid of the off-by-one bugs elsewhere in the code).  Demonstration-quality C++ code attached, note that it detects glitches but doesn't correct them, and location is hard-coded with a zoom sequence.

I plan on updating it with glitch correction and exterior distance estimation once I get the truncation error stuff for the derivative's series approximation sorted.  Equation scribbling ahoy...

* mandelbrot-series-approximation-v1.cpp.txt (6.6 KB - downloaded 67 times.)
« Last Edit: August 16, 2016, 12:22:38 PM by claude, Reason: skipping 1 period only? » Logged
Kalles Fraktaler
Fractal Senior
******
Posts: 1458



kallesfraktaler
WWW
« Reply #209 on: August 16, 2016, 02:07:31 PM »

truncError = 0;
series approx loop {
    calculate_series_coefficients(A, B, C);
    truncError = |B|2 + 2*(|z|*truncError + |A|*|C|) + 2*|tmax|*(|A|*truncError + |B|*|C|) + |tmax2|*(|C|2 + 2*|B|*truncError) + 2*|tmax3|*|C|*truncError + |tmax4|*truncError2;
    if ((truncError * |tmax|4) > ((|A| - 2*|B|*|tmax| - 3*|C|*|tmax|2) * |<Quoted Image Removed>|)) {
        // this is the iteration i'll initialize all other points at
        anything_else_you_do_when_you_bail_on_series_approx();
    }
}

i just kinda copy pasted what was already here, maybe that doesnt help much grin

z is the reference Zn
tmax i just set to the sidelength of the image for simplicity
<Quoted Image Removed> i set to the distance between points

im not sure if thats all right but thats what i did just now and it seems to work.

update:  continued testing the last hour or two with no problems.  manual zooming for a while and also tested an ultradeep location.
Seems tmax and \Delta t are limited to double precision, unless you are using some other datatype?
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
http://www.facebook.com/kallesfraktaler
Pages: 1 ... 12 13 [14] 15 16 ... 24   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Java applet for exploring the Mandelbrot set Announcements & News Paton 5 8073 Last post March 26, 2007, 06:03:34 PM
by Paton
What range/precision for fractional escape counts for Mandelbrot/Julia sets? Programming Duncan C 7 12182 Last post May 01, 2007, 08:23:13 PM
by Duncan C
Java Mandelbrot segment Help & Support fractalwizz 10 2445 Last post December 29, 2008, 08:01:24 PM
by cKleinhuis
[Java] Double-double library for 128-bit precision. Programming Zom-B 10 18659 Last post December 20, 2010, 04:03:48 AM
by David Makin
SuperFractalThing: Arbitrary precision mandelbrot set rendering in Java. Announcements & News « 1 2 ... 16 17 » mrflay 252 110984 Last post August 17, 2016, 11:59:31 PM
by cKleinhuis

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 1.218 seconds with 24 queries. (Pretty URLs adds 0.035s, 2q)