Average Error: 0.0 → 0.0
Time: 1.3m
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[{\left(e^{x + 1}\right)}^{\left(-\left(1 - x\right)\right)}\]
double f(double x) {
        double r6680280 = 1.0;
        double r6680281 = x;
        double r6680282 = r6680281 * r6680281;
        double r6680283 = r6680280 - r6680282;
        double r6680284 = -r6680283;
        double r6680285 = exp(r6680284);
        return r6680285;
}

double f(double x) {
        double r6680286 = x;
        double r6680287 = 1.0;
        double r6680288 = r6680286 + r6680287;
        double r6680289 = exp(r6680288);
        double r6680290 = r6680287 - r6680286;
        double r6680291 = -r6680290;
        double r6680292 = pow(r6680289, r6680291);
        return r6680292;
}

e^{-\left(1 - x \cdot x\right)}
{\left(e^{x + 1}\right)}^{\left(-\left(1 - x\right)\right)}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto e^{-\left(\color{blue}{1 \cdot 1} - x \cdot x\right)}\]
  4. Applied difference-of-squares0.0

    \[\leadsto e^{-\color{blue}{\left(1 + x\right) \cdot \left(1 - x\right)}}\]
  5. Applied distribute-rgt-neg-in0.0

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

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

    \[\leadsto {\left(e^{x + 1}\right)}^{\left(-\left(1 - x\right)\right)}\]

Reproduce

herbie shell --seed 2019102 
(FPCore (x)
  :name "exp neg sub"
  (exp (- (- 1 (* x x)))))