Average Error: 30.2 → 0.4
Time: 48.5s
Precision: 64
Internal Precision: 1408
\[e^{a \cdot x} - 1\]
\[\begin{array}{l} \mathbf{if}\;e^{a \cdot x} - 1 \le -1.3573432371303997 \cdot 10^{-08}:\\ \;\;\;\;\log \left(e^{e^{a \cdot x} - 1}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right) \cdot \left(\left(\frac{1}{6} \cdot x\right) \cdot a + \frac{1}{2}\right) + a \cdot x\\ \end{array}\]

Error

Bits error versus a

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if (- (exp (* a x)) 1) < -1.3573432371303997e-08

    1. Initial program 0.3

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

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

    if -1.3573432371303997e-08 < (- (exp (* a x)) 1)

    1. Initial program 44.9

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot \left({a}^{3} \cdot {x}^{3}\right) + \left(\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right) + a \cdot x\right)}\]
    3. Using strategy rm
    4. Applied pow-prod-down8.1

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

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

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

Runtime

Time bar (total: 48.5s)Debug log

herbie shell --seed '#(1743936871 1855164119 3668777427 1254258049 132811564 1366975197)' 
(FPCore (a x)
  :name "NMSE section 3.5"
  (- (exp (* a x)) 1))