Average Error: 40.0 → 0.6
Time: 17.4s
Precision: 64
Internal Precision: 128
\[\frac{e^{x}}{e^{x} - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.0016142589180630567:\\ \;\;\;\;\frac{\sqrt[3]{e^{x}} \cdot \sqrt[3]{e^{x}}}{\sqrt[3]{e^{x} - 1} \cdot \sqrt[3]{e^{x} - 1}} \cdot \frac{\sqrt[3]{e^{x}}}{\sqrt[3]{e^{x} - 1}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}} \cdot \left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}} \cdot \sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}}\right)\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}} \cdot \sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}}\right)\right) + \left(\frac{1}{2} + \frac{1}{x}\right)\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original40.0
Target39.6
Herbie0.6
\[\frac{1}{1 - e^{-x}}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -0.0016142589180630567

    1. Initial program 0.0

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

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

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

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

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

    if -0.0016142589180630567 < x

    1. Initial program 60.1

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

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

      \[\leadsto \color{blue}{\frac{1}{12} \cdot x + \left(\frac{1}{x} + \frac{1}{2}\right)}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.9

      \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \sqrt[3]{\frac{1}{12} \cdot x}\right) \cdot \sqrt[3]{\frac{1}{12} \cdot x}} + \left(\frac{1}{x} + \frac{1}{2}\right)\]
    6. Using strategy rm
    7. Applied add-cube-cbrt0.9

      \[\leadsto \left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}} \cdot \sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}}\right) \cdot \sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}}\right)}\right) \cdot \sqrt[3]{\frac{1}{12} \cdot x} + \left(\frac{1}{x} + \frac{1}{2}\right)\]
    8. Applied associate-*r*0.9

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}} \cdot \sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}}\right)\right) \cdot \sqrt[3]{\sqrt[3]{\frac{1}{12} \cdot x}}\right)} \cdot \sqrt[3]{\frac{1}{12} \cdot x} + \left(\frac{1}{x} + \frac{1}{2}\right)\]
    9. Using strategy rm
    10. Applied add-cube-cbrt0.9

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

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

Runtime

Time bar (total: 17.4s)Debug logProfile

herbie shell --seed 2018277 
(FPCore (x)
  :name "expq2 (section 3.11)"

  :herbie-target
  (/ 1 (- 1 (exp (- x))))

  (/ (exp x) (- (exp x) 1)))