Average Error: 0.0 → 0
Time: 11.6s
Precision: 64
\[\frac{2}{{e}^{x}}\]
\[2 \cdot {e}^{\left(-x\right)}\]
\frac{2}{{e}^{x}}
2 \cdot {e}^{\left(-x\right)}
double f(double e, double x) {
        double r1942698 = 2.0;
        double r1942699 = e;
        double r1942700 = x;
        double r1942701 = pow(r1942699, r1942700);
        double r1942702 = r1942698 / r1942701;
        return r1942702;
}

double f(double e, double x) {
        double r1942703 = 2.0;
        double r1942704 = e;
        double r1942705 = x;
        double r1942706 = -r1942705;
        double r1942707 = pow(r1942704, r1942706);
        double r1942708 = r1942703 * r1942707;
        return r1942708;
}

Error

Bits error versus e

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{2}{{e}^{x}}\]
  2. Using strategy rm
  3. Applied div-inv0.0

    \[\leadsto \color{blue}{2 \cdot \frac{1}{{e}^{x}}}\]
  4. Simplified0

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

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

Reproduce

herbie shell --seed 1 
(FPCore (e x)
  :name "2/e^x"
  :precision binary64
  (/ 2 (pow e x)))