# §4.45 Methods of Computation

## §4.45(i) Real Variables

### ¶ Logarithms

The function can always be computed from its ascending power series after preliminary scaling. Suppose first . Then we take square roots repeatedly until is sufficiently small, where

4.45.1

After computing from (4.6.1)

For other values of set , where and . Then

### ¶ Exponentials

Let have any real value. First, rescale via

Then

and since , can be computed straightforwardly from (4.2.19).

### ¶ Trigonometric Functions

Let have any real value. We first compute , followed by

4.45.6

Then

and since , and can be computed straightforwardly from (4.19.1) and (4.19.2).

The other trigonometric functions can be found from the definitions (4.14.4)–(4.14.7).

### ¶ Inverse Trigonometric Functions

The function can always be computed from its ascending power series after preliminary transformations to reduce the size of . From (4.24.15) with , we have

4.45.8.

Beginning with , generate the sequence

4.45.9,

until is sufficiently small. We then compute from (4.24.3), followed by

4.45.10

Another method, when is large, is to sum

4.45.11

compare (4.24.4).

As an example, take . Then

4.45.12

From (4.24.3) . From (4.45.10)

4.45.13

As a check, from (4.45.11)

4.45.14

For the remaining inverse trigonometric functions, we may use the identities provided by the fourth row of Table 4.16.3. For example, .

### ¶ Hyperbolic and Inverse Hyperbolic Functions

The hyperbolic functions can be computed directly from the definitions (4.28.1)–(4.28.7). The inverses , , and can be computed from the logarithmic forms given in §4.37(iv), with real arguments. For , , and we have (4.37.7)–(4.37.9).

### ¶ Other Methods

See Luther (1995), Ziv (1991), Cody and Waite (1980), Rosenberg and McNamee (1976), Carlson (1972a). For interval-arithmetic algorithms, see Markov (1981). For Shift-and-Add and CORDIC algorithms, see Muller (1997), Merrheim (1994), Schelin (1983). For multiprecision methods, see Smith (1989), Brent (1976).

## §4.45(ii) Complex Variables

For and

See §1.9(i) for the precise relationship of to the arctangent function.

The trigonometric functions may be computed from the definitions (4.14.1)–(4.14.7), and their inverses from the logarithmic forms in §4.23(iv), followed by (4.23.7)–(4.23.9). Similarly for the hyperbolic and inverse hyperbolic functions; compare (4.28.1)–(4.28.7), §4.37(iv), and (4.37.7)–(4.37.9).

For other methods see Miel (1981).

## §4.45(iii) Lambert -Function

For the principal branch can be computed by solving the defining equation numerically, for example, by Newton’s rule (§3.8(ii)). Initial approximations are obtainable, for example, from the power series (4.13.6) (with ) when is close to , from the asymptotic expansion (4.13.10) when is large, and by numerical integration of the differential equation (4.13.4) (§3.7) for other values of .

Similarly for in the interval .

See also Barry et al. (1995b) and Chapeau-Blondeau and Monir (2002).