8.6 KiB
8.6 KiB
In [1]:
from notebook_preamble import J, V, defineIn [2]:
define('gsra == 1 swap [over / + 2 /] cons [dup] swoncat make_generator')In [3]:
J('23 gsra')[1 [dup 23 over / + 2 /] codireco]
In [4]:
J('23 gsra 6 [x popd] times first sqr')23.0000000001585
In [5]:
define('_within_P == [first - abs] dip <=')In [6]:
define('_within_B == roll< popop first')In [7]:
define('_within_R == [popd x] dip')In [8]:
define('within == x 0.000000001 [_within_P] [_within_B] [_within_R] primrec')
define('sqrt == gsra within')In [9]:
J('36 sqrt')6.0
In [10]:
J('23 sqrt')4.795831523312719
In [11]:
4.795831523312719**2Out [11]:
22.999999999999996
In [12]:
from math import sqrt
sqrt(23)Out [12]:
4.795831523312719