This commit is contained in:
Brooke Vibber 2022-12-30 00:55:48 -08:00
parent 27d046011e
commit f50882a24d

View file

@ -226,26 +226,31 @@ positive_result:
.proc iter
; (cx and cy should be pre-scaled to 6.26 fixed point)
; zx = 0
; zx_2 = 0
; zy = 0
; zx_2 = 0
; zy_2 = 0
; zx_zy = 0
loop:
; iters++
; zx_next = zx_2 + zy_2 + cx
; zy_next = 2 * zx * zy + cy
; (detect overflows to -4 or +4 and break if necessary)
; (re-downshift into zx and zy as 3.13 fixed point; round.)
; 6.26:
; zx = zx_2 + zy_2 + cx
; zy = zx_zy + zx_zy + cy
; round to 6.10.
; 12.20:
; zx_2 = zx * zx
; zy_2 = zy * zy
; dist = zx_2 + zy_2
; if dist >= 4 break, else continue iterating
; round zx_2, zy_2, dist to 6.26
; if may be in the lake, look for looping output with a small buffer
; as an optimization vs running to max iters
.endproc
.proc start