Is there any practical way to perform calculations such as those involved in generating the Mandelbrot Set for values for precise that what double
or long double
can provide? I was thinking of possibly having two variables(either double or long), one storing the value similar to scientific notation and the other storing the negative log10 of the value, but I'm not sure if there would actually be a way to perform the calculation like this.
Asked
Active
Viewed 1,248 times
3

Yaakov Schectman
- 301
- 1
- 2
- 10
-
6Sounds like you want a [arbitrary precision math library](http://stackoverflow.com/questions/2568446/the-best-cross-platform-portable-arbitrary-precision-math-library) – NathanOliver Mar 30 '17 at 13:01
-
Is there a way to use arbitrary precision math libraries in OpenCL kernels from Java? – Yaakov Schectman Mar 30 '17 at 13:02
-
And what do OpenCL kernels and Java have to do with C++? – Bartek Banachewicz Mar 30 '17 at 13:03
-
Have a read of this blog - lots of info: https://randomascii.wordpress.com/category/fractals/ – Richard Critten Mar 30 '17 at 13:09
-
Fixed-point arithmetic can work, because x^2 + y^2 stays < 4 (when 2 is the typical escape value). – Weather Vane Mar 30 '17 at 13:16
-
@WeatherVane: if `x` has a huge number of digits, you still need some calculation mechanism, which is why it is simpler to use an arbitrary precision library (as @NathanOliver mentioned) – karatedog Mar 31 '17 at 07:58
-
@karatedog of course you need computation with fixed point, but arbitrary precision floating point libraries implemented in software are less efficient because they must normalise the sigificand. Fixed-point works well here because the maximum value is known. The [results differ](https://www.mathworks.com/examples/stateflow/mw/stateflow_product-sf_mandelbrot_fixpt-fixed-point-mandelbrot-set) but the idea is to get pretty pictures as cheaply as possible. Sharp detail near the boundary of the Mset is unachievable anyway, and when zooming is undesirable (as in any dynamic graphic). – Weather Vane Apr 01 '17 at 19:39