I recently implemented the exponential function for a sound synthesizer toolkit I’m working on. The method I used was not mentioned in the article, so I’ll explain it here. I used the Remez algorithm, modified to minimize equivalent input error. This algorithm lets you find a polynomial with the smallest maximum error. You start with a set of X coordinates, and create a polynomial which oscillates up and down around…
Remez is the most common implementation of Minimax approximation algorithms, so it's probably coming when the author makes it to section 6.
Implementing the Exponential Function
11–20 of 62 posts
Re: Implementing the Exponential Function
#12> Any function with this property can be uniquely represented as a Taylor series expansion “centered” at a
It's fairly easy to construct tame looking functions where this isn't true.
Re: Implementing the Exponential Function
#13Need to be careful about confusing smooth (infinitely differentiable) and analytic (= to Taylor series) functions. > Any function with this property can be uniquely represented as a Taylor series expansion “centered” at a It's fairly easy to construct tame looking functions where this isn't true.
Re: Implementing the Exponential Function
#14I don’t recommend it.
That said I liked that there’s a specific exp-1 function (otherwise you drop most precision).
Re: Implementing the Exponential Function
#15Re: Implementing the Exponential Function
#16Need to be careful about confusing smooth (infinitely differentiable) and analytic (= to Taylor series) functions. > Any function with this property can be uniquely represented as a Taylor series expansion “centered” at a It's fairly easy to construct tame looking functions where this isn't true.
Re: Implementing the Exponential Function
#17Re: Implementing the Exponential Function
#18Need to be careful about confusing smooth (infinitely differentiable) and analytic (= to Taylor series) functions. > Any function with this property can be uniquely represented as a Taylor series expansion “centered” at a It's fairly easy to construct tame looking functions where this isn't true.
Blessedly, in the complex analytic setting, these coincide, to they not? [Attempting to sanity-check my own understanding here]
Re: Implementing the Exponential Function
#19Ugh I had to implement all the transcendental functions a while ago. It was miserable, especially dealing with intermediate rounding, etc I don’t recommend it. That said I liked that there’s a specific exp-1 function (otherwise you drop most precision).
Re: Implementing the Exponential Function
#20This is an awesome article! One of my favorite SO answers I remember researching dealt with the Padé approximation of tanh[1] (which I found was significantly better than the Taylor expansion), but the caveat was that it only worked within a very narrow neighborhood. I will say that the article didn't really touch on techniques that minimize IEEE 754 subnormal[2] performance impact, which is a very interesting proble…
Hi, I am the author. You make a good point about subnormals, thank you. I will jot that down for a future update to the doc :) It is funny you mention the Padé approximation; I was debating whether or not to include that in this article. Originally I planned to stop after Minimax (using Remez), but if I include rational approximation schemes anyway (e.g. Carathéodory-Fejer), it probably makes sense to implement and a…