Average Error: 32.2 → 12.1
Time: 20.3s
Precision: 64
Internal precision: 1408
\[e^{a \cdot x} - 1\]
\[\begin{array}{l} \mathbf{if}\;a \cdot x \le -5.093462692759953 \cdot 10^{-15}:\\ \;\;\;\;\log \left(e^{\frac{{\left(e^{a \cdot x}\right)}^2 - {1}^2}{e^{a \cdot x} + 1}}\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array}\]

Error

Bits error versus a

Bits error versus x

Derivation

  1. Split input into 2 regimes.
  2. if (* a x) < -5.093462692759953e-15

    1. Initial program 0.9

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

      \[\leadsto \color{blue}{\log \left(e^{e^{a \cdot x} - 1}\right)}\]
    4. Using strategy rm
    5. Applied flip-- 0.9

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

    if -5.093462692759953e-15 < (* a x)

    1. Initial program 46.6

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

      \[\leadsto \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. Taylor expanded around 0 17.3

      \[\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. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 20.3s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(3052192724 3812927732 3686175817 630908657 2373248591 511094450)'
(FPCore (a x)
  :name "NMSE section 3.5"
  (- (exp (* a x)) 1))