# How do calculators evaluate inverse trig functions?

I know for simple inputs, you can just memorize the answer, but what if I wanted to find $\arcsin{0.554}$. My calculator instantly tells me that the answer is $0.5752 \ \text{radians}$. How can I do that by hand, procedurally, to always arrive at the right answer without having to memorize a bunch of stuff.

Thanks.

• Your title is contradictory with your text. – Yves Daoust Oct 31 '14 at 17:37
• My calculator tells me that $\sin(.5752)=0.544$, not $0.554$. – Barry Cipra Oct 31 '14 at 21:01
• Judging from the fact that you posted a question titled, "How do calculators..." with a body that asks, "How can I do that by hand ...", you seem to be assuming that you would want to imitate (by hand) the algorithm used by your calculator. That is not necessarily the best algorithm for calculation by hand, especially since your calculator may have "memorized" a lot of "stuff". – David K Oct 31 '14 at 21:26
• Interestingly, calculators actually often use probabilistic methods. This is largely because truncating power series can be very inefficient, as you need to store quite a few coefficients (say 10), and then raise to large powers. (You can always ditch one coefficient using Chebchev's polys though.) – Sam T Oct 31 '14 at 22:12
• Before calculators became common, engineers used slide rules for approximate results, or they used books that contained tables of logarithmic and trigometric values if they needed more precision, e.g. archive.org/details/logarithmictrigo00wilc. I don't think they calculated them by hand much. – Barmar Oct 31 '14 at 22:58

This is a good question! Trig functions and inverse trig functions are tricky. In fact, IEEE has published standards for how they should be computed. (EDIT: Clause 9 of IEEE 754-2008, the floating point standard, recommends but does not require the implementation of trigonometric functions.)

In the following paper, a method is described for computing $\arcsin x$ when $0 < x < 1$: Paper.

In essence, they use the trig identity

$$\arcsin N = \arctan \frac{N}{\sqrt{1-N^2}}.$$

Of course, this just raises the question: how do you compute $\arctan x$?

Old algorithms used something called CORDIC.

Modern computers have sufficient memory and speed that they can construct lookup tables and interpolate. However, CORDIC is still finding use in things like FPGAs. I don't know offhand what the standard algorithm is, currently, but I'm willing to bet your calculator either uses CORDIC or interpolated lookups.

• Also note that power series for arctan are very simple to evaluate. – Ali Caglayan Oct 31 '14 at 18:55
• Power series for arctan has alternating sign, which makes it a not very good choice for limited precision computer calculation. It's better to use Chebyshev series and sum the terms using recurrent formula and the Clenshaw algorithm. – facetus Oct 31 '14 at 19:29

The calculators normally use a version of the CORDIC-algorithms which is a set of algorithms for evaluating different trigonometric functions, or some kind of power series (e.g. Taylor series) of the function. These algorithms normally are not very well suited for doing calculations 'by hand' since they make use of a lot of repetition where computers are good at but we humans are pretty slow. As the hardware became cheaper we now often also have lookup tables which enables us to do a interpolation which is accurate enough for the expected applications.

To answer the question in the body, which is quite different from the title, you won't get a very accurate value for arcsin by hand without a lot of work. The easiest reasonably accurate way is to use the closest value you know and a Taylor's series. If you want $\arcsin 0.554$, you probably know $\arcsin 0.5=\frac \pi 6$. Then $\arcsin 0.554 \approx \frac \pi 6 + 0.054 \left.\frac d{dx}\arcsin x\right|_{0.5}=\frac \pi 6 + 0.054 \frac 1{\sqrt {1-0.5^2}}\approx 0.58595$, which is within $0.0012$ of the correct $0.58716.$

• Actually it's not so bad, since the correct value is $0.5871613082$. – Robert Israel Oct 31 '14 at 17:44
• Of course this isn't really "by hand" if you use your calculator to compute a value for $\pi/6 + .054/\sqrt{1 - 0.5^2}$. But if you do that, why not trust it with $\arcsin(0.554)$? – Robert Israel Oct 31 '14 at 17:48
• @RobertIsrael: I was accepting OP's value and was surprised it was so far off. I think this calculation (if you know $\pi$ and $\sqrt 3$) is within range of paper and pencil – Ross Millikan Oct 31 '14 at 20:47

It isn't actually instantaneous, but it's quite fast. There are a few ways to estimate functions. One way is to use a Taylor series expansion.

As for doing this by hand, even if you had the taylor series expansion, it would be difficult to do since you're talking about a lot of calculations. Sure, it could be done, but it would be far easier to just use a calculator.

I am afraid you won't find an easy by-hand solution. The required numerical methods will involve either sufficiently many tabulated numbers, or substantial arithmetic computation.

The Taylor series does not require any table.

If you can content yourself with a crude approximation, then you can use $$\sin x\approx\frac{4x(\pi-x)}{\pi^2},$$ for $x$ in range $[0,\pi]$. The formula is exact for $0$, $\pi/2$ and $\pi$.

Inverting the latter,

$$\arcsin x\approx\frac{\pi}2(1-\sqrt{1-x}).$$

Unfortunately, this uses a square root.

A more accurate result is given by the first two terms of Taylor $$\arcsin x\approx x+\frac{x^3}6.$$ Use it for $0<x<\sqrt2/2$, and for $x>\sqrt 2/2$, transform as $$\arcsin x=\frac\pi2-\arcsin\sqrt{1-x^2}.$$

I guess it is hard to avoid a square root, as the derivative becomes infinite at $x=1$.

• If you're able to take square roots, a somewhat better approximation is $\arcsin x\approx 3x/(2+\sqrt{1-x^2})$, which I learned from God plays dice. – user21467 Oct 31 '14 at 17:44
• @Steven Taschuk: interesting one. Do you know how it is derived ? – Yves Daoust Oct 31 '14 at 17:52
• With $t = \sqrt{1-x}$ we have $$\arcsin(x) \approx \dfrac{\pi}{2} - \sqrt{2} \left( t + t^3/12 + 3 t^5/160 + 5 t^7/896\right)$$ which is quite a good approximation, especially for $x \ge \sqrt{2}/2$. – Robert Israel Oct 31 '14 at 18:08
• @Robert Israel: given the number of terms, probably highly accurate. But is this still practical for hand calculation ? (Even a square root is a pain in the neck.) – Yves Daoust Oct 31 '14 at 18:15
• God plays dice is my blog. The commenter "logosintegralis" there took a stab at using Pade approximants to derive that approximation. – Michael Lugo Oct 31 '14 at 19:20