Post Reply 
Question for Trig Gurus
08-01-2022, 05:19 AM (This post was last modified: 08-02-2022 05:05 AM by Thomas Klemm.)
Post: #29
RE: Question for Trig Gurus
(07-31-2022 09:54 PM)Albert Chan Wrote:  There is no difference in convergence rate, whether we pick atan, asin, or acos

That's not what I meant.
If we use \(d(2, 2)\) in the implementation of \(\cos^{-1}\) we have the following function:
Code:
def arccos(x):
    a_0 = x
    g_0 = 1    
    a_1 = (a_0 + g_0) / 2
    g_1 = sqrt(a_1 * g_0)
    d = (1 + 12 * a_1 + 32 * g_1) / 45
    return degrees(sqrt(1 - x*x) / d)

This leads to the following result:

0.0: 87.024464 (90.000000)
0.1: 81.877941 (84.260830)
0.2: 76.582001 (78.463041)
0.3: 71.086883 (72.542397)
0.4: 65.326413 (66.421822)
0.5: 59.207517 (60.000000)
0.6: 52.589501 (53.130102)
0.7: 45.237511 (45.572996)
0.8: 36.695075 (36.869898)
0.9: 25.782656 (25.841933)
1.0:  0.000000 ( 0.000000)

This does not produce 5 correct figures.

Whereas using the previous implementation we get:

0.0: 89.999750 (90.000000)
0.1: 84.260698 (84.260830)
0.2: 78.462975 (78.463041)
0.3: 72.542366 (72.542397)
0.4: 66.421808 (66.421822)
0.5: 59.999995 (60.000000)
0.6: 53.130101 (53.130102)
0.7: 45.572996 (45.572996)
0.8: 36.869898 (36.869898)
0.9: 25.841933 (25.841933)
1.0:  0.000000 ( 0.000000)

That's why I used \(d(3, 3)\) in this case.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Question for Trig Gurus - Namir - 12-01-2014, 07:49 PM
RE: Question for Trig Gurus - toml_12953 - 12-01-2014, 08:08 PM
RE: Question for Trig Gurus - PANAMATIK - 12-01-2014, 08:46 PM
RE: Question for Trig Gurus - Namir - 12-01-2014, 10:54 PM
RE: Question for Trig Gurus - toml_12953 - 12-02-2014, 02:30 AM
RE: Question for Trig Gurus - Namir - 12-02-2014, 09:21 AM
RE: Question for Trig Gurus - Namir - 12-02-2014, 04:57 PM
RE: Question for Trig Gurus - Albert Chan - 07-29-2022, 03:19 PM
RE: Question for Trig Gurus - Mark Hardman - 12-01-2014, 11:00 PM
RE: Question for Trig Gurus - Thomas Klemm - 12-02-2014, 12:09 AM
RE: Question for Trig Gurus - Namir - 12-02-2014, 12:16 AM
RE: Question for Trig Gurus - Thomas Klemm - 12-02-2014, 01:12 AM
RE: Question for Trig Gurus - Namir - 12-02-2014, 01:50 AM
RE: Question for Trig Gurus - Namir - 12-02-2014, 01:49 AM
RE: Question for Trig Gurus - Namir - 12-05-2014, 02:48 AM
RE: Question for Trig Gurus - Namir - 12-09-2014, 02:19 PM
RE: Question for Trig Gurus - Thomas Klemm - 07-29-2022, 12:59 PM
RE: Question for Trig Gurus - ttw - 07-29-2022, 10:19 PM
RE: Question for Trig Gurus - Thomas Klemm - 07-30-2022, 08:26 AM
RE: Question for Trig Gurus - Albert Chan - 07-30-2022, 06:27 PM
RE: Question for Trig Gurus - Thomas Klemm - 07-30-2022, 09:38 AM
RE: Question for Trig Gurus - Thomas Klemm - 07-31-2022, 11:08 AM
RE: Question for Trig Gurus - Albert Chan - 07-31-2022, 09:54 PM
RE: Question for Trig Gurus - Thomas Klemm - 08-01-2022 05:19 AM
RE: Question for Trig Gurus - Albert Chan - 08-01-2022, 02:36 PM
RE: Question for Trig Gurus - Thomas Klemm - 08-02-2022, 06:35 AM
RE: Question for Trig Gurus - Albert Chan - 08-02-2022, 05:28 PM
RE: Question for Trig Gurus - Thomas Klemm - 08-03-2022, 04:42 PM



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