Average Error: 0.0 → 0.0
Time: 15.9s
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 r27457 = 1.0;
        double r27458 = x;
        double r27459 = r27458 * r27458;
        double r27460 = r27457 - r27459;
        double r27461 = -r27460;
        double r27462 = exp(r27461);
        return r27462;
}

double f(double x) {
        double r27463 = exp(1.0);
        double r27464 = x;
        double r27465 = 1.0;
        double r27466 = -r27465;
        double r27467 = fma(r27464, r27464, r27466);
        double r27468 = pow(r27463, r27467);
        return r27468;
}

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 2019326 +o rules:numerics
(FPCore (x)
  :name "exp neg sub"
  :precision binary64
  (exp (- (- 1 (* x x)))))