Average Error: 0.0 → 0.0
Time: 3.3s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[\sqrt{e^{-\left(1 - x \cdot x\right)}} \cdot \sqrt{e^{-\left(1 - x \cdot x\right)}}\]
e^{-\left(1 - x \cdot x\right)}
\sqrt{e^{-\left(1 - x \cdot x\right)}} \cdot \sqrt{e^{-\left(1 - x \cdot x\right)}}
double f(double x) {
        double r31345 = 1.0;
        double r31346 = x;
        double r31347 = r31346 * r31346;
        double r31348 = r31345 - r31347;
        double r31349 = -r31348;
        double r31350 = exp(r31349);
        return r31350;
}

double f(double x) {
        double r31351 = 1.0;
        double r31352 = x;
        double r31353 = r31352 * r31352;
        double r31354 = r31351 - r31353;
        double r31355 = -r31354;
        double r31356 = exp(r31355);
        double r31357 = sqrt(r31356);
        double r31358 = r31357 * r31357;
        return r31358;
}

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 \color{blue}{\sqrt{e^{-\left(1 - x \cdot x\right)}} \cdot \sqrt{e^{-\left(1 - x \cdot x\right)}}}\]
  4. Final simplification0.0

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

Reproduce

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