Average Error: 39.6 → 0.3
Time: 1.1m
Precision: 64
Internal Precision: 1344
\[\frac{e^{x} - 1}{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.00010950689972437187:\\ \;\;\;\;\frac{\frac{\sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)} \cdot \sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)}}{\sqrt[3]{e^{x} + 1} \cdot \sqrt[3]{e^{x} + 1}}}{\frac{x \cdot \sqrt[3]{1 + e^{x}}}{\sqrt[3]{e^{x} \cdot e^{x} - 1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot {x}^{2} + \left(\frac{1}{6} \cdot {x}^{3} + x\right)}{x}\\ \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.7
Herbie0.3
\[\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.00010950689972437187

    1. Initial program 0.1

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

      \[\leadsto \frac{\color{blue}{\frac{e^{x} \cdot e^{x} - 1 \cdot 1}{e^{x} + 1}}}{x}\]
    4. Applied simplify0.0

      \[\leadsto \frac{\frac{\color{blue}{e^{x + x} - 1}}{e^{x} + 1}}{x}\]
    5. Using strategy rm
    6. Applied add-log-exp0.0

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

      \[\leadsto \frac{\frac{\log \left(e^{e^{x + x} - 1}\right)}{\color{blue}{\left(\sqrt[3]{e^{x} + 1} \cdot \sqrt[3]{e^{x} + 1}\right) \cdot \sqrt[3]{e^{x} + 1}}}}{x}\]
    9. Applied add-cube-cbrt0.1

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

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)} \cdot \sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)}}{\sqrt[3]{e^{x} + 1} \cdot \sqrt[3]{e^{x} + 1}} \cdot \frac{\sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)}}{\sqrt[3]{e^{x} + 1}}}}{x}\]
    11. Applied associate-/l*0.1

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)} \cdot \sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)}}{\sqrt[3]{e^{x} + 1} \cdot \sqrt[3]{e^{x} + 1}}}{\frac{x}{\frac{\sqrt[3]{\log \left(e^{e^{x + x} - 1}\right)}}{\sqrt[3]{e^{x} + 1}}}}}\]
    12. Applied simplify0.1

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

    if -0.00010950689972437187 < x

    1. Initial program 60.2

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

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

Runtime

Time bar (total: 1.1m)Debug logProfile

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