Average Error: 41.0 → 0.1
Time: 10.4s
Precision: 64
Internal precision: 1408
\[e^{x} - 1\]
\[\begin{array}{l} \mathbf{if}\;x \le -6.667433711053936 \cdot 10^{-08}:\\ \;\;\;\;e^{x} - 1\\ \mathbf{else}:\\ \;\;\;\;{x}^2 \cdot \frac{1}{2} + \left({x}^3 \cdot \frac{1}{6} + x\right)\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes.
  2. if x < -6.667433711053936e-08

    1. Initial program 0.2

      \[e^{x} - 1\]

    if -6.667433711053936e-08 < x

    1. Initial program 59.5

      \[e^{x} - 1\]
    2. Applied taylor 0.1

      \[\leadsto \frac{1}{2} \cdot {x}^2 + \left(\frac{1}{6} \cdot {x}^{3} + x\right)\]
    3. Taylor expanded around 0 0.1

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

      \[\leadsto \color{blue}{{x}^2 \cdot \left(\frac{1}{2} + x \cdot \frac{1}{6}\right) + x}\]
    5. Using strategy rm
    6. Applied distribute-lft-in 0.1

      \[\leadsto \color{blue}{\left({x}^2 \cdot \frac{1}{2} + {x}^2 \cdot \left(x \cdot \frac{1}{6}\right)\right)} + x\]
    7. Applied associate-+l+ 0.1

      \[\leadsto \color{blue}{{x}^2 \cdot \frac{1}{2} + \left({x}^2 \cdot \left(x \cdot \frac{1}{6}\right) + x\right)}\]
    8. Applied simplify 0.1

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

Runtime

Time bar (total: 10.4s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(3052192724 3812927732 3686175817 630908657 2373248591 511094450)'
(FPCore (x)
  :name "NMSE example 3.7"
  (- (exp x) 1))