Average Error: 39.8 → 1.0
Time: 15.0s
Precision: 64
Internal Precision: 128
\[\frac{e^{x} - 1}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -175606663.94769424:\\ \;\;\;\;\frac{1 - e^{x} \cdot e^{x}}{\left(x \cdot \left(\sqrt[3]{-1 - e^{x}} \cdot \sqrt[3]{-1 - e^{x}}\right)\right) \cdot \sqrt[3]{-1 - e^{x}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{2} + \left(1 + \frac{1}{6} \cdot {x}^{2}\right)\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original39.8
Target39.0
Herbie1.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. Split input into 2 regimes
  2. if x < -175606663.94769424

    1. Initial program 0

      \[\frac{e^{x} - 1}{x}\]
    2. Initial simplification0

      \[\leadsto \frac{-1 + e^{x}}{x}\]
    3. Using strategy rm
    4. Applied flip-+0

      \[\leadsto \frac{\color{blue}{\frac{-1 \cdot -1 - e^{x} \cdot e^{x}}{-1 - e^{x}}}}{x}\]
    5. Applied associate-/l/0

      \[\leadsto \color{blue}{\frac{-1 \cdot -1 - e^{x} \cdot e^{x}}{x \cdot \left(-1 - e^{x}\right)}}\]
    6. Simplified0

      \[\leadsto \frac{\color{blue}{1 - e^{x} \cdot e^{x}}}{x \cdot \left(-1 - e^{x}\right)}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt0

      \[\leadsto \frac{1 - e^{x} \cdot e^{x}}{x \cdot \color{blue}{\left(\left(\sqrt[3]{-1 - e^{x}} \cdot \sqrt[3]{-1 - e^{x}}\right) \cdot \sqrt[3]{-1 - e^{x}}\right)}}\]
    9. Applied associate-*r*0

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

    if -175606663.94769424 < x

    1. Initial program 58.9

      \[\frac{e^{x} - 1}{x}\]
    2. Initial simplification58.9

      \[\leadsto \frac{-1 + e^{x}}{x}\]
    3. Taylor expanded around 0 1.4

      \[\leadsto \color{blue}{\frac{1}{2} \cdot x + \left(\frac{1}{6} \cdot {x}^{2} + 1\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -175606663.94769424:\\ \;\;\;\;\frac{1 - e^{x} \cdot e^{x}}{\left(x \cdot \left(\sqrt[3]{-1 - e^{x}} \cdot \sqrt[3]{-1 - e^{x}}\right)\right) \cdot \sqrt[3]{-1 - e^{x}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{2} + \left(1 + \frac{1}{6} \cdot {x}^{2}\right)\\ \end{array}\]

Runtime

Time bar (total: 15.0s)Debug logProfile

herbie shell --seed 2018277 
(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))