Average Error: 45.5 → 0.1
Time: 18.1s
Precision: 64
Ground Truth: 128
\[\frac{e^{x}}{e^{x} - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -8.658073314327725 \cdot 10^{-05}:\\ \;\;\;\;\frac{e^{x}}{e^{x} - 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} + \left(\frac{1}{12} \cdot x + \frac{1}{x}\right)\\ \end{array}\]

Error

Bits error versus x

Target

Original45.5
Comparison45.5
Herbie0.1
\[ \frac{1}{1 - e^{-x}} \]

Derivation

  1. Split input into 2 regimes.
  2. if x < -8.658073314327725e-05

    1. Initial program 0.1

      \[\frac{e^{x}}{e^{x} - 1}\]

    if -8.658073314327725e-05 < x

    1. Initial program 60.6

      \[\frac{e^{x}}{e^{x} - 1}\]
    2. Applied taylor 0.1

      \[\leadsto \frac{1}{2} + \left(\frac{1}{12} \cdot x + \frac{1}{x}\right)\]
    3. Taylor expanded around 0 0.1

      \[\leadsto \color{blue}{\frac{1}{2} + \left(\frac{1}{12} \cdot x + \frac{1}{x}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Total time: 18.1s Debug log

Please include this information when filing a bug report:

herbie --seed '#(159337892 3967392979 2364236447 3188298973 2350036330 69330587)'
(FPCore (x)
  :name "NMSE section 3.11"

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

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