commands → exp

exp(A)

The exp command raises e, the base of natural logarithms, to the power A. If A is a floating point number then a floating point result is computed, otherwise the result is an exact symbolic value.

Examples

# hardware floats
exp(1.0);
	2.71828182845904

# symbolic
exp(1);
	exp(1)

Algorithm

To compute exp(x) in extended precision, we reduce x to the range -1 <= x <= 1 by recursively squaring exp(x/2), followed by computation of the power series for exp.

References

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