Technical Articles and Newsletters

Trigonometry Is a Complex Subject

By Cleve Moler, MathWorks

Computing inverse, complex, hyperbolic, floating-point trigonometric functions is not always straightforward. For example, consider this formula for the inverse hyberbolic cosine of x:

acosh(x) = log(x ± (x2 - 1)1/2)

Although it can be found in many trigonometry text books, this formula is not suitable for actual computation, except for a limited range of x. As a general-purpose computational formula, it may be inaccurate, and it may generate unnecessary arithmetic overflow. In some cases, it may also give the wrong branch cuts in the complex plane.

In this article, originally published in 1998, Cleve Moler explores these problems in depth and describes a formula for acosh(x), proposed by William Kahan, that addresses them.

Additional images for this article are available in the Cleve’s Corner Supplement.

Read full article.

Published 1998 - 92023v00