Trustworthy 2D/3D Julia set source code

  • 10 Replies
  • 345 Views

0 Members and 1 Guest are viewing this topic.

Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« on: July 12, 2019, 12:00:03 PM »
I uploaded a first version of the source code for my implementation of the "trustworthy Julia sets algorithm" by Figueiredo et al.

https://github.com/marcm200/julia-tsa-core

The functionality is pretty simple for now, but images up to 2^18 pixel width have been generated by it:
  • command line version
  • generating a Julia set from scratch for the quadratic, cubic, quartic or pentic case.
  • resuming computation from temporary raw data
  • refinement simulation

EDIT: Nov 18, 2019: I changed the title to reflect that there are currently two different programs in this topic - polynomial 2D and the trivariate polynomial 3D one (reply #9).

Linkback: https://fractalforums.org/programming/11/trustworthy-2d3d-julia-set-source-code/2930/
« Last Edit: November 18, 2019, 07:49:59 PM by marcm200, Reason: Title change »

Offline gerson

  • *
  • Fractal Furball
  • ***
  • Posts: 239
« Reply #1 on: July 12, 2019, 06:31:02 PM »
Could you release the .exe file?

Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« Reply #2 on: July 12, 2019, 09:21:44 PM »
Yes, I will in a couple of days. I'm trying to understand the licensing of the tdm64 compiler I'm using and if I can just compile and upload the exe of my code or if there's more legal things to do beforehand.

Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« Reply #3 on: July 14, 2019, 11:48:18 AM »
I uploaded 64bit (tested on Windows 10 and Wine for ubuntu 12.04) and 32bit (tested on Windows 10, 8.1, XP and Wine for ubuntu 12.04) executables. Also included are some DOS-batch files to demonstrate automatic computation of increasingly large images.


Offline gerson

  • *
  • Fractal Furball
  • ***
  • Posts: 239
« Reply #4 on: July 15, 2019, 04:52:18 PM »
I edited BATCH CREATION file to render an image, see the result:

@echo off
juliatsacore_quadratic_win32.exe 4096 -0.78 -0.05 2 6
copy _tsa_juliaset_Y00X00.bmp julia-tsa-core_19071501.bmp
pause

Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« Reply #5 on: July 15, 2019, 05:48:51 PM »
Nice, and a relief for me that the binaries actually work outside my house.

The underlying double floating type in my code however cannot accurately represent your value -0.78 (To my knowledge, decimal fractions can only be represented if they end in 5 or zero (mandatory condition but not sufficient alone).

So the algorithm actually computes a slightly different set (whatever the compiler makes out of it), I doubt it makes any visible difference, but to still be on the side of mathematical guarantee, I usually correct any value I like by:

Code: [Select]
floor or ceil(DECIMAL_SEED_VALUE * 2^25) / 2^25

Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« Reply #6 on: October 11, 2019, 08:10:08 PM »
New version with added functionality (source and binaries):

https://github.com/marcm200/julia-tsa-core/releases

  • detecting basins of attraction
  • detecting periodicity and immediate basins of periodic points
  • polynomials z^n+A*z+C for n=2..6 implemented in one binary
  • binaries provided for C++ double, long double and __float128 precision
  • seed value c can be used as a single value or a complex interval
  • check for sufficient precision of data type under current screen width, formula, complex plane range


Offline Adam Majewski

  • *
  • Fractal Feline
  • **
  • Posts: 195
« Reply #7 on: October 11, 2019, 08:52:02 PM »
Can you check 89 petals:
https://www.math.univ-toulouse.fr/~cheritat/GalII/L34_89_b.png

Quadratic  polynomial with a parabolic fixed point with many petals : 34/89


Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« Reply #8 on: October 12, 2019, 01:37:07 PM »
I don't think this set is computable in a trustworthy manner to show interior cells.

The seed value I found in wikibooks is c=-0.390837354761211+0.586641524321638*i (I suspect it's a truncated/rounded value).
Julia sets with specific c values are only computable here if the real and imaginary parts both are dyadic fractions due to the underlying datatype.  Is the exact seed such a rational p/2^n ?

If not or if it is irrational I could only compute a set-family using a small complex box interval around the c seed. However since the actual seed is on the boundary of the Mandelbrot set, I think any complex interval would encompass both interior and exterior of the Mset and hence the set-family will contain both Cantor dust sets without interior and sets with interior. So the TSA algorithm would never show black cells (black when using c as an interval is the intersection of all black regions (2013 paper by Figueiredo, page 7).

A complex plane region where the whole set for the exact value resides, would be computable - if that is sufficient for your purposes. The image below shows such an interval Julia set family at level 16 (trustworthily downscaled 16-fold).

c=( [-13114327..-13114324] + i* [19684422..19684425] ) *2^-25

Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« Reply #9 on: November 18, 2019, 07:47:07 PM »
I uploaded a first version of the 3D Julia set (forum link) source code and binaries:

https://github.com/marcm200/juliatsa3d-core

The functionality is the same as for the 2D version:

  • command line version
  • main purpose: finding cycles and immediate basins / attraction basins
  • several trivariate polynomial functions implemented: from bugman123.com/Hypercomplex, Tyler Smith's formula here and some of my own

Binaries are provided for Win32 (XP, 8.1), Win64 (10) and the latter worked on Wine for Ubuntu 12, with and without compiler optimizations and with C++ datatype double.

(I changed the topic's title to reflect there are actually two different programs - and not to flood the forum with topics named trustworthy or true shape).

Offline marcm200

  • *
  • Fractal Frogurt
  • ******
  • Posts: 492
« Reply #10 on: December 10, 2019, 03:26:04 PM »
Two tools for the TSA algorithm:

Tool: TSApredictor (works only for the 2D version)
Purpose: To predict a refinement level at which interior cells can be detected.
Code and binaries for win32, win64 at: https://github.com/marcm200/TSApredictor

For limitations of the fast prediction process, please see forum link and the above-linked README.

Tool: bitPrec
Purpose: For user-entered real-valued expressions (e.g. component functions of complex or triplex iterative polynomials), the tool analyzes which datatype (double, long double, float128) is needed at a specific refinement level to provide error-free computation.

Code and binaries for win32, win64 at: https://github.com/marcm200/bitPrec

The command-line parser is very simple (variables and numbers are only one-digit/character, so 12*x must be written as 6*x+6*x, no unary operator, bracket-free expression) (detailed description in README in above link).

Below is an example output for a cubic complex polynomial:

Code: [Select]
z^3+A*z+c == (x+i*y)^3 + (f+g*i)*(x+i*y) + (d+e*i)

|re(C)=d|<=2,|im(C)=e|<=2
|re(A)=f|<=2,|im(A)=g|<=2
|x|<=4,|y|<=4

axisrange = -4 .. +4
SCALE := (2*axis range) / (2^REFINEMENT LEVEL == pixels per axis)
  := 2^-(REF-3)

notation: e.g. 3.21 = 24
  3 bits for the integer part
 21 bits for the fractional part
 24 total bits


===============================================================
|real z_new| <=
                 |d| ||maxw=  2 2.0 .25
             + |f*x| ||maxw=  8 4.0 (.25)+(.(SCALE))
             + |g*y| ||maxw=  8 4.0 (.25)+(.(SCALE))
             + |x^3| ||maxw= 64 7.0 3*(.(SCALE))
     + |3*(x*(y^2))| ||maxw=192 8.0 (.0)+((.(SCALE))+(2*(.(SCALE))))
-----------------------------------------------------------
                ||maxw=274 9.0 max(.25,(.25)+(.(SCALE)),3*(.(SCALE)),(.0)+((.(SCALE))+(2*(.(SCALE)))))

REF 10 9.32 = 41 => double
REF 11 9.33 = 42 => double
REF 12 9.34 = 43 => double
REF 13 9.35 = 44 => double
REF 14 9.36 = 45 => double
REF 15 9.37 = 46 => double
REF 16 9.39 = 48 => double
REF 17 9.42 = 51 => double
REF 18 9.45 = 54 => long double
REF 19 9.48 = 57 => long double
REF 20 9.51 = 60 => long double
REF 21 9.54 = 63 => float128
REF 22 9.57 = 66 => float128
REF 23 9.60 = 69 => float128
REF 24 9.63 = 72 => float128

===============================================================
|imag z_new| <=
                 |e| ||maxw=  2 2.0 .25
             + |f*y| ||maxw=  8 4.0 (.25)+(.(SCALE))
             + |g*x| ||maxw=  8 4.0 (.25)+(.(SCALE))
     + |3*((x^2)*y)| ||maxw=192 8.0 (.0)+((2*(.(SCALE)))+(.(SCALE)))
             + |y^3| ||maxw= 64 7.0 3*(.(SCALE))
-----------------------------------------------------------
                ||maxw=274 9.0 max(.25,(.25)+(.(SCALE)),(.0)+((2*(.(SCALE)))+(.(SCALE))),3*(.(SCALE)))

REF 10 9.32 = 41 => double
REF 11 9.33 = 42 => double
REF 12 9.34 = 43 => double
REF 13 9.35 = 44 => double
REF 14 9.36 = 45 => double
REF 15 9.37 = 46 => double
REF 16 9.39 = 48 => double
REF 17 9.42 = 51 => double
REF 18 9.45 = 54 => long double
REF 19 9.48 = 57 => long double
REF 20 9.51 = 60 => long double
REF 21 9.54 = 63 => float128
REF 22 9.57 = 66 => float128
REF 23 9.60 = 69 => float128
REF 24 9.63 = 72 => float128



clip
Minuscule source code for Lyapunov images (ASCII style)

Started by marcm200 on Programming

8 Replies
497 Views
Last post March 20, 2019, 07:37:58 PM
by marcm200
question
GitHub source deployment

Started by ygidaslm on Kalles Fraktaler

5 Replies
279 Views
Last post May 20, 2018, 07:21:53 PM
by ygidaslm
xx
Code: (Select) not working?

Started by Anon on Forum Help And Support

3 Replies
178 Views
Last post February 19, 2018, 03:02:31 PM
by 3DickUlus
xx
Code Snippets for Fragmentarium

Started by Sabine62 on Code Snippets (fragments)

0 Replies
164 Views
Last post November 02, 2018, 01:23:11 PM
by Sabine62
xx
Mandelbrot Set Code in System RPL or User RPL

Started by WAUthethird on Programming

3 Replies
474 Views
Last post October 21, 2017, 09:11:54 AM
by WAUthethird