[math-fun] RIES and tan(1) (was re: Gamma(p/q) values)
I'm just getting back to this now: 2011/12/29 Bill Gosper <billgosper@gmail.com>
[...] But things like sin(1) and cos(2) are exceptionally rare, so sin and cos should maybe be replaced with sin pi # and cos pi #. Irony: tan(1) is a bit more interesting due its continued fraction, but we'd need (sinpi 1/pi)/(cospi 1/pi) ! [...]
tan(1) = 1.5574077246549022305069748..., with continued fraction convergents [1, 1, 1, 3, 1, 5, 1, 7, 1, 9, ...] RWG's sinpi, cospi and tanpi suggestion made so much sense that I went ahead and made the change (as RWG and a few others already know) but in the mean-time, using the version of RIES that you have now, it of course finds cos(1) x = sin(1) when given as few as 5 digits (1.5574). There is no simpler equation with a root within 10^-4 of that value. With the new version it finds x = tanpi(1/pi) equally quickly. To reproduce old formulas one can use either the -NT (no tangent) or --trig-argument-scale 1 (use radians) options, or both. Even if I hadn't added tanpi(), it still would have worked, but what it finds is: sqrt(x^2+1) = 1/cospi(1/pi) RIES finds an identity that converts tan(1) to sec(1), allowing it to match 1/cos(1). Why not RWG's hypothetical "(sinpi 1/pi)/(cospi 1/pi)"? In an equation RIES would find this first as "cospi(1/pi) x = sinpi(1/pi)", but it happens to consider "sqrt(x^2+1) to be a less complicated expression than "x cospi(1/pi)". Note the complexity scores {47}, {41}, etc: ries 1.5574077246549 --eval-expression xs1+q prCr 'xprC*' prS Evaluating postfix expression 'xs1+q' with x=1.5574077246549 x = 1.5574077246549001 (d/dx = 1) x^2 = 2.4255188208147529 (d/dx = 3.1148154493098001) 1 = 1 x^2+1 = 3.4255188208147529 (d/dx = 3.1148154493098001) sqrt(x^2+1) = 1.8508157176809237 (d/dx = 0.84147098480789617) [xs1+q] = 1.85081571768092; d/dx = 0.841470984807896, complexity = {47} Evaluating postfix expression 'prCr' pi = 3.1415926535897931 1/pi = 0.31830988618379069 cospi(1/pi) = 0.54030230586813977 1/cospi(1/pi) = 1.8508157176809255 [prCr] = 1.85081571768093; d/dx = 0, complexity = {41} Evaluating postfix expression 'xprC*' with x=1.5574077246549 x = 1.5574077246549001 (d/dx = 1) pi = 3.1415926535897931 1/pi = 0.31830988618379069 cospi(1/pi) = 0.54030230586813977 cospi(1/pi) x = 0.84147098480789539 (d/dx = 0.54030230586813977) [xprC*] = 0.841470984807895; d/dx = 0.54030230586814, complexity = {53} Evaluating postfix expression 'prS' pi = 3.1415926535897931 1/pi = 0.31830988618379069 sinpi(1/pi) = 0.8414709848078965 [prS] = 0.841470984807897; d/dx = 0, complexity = {34} - Robert -- Robert Munafo -- mrob.com Follow me at: gplus.to/mrob - fb.com/mrob27 - twitter.com/mrob_27 - mrob27.wordpress.com - youtube.com/user/mrob143 - rilybot.blogspot.com
participants (1)
-
Robert Munafo