Average Error: 0.0 → 0.0
Time: 11.2s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[{e}^{\left(\mathsf{fma}\left(x, x, -1\right)\right)}\]
e^{-\left(1 - x \cdot x\right)}
{e}^{\left(\mathsf{fma}\left(x, x, -1\right)\right)}
double f(double x) {
        double r32303 = 1.0;
        double r32304 = x;
        double r32305 = r32304 * r32304;
        double r32306 = r32303 - r32305;
        double r32307 = -r32306;
        double r32308 = exp(r32307);
        return r32308;
}

double f(double x) {
        double r32309 = exp(1.0);
        double r32310 = x;
        double r32311 = 1.0;
        double r32312 = -r32311;
        double r32313 = fma(r32310, r32310, r32312);
        double r32314 = pow(r32309, r32313);
        return r32314;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Using strategy rm
  3. Applied add-log-exp0.0

    \[\leadsto e^{-\color{blue}{\log \left(e^{1 - x \cdot x}\right)}}\]
  4. Applied neg-log0.0

    \[\leadsto e^{\color{blue}{\log \left(\frac{1}{e^{1 - x \cdot x}}\right)}}\]
  5. Applied rem-exp-log0.0

    \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.0

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

    \[\leadsto \frac{1}{\color{blue}{{\left(e^{1}\right)}^{\left(1 - x \cdot x\right)}}}\]
  9. Applied pow-flip0.0

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

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

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

Reproduce

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