Average Error: 39.4 → 0.0
Time: 3.7s
Precision: 64
Internal Precision: 1408
\[\frac{e^{x} - 1}{x}\]
\[\frac{(e^{x} - 1)^*}{x}\]

Error

Bits error versus x

Target

Original39.4
Target38.7
Herbie0.0
\[\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 39.4

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

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

Runtime

Time bar (total: 3.7s)Debug logProfile

herbie shell --seed '#(1070609872 3456127585 2380521889 2328837196 1765472538 734540918)' +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))