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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

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

    1. Initial program 0.0

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

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

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

    if -0.00186466958584243 < x

    1. Initial program 60.0

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

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

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

      \[\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-exp-log1.0

      \[\leadsto \color{blue}{e^{\log \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)\]
    8. Using strategy rm
    9. Applied add-cube-cbrt1.0

      \[\leadsto e^{\color{blue}{\left(\sqrt[3]{\log \left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \sqrt[3]{\frac{1}{12} \cdot x}\right)} \cdot \sqrt[3]{\log \left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \sqrt[3]{\frac{1}{12} \cdot x}\right)}\right) \cdot \sqrt[3]{\log \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)\]
    10. Applied exp-prod1.0

      \[\leadsto \color{blue}{{\left(e^{\sqrt[3]{\log \left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \sqrt[3]{\frac{1}{12} \cdot x}\right)} \cdot \sqrt[3]{\log \left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \sqrt[3]{\frac{1}{12} \cdot x}\right)}}\right)}^{\left(\sqrt[3]{\log \left(\sqrt[3]{\frac{1}{12} \cdot x} \cdot \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)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.6

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

Runtime

Time bar (total: 14.4s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes21.30.60.420.998.7%
herbie shell --seed 2018353 
(FPCore (x)
  :name "expq2 (section 3.11)"

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

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