Average Error: 0.0 → 0.0
Time: 1.2s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[{e}^{\left(-\left(1 - x \cdot x\right)\right)}\]
e^{-\left(1 - x \cdot x\right)}
{e}^{\left(-\left(1 - x \cdot x\right)\right)}
double f(double x) {
        double r17942 = 1.0;
        double r17943 = x;
        double r17944 = r17943 * r17943;
        double r17945 = r17942 - r17944;
        double r17946 = -r17945;
        double r17947 = exp(r17946);
        return r17947;
}

double f(double x) {
        double r17948 = exp(1.0);
        double r17949 = 1.0;
        double r17950 = x;
        double r17951 = r17950 * r17950;
        double r17952 = r17949 - r17951;
        double r17953 = -r17952;
        double r17954 = pow(r17948, r17953);
        return r17954;
}

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 *-un-lft-identity0.0

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

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

    \[\leadsto {\color{blue}{e}}^{\left(-\left(1 - x \cdot x\right)\right)}\]
  6. Final simplification0.0

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

Reproduce

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