24 lines
1.6 KiB
Markdown
24 lines
1.6 KiB
Markdown
[pad](https://uiua.org/pad?src=0_17_0-rc_2__IyBob3cgbWFueSBpdGVyYXRpb25zIGJlZm9yZSBkaXZlcmdlbmNlCiMgaXRlcmF0aW9uX251bWJlciA_IHowPWMKSXRlciDihpAgLys8MuKGp-KInuKMteKNpeKfnOKKuCgr4oqZwrDiiJopMzIgLgoKIyBbciBnIGJdID8gaXRlcmF0aW9uX251bWJlcgpDb2xvciDihpAgwrBoc3Yg4o2JIOKKgsKvzrfiioIwLjc1IMKkIMKs4oanMcO3MTIKIyBjcmVhdGUgW2EsIGIpIHdpdGggbiB2YWx1ZXMKIyA_IGEgYiBuCkxpbnNwYWNlIOKGkCDijZwtw5fiipniipkow7fin5zih6EpCgpYIOKGkCBMaW5zcGFjZSDCrzIgMC44NSA0MDAKWSDihpAgTGluc3BhY2Ugwq8xLjIgMS4yIDQwMAoKJmltcyBDb2xvciBJdGVyIOKKnuKEgiBZIFgK)
|
|
|
|
this is my attempt at creating the mandelbrot set, after having learned about it
|
|
in my [parallel computations course](https://git.pvv.ntnu.no/frero-uni/TDT4200).
|
|
it is of course done in uiua.
|
|
|
|
my initial solution was quite slow, but mostly because i did upwards of 1000
|
|
iterations before concluding that a given complex number would diverge. however,
|
|
given the image size i worked with (400x400), this was overkill. changing it to
|
|
32 at most gave significant speed-up. with that, it was not worth doing any
|
|
threading anymore.
|
|
|
|
then came jan makoso's solution, using `repeat on by (+ dip un sqrt)` as the
|
|
driving force behind the Iter function. this yielded significant speed-up by
|
|
trading spatial complexity through performing pervasive calculations with
|
|
iterative depth of 32. i.e., instead of doing a loop for each pixel, we
|
|
vectorize the instruction by working on the entire array at the same time.
|
|
pervasive functions are thus highly desirable for performant calculations,
|
|
though at the cost of memory.
|
|
|
|
so, we essentially cheat in this case to make the image draw near instantly.
|
|
|
|

|