ACOS logarithmic form
|
04-28-2016, 05:03 PM
(This post was last modified: 04-28-2016 05:04 PM by Claudio L..)
Post: #3
|
|||
|
|||
RE: ACOS logarithmic form
Sorry if I turned this into a monologue, but I'll leave it written for the curious reader.
So how's the 50g and everybody else doing it? It seems everybody has a slightly different formula for ACOS, but everybody agrees 100% identical for ASIN. ASIN doesn't have a problem, whether you use the calculator, or do it "by hand" following the formula you get the same result. Here, all the way to the bottom, we have a formula from Mathworks. And here is the implementation from Wolfram. Basically, Wolfram just does pi/2-asin(Z), so the branch chosen is consistent with the ASIN results. Mathworks uses a formula slightly different from Wikipedia: Wikipedia uses sqrt(Z^2-1), while the other formula has i*sqrt(1-Z^2). Before somebody jumps and says "it's the same!", let's try a couple of cases: Z=2: sqrt(2^2-1)=1.73... i*sqrt(1-2^2)=i*sqrt(-3) = i*(i*1.73...) = -1.73... Z=2+3*i: sqrt(Z^2-1)=sqrt(-6+12*i)=(1.92...,3.11...) i*sqrt(1-Z^2)=sqrt(6-12*i)=i*(3.11...,-1.92...)=(1.92..., 3.11...) Z=2-3*i: sqrt(Z^2-1)=sqrt(-6-12*i)=(1.92...,-3.11...) i*sqrt(1-Z^2)=sqrt(6+12*i)=i*(3.11...,1.92...)=(-1.92..., 3.11...) Very subtle... the second form gives results consistent with the 50g for all values. It would never occur to me that such a trivial expression manipulation would push you through a different solution. Very sneaky. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)