I want to calculate the error of exp function under finite precision(data type is double). Is taylor series or other special algorithm?
Generally, the best way to implement ex is by calling the exp
function provided by your computing platform.
Failing this, implementing the exp
function is complicated and requires several esoteric skills. An implementation typically involves:
Additionally:
Taylor series are inappropriate for evaluating functions because they are inaccurate away from their center points. This means they take too many terms to converge to the necessary precision. Having too many terms not only takes time but also makes it difficult to do the arithmetic accurately.