Average Error: 40.3 → 0.4
Time: 10.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 r7932199 = x;
        double r7932200 = exp(r7932199);
        double r7932201 = 1.0;
        double r7932202 = r7932200 - r7932201;
        double r7932203 = r7932200 / r7932202;
        return r7932203;
}

double f(double x) {
        double r7932204 = x;
        double r7932205 = exp(r7932204);
        double r7932206 = expm1(r7932204);
        double r7932207 = r7932205 / r7932206;
        return r7932207;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original40.3
Target39.8
Herbie0.4
\[\frac{1}{1 - e^{-x}}\]

Derivation

  1. Initial program 40.3

    \[\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 2019112 +o rules:numerics
(FPCore (x)
  :name "expq2 (section 3.11)"

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

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