commands → arccos

arccos(x)

The arccos command computes the inverse cosine 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
arccos(0.5);
	1.0471975511966

# symbolic
arccos(1/2);
        arccos(1/2)

Algorithm

To compute arccos(x) in extended precision, we use Newton's method to invert the cos function.

References

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