MODE BR = LONG LONG REAL; MODE POS = STRUCT(BR x, y, b); BR pi = long long pi; PROC (BR)BR lsrt = long long sqrt, ltan = long long tan, lln = long long ln, lexp = long long exp, lsin = long long sin, lcos = long long cos, latan = long long atan; PROC st = (POS xs, BR d)POS: ( BR x = x OF xs, y = y OF xs, b = b OF xs; BOOL o = b > pi/2; BR a = (o|pi - b|-b); BR cenx = x + y*ltan(b), l = lln(ltan(a/2 + pi/4)); BR nl = (o|l-d|l+d), na = 2*latan(lexp(nl)) - pi/2; BR r = lsrt(y*y + (BR dx = cenx - x; dx*dx)); BR nx = cenx + r*lsin(na), ny = r*lcos(na); BR pnb = (o|pi - na|-na), tnb = pnb + pi/2, nb = (tnb > 1.5*pi|tnb-2*pi|tnb); (nx, ny, nb)); PROC tv = (BR d)BR: (POS p := (0, 1, 0.1); TO 5 DO p := st(p, d) OD; x OF p); (BR ela := 2.89, elb := 2.9, va := tv(lln(ela)), vb := tv(lln(elb)); TO 300 DO BR la = -va/(vb-va), nel = ela + la*(elb - ela); BR nv = tv(lln(nel)); BOOL o = va < vb, p = 0 < nv; IF o AND p OR NOT o AND NOT p THEN elb := nel; vb := nv ELSE ela := nel; va := nv FI OD; print((ela, newline, long long log(elb - ela), newline, 1 - ela*(3 - ela*ela*ela*(3 - ela)))) )