Average Error: 0.0 → 0.2
Time: 10.5s
Precision: 64
\[e^{-\left(1 - x \cdot x\right)}\]
\[{\left(e^{-\sqrt{1 - x \cdot x}}\right)}^{\left(\sqrt{1 - x \cdot x}\right)}\]
e^{-\left(1 - x \cdot x\right)}
{\left(e^{-\sqrt{1 - x \cdot x}}\right)}^{\left(\sqrt{1 - x \cdot x}\right)}
double f(double x) {
        double r24503 = 1.0;
        double r24504 = x;
        double r24505 = r24504 * r24504;
        double r24506 = r24503 - r24505;
        double r24507 = -r24506;
        double r24508 = exp(r24507);
        return r24508;
}

double f(double x) {
        double r24509 = 1.0;
        double r24510 = x;
        double r24511 = r24510 * r24510;
        double r24512 = r24509 - r24511;
        double r24513 = sqrt(r24512);
        double r24514 = -r24513;
        double r24515 = exp(r24514);
        double r24516 = pow(r24515, r24513);
        return r24516;
}

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 add-sqr-sqrt0.2

    \[\leadsto e^{-\color{blue}{\sqrt{1 - x \cdot x} \cdot \sqrt{1 - x \cdot x}}}\]
  4. Applied distribute-lft-neg-in0.2

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

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

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

Reproduce

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