Average Error: 0.0 → 0.1
Time: 15.6s
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 r34250 = 1.0;
        double r34251 = x;
        double r34252 = r34251 * r34251;
        double r34253 = r34250 - r34252;
        double r34254 = -r34253;
        double r34255 = exp(r34254);
        return r34255;
}

double f(double x) {
        double r34256 = x;
        double r34257 = 1.0;
        double r34258 = -r34257;
        double r34259 = fma(r34256, r34256, r34258);
        double r34260 = exp(r34259);
        double r34261 = 3.0;
        double r34262 = pow(r34260, r34261);
        double r34263 = cbrt(r34262);
        double r34264 = log1p(r34263);
        double r34265 = expm1(r34264);
        return r34265;
}

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)))))