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
 Albert Chan Senior Member Posts: 1,560 Joined: Jul 2018
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

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
 « Next Oldest | Next Newest »

 Messages In This Thread Odd Angles Formula Trivia - Albert Chan - 12-20-2018, 05:38 PM RE: Odd Angles Formula Trivia - Albert Chan - 12-21-2018, 01:10 PM RE: Odd Angles Formula Trivia - Albert Chan - 08-14-2019, 01:54 PM RE: Odd Angles Formula Trivia - Albert Chan - 08-15-2019 01:55 AM RE: Odd Angles Formula Trivia - Albert Chan - 08-15-2019, 03:42 PM RE: Odd Angles Formula Trivia - Albert Chan - 12-15-2019, 01:03 AM RE: Odd Angles Formula Trivia - Albert Chan - 12-15-2019, 01:49 AM RE: Odd Angles Formula Trivia - Albert Chan - 01-22-2020, 12:45 AM

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