Average Error: 38.6 → 0.5
Time: 9.2s
Precision: 64
Internal Precision: 1344
\[e^{x} - 1\]
\[\begin{array}{l} \mathbf{if}\;e^{x} - 1 \le -1.4757203902199797 \cdot 10^{-11}:\\ \;\;\;\;\frac{e^{x + x} - 1}{e^{x} + 1}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{2} + \frac{1}{6} \cdot x\right) \cdot \left(x \cdot x\right) + x\\ \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 flip--0.6

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

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

    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}{6} \cdot {x}^{3} + \left(\frac{1}{2} \cdot {x}^{2} + x\right)}\]
    3. Applied simplify0.5

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

Runtime

Time bar (total: 9.2s)Debug log

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