Average Error: 39.9 → 0.4
Time: 5.3s
Precision: 64
\[\frac{e^{x}}{e^{x} - 1}\]
\[\frac{e^{x}}{(e^{x} - 1)^*}\]
\frac{e^{x}}{e^{x} - 1}
\frac{e^{x}}{(e^{x} - 1)^*}
double f(double x) {
        double r7013240 = x;
        double r7013241 = exp(r7013240);
        double r7013242 = 1.0;
        double r7013243 = r7013241 - r7013242;
        double r7013244 = r7013241 / r7013243;
        return r7013244;
}

double f(double x) {
        double r7013245 = x;
        double r7013246 = exp(r7013245);
        double r7013247 = expm1(r7013245);
        double r7013248 = r7013246 / r7013247;
        return r7013248;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original39.9
Target39.5
Herbie0.4
\[\frac{1}{1 - e^{-x}}\]

Derivation

  1. Initial program 39.9

    \[\frac{e^{x}}{e^{x} - 1}\]
  2. Using strategy rm
  3. Applied expm1-def0.4

    \[\leadsto \frac{e^{x}}{\color{blue}{(e^{x} - 1)^*}}\]
  4. Final simplification0.4

    \[\leadsto \frac{e^{x}}{(e^{x} - 1)^*}\]

Reproduce

herbie shell --seed 2019107 +o rules:numerics
(FPCore (x)
  :name "expq2 (section 3.11)"

  :herbie-target
  (/ 1 (- 1 (exp (- x))))

  (/ (exp x) (- (exp x) 1)))