Average Error: 40.1 → 40.1
Time: 8.9s
Precision: 64
Internal Precision: 1408
\[\frac{e^{x} - 1}{x}\]
\[\frac{e^{x} - 1}{x}\]

Error

Bits error versus x

Target

Original40.1
Target39.2
Herbie40.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. Removed slow pow expressions.

Runtime

Time bar (total: 8.9s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(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))