Average Error: 0.0 → 0.0
Time: 13.0s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[\frac{e^{x \cdot x - 1}}{e^{\mathsf{fma}\left(-x, x, x \cdot x\right)}}\]
e^{-\left(1 - x \cdot x\right)}
\frac{e^{x \cdot x - 1}}{e^{\mathsf{fma}\left(-x, x, x \cdot x\right)}}
double f(double x) {
        double r21985 = 1.0;
        double r21986 = x;
        double r21987 = r21986 * r21986;
        double r21988 = r21985 - r21987;
        double r21989 = -r21988;
        double r21990 = exp(r21989);
        return r21990;
}

double f(double x) {
        double r21991 = x;
        double r21992 = r21991 * r21991;
        double r21993 = 1.0;
        double r21994 = r21992 - r21993;
        double r21995 = exp(r21994);
        double r21996 = -r21991;
        double r21997 = fma(r21996, r21991, r21992);
        double r21998 = exp(r21997);
        double r21999 = r21995 / r21998;
        return r21999;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Using strategy rm
  3. Applied add-log-exp0.0

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

    \[\leadsto e^{\color{blue}{\log \left(\frac{1}{e^{1 - x \cdot x}}\right)}}\]
  5. Applied rem-exp-log0.0

    \[\leadsto \color{blue}{\frac{1}{e^{1 - x \cdot x}}}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.0

    \[\leadsto \frac{1}{e^{\color{blue}{\sqrt{1} \cdot \sqrt{1}} - x \cdot x}}\]
  8. Applied prod-diff0.0

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

    \[\leadsto \frac{1}{\color{blue}{e^{\mathsf{fma}\left(\sqrt{1}, \sqrt{1}, -x \cdot x\right)} \cdot e^{\mathsf{fma}\left(-x, x, x \cdot x\right)}}}\]
  10. Applied associate-/r*0.0

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

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

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

Reproduce

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