Average Error: 0.0 → 0.0
Time: 14.6s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[e^{\frac{1}{\mathsf{fma}\left(1, x \cdot x + 1, \left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)} \cdot \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) - 1 \cdot \left(1 \cdot 1\right)\right)}\]
e^{-\left(1 - x \cdot x\right)}
e^{\frac{1}{\mathsf{fma}\left(1, x \cdot x + 1, \left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)} \cdot \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right) - 1 \cdot \left(1 \cdot 1\right)\right)}
double f(double x) {
        double r946634 = 1.0;
        double r946635 = x;
        double r946636 = r946635 * r946635;
        double r946637 = r946634 - r946636;
        double r946638 = -r946637;
        double r946639 = exp(r946638);
        return r946639;
}

double f(double x) {
        double r946640 = 1.0;
        double r946641 = 1.0;
        double r946642 = x;
        double r946643 = r946642 * r946642;
        double r946644 = r946643 + r946641;
        double r946645 = r946643 * r946643;
        double r946646 = fma(r946641, r946644, r946645);
        double r946647 = r946640 / r946646;
        double r946648 = r946645 * r946643;
        double r946649 = r946641 * r946641;
        double r946650 = r946641 * r946649;
        double r946651 = r946648 - r946650;
        double r946652 = r946647 * r946651;
        double r946653 = exp(r946652);
        return r946653;
}

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^{x \cdot x - 1}}\]
  3. Using strategy rm
  4. Applied flip3--0.0

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

    \[\leadsto e^{\frac{\color{blue}{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) - \left(1 \cdot 1\right) \cdot 1}}{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 + \left(x \cdot x\right) \cdot 1\right)}}\]
  6. Using strategy rm
  7. Applied div-inv0.0

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

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

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

Reproduce

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