Average Error: 40.1 → 0.1
Time: 5.6s
Precision: 64
Internal Precision: 1408
\[\frac{e^{x} - 1}{x}\]
\[(e^{x} - 1)^* \cdot \frac{1}{x}\]

Error

Bits error versus x

Target

Original40.1
Target39.2
Herbie0.1
\[\begin{array}{l} \mathbf{if}\;x \lt 1 \land x \gt -1:\\ \;\;\;\;\frac{e^{x} - 1}{\log \left(e^{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x} - 1}{x}\\ \end{array}\]

Derivation

  1. Initial program 40.1

    \[\frac{e^{x} - 1}{x}\]
  2. Applied simplify0.0

    \[\leadsto \color{blue}{\frac{(e^{x} - 1)^*}{x}}\]
  3. Using strategy rm
  4. Applied div-inv0.1

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

Runtime

Time bar (total: 5.6s)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' +o rules:numerics
(FPCore (x)
  :name "Kahan's exp quotient"

  :herbie-target
  (if (and (< x 1) (> x -1)) (/ (- (exp x) 1) (log (exp x))) (/ (- (exp x) 1) x))

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