Post Reply 
Odd Angles Formula Trivia
08-15-2019, 01:55 AM (This post was last modified: 10-08-2019 09:14 PM by Albert Chan.)
Post: #4
RE: Odd Angles Formula Trivia
Numerically, it is better not to use multiple angle formula for cos(n*x)
When x is small, cos(x) approach 1.0, and might "pushed away" many significant digits.

Example, using HP-12C, calculate cos(1), by applying T5 3 times

T5(x) = 5x - 20x^3 + 16x^5 = x(5 - x²(20 - x²(16)))
x = 1/5³ = 0.008 // reduced angle, in radian

cos(x) ≅ 1 - x^2/2 + x^4/24 = 1 - 0.00003199982933 = 0.9999680002
cos(0.04) = 0.9992001048, error = 19 ULP
cos(0.20) = 0.9800665309, error = 469 ULP
cos(1.00) = 0.5403013120, error = 9939 ULP

Had we use sin(5x) formula (same T5, but start with sin(x)):

sin(x) ≅ x - x^3/6 = 0.007999914667
sin(0.04) = 0.03998933419, error = 0 ULP
sin(0.20) = 0.1986693308,   error = 0 ULP
sin(1.00) = 0.8414709849,   error = -1 ULP

cos(1) = √(1 - sin(1)²) = 0.5403023058, error = 1 ULP
Actual value for cos(1) = 0.54030 23058 68139 ...

note: error (under-estimated) = exact - approx
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Odd Angles Formula Trivia - Albert Chan - 12-20-2018, 05:38 PM
RE: Odd Angles Formula Trivia - Albert Chan - 08-15-2019 01:55 AM



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