Created
March 29, 2021 12:14
-
-
Save zeroflag/d4076a690f124c818db31206748fd8ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare size int = 100; | |
declare fac double = 2.0 / 100.0; | |
create procedure computeRow(y int) | |
begin | |
declare Ci double = (y*fac - 1.0); | |
for x in 0..size-1 loop | |
declare Zr double = 0.0; | |
declare Zi double = 0.0; | |
declare Cr double = (x*fac - 1.5); | |
declare i int = 50; | |
declare ZrN double = 0; | |
declare ZiN double = 0; | |
loop | |
Zi = 2.0 * Zr * Zi + Ci; | |
Zr = ZrN - ZiN + Cr; | |
ZiN = Zi * Zi; | |
ZrN = Zr * Zr; | |
i = i -1; | |
exit when (ZiN + ZrN > 4.0 or i <= 0); | |
end loop; | |
end loop; | |
end; | |
declare start int = current_time_millis(); | |
for y in 0..size-1 loop | |
computeRow(y); | |
end loop; | |
print 'total: ' || (current_time_millis() - start); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment