Average Error: 0.0 → 0.0
Time: 1.3s
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 r39655 = 1.0;
        double r39656 = x;
        double r39657 = r39656 * r39656;
        double r39658 = r39655 - r39657;
        double r39659 = -r39658;
        double r39660 = exp(r39659);
        return r39660;
}

double f(double x) {
        double r39661 = exp(1.0);
        double r39662 = 1.0;
        double r39663 = x;
        double r39664 = r39663 * r39663;
        double r39665 = r39662 - r39664;
        double r39666 = -r39665;
        double r39667 = pow(r39661, r39666);
        return r39667;
}

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(-\left(1 - x \cdot x\right)\right)}}\]
  4. Applied exp-prod0.0

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

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

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

Reproduce

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