Add exp2() as a packet op and array method.
What does this implement/fix?
This exposes exp2(x) as a packet op and coefficient-wise array method.
The generic implementation computes exp2(x) as exp(ln(2)*x) but represents the product ln(2)*x) exactly via the TwoProd algorithm, which significantly reduces the worst case error.
| type | max error | max error w/o TwoProd |
|---|---|---|
| float | 4 ulps | 35 ulps |
| double | 110 ulps | 363 ulps |
Edited by Rasmus Munk Larsen