Average Error: 0.0 → 0.1
Time: 16.2s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{{\left(e^{\mathsf{fma}\left(x, x, -1\right)}\right)}^{3}}\right)\right)\]
e^{-\left(1 - x \cdot x\right)}
\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{{\left(e^{\mathsf{fma}\left(x, x, -1\right)}\right)}^{3}}\right)\right)
double f(double x) {
        double r42928 = 1.0;
        double r42929 = x;
        double r42930 = r42929 * r42929;
        double r42931 = r42928 - r42930;
        double r42932 = -r42931;
        double r42933 = exp(r42932);
        return r42933;
}

double f(double x) {
        double r42934 = x;
        double r42935 = 1.0;
        double r42936 = -r42935;
        double r42937 = fma(r42934, r42934, r42936);
        double r42938 = exp(r42937);
        double r42939 = 3.0;
        double r42940 = pow(r42938, r42939);
        double r42941 = cbrt(r42940);
        double r42942 = log1p(r42941);
        double r42943 = expm1(r42942);
        return r42943;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[e^{-\left(1 - x \cdot x\right)}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(x, x, -1\right)}}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.0

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{\mathsf{fma}\left(x, x, -1\right)}\right)\right)}\]
  5. Using strategy rm
  6. Applied add-cbrt-cube0.1

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

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\color{blue}{{\left(e^{\mathsf{fma}\left(x, x, -1\right)}\right)}^{3}}}\right)\right)\]
  8. Final simplification0.1

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{{\left(e^{\mathsf{fma}\left(x, x, -1\right)}\right)}^{3}}\right)\right)\]

Reproduce

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