Average Error: 0.0 → 0.0
Time: 3.8s
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 r40000 = 1.0;
        double r40001 = x;
        double r40002 = r40001 * r40001;
        double r40003 = r40000 - r40002;
        double r40004 = -r40003;
        double r40005 = exp(r40004);
        return r40005;
}

double f(double x) {
        double r40006 = 1.0;
        double r40007 = x;
        double r40008 = r40007 * r40007;
        double r40009 = r40006 - r40008;
        double r40010 = -r40009;
        double r40011 = exp(r40010);
        double r40012 = sqrt(r40011);
        double r40013 = r40012 * r40012;
        return r40013;
}

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 2020047 +o rules:numerics
(FPCore (x)
  :name "exp neg sub"
  :precision binary64
  (exp (- (- 1 (* x x)))))