Average Error: 0.0 → 0.0
Time: 2.2s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[{\left(e^{-\sqrt{1}} \cdot e^{-x}\right)}^{\left(\sqrt{1} - x\right)}\]
e^{-\left(1 - x \cdot x\right)}
{\left(e^{-\sqrt{1}} \cdot e^{-x}\right)}^{\left(\sqrt{1} - x\right)}
double f(double x) {
        double r39040 = 1.0;
        double r39041 = x;
        double r39042 = r39041 * r39041;
        double r39043 = r39040 - r39042;
        double r39044 = -r39043;
        double r39045 = exp(r39044);
        return r39045;
}

double f(double x) {
        double r39046 = 1.0;
        double r39047 = sqrt(r39046);
        double r39048 = -r39047;
        double r39049 = exp(r39048);
        double r39050 = x;
        double r39051 = -r39050;
        double r39052 = exp(r39051);
        double r39053 = r39049 * r39052;
        double r39054 = r39047 - r39050;
        double r39055 = pow(r39053, r39054);
        return r39055;
}

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 distribute-neg-in0.0

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

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

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

Reproduce

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