HP 17B Solver - another ARCTAN(Y/X) approximation
|
05-15-2021, 11:01 PM
(This post was last modified: 05-16-2021 01:34 AM by Albert Chan.)
Post: #2
|
|||
|
|||
RE: HP 17B Solver - another ARCTAN(Y/X) approximation
(05-15-2021 09:14 AM)Martin Hepperle Wrote: I guess there are options to reduce the complexity of the quadrant handling. Code: function my_atan2(y, x) This may be simpler in logic, letting atan() part take care of Q1 and Q4. Also, returned angles matched most implementation of atan2, -pi < angle ≤ pi Reference: https://mae.ufl.edu/~uhk/ARCTAN-APPROX-PAPER.pdf --- What is the reason for 0 = (R-R) + ... ? Comment: I had matched the top/bottom polynomial constant term. (so that it is more obvious to see formula gives atan(ε) ≈ ε, as expected) Coefficient 15159/35 is not an integer, we might as well adjust it to reduce relative error. Replace 15159/35 by 433.1338, we reduced max. rel error from 1.2e-6, down to 2.9e-7 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)