Need 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]
Implementing the Exponential Function
21–30 of 62 posts
Re: Implementing the Exponential Function
#22A couple other ways to compute the exponential function: The Intel 8087 coprocessor used CORDIC. The chip contained a ROM with the values of log2(1+2^-n) for various n. These constants allowed the exponential to be rapidly computed with shifts and adds. The Sinclair Scientific calculator was notable for cramming transcendental functions into a chip designed as a 4-function calculator, so they took some severe shortcu…
http://files.righto.com/calculator/sinclair_scientific_simul...
And then I noticed who I'm replying to...
Despite its flaws, this calculator was quite an achievement, doing everything it did with a ROM that holds only 320 instructions.
Re: Implementing the Exponential Function
#23A couple other ways to compute the exponential function: The Intel 8087 coprocessor used CORDIC. The chip contained a ROM with the values of log2(1+2^-n) for various n. These constants allowed the exponential to be rapidly computed with shifts and adds. The Sinclair Scientific calculator was notable for cramming transcendental functions into a chip designed as a 4-function calculator, so they took some severe shortcu…
I was going to say there is a great article about the Sinclair Scientific here: http://files.righto.com/calculator/sinclair_scientific_simul... And then I noticed who I'm replying to... Despite its flaws, this calculator was quite an achievement, doing everything it did with a ROM that holds only 320 instructions.
Re: Implementing the Exponential Function
#24Re: Implementing the Exponential Function
#25I 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…
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.
Re: Implementing the Exponential Function
#26A couple other ways to compute the exponential function: The Intel 8087 coprocessor used CORDIC. The chip contained a ROM with the values of log2(1+2^-n) for various n. These constants allowed the exponential to be rapidly computed with shifts and adds. The Sinclair Scientific calculator was notable for cramming transcendental functions into a chip designed as a 4-function calculator, so they took some severe shortcu…
I was going to say there is a great article about the Sinclair Scientific here: http://files.righto.com/calculator/sinclair_scientific_simul... And then I noticed who I'm replying to... Despite its flaws, this calculator was quite an achievement, doing everything it did with a ROM that holds only 320 instructions.
Re: Implementing the Exponential Function
#27Ugh 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).
To go with that, you need ln(1+x). HP calculators had both.
Re: Implementing the Exponential Function
#28IMHO it's a bit cheeky to use exp2 from the standard library. It's likely got all the same math exp does. Fortunately, if you know that your exponent is an integer, there's a constant time version. It's 5 instructions: add, and, shift, mov, ret. https://godbolt.org/z/KNyoVd
Re: Implementing the Exponential Function
#29* The article looks beautiful, but am I the only one that hates left-centered content? Wide monitors are the norm these days, and reading left centered content literally hurts my neck (need to resize manually to center the content, approximately.
* Why would someone make the effort to write such detailed analysis and conceal their identity? I just don't get what's the objective of not providing any sort of provenance... just a gripe of mine.
Re: Implementing the Exponential Function
#30https://github.com/sipa/minisketch/blob/master/src/false_pos...