Post Reply 
HP 17B Solver - another ARCTAN(Y/X) approximation
06-01-2021, 04:38 PM
Post: #12
RE: HP 17B Solver - another ARCTAN(Y/X) approximation
(06-01-2021 03:16 PM)Martin Hepperle Wrote:  Ah, that's quite compact and accurate!

Unfortunately, the HP-17B Solver cannot do recursion, but has a Sum() function which might be useable for an iteration.

With good approximation formula, we need very few argument reductions.
For example, with 3 reductions and n=3 approximation formula

Code:
def myatan(x):
    x /= sqrt(1+x*x)+1
    x /= sqrt(1+x*x)+1
    x /= sqrt(1+x*x)+1
    y = x*x
    return 11.2*x *((6.6*y+34)*y+33) / ((((y+21)*y+63)*y+46.2))

Above code work with any real x, as long as x*x does not overflow.
We have 12-digits accuracy (if |x|≤ 1, we have 15-digits accuracy)

>>> myatan(10000)
1.5706963267932448
>>> myatan(100)
1.5607966601064045
>>> myatan(1)
0.78539816339744795
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 - 06-01-2021 04:38 PM



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