wgxli / complex-function-plotter

WebGL Complex Function Plotter
https://samuelj.li/complex-function-plotter/
GNU General Public License v3.0
48 stars 9 forks source link

graphical discontinuity #16

Closed farteryhr closed 1 year ago

farteryhr commented 2 years ago

abs(sin(sqrt(z))/sqrt(z))-1, near 33.23+33.23i image

btw i thought it was parabola (turns out no), and i wanted to get its parameter by finding where x+xi is a root. and i found something more there!

last time i could find such big glitch (by precision loss that i could imagine) is on (1-cos(z))/z^2 near the origin with checkerborard turned on.

but yes also abs((1-cos(sqrt(z)))/z)-1/2 near 132.92+132.92i.

is this unavoidable with GPU precision?

wgxli commented 2 years ago

Unfortunately, this is unavoidable with GPU precision (at least if I want to have widespread support on all devices). I am already using the highest precision available with WebGL 1.

More precision would, of course, just push the issue down the road. There will always be sufficiently pathological functions that will require more than the available number of bits. (Unless I can implement arbitrary-precision arithmetic on the GPU - which would not be easy.)

wgxli commented 1 year ago

Mostly fixed in latest update - range has been expanded by a massive amount, by some quasi-arbitrary precision trickery.

farteryhr commented 2 weeks ago

image image just found another unexpected spot... is it reflection formula, how does it fail so much?

wgxli commented 2 weeks ago

Will investigate - of note is that gamma(z/pi) shows this issue, but not gamma(z/t) with t set to pi.

wgxli commented 2 weeks ago

Fixed in latest update.