True shape/IA 2D/3D Julia set source code

  • 13 Replies
  • 606 Views

0 Members and 1 Guest are viewing this topic.

Offline marcm200

  • *
  • Fractal Frankfurter
  • *
  • Posts: 625
« 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/true-shapeia-2d3d-julia-set-source-code/2930/
« Last Edit: January 21, 2020, 01:36:14 PM by marcm200, Reason: Changed topic\'s title »

Offline gerson

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

Offline marcm200

  • *
  • Fractal Frankfurter
  • *
  • Posts: 625
« 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 Frankfurter
  • *
  • Posts: 625
« 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: 291
« 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 Frankfurter
  • *
  • Posts: 625
« 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 Frankfurter
  • *
  • Posts: 625
« 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 Furball
  • ***
  • Posts: 248
« 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 Frankfurter
  • *
  • Posts: 625
« 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 Frankfurter
  • *
  • Posts: 625
« 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 Frankfurter
  • *
  • Posts: 625
« 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


Offline marcm200

  • *
  • Fractal Frankfurter
  • *
  • Posts: 625
« Reply #11 on: January 08, 2020, 03:27:05 PM »
I uploaded a new version of julia-tsa-core (2.0.1).

New features:
  • Detection of periodic points (very memory-demanding)
  • optimized memory usage - higher levels possible, especially for sparse objects like dendrites.
  • performance gains by algorithmic and bounding box optimizations (sometimes 3-fold)
  • support for (faster than float128) higher precision datatypes fpa (fixed point, 32/96 bits) and Robert Munafo's f107 (107 bit mantissa)

Data storage file format has changed, a CONVERT-command is supported (see item 5 in README at https://github.com/marcm200/julia-tsa-core).


Offline marcm200

  • *
  • Fractal Frankfurter
  • *
  • Posts: 625
« Reply #12 on: January 21, 2020, 01:35:39 PM »
New release (1.1.0) of juliatsa3dcore.

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

Performance improvements:

  • reduced number of bounding box calculations (split color propagation)
  • reduced memory transfer to cache (low-resolution reverse cell graph)
  • support for Robert Munafo's fast double-double f107 datatype
  • optimized calculation path for __float128 and f107 bbx calculations in some formulas
  • faster internal viewer to create final 2D image
  • some new formulas added (names SHnn)

(I changed the topic's title to "true shape/IA" as I think the former title was too ambiguous).

Offline marcm200

  • *
  • Fractal Frankfurter
  • *
  • Posts: 625
« Reply #13 on: March 10, 2020, 08:35:44 PM »
New release of julia-tsa-core (2.1.0):

New features:
  • performance improvements: precomputing sub-expressions and whole screenRects
  • convergence improvements: rearranged IA formulas
  • better memory usage to allow for higher reverse cell graph resolution
  • added functions z^7+A*z+c and z^8+A*z+c
  • added function (z^2+c)^2+c as a 2-iterate version of z^2+c to split cycles
  • support for triple-double datatype f161 by Robert Munafo
  • new periodicity routine that works for levels 19 and above (solely detects immediate basins) (command CMD=PERIOD,M3)
  • validation routine for correctness of usage of C++ number type double independent of precision requirement (command CMD=FASTDTCHK)

Disclaimer:
All my daily programming goes on in win64 with 48 GB memory available.
I tested (part of the) program in win32 and/or with lower memory but cannot guarantee that no "bad_alloc" error will occur.


clip
Minuscule source code for Lyapunov images (ASCII style)

Started by marcm200 on Programming

8 Replies
600 Views
Last post March 20, 2019, 07:37:58 PM
by marcm200
clip
3d Julia sets: True shape

Started by marcm200 on Image Threads

31 Replies
959 Views
Last post January 20, 2020, 11:42:23 AM
by marcm200
xx
Julia sets: True shape and escape time

Started by marcm200 on Fractal Mathematics And New Theories

214 Replies
6953 Views
Last post Today at 10:41:44 AM
by marcm200
clip
True-shape based C++ oracle for the int-/exterior of Julia sets

Started by marcm200 on Programming

6 Replies
311 Views
Last post August 23, 2019, 10:47:10 AM
by marcm200
clip
Rational maps: True shape

Started by marcm200 on Fractal Mathematics And New Theories

3 Replies
211 Views
Last post October 26, 2019, 10:09:47 AM
by marcm200