Average Error: 38.6 → 0.5
Time: 9.6s
Precision: 64
Internal Precision: 1344
\[e^{x} - 1\]
\[\begin{array}{l} \mathbf{if}\;e^{x} - 1 \le -1.4757203902199797 \cdot 10^{-11}:\\ \;\;\;\;\frac{{\left(e^{x}\right)}^{3} - 1}{e^{x + x} + \left(1 + e^{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \frac{1}{6}\right)\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (- (exp x) 1) < -1.4757203902199797e-11

    1. Initial program 0.6

      \[e^{x} - 1\]
    2. Using strategy rm
    3. Applied flip3--0.6

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

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

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

    if -1.4757203902199797e-11 < (- (exp x) 1)

    1. Initial program 59.0

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {x}^{2} + \left(x + \frac{1}{6} \cdot {x}^{3}\right)}\]
    3. Applied simplify0.5

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

Runtime

Time bar (total: 9.6s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x)
  :name "exp(x) - 1"
  (- (exp x) 1))