Error: 33.4 → 0.1
Time: 14.6s
Precision: 64
Ground Truth: 128
\[e^{a \cdot x} - 1\]
\[\begin{cases} \left(\sqrt{e^{a \cdot x}} + 1\right) \cdot \left(\sqrt{e^{a \cdot x}} - 1\right) & \text{when } a \cdot x \le -3.4442505479166693 \cdot 10^{-07} \\ \frac{1}{2} \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right) + a \cdot x & \text{otherwise} \end{cases}\]

Error

Bits error versus a

Bits error versus x

Derivation

    if (* a x) < -3.4442505479166693e-07

    1. Initial program 0.2

      \[e^{a \cdot x} - 1\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt 0.2

      \[\leadsto \color{blue}{{\left(\sqrt{e^{a \cdot x}}\right)}^2} - 1\]
    4. Applied difference-of-sqr-1 0.2

      \[\leadsto \color{blue}{\left(\sqrt{e^{a \cdot x}} + 1\right) \cdot \left(\sqrt{e^{a \cdot x}} - 1\right)}\]

    if -3.4442505479166693e-07 < (* a x)

    1. Initial program 47.4

      \[e^{a \cdot x} - 1\]
    2. Applied taylor 43.0

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

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right) + a \cdot x}\]
  1. Removed slow pow expressions

Runtime

Total time: 14.6s Debug log

Please report a bug with the following info:

herbie --seed '#(2722000824 1578439985 1220353839 3752218380 2202156817 3292856742)'
(FPCore (a x)
  :name "NMSE section 3.5"
  
  :target
  (if (< (fabs (* a x)) 1/10) (* (* a x) (+ 1 (+ (/ (* a x) 2) (/ (sqr (* a x)) 6)))) (- (exp (* a x)) 1))(- (exp (* a x)) 1))