expax (section 3.5)

Percentage Accurate: 53.4% → 100.0%
Time: 9.0s
Alternatives: 8
Speedup: 6.4×

Specification

?
\[710 > a \cdot x\]
\[\begin{array}{l} \\ e^{a \cdot x} - 1 \end{array} \]
(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
double code(double a, double x) {
	return exp((a * x)) - 1.0;
}
real(8) function code(a, x)
    real(8), intent (in) :: a
    real(8), intent (in) :: x
    code = exp((a * x)) - 1.0d0
end function
public static double code(double a, double x) {
	return Math.exp((a * x)) - 1.0;
}
def code(a, x):
	return math.exp((a * x)) - 1.0
function code(a, x)
	return Float64(exp(Float64(a * x)) - 1.0)
end
function tmp = code(a, x)
	tmp = exp((a * x)) - 1.0;
end
code[a_, x_] := N[(N[Exp[N[(a * x), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}

\\
e^{a \cdot x} - 1
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 53.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{a \cdot x} - 1 \end{array} \]
(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
double code(double a, double x) {
	return exp((a * x)) - 1.0;
}
real(8) function code(a, x)
    real(8), intent (in) :: a
    real(8), intent (in) :: x
    code = exp((a * x)) - 1.0d0
end function
public static double code(double a, double x) {
	return Math.exp((a * x)) - 1.0;
}
def code(a, x):
	return math.exp((a * x)) - 1.0
function code(a, x)
	return Float64(exp(Float64(a * x)) - 1.0)
end
function tmp = code(a, x)
	tmp = exp((a * x)) - 1.0;
end
code[a_, x_] := N[(N[Exp[N[(a * x), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}

\\
e^{a \cdot x} - 1
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{expm1}\left(a \cdot x\right) \end{array} \]
(FPCore (a x) :precision binary64 (expm1 (* a x)))
double code(double a, double x) {
	return expm1((a * x));
}
public static double code(double a, double x) {
	return Math.expm1((a * x));
}
def code(a, x):
	return math.expm1((a * x))
function code(a, x)
	return expm1(Float64(a * x))
end
code[a_, x_] := N[(Exp[N[(a * x), $MachinePrecision]] - 1), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{expm1}\left(a \cdot x\right)
\end{array}
Derivation
  1. Initial program 48.8%

    \[e^{a \cdot x} - 1 \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. accelerator-lowering-expm1.f64N/A

      \[\leadsto \color{blue}{\mathsf{expm1}\left(a \cdot x\right)} \]
    2. *-lowering-*.f64100.0

      \[\leadsto \mathsf{expm1}\left(\color{blue}{a \cdot x}\right) \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\mathsf{expm1}\left(a \cdot x\right)} \]
  5. Add Preprocessing

Alternative 2: 99.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(\left(a \cdot x\right) \cdot \mathsf{fma}\left(a \cdot x, \mathsf{fma}\left(x, a \cdot 0.041666666666666664, 0.16666666666666666\right), 0.5\right), x, x\right)\\ \end{array} \end{array} \]
(FPCore (a x)
 :precision binary64
 (if (<= (* a x) -10.0)
   -1.0
   (*
    a
    (fma
     (*
      (* a x)
      (fma (* a x) (fma x (* a 0.041666666666666664) 0.16666666666666666) 0.5))
     x
     x))))
double code(double a, double x) {
	double tmp;
	if ((a * x) <= -10.0) {
		tmp = -1.0;
	} else {
		tmp = a * fma(((a * x) * fma((a * x), fma(x, (a * 0.041666666666666664), 0.16666666666666666), 0.5)), x, x);
	}
	return tmp;
}
function code(a, x)
	tmp = 0.0
	if (Float64(a * x) <= -10.0)
		tmp = -1.0;
	else
		tmp = Float64(a * fma(Float64(Float64(a * x) * fma(Float64(a * x), fma(x, Float64(a * 0.041666666666666664), 0.16666666666666666), 0.5)), x, x));
	end
	return tmp
end
code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -10.0], -1.0, N[(a * N[(N[(N[(a * x), $MachinePrecision] * N[(N[(a * x), $MachinePrecision] * N[(x * N[(a * 0.041666666666666664), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] * x + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot x \leq -10:\\
\;\;\;\;-1\\

\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(\left(a \cdot x\right) \cdot \mathsf{fma}\left(a \cdot x, \mathsf{fma}\left(x, a \cdot 0.041666666666666664, 0.16666666666666666\right), 0.5\right), x, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a x) < -10

    1. Initial program 100.0%

      \[e^{a \cdot x} - 1 \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
      2. *-commutativeN/A

        \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
      3. associate-*r*N/A

        \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
      9. unpow2N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
      10. *-lowering-*.f641.5

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
    5. Simplified1.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right)} - 1 \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot {x}^{2}} - 1 \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)} - 1 \]
      3. unpow2N/A

        \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right) - 1 \]
      4. associate-*l*N/A

        \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
      5. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
      7. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)}\right) - 1 \]
      8. unpow2N/A

        \[\leadsto x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
      9. *-lowering-*.f6410.2

        \[\leadsto x \cdot \left(x \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
    8. Simplified10.2%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(a \cdot a\right)\right)\right)} - 1 \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{-1} \]
    10. Step-by-step derivation
      1. Simplified99.3%

        \[\leadsto \color{blue}{-1} \]

      if -10 < (*.f64 a x)

      1. Initial program 27.9%

        \[e^{a \cdot x} - 1 \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{a \cdot \left(x + a \cdot \left(\frac{1}{2} \cdot {x}^{2} + a \cdot \left(\frac{1}{24} \cdot \left(a \cdot {x}^{4}\right) + \frac{1}{6} \cdot {x}^{3}\right)\right)\right)} \]
      4. Simplified92.0%

        \[\leadsto \color{blue}{a \cdot \mathsf{fma}\left(a, x \cdot \left(x \cdot \mathsf{fma}\left(a \cdot x, \mathsf{fma}\left(a \cdot x, 0.041666666666666664, 0.16666666666666666\right), 0.5\right)\right), x\right)} \]
      5. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto a \cdot \left(\color{blue}{\left(a \cdot x\right) \cdot \left(x \cdot \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}\right) + \frac{1}{2}\right)\right)} + x\right) \]
        2. *-commutativeN/A

          \[\leadsto a \cdot \left(\left(a \cdot x\right) \cdot \color{blue}{\left(\left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}\right) + \frac{1}{2}\right) \cdot x\right)} + x\right) \]
        3. associate-*r*N/A

          \[\leadsto a \cdot \left(\color{blue}{\left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}\right) + \frac{1}{2}\right)\right) \cdot x} + x\right) \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto a \cdot \color{blue}{\mathsf{fma}\left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}\right) + \frac{1}{2}\right), x, x\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto a \cdot \mathsf{fma}\left(\color{blue}{\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}\right) + \frac{1}{2}\right)}, x, x\right) \]
        6. *-commutativeN/A

          \[\leadsto a \cdot \mathsf{fma}\left(\color{blue}{\left(x \cdot a\right)} \cdot \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}\right) + \frac{1}{2}\right), x, x\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto a \cdot \mathsf{fma}\left(\color{blue}{\left(x \cdot a\right)} \cdot \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}\right) + \frac{1}{2}\right), x, x\right) \]
        8. accelerator-lowering-fma.f64N/A

          \[\leadsto a \cdot \mathsf{fma}\left(\left(x \cdot a\right) \cdot \color{blue}{\mathsf{fma}\left(a \cdot x, \left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}, \frac{1}{2}\right)}, x, x\right) \]
        9. *-commutativeN/A

          \[\leadsto a \cdot \mathsf{fma}\left(\left(x \cdot a\right) \cdot \mathsf{fma}\left(\color{blue}{x \cdot a}, \left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}, \frac{1}{2}\right), x, x\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto a \cdot \mathsf{fma}\left(\left(x \cdot a\right) \cdot \mathsf{fma}\left(\color{blue}{x \cdot a}, \left(a \cdot x\right) \cdot \frac{1}{24} + \frac{1}{6}, \frac{1}{2}\right), x, x\right) \]
        11. *-commutativeN/A

          \[\leadsto a \cdot \mathsf{fma}\left(\left(x \cdot a\right) \cdot \mathsf{fma}\left(x \cdot a, \color{blue}{\left(x \cdot a\right)} \cdot \frac{1}{24} + \frac{1}{6}, \frac{1}{2}\right), x, x\right) \]
        12. associate-*l*N/A

          \[\leadsto a \cdot \mathsf{fma}\left(\left(x \cdot a\right) \cdot \mathsf{fma}\left(x \cdot a, \color{blue}{x \cdot \left(a \cdot \frac{1}{24}\right)} + \frac{1}{6}, \frac{1}{2}\right), x, x\right) \]
        13. accelerator-lowering-fma.f64N/A

          \[\leadsto a \cdot \mathsf{fma}\left(\left(x \cdot a\right) \cdot \mathsf{fma}\left(x \cdot a, \color{blue}{\mathsf{fma}\left(x, a \cdot \frac{1}{24}, \frac{1}{6}\right)}, \frac{1}{2}\right), x, x\right) \]
        14. *-lowering-*.f64100.0

          \[\leadsto a \cdot \mathsf{fma}\left(\left(x \cdot a\right) \cdot \mathsf{fma}\left(x \cdot a, \mathsf{fma}\left(x, \color{blue}{a \cdot 0.041666666666666664}, 0.16666666666666666\right), 0.5\right), x, x\right) \]
      6. Applied egg-rr100.0%

        \[\leadsto a \cdot \color{blue}{\mathsf{fma}\left(\left(x \cdot a\right) \cdot \mathsf{fma}\left(x \cdot a, \mathsf{fma}\left(x, a \cdot 0.041666666666666664, 0.16666666666666666\right), 0.5\right), x, x\right)} \]
    11. Recombined 2 regimes into one program.
    12. Final simplification99.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(\left(a \cdot x\right) \cdot \mathsf{fma}\left(a \cdot x, \mathsf{fma}\left(x, a \cdot 0.041666666666666664, 0.16666666666666666\right), 0.5\right), x, x\right)\\ \end{array} \]
    13. Add Preprocessing

    Alternative 3: 99.3% accurate, 2.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(a \cdot x, x \cdot \mathsf{fma}\left(a \cdot x, 0.16666666666666666, 0.5\right), x\right)\\ \end{array} \end{array} \]
    (FPCore (a x)
     :precision binary64
     (if (<= (* a x) -10.0)
       -1.0
       (* a (fma (* a x) (* x (fma (* a x) 0.16666666666666666 0.5)) x))))
    double code(double a, double x) {
    	double tmp;
    	if ((a * x) <= -10.0) {
    		tmp = -1.0;
    	} else {
    		tmp = a * fma((a * x), (x * fma((a * x), 0.16666666666666666, 0.5)), x);
    	}
    	return tmp;
    }
    
    function code(a, x)
    	tmp = 0.0
    	if (Float64(a * x) <= -10.0)
    		tmp = -1.0;
    	else
    		tmp = Float64(a * fma(Float64(a * x), Float64(x * fma(Float64(a * x), 0.16666666666666666, 0.5)), x));
    	end
    	return tmp
    end
    
    code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -10.0], -1.0, N[(a * N[(N[(a * x), $MachinePrecision] * N[(x * N[(N[(a * x), $MachinePrecision] * 0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;a \cdot x \leq -10:\\
    \;\;\;\;-1\\
    
    \mathbf{else}:\\
    \;\;\;\;a \cdot \mathsf{fma}\left(a \cdot x, x \cdot \mathsf{fma}\left(a \cdot x, 0.16666666666666666, 0.5\right), x\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 a x) < -10

      1. Initial program 100.0%

        \[e^{a \cdot x} - 1 \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
        2. *-commutativeN/A

          \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
        3. associate-*r*N/A

          \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
        9. unpow2N/A

          \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
        10. *-lowering-*.f641.5

          \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
      5. Simplified1.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
      6. Taylor expanded in a around inf

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right)} - 1 \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot {x}^{2}} - 1 \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)} - 1 \]
        3. unpow2N/A

          \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right) - 1 \]
        4. associate-*l*N/A

          \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
        5. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
        6. *-lowering-*.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
        7. *-lowering-*.f64N/A

          \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)}\right) - 1 \]
        8. unpow2N/A

          \[\leadsto x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
        9. *-lowering-*.f6410.2

          \[\leadsto x \cdot \left(x \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
      8. Simplified10.2%

        \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(a \cdot a\right)\right)\right)} - 1 \]
      9. Taylor expanded in x around 0

        \[\leadsto \color{blue}{-1} \]
      10. Step-by-step derivation
        1. Simplified99.3%

          \[\leadsto \color{blue}{-1} \]

        if -10 < (*.f64 a x)

        1. Initial program 27.9%

          \[e^{a \cdot x} - 1 \]
        2. Add Preprocessing
        3. Taylor expanded in a around 0

          \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + a \cdot \left(\frac{1}{6} \cdot \left(a \cdot {x}^{3}\right) + \frac{1}{2} \cdot {x}^{2}\right)\right)\right)} - 1 \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\left(a \cdot \left(x + a \cdot \left(\frac{1}{6} \cdot \left(a \cdot {x}^{3}\right) + \frac{1}{2} \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + a \cdot \left(\frac{1}{6} \cdot \left(a \cdot {x}^{3}\right) + \frac{1}{2} \cdot {x}^{2}\right), 1\right)} - 1 \]
        5. Simplified26.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a \cdot \left(x \cdot x\right), \mathsf{fma}\left(a, x \cdot 0.16666666666666666, 0.5\right), x\right), 1\right)} - 1 \]
        6. Step-by-step derivation
          1. associate--l+N/A

            \[\leadsto \color{blue}{a \cdot \left(\left(a \cdot \left(x \cdot x\right)\right) \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right) + x\right) + \left(1 - 1\right)} \]
          2. metadata-evalN/A

            \[\leadsto a \cdot \left(\left(a \cdot \left(x \cdot x\right)\right) \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right) + x\right) + \color{blue}{0} \]
          3. +-rgt-identityN/A

            \[\leadsto \color{blue}{a \cdot \left(\left(a \cdot \left(x \cdot x\right)\right) \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right) + x\right)} \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\left(a \cdot \left(x \cdot x\right)\right) \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right) + x\right) \cdot a} \]
          5. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(a \cdot \left(x \cdot x\right)\right) \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right) + x\right) \cdot a} \]
          6. associate-*r*N/A

            \[\leadsto \left(\color{blue}{\left(\left(a \cdot x\right) \cdot x\right)} \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right) + x\right) \cdot a \]
          7. associate-*l*N/A

            \[\leadsto \left(\color{blue}{\left(a \cdot x\right) \cdot \left(x \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right)\right)} + x\right) \cdot a \]
          8. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, x \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right), x\right)} \cdot a \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{a \cdot x}, x \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right), x\right) \cdot a \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot x, \color{blue}{x \cdot \left(a \cdot \left(x \cdot \frac{1}{6}\right) + \frac{1}{2}\right)}, x\right) \cdot a \]
          11. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(a \cdot x, x \cdot \left(\color{blue}{\left(a \cdot x\right) \cdot \frac{1}{6}} + \frac{1}{2}\right), x\right) \cdot a \]
          12. accelerator-lowering-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(a \cdot x, x \cdot \color{blue}{\mathsf{fma}\left(a \cdot x, \frac{1}{6}, \frac{1}{2}\right)}, x\right) \cdot a \]
          13. *-lowering-*.f6499.8

            \[\leadsto \mathsf{fma}\left(a \cdot x, x \cdot \mathsf{fma}\left(\color{blue}{a \cdot x}, 0.16666666666666666, 0.5\right), x\right) \cdot a \]
        7. Applied egg-rr99.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, x \cdot \mathsf{fma}\left(a \cdot x, 0.16666666666666666, 0.5\right), x\right) \cdot a} \]
      11. Recombined 2 regimes into one program.
      12. Final simplification99.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(a \cdot x, x \cdot \mathsf{fma}\left(a \cdot x, 0.16666666666666666, 0.5\right), x\right)\\ \end{array} \]
      13. Add Preprocessing

      Alternative 4: 99.1% accurate, 2.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, a, a \cdot \left(0.5 \cdot \left(x \cdot \left(a \cdot x\right)\right)\right)\right)\\ \end{array} \end{array} \]
      (FPCore (a x)
       :precision binary64
       (if (<= (* a x) -10.0) -1.0 (fma x a (* a (* 0.5 (* x (* a x)))))))
      double code(double a, double x) {
      	double tmp;
      	if ((a * x) <= -10.0) {
      		tmp = -1.0;
      	} else {
      		tmp = fma(x, a, (a * (0.5 * (x * (a * x)))));
      	}
      	return tmp;
      }
      
      function code(a, x)
      	tmp = 0.0
      	if (Float64(a * x) <= -10.0)
      		tmp = -1.0;
      	else
      		tmp = fma(x, a, Float64(a * Float64(0.5 * Float64(x * Float64(a * x)))));
      	end
      	return tmp
      end
      
      code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -10.0], -1.0, N[(x * a + N[(a * N[(0.5 * N[(x * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;a \cdot x \leq -10:\\
      \;\;\;\;-1\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(x, a, a \cdot \left(0.5 \cdot \left(x \cdot \left(a \cdot x\right)\right)\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 a x) < -10

        1. Initial program 100.0%

          \[e^{a \cdot x} - 1 \]
        2. Add Preprocessing
        3. Taylor expanded in a around 0

          \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
          2. *-commutativeN/A

            \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
          3. associate-*r*N/A

            \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
          4. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
          5. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
          7. accelerator-lowering-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
          9. unpow2N/A

            \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
          10. *-lowering-*.f641.5

            \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
        5. Simplified1.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
        6. Taylor expanded in a around inf

          \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right)} - 1 \]
        7. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot {x}^{2}} - 1 \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)} - 1 \]
          3. unpow2N/A

            \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right) - 1 \]
          4. associate-*l*N/A

            \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
          5. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
          6. *-lowering-*.f64N/A

            \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
          7. *-lowering-*.f64N/A

            \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)}\right) - 1 \]
          8. unpow2N/A

            \[\leadsto x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
          9. *-lowering-*.f6410.2

            \[\leadsto x \cdot \left(x \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
        8. Simplified10.2%

          \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(a \cdot a\right)\right)\right)} - 1 \]
        9. Taylor expanded in x around 0

          \[\leadsto \color{blue}{-1} \]
        10. Step-by-step derivation
          1. Simplified99.3%

            \[\leadsto \color{blue}{-1} \]

          if -10 < (*.f64 a x)

          1. Initial program 27.9%

            \[e^{a \cdot x} - 1 \]
          2. Add Preprocessing
          3. Taylor expanded in a around 0

            \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
            2. *-commutativeN/A

              \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
            3. associate-*r*N/A

              \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
            4. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
            5. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
            7. accelerator-lowering-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
            8. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
            9. unpow2N/A

              \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
            10. *-lowering-*.f6426.5

              \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
          5. Simplified26.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
          6. Step-by-step derivation
            1. associate--l+N/A

              \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right) + \left(1 - 1\right)} \]
            2. metadata-evalN/A

              \[\leadsto a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right) + \color{blue}{0} \]
            3. +-rgt-identityN/A

              \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right)} \]
            4. +-commutativeN/A

              \[\leadsto a \cdot \color{blue}{\left(x + a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right)\right)} \]
            5. distribute-rgt-inN/A

              \[\leadsto \color{blue}{x \cdot a + \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right)\right) \cdot a} \]
            6. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(x, a, \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right)\right) \cdot a\right)} \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, a, \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right)\right)}\right) \]
            8. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(x, a, \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right)\right)}\right) \]
            9. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) \cdot a\right)}\right) \]
            10. associate-*r*N/A

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot \left(\left(x \cdot x\right) \cdot a\right)\right)}\right) \]
            11. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(x \cdot x\right)\right)}\right)\right) \]
            12. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot \left(a \cdot \left(x \cdot x\right)\right)\right)}\right) \]
            13. associate-*r*N/A

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(\left(a \cdot x\right) \cdot x\right)}\right)\right) \]
            14. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(x \cdot \left(a \cdot x\right)\right)}\right)\right) \]
            15. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(x \cdot \left(a \cdot x\right)\right)}\right)\right) \]
            16. *-lowering-*.f6499.4

              \[\leadsto \mathsf{fma}\left(x, a, a \cdot \left(0.5 \cdot \left(x \cdot \color{blue}{\left(a \cdot x\right)}\right)\right)\right) \]
          7. Applied egg-rr99.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, a, a \cdot \left(0.5 \cdot \left(x \cdot \left(a \cdot x\right)\right)\right)\right)} \]
        11. Recombined 2 regimes into one program.
        12. Add Preprocessing

        Alternative 5: 99.1% accurate, 3.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(0.5, x \cdot \left(a \cdot x\right), x\right)\\ \end{array} \end{array} \]
        (FPCore (a x)
         :precision binary64
         (if (<= (* a x) -10.0) -1.0 (* a (fma 0.5 (* x (* a x)) x))))
        double code(double a, double x) {
        	double tmp;
        	if ((a * x) <= -10.0) {
        		tmp = -1.0;
        	} else {
        		tmp = a * fma(0.5, (x * (a * x)), x);
        	}
        	return tmp;
        }
        
        function code(a, x)
        	tmp = 0.0
        	if (Float64(a * x) <= -10.0)
        		tmp = -1.0;
        	else
        		tmp = Float64(a * fma(0.5, Float64(x * Float64(a * x)), x));
        	end
        	return tmp
        end
        
        code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -10.0], -1.0, N[(a * N[(0.5 * N[(x * N[(a * x), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a \cdot x \leq -10:\\
        \;\;\;\;-1\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot \mathsf{fma}\left(0.5, x \cdot \left(a \cdot x\right), x\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 a x) < -10

          1. Initial program 100.0%

            \[e^{a \cdot x} - 1 \]
          2. Add Preprocessing
          3. Taylor expanded in a around 0

            \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
            2. *-commutativeN/A

              \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
            3. associate-*r*N/A

              \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
            4. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
            5. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
            7. accelerator-lowering-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
            8. *-lowering-*.f64N/A

              \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
            9. unpow2N/A

              \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
            10. *-lowering-*.f641.5

              \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
          5. Simplified1.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
          6. Taylor expanded in a around inf

            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right)} - 1 \]
          7. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot {x}^{2}} - 1 \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)} - 1 \]
            3. unpow2N/A

              \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right) - 1 \]
            4. associate-*l*N/A

              \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
            5. *-lowering-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
            6. *-lowering-*.f64N/A

              \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
            7. *-lowering-*.f64N/A

              \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)}\right) - 1 \]
            8. unpow2N/A

              \[\leadsto x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
            9. *-lowering-*.f6410.2

              \[\leadsto x \cdot \left(x \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
          8. Simplified10.2%

            \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(a \cdot a\right)\right)\right)} - 1 \]
          9. Taylor expanded in x around 0

            \[\leadsto \color{blue}{-1} \]
          10. Step-by-step derivation
            1. Simplified99.3%

              \[\leadsto \color{blue}{-1} \]

            if -10 < (*.f64 a x)

            1. Initial program 27.9%

              \[e^{a \cdot x} - 1 \]
            2. Add Preprocessing
            3. Taylor expanded in a around 0

              \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
              2. *-commutativeN/A

                \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
              3. associate-*r*N/A

                \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
              4. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
              5. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
              7. accelerator-lowering-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
              8. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
              9. unpow2N/A

                \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
              10. *-lowering-*.f6426.5

                \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
            5. Simplified26.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
            6. Step-by-step derivation
              1. associate--l+N/A

                \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right) + \left(1 - 1\right)} \]
              2. metadata-evalN/A

                \[\leadsto a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right) + \color{blue}{0} \]
              3. +-rgt-identityN/A

                \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right)} \]
              4. *-commutativeN/A

                \[\leadsto \color{blue}{\left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right) \cdot a} \]
              5. *-lowering-*.f64N/A

                \[\leadsto \color{blue}{\left(a \cdot \left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) + x\right) \cdot a} \]
              6. *-commutativeN/A

                \[\leadsto \left(\color{blue}{\left(\frac{1}{2} \cdot \left(x \cdot x\right)\right) \cdot a} + x\right) \cdot a \]
              7. associate-*r*N/A

                \[\leadsto \left(\color{blue}{\frac{1}{2} \cdot \left(\left(x \cdot x\right) \cdot a\right)} + x\right) \cdot a \]
              8. *-commutativeN/A

                \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(x \cdot x\right)\right)} + x\right) \cdot a \]
              9. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot \left(x \cdot x\right), x\right)} \cdot a \]
              10. associate-*r*N/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \color{blue}{\left(a \cdot x\right) \cdot x}, x\right) \cdot a \]
              11. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x \cdot \left(a \cdot x\right)}, x\right) \cdot a \]
              12. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \color{blue}{x \cdot \left(a \cdot x\right)}, x\right) \cdot a \]
              13. *-lowering-*.f6499.4

                \[\leadsto \mathsf{fma}\left(0.5, x \cdot \color{blue}{\left(a \cdot x\right)}, x\right) \cdot a \]
            7. Applied egg-rr99.4%

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, x \cdot \left(a \cdot x\right), x\right) \cdot a} \]
          11. Recombined 2 regimes into one program.
          12. Final simplification99.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \mathsf{fma}\left(0.5, x \cdot \left(a \cdot x\right), x\right)\\ \end{array} \]
          13. Add Preprocessing

          Alternative 6: 98.4% accurate, 6.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -10:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot x\\ \end{array} \end{array} \]
          (FPCore (a x) :precision binary64 (if (<= (* a x) -10.0) -1.0 (* a x)))
          double code(double a, double x) {
          	double tmp;
          	if ((a * x) <= -10.0) {
          		tmp = -1.0;
          	} else {
          		tmp = a * x;
          	}
          	return tmp;
          }
          
          real(8) function code(a, x)
              real(8), intent (in) :: a
              real(8), intent (in) :: x
              real(8) :: tmp
              if ((a * x) <= (-10.0d0)) then
                  tmp = -1.0d0
              else
                  tmp = a * x
              end if
              code = tmp
          end function
          
          public static double code(double a, double x) {
          	double tmp;
          	if ((a * x) <= -10.0) {
          		tmp = -1.0;
          	} else {
          		tmp = a * x;
          	}
          	return tmp;
          }
          
          def code(a, x):
          	tmp = 0
          	if (a * x) <= -10.0:
          		tmp = -1.0
          	else:
          		tmp = a * x
          	return tmp
          
          function code(a, x)
          	tmp = 0.0
          	if (Float64(a * x) <= -10.0)
          		tmp = -1.0;
          	else
          		tmp = Float64(a * x);
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, x)
          	tmp = 0.0;
          	if ((a * x) <= -10.0)
          		tmp = -1.0;
          	else
          		tmp = a * x;
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -10.0], -1.0, N[(a * x), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;a \cdot x \leq -10:\\
          \;\;\;\;-1\\
          
          \mathbf{else}:\\
          \;\;\;\;a \cdot x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 a x) < -10

            1. Initial program 100.0%

              \[e^{a \cdot x} - 1 \]
            2. Add Preprocessing
            3. Taylor expanded in a around 0

              \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
              2. *-commutativeN/A

                \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
              3. associate-*r*N/A

                \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
              4. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
              5. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
              7. accelerator-lowering-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
              8. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
              9. unpow2N/A

                \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
              10. *-lowering-*.f641.5

                \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
            5. Simplified1.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
            6. Taylor expanded in a around inf

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right)} - 1 \]
            7. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot {x}^{2}} - 1 \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)} - 1 \]
              3. unpow2N/A

                \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right) - 1 \]
              4. associate-*l*N/A

                \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
              5. *-lowering-*.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
              6. *-lowering-*.f64N/A

                \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
              7. *-lowering-*.f64N/A

                \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)}\right) - 1 \]
              8. unpow2N/A

                \[\leadsto x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
              9. *-lowering-*.f6410.2

                \[\leadsto x \cdot \left(x \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
            8. Simplified10.2%

              \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(a \cdot a\right)\right)\right)} - 1 \]
            9. Taylor expanded in x around 0

              \[\leadsto \color{blue}{-1} \]
            10. Step-by-step derivation
              1. Simplified99.3%

                \[\leadsto \color{blue}{-1} \]

              if -10 < (*.f64 a x)

              1. Initial program 27.9%

                \[e^{a \cdot x} - 1 \]
              2. Add Preprocessing
              3. Taylor expanded in a around 0

                \[\leadsto \color{blue}{a \cdot x} \]
              4. Step-by-step derivation
                1. *-lowering-*.f6497.9

                  \[\leadsto \color{blue}{a \cdot x} \]
              5. Simplified97.9%

                \[\leadsto \color{blue}{a \cdot x} \]
            11. Recombined 2 regimes into one program.
            12. Add Preprocessing

            Alternative 7: 51.7% accurate, 9.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -1.1 \cdot 10^{-154}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
            (FPCore (a x) :precision binary64 (if (<= (* a x) -1.1e-154) -1.0 0.0))
            double code(double a, double x) {
            	double tmp;
            	if ((a * x) <= -1.1e-154) {
            		tmp = -1.0;
            	} else {
            		tmp = 0.0;
            	}
            	return tmp;
            }
            
            real(8) function code(a, x)
                real(8), intent (in) :: a
                real(8), intent (in) :: x
                real(8) :: tmp
                if ((a * x) <= (-1.1d-154)) then
                    tmp = -1.0d0
                else
                    tmp = 0.0d0
                end if
                code = tmp
            end function
            
            public static double code(double a, double x) {
            	double tmp;
            	if ((a * x) <= -1.1e-154) {
            		tmp = -1.0;
            	} else {
            		tmp = 0.0;
            	}
            	return tmp;
            }
            
            def code(a, x):
            	tmp = 0
            	if (a * x) <= -1.1e-154:
            		tmp = -1.0
            	else:
            		tmp = 0.0
            	return tmp
            
            function code(a, x)
            	tmp = 0.0
            	if (Float64(a * x) <= -1.1e-154)
            		tmp = -1.0;
            	else
            		tmp = 0.0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, x)
            	tmp = 0.0;
            	if ((a * x) <= -1.1e-154)
            		tmp = -1.0;
            	else
            		tmp = 0.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -1.1e-154], -1.0, 0.0]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \cdot x \leq -1.1 \cdot 10^{-154}:\\
            \;\;\;\;-1\\
            
            \mathbf{else}:\\
            \;\;\;\;0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 a x) < -1.10000000000000004e-154

              1. Initial program 63.1%

                \[e^{a \cdot x} - 1 \]
              2. Add Preprocessing
              3. Taylor expanded in a around 0

                \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
                2. *-commutativeN/A

                  \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
                3. associate-*r*N/A

                  \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
                4. accelerator-lowering-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
                5. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
                6. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
                7. accelerator-lowering-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
                8. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
                9. unpow2N/A

                  \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
                10. *-lowering-*.f643.9

                  \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
              5. Simplified3.9%

                \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
              6. Taylor expanded in a around inf

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right)} - 1 \]
              7. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot {x}^{2}} - 1 \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)} - 1 \]
                3. unpow2N/A

                  \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right) - 1 \]
                4. associate-*l*N/A

                  \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
                6. *-lowering-*.f64N/A

                  \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
                7. *-lowering-*.f64N/A

                  \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)}\right) - 1 \]
                8. unpow2N/A

                  \[\leadsto x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
                9. *-lowering-*.f648.3

                  \[\leadsto x \cdot \left(x \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
              8. Simplified8.3%

                \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(a \cdot a\right)\right)\right)} - 1 \]
              9. Taylor expanded in x around 0

                \[\leadsto \color{blue}{-1} \]
              10. Step-by-step derivation
                1. Simplified61.6%

                  \[\leadsto \color{blue}{-1} \]

                if -1.10000000000000004e-154 < (*.f64 a x)

                1. Initial program 35.1%

                  \[e^{a \cdot x} - 1 \]
                2. Add Preprocessing
                3. Taylor expanded in a around 0

                  \[\leadsto \color{blue}{1} - 1 \]
                4. Step-by-step derivation
                  1. Simplified32.7%

                    \[\leadsto \color{blue}{1} - 1 \]
                  2. Step-by-step derivation
                    1. metadata-eval32.7

                      \[\leadsto \color{blue}{0} \]
                  3. Applied egg-rr32.7%

                    \[\leadsto \color{blue}{0} \]
                5. Recombined 2 regimes into one program.
                6. Add Preprocessing

                Alternative 8: 35.2% accurate, 109.0× speedup?

                \[\begin{array}{l} \\ -1 \end{array} \]
                (FPCore (a x) :precision binary64 -1.0)
                double code(double a, double x) {
                	return -1.0;
                }
                
                real(8) function code(a, x)
                    real(8), intent (in) :: a
                    real(8), intent (in) :: x
                    code = -1.0d0
                end function
                
                public static double code(double a, double x) {
                	return -1.0;
                }
                
                def code(a, x):
                	return -1.0
                
                function code(a, x)
                	return -1.0
                end
                
                function tmp = code(a, x)
                	tmp = -1.0;
                end
                
                code[a_, x_] := -1.0
                
                \begin{array}{l}
                
                \\
                -1
                \end{array}
                
                Derivation
                1. Initial program 48.8%

                  \[e^{a \cdot x} - 1 \]
                2. Add Preprocessing
                3. Taylor expanded in a around 0

                  \[\leadsto \color{blue}{\left(1 + a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right)\right)} - 1 \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{\left(a \cdot \left(x + \frac{1}{2} \cdot \left(a \cdot {x}^{2}\right)\right) + 1\right)} - 1 \]
                  2. *-commutativeN/A

                    \[\leadsto \left(a \cdot \left(x + \frac{1}{2} \cdot \color{blue}{\left({x}^{2} \cdot a\right)}\right) + 1\right) - 1 \]
                  3. associate-*r*N/A

                    \[\leadsto \left(a \cdot \left(x + \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a}\right) + 1\right) - 1 \]
                  4. accelerator-lowering-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(a, x + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a, 1\right)} - 1 \]
                  5. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot a + x}, 1\right) - 1 \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {x}^{2}\right)} + x, 1\right) - 1 \]
                  7. accelerator-lowering-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(a, \frac{1}{2} \cdot {x}^{2}, x\right)}, 1\right) - 1 \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot {x}^{2}}, x\right), 1\right) - 1 \]
                  9. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \frac{1}{2} \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
                  10. *-lowering-*.f6419.3

                    \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \color{blue}{\left(x \cdot x\right)}, x\right), 1\right) - 1 \]
                5. Simplified19.3%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5 \cdot \left(x \cdot x\right), x\right), 1\right)} - 1 \]
                6. Taylor expanded in a around inf

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right)} - 1 \]
                7. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot {x}^{2}} - 1 \]
                  2. *-commutativeN/A

                    \[\leadsto \color{blue}{{x}^{2} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)} - 1 \]
                  3. unpow2N/A

                    \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(\frac{1}{2} \cdot {a}^{2}\right) - 1 \]
                  4. associate-*l*N/A

                    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} \cdot {a}^{2}\right)\right)} - 1 \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)}\right) - 1 \]
                  8. unpow2N/A

                    \[\leadsto x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
                  9. *-lowering-*.f645.4

                    \[\leadsto x \cdot \left(x \cdot \left(0.5 \cdot \color{blue}{\left(a \cdot a\right)}\right)\right) - 1 \]
                8. Simplified5.4%

                  \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(0.5 \cdot \left(a \cdot a\right)\right)\right)} - 1 \]
                9. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{-1} \]
                10. Step-by-step derivation
                  1. Simplified31.4%

                    \[\leadsto \color{blue}{-1} \]
                  2. Add Preprocessing

                  Developer Target 1: 100.0% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \mathsf{expm1}\left(a \cdot x\right) \end{array} \]
                  (FPCore (a x) :precision binary64 (expm1 (* a x)))
                  double code(double a, double x) {
                  	return expm1((a * x));
                  }
                  
                  public static double code(double a, double x) {
                  	return Math.expm1((a * x));
                  }
                  
                  def code(a, x):
                  	return math.expm1((a * x))
                  
                  function code(a, x)
                  	return expm1(Float64(a * x))
                  end
                  
                  code[a_, x_] := N[(Exp[N[(a * x), $MachinePrecision]] - 1), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \mathsf{expm1}\left(a \cdot x\right)
                  \end{array}
                  

                  Reproduce

                  ?
                  herbie shell --seed 2024199 
                  (FPCore (a x)
                    :name "expax (section 3.5)"
                    :precision binary64
                    :pre (> 710.0 (* a x))
                  
                    :alt
                    (! :herbie-platform default (expm1 (* a x)))
                  
                    (- (exp (* a x)) 1.0))