Average Error: 0.0 → 0.0
Time: 5.2s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[{\left(e^{x + 1}\right)}^{\left(-\left(1 - x\right)\right)}\]
e^{-\left(1 - x \cdot x\right)}
{\left(e^{x + 1}\right)}^{\left(-\left(1 - x\right)\right)}
double f(double x) {
        double r479942 = 1.0;
        double r479943 = x;
        double r479944 = r479943 * r479943;
        double r479945 = r479942 - r479944;
        double r479946 = -r479945;
        double r479947 = exp(r479946);
        return r479947;
}

double f(double x) {
        double r479948 = x;
        double r479949 = 1.0;
        double r479950 = r479948 + r479949;
        double r479951 = exp(r479950);
        double r479952 = r479949 - r479948;
        double r479953 = -r479952;
        double r479954 = pow(r479951, r479953);
        return r479954;
}

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^{-\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 2019128 +o rules:numerics
(FPCore (x)
  :name "exp neg sub"
  (exp (- (- 1 (* x x)))))