1

I am creating a mandelbrot set application in java, but after a certain zoom it starts to look weird because doubles are not accurate enough. I refactored my code to work with BigDecimals, but the performance was absolutely terrible.

Is there a way to achieve at least a little more accuracy while still having acceptable performance?

Finni
  • 429
  • 5
  • 17
  • 1
    There's actually a 128-bit floating point library that you can use, described in [this answer](https://stackoverflow.com/a/21071907/1361506). – azurefrog Sep 12 '19 at 17:41
  • there is a post about performance problem with bigDecimal https://stackoverflow.com/questions/39921191/is-there-a-way-to-make-bigdecimal-faster-than-i-have-here – Renato Andrade Sep 12 '19 at 17:46
  • Do you have enough iterations? The deeper the zoom, the more iterations are needed. – Weather Vane Sep 12 '19 at 19:13
  • @WeatherVane yes, I definitely have enough iterations. – Finni Sep 12 '19 at 19:57
  • Given the nature of Mandlebrot, the most you can gain by changing the data type is to increase the amount of zooming you can do before it goes weird. The question is whether the increased zoom depth you will get with a given data type is worth the performance cost. – Patricia Shanahan Sep 13 '19 at 22:39

0 Answers0