Question for Trig Gurus
|
07-31-2022, 09:54 PM
Post: #28
|
|||
|
|||
RE: Question for Trig Gurus
(07-31-2022 11:08 AM)Thomas Klemm Wrote: Inverse Cosine There is no difference in convergence rate, whether we pick atan, asin, or acos All based on extrapolation of sequence ak = (c1/2^k) / tan(c2/2^k) ⇒ a∞ = c1/c2 Basing all from atan(x) is better, because acot(x) = atan(1/x), without using square roots. Using d(3,3), and atan argument reduced to within to ±1/√3, we get 9+ correct digits. (with simpler d(2,2), we have 6+ digits accuracy) Code: function atand(x) -- = deg(atan(x)), 9+ digits accuracy lua> function asind(x) return atand(x/sqrt(1-x*x)) end -- range = -90 .. 90 lua> function acosd(x) return 90 - asind(x) end -- range = 0 .. 180 lua> deg(atan(0.6)) , atand(0.6) 30.96375653207352 30.963756534561696 lua> deg(acos(0.6)) , acosd(0.6) 53.13010235415598 53.13010235413812 lua> deg(acos(0.7)) , acosd(0.7) 45.5729959991943 45.5729959991943 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)