Post Reply 
Collaborative collection of useful userRPL snippets
03-26-2018, 10:55 AM (This post was last modified: 03-26-2018 10:57 AM by Paul Dale.)
Post: #11
RE: Collaborative collection of useful userRPL snippets
It comes down to taking an arccosine of a number near to ±1. The result is close to zero but you are also likely to lose up to half the possible digits. Remember that there are more numbers close to zero than any other number in floating point arithmetic and that cosine is very flat when it takes a value of ±1.

For fun, try plotting: \( arccos(1-x) \) and \( 2 \, arcsin(\sqrt{\frac{x}{2}}) \) for very small \( x > 0 \). These two are mathematically equivalent.

There is also a worse possibility here, where the number rounds to > 1 or < -1 causing an error.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Collaborative collection of useful userRPL snippets - Paul Dale - 03-26-2018 10:55 AM



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