Average Error: 0.0 → 0.0
Time: 17.1s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[{e}^{\left(-\left(1 - x \cdot x\right)\right)}\]
e^{-\left(1 - x \cdot x\right)}
{e}^{\left(-\left(1 - x \cdot x\right)\right)}
double f(double x) {
        double r1041370 = 1.0;
        double r1041371 = x;
        double r1041372 = r1041371 * r1041371;
        double r1041373 = r1041370 - r1041372;
        double r1041374 = -r1041373;
        double r1041375 = exp(r1041374);
        return r1041375;
}

double f(double x) {
        double r1041376 = exp(1.0);
        double r1041377 = 1.0;
        double r1041378 = x;
        double r1041379 = r1041378 * r1041378;
        double r1041380 = r1041377 - r1041379;
        double r1041381 = -r1041380;
        double r1041382 = pow(r1041376, r1041381);
        return r1041382;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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^{-\color{blue}{1 \cdot \left(1 - x \cdot x\right)}}\]
  4. Applied distribute-rgt-neg-in0.0

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

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

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

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

Reproduce

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