Average Error: 0.0 → 0.0
Time: 14.6s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(e^{{x}^{2} - 1}\right)\right)\]
e^{-\left(1 - x \cdot x\right)}
\mathsf{expm1}\left(\mathsf{log1p}\left(e^{{x}^{2} - 1}\right)\right)
double f(double x) {
        double r27707 = 1.0;
        double r27708 = x;
        double r27709 = r27708 * r27708;
        double r27710 = r27707 - r27709;
        double r27711 = -r27710;
        double r27712 = exp(r27711);
        return r27712;
}

double f(double x) {
        double r27713 = x;
        double r27714 = 2.0;
        double r27715 = pow(r27713, r27714);
        double r27716 = 1.0;
        double r27717 = r27715 - r27716;
        double r27718 = exp(r27717);
        double r27719 = log1p(r27718);
        double r27720 = expm1(r27719);
        return r27720;
}

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 pow10.0

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

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{-{\left(1 - x \cdot x\right)}^{1}}\right)\right)}\]
  6. Simplified0.0

    \[\leadsto \mathsf{expm1}\left(\color{blue}{\mathsf{log1p}\left(e^{{x}^{2} - 1}\right)}\right)\]
  7. Final simplification0.0

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(e^{{x}^{2} - 1}\right)\right)\]

Reproduce

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