Post Reply 
Arc SOHCAHTOA method
04-01-2022, 05:49 PM (This post was last modified: 04-01-2022 05:56 PM by Albert Chan.)
Post: #4
RE: SOHCAHTOA, for arc-trig
(03-31-2022 11:07 PM)Albert Chan Wrote:  acos(x) = 2 * acos(sqrt((1+x)/2))
acosq(x) = 2 * acosq((1+sqrt(x))/2)

Although relation is true, RHS argument is bigger.
Perhaps it is better to flip the sides, with reduced argument, then get acos from asin

acos(x) = 1/2 * acos(2*x^2-1) = 1/2 * (pi/2 - asin(2*x^2-1))
acosq(x) = pi/4 - asin(2*x-1)/2

asinq(x) = acosq(1-x) = pi/4 - asin(1-2*x)/2

We can reduce argument of asinq(x) to 1/4 or less, before using half-angle formula.
Code:
function asinq(x)   -- asin(sqrt(x)), x = 0 to 1
    if x > 1/2  then return pi/2 - asinq(1-x) end
    if x > 1/4  then return pi/4 - asinq((1-2*x)^2)/2 end
    if x > 4e-4 then return 2 * asinq(0.5*x/(sqrt(1-x)+1)) end
    return sqrt(x) * (1+x/6*(1+x*9/20/(1-x*25/42)))
end

The first reduction, x = (1/2,1], (x → 1-x), is cheap, and exact, see Sterbenz lemma
Second reduction, x = (1/4,1/2], (x → (1-2*x)^2), is cheap, and correctly rounded.

Note that second reduction relation is a parabola.
At some point, there is no argument reduction (for x=1/4, (1-2*x)^2 = 1/4)

We can solve for break-even point, between 2nd reduction and half-angle formula
(Below break-even point, half-angle formula reduce argument more)

CAS> normal(solve((1-2*x)^2 = x/2/(1+sqrt(1-x)), x))      → [(-√5+5)/8, 3/4]

With domain of (1/4,1/2], break-even at x = (-√5+5)/8 = 1-(ϕ/2)^2 ≈ 0.3455

asinq(1-(ϕ/2)^2) = acosq((ϕ/2)^2) = acos(ϕ/2) = pi/5, see Golden Triangle
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Arc SOHCAHTOA method - Albert Chan - 03-31-2022, 09:50 PM
RE: SOHCAHTOA, for arc-trig - Albert Chan - 04-01-2022 05:49 PM
RE: SOHCAHTOA, for arc-trig - toml_12953 - 04-01-2022, 02:56 AM
RE: SOHCAHTOA, for arc-trig - Albert Chan - 04-02-2022, 12:10 AM
RE: SOHCAHTOA, for arc-trig - Albert Chan - 04-02-2022, 09:59 AM
RE: SOHCAHTOA, for arc-trig - Albert Chan - 04-02-2022, 01:51 AM
RE: SOHCAHTOA, for arc-trig - Albert Chan - 04-06-2022, 08:46 PM
RE: SOHCAHTOA, for arc-trig - trojdor - 04-07-2022, 08:10 AM
RE: SOHCAHTOA, for arc-trig - Albert Chan - 04-09-2022, 01:07 PM



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