commands → sin

sin(x)

The sin command computes the sine of x where x is in radians. If x is a floating point number then a floating point result is computed, otherwise the result is an exact symbolic value.

Examples

# hardware floating point
sin(1.0);
	0.841470984807897

# symbolic
sin(1);
	sin(1)

Algorithm

To compute sin(x) in extended precision, we first reduce x modulo 2*pi followed by computation of the power series for sin.

References

Gullberg, Jan. Mathematics: From the Birth of Numbers. Norton, 1996.