Average Error: 0.0 → 0.0
Time: 15.1s
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 r42168 = 1.0;
        double r42169 = x;
        double r42170 = r42169 * r42169;
        double r42171 = r42168 - r42170;
        double r42172 = -r42171;
        double r42173 = exp(r42172);
        return r42173;
}

double f(double x) {
        double r42174 = exp(1.0);
        double r42175 = x;
        double r42176 = 1.0;
        double r42177 = -r42176;
        double r42178 = fma(r42175, r42175, r42177);
        double r42179 = pow(r42174, r42178);
        return r42179;
}

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