[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Computes the trigonometric functions.

or System V Math Library (**libmsaa.a**)

#include <math.h>

**double sin (** *x***)**

**double*** x***;**

long double sinl (x)long doublex;

double cos (x)doublex;

long double cosl (x)long doublex;

double tan (x)doublex;

long double tanl (x)long doublex;

The **sin**,
**cos**, and **tan** subroutines return the sine, cosine, and
tangent, respectively, of their parameters, which are in radians. The
**sinl** subroutine, **cosl** subroutine, and **tanl**
subroutine return the same values, but these subroutines take and return
numbers of the long double data type.

The **sin**,
**sinl**, **cos**, **cosl, tan**, and **tanl**
subroutines lose accuracy when passed a large value for the *x*
parameter. In the **sin** subroutine, for example, values of
*x* that are greater than pi are argument-reduced by first dividing
them by the machine value for 2 *` pi `, and then using the
IEEE remainder of this division in place of *x.* Since the
machine value of` pi` can only approximate its infinitely precise
value, the remainder of x/(2 * `pi`) becomes less accurate as
*x* becomes larger. Similar loss of accuracy occurs for the
**sinl**, **cos**, **cosl**, **tan**, and
**tanl** subroutines during argument reduction of large
arguments.

These error-handling procedures
may be changed with the **matherr** subroutine when using the
**libmsaa.a** (**-lmsaa**) library.

These subroutines are part of Base Operating System (BOS) Runtime.

The **matherr** subroutine, **sinh**,
**sinhl**, **cosh**, **coshl**, **tanh**, or
**tanhl** (sinh, sinhl, cosh, coshl, tanh, or tanhl Subroutine) subroutines.

Subroutines
Overview in *AIX 5L Version 5.1 General Programming
Concepts: Writing and Debugging Programs*.

128-Bit long
double Floating-Point Format in *AIX 5L Version 5.1 General
Programming Concepts: Writing and Debugging Programs*.
**
**