15 KiB
15 KiB
In [1]:
[F over / + 2 /] inscribeIn [2]:
clear
5 36 [F] trace 5 36 • F
5 36 • over / + 2 /
5 36 5 • / + 2 /
5 7 • + 2 /
12 • 2 /
12 2 • /
6 •
6In [3]:
[F1 2 swap [F] cons] inscribe6
In [4]:
clear
36 [F1] trace 36 • F1
36 • 2 swap [F] cons
36 2 • swap [F] cons
2 36 • [F] cons
2 36 [F] • cons
2 [36 F] •
2 [36 F]In [5]:
trace 2 • 36 F
2 36 • F
2 36 • over / + 2 /
2 36 2 • / + 2 /
2 18 • + 2 /
20 • 2 /
20 2 • /
10 •
10In [6]:
36 F6
In [7]:
clearIn [8]:
36 F1 make_generator[2 [36 F] codireco]
In [9]:
x x x first6
In [10]:
144 F1 make_generator x x x x first6 12
In [11]:
clear
2 [36 F]2 [36 F]
In [12]:
[first] [pop sqr] fork - abs 3 <2 [36 F] false
In [13]:
pop i10
In [14]:
[36 F] [first] [pop sqr] fork - abs 3 <10 [36 F] false
In [15]:
pop i6
In [16]:
[36 F] [first] [pop sqr] fork - abs 3 <6 [36 F] true
In [ ]:
In [17]:
clear
22
In [18]:
[] true [i [36 F] [first] [pop sqr] fork - abs 3 >] loop pop6
In [19]:
clear
7 [] true [i [144 F] [first] [pop sqr] fork - abs 3 >] loop pop12
In [20]:
clear
7 [] true [i [14400 F] [first] [pop sqr] fork - abs 3 >] loop pop120
In [ ]:
define('gsra 1 swap [over / + 2 /] cons [dup] swoncat make_generator')In [ ]:
J('23 gsra')In [ ]:
J('23 gsra 6 [x popd] times first sqr')In [ ]:
define('_within_P [first - abs] dip <=')In [ ]:
define('_within_B roll< popop first')In [ ]:
define('_within_R [popd x] dip')In [ ]:
define('within x 0.000000001 [_within_P] [_within_B] [_within_R] tailrec')
define('sqrt gsra within')In [ ]:
J('36 sqrt')In [ ]:
J('23 sqrt')In [ ]:
4.795831523312719**2In [ ]:
from math import sqrt
sqrt(23)