Average Error: 0.0 → 0.0
Time: 22.0s
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 r1265488 = 1.0;
        double r1265489 = x;
        double r1265490 = r1265489 * r1265489;
        double r1265491 = r1265488 - r1265490;
        double r1265492 = -r1265491;
        double r1265493 = exp(r1265492);
        return r1265493;
}

double f(double x) {
        double r1265494 = exp(1.0);
        double r1265495 = x;
        double r1265496 = -1.0;
        double r1265497 = fma(r1265495, r1265495, r1265496);
        double r1265498 = pow(r1265494, r1265497);
        return r1265498;
}

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. Using strategy rm
  4. Applied *-un-lft-identity0.0

    \[\leadsto e^{\color{blue}{1 \cdot \mathsf{fma}\left(x, x, -1\right)}}\]
  5. Applied exp-prod0.0

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

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

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

Reproduce

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