Average Error: 0.0 → 0.4
Time: 16.4s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, \left(x \cdot x\right) \cdot \left(x \cdot x\right), x \cdot x\right), e^{-1}, e^{-1}\right)\]
e^{-\left(1 - x \cdot x\right)}
\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, \left(x \cdot x\right) \cdot \left(x \cdot x\right), x \cdot x\right), e^{-1}, e^{-1}\right)
double f(double x) {
        double r1736575 = 1.0;
        double r1736576 = x;
        double r1736577 = r1736576 * r1736576;
        double r1736578 = r1736575 - r1736577;
        double r1736579 = -r1736578;
        double r1736580 = exp(r1736579);
        return r1736580;
}

double f(double x) {
        double r1736581 = 0.5;
        double r1736582 = x;
        double r1736583 = r1736582 * r1736582;
        double r1736584 = r1736583 * r1736583;
        double r1736585 = fma(r1736581, r1736584, r1736583);
        double r1736586 = -1.0;
        double r1736587 = exp(r1736586);
        double r1736588 = fma(r1736585, r1736587, r1736587);
        return r1736588;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(x, x, -1\right)}}\]
  3. Taylor expanded around 0 0.4

    \[\leadsto \color{blue}{e^{-1} + \left({x}^{2} \cdot e^{-1} + \frac{1}{2} \cdot \left({x}^{4} \cdot e^{-1}\right)\right)}\]
  4. Simplified0.4

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, \left(x \cdot x\right) \cdot \left(x \cdot x\right), x \cdot x\right), e^{-1}, e^{-1}\right)}\]
  5. Final simplification0.4

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, \left(x \cdot x\right) \cdot \left(x \cdot x\right), x \cdot x\right), e^{-1}, e^{-1}\right)\]

Reproduce

herbie shell --seed 2019135 +o rules:numerics
(FPCore (x)
  :name "exp neg sub"
  (exp (- (- 1 (* x x)))))