Average Error: 45.1 → 0.2
Time: 10.3s
Precision: 64
Internal precision: 1408
\[\frac{e^{x}}{e^{x} - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -6.667433711053936 \cdot 10^{-08}:\\ \;\;\;\;\frac{e^{x}}{\log \left(e^{e^{x} - 1}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} + \left(\frac{1}{x} + \frac{1}{12} \cdot x\right)\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes.
  2. if x < -6.667433711053936e-08

    1. Initial program 0.3

      \[\frac{e^{x}}{e^{x} - 1}\]
    2. Using strategy rm
    3. Applied add-log-exp 0.3

      \[\leadsto \frac{e^{x}}{\color{blue}{\log \left(e^{e^{x} - 1}\right)}}\]

    if -6.667433711053936e-08 < 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

Time bar (total: 10.3s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(3052192724 3812927732 3686175817 630908657 2373248591 511094450)'
(FPCore (x)
  :name "NMSE section 3.11"
  :pre (!= x 0)
  (/ (exp x) (- (exp x) 1)))