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

Error

Bits error versus x

Target

Original44.8
Comparison44.8
Herbie0.1
\[ \frac{1}{1 - e^{-x}} \]

Derivation

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

    1. Initial program 0.1

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

    if -7.829158115972637e-05 < x

    1. Initial program 60.7

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

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

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

Runtime

Total time: 12.6s Debug log

Please include this information when filing a bug report:

herbie --seed '#(1554391133 2810866021 1834724969 3257213367 4265476673 21750623)'
(FPCore (x)
  :name "NMSE section 3.11"

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

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