Average Error: 0.0 → 0.0
Time: 2.0s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[e^{-1 \cdot \left(1 - {x}^{2}\right)} \cdot {\left(e^{-1}\right)}^{\left(\mathsf{fma}\left(-x, x, x \cdot x\right)\right)}\]
e^{-\left(1 - x \cdot x\right)}
e^{-1 \cdot \left(1 - {x}^{2}\right)} \cdot {\left(e^{-1}\right)}^{\left(\mathsf{fma}\left(-x, x, x \cdot x\right)\right)}
double f(double x) {
        double r21091 = 1.0;
        double r21092 = x;
        double r21093 = r21092 * r21092;
        double r21094 = r21091 - r21093;
        double r21095 = -r21094;
        double r21096 = exp(r21095);
        return r21096;
}

double f(double x) {
        double r21097 = -1.0;
        double r21098 = 1.0;
        double r21099 = x;
        double r21100 = 2.0;
        double r21101 = pow(r21099, r21100);
        double r21102 = r21098 - r21101;
        double r21103 = r21097 * r21102;
        double r21104 = exp(r21103);
        double r21105 = exp(r21097);
        double r21106 = -r21099;
        double r21107 = r21099 * r21099;
        double r21108 = fma(r21106, r21099, r21107);
        double r21109 = pow(r21105, r21108);
        double r21110 = r21104 * r21109;
        return r21110;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Using strategy rm
  3. Applied neg-mul-10.0

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

    \[\leadsto \color{blue}{{\left(e^{-1}\right)}^{\left(1 - x \cdot x\right)}}\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.0

    \[\leadsto {\left(e^{-1}\right)}^{\left(\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}} - x \cdot x\right)}\]
  7. Applied prod-diff0.0

    \[\leadsto {\left(e^{-1}\right)}^{\color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -x \cdot x\right) + \mathsf{fma}\left(-x, x, x \cdot x\right)\right)}}\]
  8. Applied unpow-prod-up0.0

    \[\leadsto \color{blue}{{\left(e^{-1}\right)}^{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -x \cdot x\right)\right)} \cdot {\left(e^{-1}\right)}^{\left(\mathsf{fma}\left(-x, x, x \cdot x\right)\right)}}\]
  9. Simplified0.0

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

    \[\leadsto e^{-1 \cdot \left(1 - {x}^{2}\right)} \cdot {\left(e^{-1}\right)}^{\left(\mathsf{fma}\left(-x, x, x \cdot x\right)\right)}\]

Reproduce

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