|
|
|
|
|
by jbay808
2184 days ago
|
|
I wouldn't recommend doing this directly -- there's no good polynomial that can represent the exponential function well over a wide range. Instead, it's better to exploit the definition of IEEE754 as an exponent and a mantissa. You calculate the exponent directly (because e^x = 2^(x/ln2)), and use the Remez algorithm to find a polynomial that fits just the mantissa. |
|
You have to explicitly choose a range [x1,x2] for the Remez algorithm. It minimizes the maximum error over that range.
I'm ordinarily happy to share the work I'm doing but this comment reminds me of the reasons I don't share much with HN.