Average Error: 0.0 → 0.0
Time: 4.2s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[\frac{{\left(e^{-\left(\sqrt{1} + x\right)}\right)}^{\left(\sqrt{1}\right)}}{{\left(e^{-\left(\sqrt{1} + x\right)}\right)}^{x}}\]
e^{-\left(1 - x \cdot x\right)}
\frac{{\left(e^{-\left(\sqrt{1} + x\right)}\right)}^{\left(\sqrt{1}\right)}}{{\left(e^{-\left(\sqrt{1} + x\right)}\right)}^{x}}
double f(double x) {
        double r37947 = 1.0;
        double r37948 = x;
        double r37949 = r37948 * r37948;
        double r37950 = r37947 - r37949;
        double r37951 = -r37950;
        double r37952 = exp(r37951);
        return r37952;
}

double f(double x) {
        double r37953 = 1.0;
        double r37954 = sqrt(r37953);
        double r37955 = x;
        double r37956 = r37954 + r37955;
        double r37957 = -r37956;
        double r37958 = exp(r37957);
        double r37959 = pow(r37958, r37954);
        double r37960 = pow(r37958, r37955);
        double r37961 = r37959 / r37960;
        return r37961;
}

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 add-sqr-sqrt0.0

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

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

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

    \[\leadsto \color{blue}{{\left(e^{-\left(\sqrt{1} + x\right)}\right)}^{\left(\sqrt{1} - x\right)}}\]
  7. Using strategy rm
  8. Applied pow-sub0.0

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

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

Reproduce

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