Post Reply 
HP 17B Solver - another ARCTAN(Y/X) approximation
05-16-2021, 01:03 PM
Post: #4
RE: HP 17B Solver - another ARCTAN(Y/X) approximation
Why not have the solver solve something !

Example, we can convert y = atan(x), |x| ≤ 1, into sin(y) = x/sqrt(x*x+1), for y

Compare to atan(t), sin(t) taylor series taper factorially fast !

atan(t) = t - t^3/3 + t^5/5 - t^7/7 + t^9/9 - t^11/11 + ...
sin(t) = t - t^3/3! + t^5/5! - t^7/7! + t^9/9! - t^11/11! + ...

Another benefit is argument is further reduced. abs(x/sqrt(x*x+1)) ≤ 1/sqrt(2) ≈ 0.7071

Using only above terms, atan (via solving sin) is very good (HP Prime emulator, CAS side):

myatan(x) := fsolve(t-t^3/6*(1-t^2/20*(1-t^2/42*(1-t^2/72*(1-t^2/110)))) = x/sqrt(x*x+1.), t=x)
relerr(ok, est) := 1 - est/ok

relerr(π/4, myatan(1)) = −1.24700250126e−11
relerr(π/5,myatan(√(5-2*√5))) = −7.60280727263e−13       // cos(pi/5) = φ/2
relerr(π/6, myatan(1/(√3))) = −7.1054273576e−14
relerr(π/8, myatan(√2-1)) = 7.1054273576e−15
relerr(π/10,myatan(1/(√(5+2*√5)))) = 0.                            // sin(pi/10) = 1/(2φ)
relerr(π/12, myatan(2-(√3))) = −7.1054273576e−15
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 17B Solver - another ARCTAN(Y/X) approximation - Albert Chan - 05-16-2021 01:03 PM



User(s) browsing this thread: 1 Guest(s)