Average Error: 39.6 → 0.4
Time: 12.7s
Precision: 64
Internal Precision: 1344
\[\frac{e^{x} - 1}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0001319153847279274:\\ \;\;\;\;\frac{\sqrt[3]{e^{x + x} - 1}}{\frac{x}{\sqrt[3]{e^{x + x} - 1}}} \cdot \frac{\sqrt[3]{e^{x + x} - 1}}{e^{x} + 1}\\ \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.6
Target38.8
Herbie0.4
\[\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 < -0.0001319153847279274

    1. Initial program 0.0

      \[\frac{e^{x} - 1}{x}\]
    2. Using strategy rm
    3. Applied flip--0.0

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

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

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

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{e^{x} \cdot e^{x} - 1} \cdot \sqrt[3]{e^{x} \cdot e^{x} - 1}\right) \cdot \sqrt[3]{e^{x} \cdot e^{x} - 1}}}{x \cdot \left(e^{x} + 1\right)}\]
    8. Applied times-frac0.0

      \[\leadsto \color{blue}{\frac{\sqrt[3]{e^{x} \cdot e^{x} - 1} \cdot \sqrt[3]{e^{x} \cdot e^{x} - 1}}{x} \cdot \frac{\sqrt[3]{e^{x} \cdot e^{x} - 1}}{e^{x} + 1}}\]
    9. Simplified0.0

      \[\leadsto \color{blue}{\frac{\sqrt[3]{e^{x + x} - 1}}{\frac{x}{\sqrt[3]{e^{x + x} - 1}}}} \cdot \frac{\sqrt[3]{e^{x} \cdot e^{x} - 1}}{e^{x} + 1}\]
    10. Simplified0.0

      \[\leadsto \frac{\sqrt[3]{e^{x + x} - 1}}{\frac{x}{\sqrt[3]{e^{x + x} - 1}}} \cdot \color{blue}{\frac{\sqrt[3]{e^{x + x} - 1}}{1 + e^{x}}}\]

    if -0.0001319153847279274 < x

    1. Initial program 60.1

      \[\frac{e^{x} - 1}{x}\]
    2. Taylor expanded around 0 0.5

      \[\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 simplification0.4

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

Runtime

Time bar (total: 12.7s)Debug logProfile

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