expax (section 3.5)

Percentage Accurate: 53.9% → 100.0%
Time: 11.1s
Alternatives: 11
Speedup: 10.5×

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 11 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.9% 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 50.9%

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

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

      \[\leadsto \mathsf{expm1.f64}\left(\mathsf{*.f64}\left(a, x\right)\right) \]
  4. Applied egg-rr100.0%

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

Alternative 2: 99.3% accurate, 3.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -100:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot x + a \cdot \left(\left(a \cdot x\right) \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + a \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (a x)
 :precision binary64
 (if (<= (* a x) -100.0)
   -1.0
   (+
    (* a x)
    (*
     a
     (*
      (* a x)
      (*
       x
       (+
        0.5
        (*
         (* a x)
         (+ 0.16666666666666666 (* a (* x 0.041666666666666664)))))))))))
double code(double a, double x) {
	double tmp;
	if ((a * x) <= -100.0) {
		tmp = -1.0;
	} else {
		tmp = (a * x) + (a * ((a * x) * (x * (0.5 + ((a * x) * (0.16666666666666666 + (a * (x * 0.041666666666666664))))))));
	}
	return tmp;
}
real(8) function code(a, x)
    real(8), intent (in) :: a
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((a * x) <= (-100.0d0)) then
        tmp = -1.0d0
    else
        tmp = (a * x) + (a * ((a * x) * (x * (0.5d0 + ((a * x) * (0.16666666666666666d0 + (a * (x * 0.041666666666666664d0))))))))
    end if
    code = tmp
end function
public static double code(double a, double x) {
	double tmp;
	if ((a * x) <= -100.0) {
		tmp = -1.0;
	} else {
		tmp = (a * x) + (a * ((a * x) * (x * (0.5 + ((a * x) * (0.16666666666666666 + (a * (x * 0.041666666666666664))))))));
	}
	return tmp;
}
def code(a, x):
	tmp = 0
	if (a * x) <= -100.0:
		tmp = -1.0
	else:
		tmp = (a * x) + (a * ((a * x) * (x * (0.5 + ((a * x) * (0.16666666666666666 + (a * (x * 0.041666666666666664))))))))
	return tmp
function code(a, x)
	tmp = 0.0
	if (Float64(a * x) <= -100.0)
		tmp = -1.0;
	else
		tmp = Float64(Float64(a * x) + Float64(a * Float64(Float64(a * x) * Float64(x * Float64(0.5 + Float64(Float64(a * x) * Float64(0.16666666666666666 + Float64(a * Float64(x * 0.041666666666666664)))))))));
	end
	return tmp
end
function tmp_2 = code(a, x)
	tmp = 0.0;
	if ((a * x) <= -100.0)
		tmp = -1.0;
	else
		tmp = (a * x) + (a * ((a * x) * (x * (0.5 + ((a * x) * (0.16666666666666666 + (a * (x * 0.041666666666666664))))))));
	end
	tmp_2 = tmp;
end
code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -100.0], -1.0, N[(N[(a * x), $MachinePrecision] + N[(a * N[(N[(a * x), $MachinePrecision] * N[(x * N[(0.5 + N[(N[(a * x), $MachinePrecision] * N[(0.16666666666666666 + N[(a * N[(x * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 100.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
      3. *-lowering-*.f645.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
    5. Simplified5.3%

      \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
    6. Step-by-step derivation
      1. flip3-+N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      11. *-rgt-identityN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
      14. metadata-evalN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
      15. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
      17. cube-multN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
    7. Applied egg-rr2.9%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
    10. Simplified98.9%

      \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
    11. Taylor expanded in x around inf

      \[\leadsto \color{blue}{-1} \]
    12. Step-by-step derivation
      1. Simplified100.0%

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

      if -100 < (*.f64 a x)

      1. Initial program 27.3%

        \[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. Simplified99.0%

        \[\leadsto \color{blue}{a \cdot \left(x \cdot \left(1 + a \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + \left(a \cdot x\right) \cdot 0.041666666666666664\right)\right)\right)\right)\right)} \]
      5. Step-by-step derivation
        1. distribute-rgt-inN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), \mathsf{*.f64}\left(\left(\left(a \cdot \left(x \cdot \left(\frac{1}{2} + \left(a \cdot x\right) \cdot \left(\frac{1}{6} + \left(a \cdot x\right) \cdot \frac{1}{24}\right)\right)\right)\right) \cdot x\right), \color{blue}{a}\right)\right) \]
      6. Applied egg-rr99.0%

        \[\leadsto \color{blue}{a \cdot x + \left(\left(a \cdot x\right) \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + a \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)\right)\right) \cdot a} \]
    13. Recombined 2 regimes into one program.
    14. Final simplification99.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot x \leq -100:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot x + a \cdot \left(\left(a \cdot x\right) \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + a \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)\right)\right)\\ \end{array} \]
    15. Add Preprocessing

    Alternative 3: 99.3% accurate, 3.5× speedup?

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

      1. Initial program 100.0%

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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
        3. *-lowering-*.f645.3%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
      5. Simplified5.3%

        \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
      6. Step-by-step derivation
        1. flip3-+N/A

          \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
        2. clear-numN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        6. associate-*l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        11. *-rgt-identityN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        12. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
        14. metadata-evalN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
        15. +-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
        16. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
        17. cube-multN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
        18. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
      7. Applied egg-rr2.9%

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
      9. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
        5. unsub-negN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
      10. Simplified98.9%

        \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
      11. Taylor expanded in x around inf

        \[\leadsto \color{blue}{-1} \]
      12. Step-by-step derivation
        1. Simplified100.0%

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

        if -100 < (*.f64 a x)

        1. Initial program 27.3%

          \[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. Simplified99.0%

          \[\leadsto \color{blue}{a \cdot \left(x \cdot \left(1 + a \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + \left(a \cdot x\right) \cdot 0.041666666666666664\right)\right)\right)\right)\right)} \]
        5. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\left(\left(a \cdot \left(x \cdot \left(\frac{1}{2} + \left(a \cdot x\right) \cdot \left(\frac{1}{6} + \left(a \cdot x\right) \cdot \frac{1}{24}\right)\right)\right)\right) \cdot x\right), \color{blue}{x}\right)\right) \]
        6. Applied egg-rr99.0%

          \[\leadsto a \cdot \color{blue}{\left(\left(a \cdot x\right) \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + a \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)\right) + x\right)} \]
      13. Recombined 2 regimes into one program.
      14. Final simplification99.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot x \leq -100:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x + \left(a \cdot x\right) \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + a \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)\right)\right)\\ \end{array} \]
      15. Add Preprocessing

      Alternative 4: 99.3% accurate, 3.5× speedup?

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

        1. Initial program 100.0%

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

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
          3. *-lowering-*.f645.3%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
        5. Simplified5.3%

          \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
        6. Step-by-step derivation
          1. flip3-+N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
          2. clear-numN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
          3. /-lowering-/.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          6. associate-*l*N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          11. *-rgt-identityN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          12. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
          14. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
          15. +-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
          16. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
          17. cube-multN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
          18. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
        7. Applied egg-rr2.9%

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

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
        9. Step-by-step derivation
          1. +-lowering-+.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
          4. mul-1-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
          5. unsub-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
        10. Simplified98.9%

          \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
        11. Taylor expanded in x around inf

          \[\leadsto \color{blue}{-1} \]
        12. Step-by-step derivation
          1. Simplified100.0%

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

          if -100 < (*.f64 a x)

          1. Initial program 27.3%

            \[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. Simplified99.0%

            \[\leadsto \color{blue}{a \cdot \left(x \cdot \left(1 + a \cdot \left(x \cdot \left(0.5 + \left(a \cdot x\right) \cdot \left(0.16666666666666666 + \left(a \cdot x\right) \cdot 0.041666666666666664\right)\right)\right)\right)\right)} \]
        13. Recombined 2 regimes into one program.
        14. Add Preprocessing

        Alternative 5: 99.2% accurate, 4.4× speedup?

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

          1. Initial program 100.0%

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

            \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
            3. *-lowering-*.f645.3%

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
          5. Simplified5.3%

            \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
          6. Step-by-step derivation
            1. flip3-+N/A

              \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
            2. clear-numN/A

              \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
            3. /-lowering-/.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            6. associate-*l*N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            8. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            9. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            10. metadata-evalN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            11. *-rgt-identityN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            12. --lowering--.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            13. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
            14. metadata-evalN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
            15. +-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
            16. +-lowering-+.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
            17. cube-multN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
            18. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
          7. Applied egg-rr2.9%

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

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
          9. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
            4. mul-1-negN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
            5. unsub-negN/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
            6. --lowering--.f64N/A

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
          10. Simplified98.9%

            \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
          11. Taylor expanded in x around inf

            \[\leadsto \color{blue}{-1} \]
          12. Step-by-step derivation
            1. Simplified100.0%

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

            if -100 < (*.f64 a x)

            1. Initial program 27.3%

              \[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}{6} \cdot \left(a \cdot {x}^{3}\right) + \frac{1}{2} \cdot {x}^{2}\right)\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                \[\leadsto a \cdot \left(\left(\left(a \cdot \left(\frac{1}{6} \cdot a\right)\right) \cdot {x}^{2}\right) \cdot x + \left(\left(\frac{1}{2} \cdot a\right) \cdot {x}^{2} + x\right)\right) \]
              11. unpow2N/A

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

                \[\leadsto a \cdot \left(\left(\left(a \cdot \left(\frac{1}{6} \cdot a\right)\right) \cdot {x}^{2}\right) \cdot x + \left(\left(\left(\frac{1}{2} \cdot a\right) \cdot x\right) \cdot x + x\right)\right) \]
              13. distribute-lft1-inN/A

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

                \[\leadsto a \cdot \left(x \cdot \color{blue}{\left(\left(a \cdot \left(\frac{1}{6} \cdot a\right)\right) \cdot {x}^{2} + \left(\left(\frac{1}{2} \cdot a\right) \cdot x + 1\right)\right)}\right) \]
            5. Simplified98.8%

              \[\leadsto \color{blue}{\left(a \cdot x\right) \cdot \left(1 + \left(a \cdot x\right) \cdot \left(0.5 + x \cdot \left(a \cdot 0.16666666666666666\right)\right)\right)} \]
          13. Recombined 2 regimes into one program.
          14. Add Preprocessing

          Alternative 6: 98.9% accurate, 5.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -100:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot x + a \cdot \left(x \cdot \left(a \cdot \frac{x}{2}\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a x)
           :precision binary64
           (if (<= (* a x) -100.0) -1.0 (+ (* a x) (* a (* x (* a (/ x 2.0)))))))
          double code(double a, double x) {
          	double tmp;
          	if ((a * x) <= -100.0) {
          		tmp = -1.0;
          	} else {
          		tmp = (a * x) + (a * (x * (a * (x / 2.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) <= (-100.0d0)) then
                  tmp = -1.0d0
              else
                  tmp = (a * x) + (a * (x * (a * (x / 2.0d0))))
              end if
              code = tmp
          end function
          
          public static double code(double a, double x) {
          	double tmp;
          	if ((a * x) <= -100.0) {
          		tmp = -1.0;
          	} else {
          		tmp = (a * x) + (a * (x * (a * (x / 2.0))));
          	}
          	return tmp;
          }
          
          def code(a, x):
          	tmp = 0
          	if (a * x) <= -100.0:
          		tmp = -1.0
          	else:
          		tmp = (a * x) + (a * (x * (a * (x / 2.0))))
          	return tmp
          
          function code(a, x)
          	tmp = 0.0
          	if (Float64(a * x) <= -100.0)
          		tmp = -1.0;
          	else
          		tmp = Float64(Float64(a * x) + Float64(a * Float64(x * Float64(a * Float64(x / 2.0)))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, x)
          	tmp = 0.0;
          	if ((a * x) <= -100.0)
          		tmp = -1.0;
          	else
          		tmp = (a * x) + (a * (x * (a * (x / 2.0))));
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -100.0], -1.0, N[(N[(a * x), $MachinePrecision] + N[(a * N[(x * N[(a * N[(x / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;a \cdot x \leq -100:\\
          \;\;\;\;-1\\
          
          \mathbf{else}:\\
          \;\;\;\;a \cdot x + a \cdot \left(x \cdot \left(a \cdot \frac{x}{2}\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 a x) < -100

            1. Initial program 100.0%

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

              \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
              2. +-lowering-+.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
              3. *-lowering-*.f645.3%

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
            5. Simplified5.3%

              \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
            6. Step-by-step derivation
              1. flip3-+N/A

                \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
              2. clear-numN/A

                \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
              3. /-lowering-/.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
              4. /-lowering-/.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              5. +-lowering-+.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              6. associate-*l*N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              8. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              9. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              10. metadata-evalN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              11. *-rgt-identityN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              12. --lowering--.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              13. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
              14. metadata-evalN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
              15. +-commutativeN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
              16. +-lowering-+.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
              17. cube-multN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
              18. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
            7. Applied egg-rr2.9%

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
            9. Step-by-step derivation
              1. +-lowering-+.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
              2. *-lowering-*.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
              4. mul-1-negN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
              5. unsub-negN/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
              6. --lowering--.f64N/A

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
            10. Simplified98.9%

              \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
            11. Taylor expanded in x around inf

              \[\leadsto \color{blue}{-1} \]
            12. Step-by-step derivation
              1. Simplified100.0%

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

              if -100 < (*.f64 a x)

              1. Initial program 27.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \color{blue}{\frac{1}{2}}\right)\right)\right) \]
                17. *-lowering-*.f6498.5%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, x\right), \frac{1}{2}\right)\right)\right) \]
              5. Simplified98.5%

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(\left(a \cdot x\right) \cdot \frac{1}{2}\right)\right)\right), \left(a \cdot x\right)\right) \]
                9. associate-*l*N/A

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \left(a \cdot x\right)\right) \]
                11. metadata-evalN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, \left(x \cdot \frac{1}{2}\right)\right)\right)\right), \left(a \cdot x\right)\right) \]
                12. div-invN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, \left(\frac{x}{2}\right)\right)\right)\right), \left(a \cdot x\right)\right) \]
                13. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right), \left(a \cdot x\right)\right) \]
                14. *-lowering-*.f6498.5%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, \mathsf{/.f64}\left(x, 2\right)\right)\right)\right), \mathsf{*.f64}\left(a, \color{blue}{x}\right)\right) \]
              7. Applied egg-rr98.5%

                \[\leadsto \color{blue}{a \cdot \left(x \cdot \left(a \cdot \frac{x}{2}\right)\right) + a \cdot x} \]
            13. Recombined 2 regimes into one program.
            14. Final simplification99.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot x \leq -100:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot x + a \cdot \left(x \cdot \left(a \cdot \frac{x}{2}\right)\right)\\ \end{array} \]
            15. Add Preprocessing

            Alternative 7: 98.9% accurate, 5.8× speedup?

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

              1. Initial program 100.0%

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

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
                2. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
                3. *-lowering-*.f645.3%

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
              5. Simplified5.3%

                \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
              6. Step-by-step derivation
                1. flip3-+N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
                2. clear-numN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
                3. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
                4. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                5. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                6. associate-*l*N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                8. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                10. metadata-evalN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                11. *-rgt-identityN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                12. --lowering--.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                13. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                14. metadata-evalN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
                15. +-commutativeN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
                16. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
                17. cube-multN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                18. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
              7. Applied egg-rr2.9%

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

                \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
              9. Step-by-step derivation
                1. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                2. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                3. +-commutativeN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
                4. mul-1-negN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
                5. unsub-negN/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
                6. --lowering--.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
              10. Simplified98.9%

                \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
              11. Taylor expanded in x around inf

                \[\leadsto \color{blue}{-1} \]
              12. Step-by-step derivation
                1. Simplified100.0%

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

                if -100 < (*.f64 a x)

                1. Initial program 27.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \color{blue}{\frac{1}{2}}\right)\right)\right) \]
                  17. *-lowering-*.f6498.5%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, x\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, x\right), \frac{1}{2}\right)\right)\right) \]
                5. Simplified98.5%

                  \[\leadsto \color{blue}{\left(a \cdot x\right) \cdot \left(1 + \left(a \cdot x\right) \cdot 0.5\right)} \]
              13. Recombined 2 regimes into one program.
              14. Add Preprocessing

              Alternative 8: 98.9% accurate, 5.8× speedup?

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

                1. Initial program 100.0%

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

                  \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
                  3. *-lowering-*.f645.3%

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
                5. Simplified5.3%

                  \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
                6. Step-by-step derivation
                  1. flip3-+N/A

                    \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
                  2. clear-numN/A

                    \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
                  3. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  6. associate-*l*N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  11. *-rgt-identityN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  12. --lowering--.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                  14. metadata-evalN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
                  15. +-commutativeN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
                  16. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
                  17. cube-multN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                  18. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                7. Applied egg-rr2.9%

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

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
                9. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
                  4. mul-1-negN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
                  5. unsub-negN/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
                  6. --lowering--.f64N/A

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
                10. Simplified98.9%

                  \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
                11. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{-1} \]
                12. Step-by-step derivation
                  1. Simplified100.0%

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

                  if -100 < (*.f64 a x)

                  1. Initial program 27.3%

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

                      \[\leadsto \mathsf{expm1.f64}\left(\left(a \cdot x\right)\right) \]
                    2. *-lowering-*.f6499.9%

                      \[\leadsto \mathsf{expm1.f64}\left(\mathsf{*.f64}\left(a, x\right)\right) \]
                  4. Applied egg-rr99.9%

                    \[\leadsto \color{blue}{\mathsf{expm1}\left(a \cdot x\right)} \]
                  5. Taylor expanded in a around 0

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(a, \left(x + \frac{1}{2} \cdot \left(a \cdot \color{blue}{{x}^{2}}\right)\right)\right) \]
                    8. *-lft-identityN/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \left(x \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
                    20. *-lowering-*.f6498.5%

                      \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
                  7. Simplified98.5%

                    \[\leadsto \color{blue}{a \cdot \left(x \cdot \left(1 + a \cdot \left(x \cdot 0.5\right)\right)\right)} \]
                13. Recombined 2 regimes into one program.
                14. Add Preprocessing

                Alternative 9: 98.2% accurate, 10.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot x \leq -100:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;a \cdot x\\ \end{array} \end{array} \]
                (FPCore (a x) :precision binary64 (if (<= (* a x) -100.0) -1.0 (* a x)))
                double code(double a, double x) {
                	double tmp;
                	if ((a * x) <= -100.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) <= (-100.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) <= -100.0) {
                		tmp = -1.0;
                	} else {
                		tmp = a * x;
                	}
                	return tmp;
                }
                
                def code(a, x):
                	tmp = 0
                	if (a * x) <= -100.0:
                		tmp = -1.0
                	else:
                		tmp = a * x
                	return tmp
                
                function code(a, x)
                	tmp = 0.0
                	if (Float64(a * x) <= -100.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) <= -100.0)
                		tmp = -1.0;
                	else
                		tmp = a * x;
                	end
                	tmp_2 = tmp;
                end
                
                code[a_, x_] := If[LessEqual[N[(a * x), $MachinePrecision], -100.0], -1.0, N[(a * x), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;a \cdot x \leq -100:\\
                \;\;\;\;-1\\
                
                \mathbf{else}:\\
                \;\;\;\;a \cdot x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 a x) < -100

                  1. Initial program 100.0%

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

                    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
                    3. *-lowering-*.f645.3%

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
                  5. Simplified5.3%

                    \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
                  6. Step-by-step derivation
                    1. flip3-+N/A

                      \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
                    2. clear-numN/A

                      \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    5. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    6. associate-*l*N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    8. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    9. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    10. metadata-evalN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    11. *-rgt-identityN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    12. --lowering--.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    13. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                    14. metadata-evalN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
                    15. +-commutativeN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
                    16. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
                    17. cube-multN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                    18. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                  7. Applied egg-rr2.9%

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

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
                  9. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                    3. +-commutativeN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
                    4. mul-1-negN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
                    5. unsub-negN/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
                    6. --lowering--.f64N/A

                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
                  10. Simplified98.9%

                    \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
                  11. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{-1} \]
                  12. Step-by-step derivation
                    1. Simplified100.0%

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

                    if -100 < (*.f64 a x)

                    1. Initial program 27.3%

                      \[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.7%

                        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{x}\right) \]
                    5. Simplified97.7%

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

                  Alternative 10: 32.9% accurate, 17.5× speedup?

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

                    1. Initial program 49.7%

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

                      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, 1\right) \]
                    4. Step-by-step derivation
                      1. Simplified21.9%

                        \[\leadsto \color{blue}{1} - 1 \]
                      2. Step-by-step derivation
                        1. metadata-eval21.9%

                          \[\leadsto 0 \]
                      3. Applied egg-rr21.9%

                        \[\leadsto \color{blue}{0} \]

                      if 1.84999999999999993e-146 < x

                      1. Initial program 53.6%

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

                        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
                        3. *-lowering-*.f648.8%

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
                      5. Simplified8.8%

                        \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
                      6. Step-by-step derivation
                        1. flip3-+N/A

                          \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
                        2. clear-numN/A

                          \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
                        3. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
                        4. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        6. associate-*l*N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        9. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        10. metadata-evalN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        11. *-rgt-identityN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        12. --lowering--.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        14. metadata-evalN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
                        15. +-commutativeN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
                        17. cube-multN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                        18. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                      7. Applied egg-rr7.8%

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

                        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
                      9. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                        3. +-commutativeN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
                        4. mul-1-negN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
                        5. unsub-negN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
                        6. --lowering--.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
                      10. Simplified53.2%

                        \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
                      11. Taylor expanded in x around inf

                        \[\leadsto \color{blue}{-1} \]
                      12. Step-by-step derivation
                        1. Simplified48.8%

                          \[\leadsto \color{blue}{-1} \]
                      13. Recombined 2 regimes into one program.
                      14. Add Preprocessing

                      Alternative 11: 35.7% accurate, 105.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 50.9%

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

                        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + a \cdot x\right)}, 1\right) \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{\_.f64}\left(\left(a \cdot x + 1\right), 1\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(a \cdot x\right), 1\right), 1\right) \]
                        3. *-lowering-*.f6419.1%

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, x\right), 1\right), 1\right) \]
                      5. Simplified19.1%

                        \[\leadsto \color{blue}{\left(a \cdot x + 1\right)} - 1 \]
                      6. Step-by-step derivation
                        1. flip3-+N/A

                          \[\leadsto \mathsf{\_.f64}\left(\left(\frac{{\left(a \cdot x\right)}^{3} + {1}^{3}}{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}\right), 1\right) \]
                        2. clear-numN/A

                          \[\leadsto \mathsf{\_.f64}\left(\left(\frac{1}{\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}}\right), 1\right) \]
                        3. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)}{{\left(a \cdot x\right)}^{3} + {1}^{3}}\right)\right), 1\right) \]
                        4. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right) + \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        6. associate-*l*N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(a \cdot \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \left(x \cdot \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \left(a \cdot x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        9. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 \cdot 1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        10. metadata-evalN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - \left(a \cdot x\right) \cdot 1\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        11. *-rgt-identityN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 - a \cdot x\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        12. --lowering--.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \left(a \cdot x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + {1}^{3}\right)\right)\right), 1\right) \]
                        14. metadata-evalN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left({\left(a \cdot x\right)}^{3} + 1\right)\right)\right), 1\right) \]
                        15. +-commutativeN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \left(1 + {\left(a \cdot x\right)}^{3}\right)\right)\right), 1\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left({\left(a \cdot x\right)}^{3}\right)\right)\right)\right), 1\right) \]
                        17. cube-multN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \left(\left(a \cdot x\right) \cdot \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                        18. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(a, x\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot x\right), \left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right)\right)\right)\right)\right), 1\right) \]
                      7. Applied egg-rr18.4%

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

                        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \color{blue}{\left(1 + x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)}\right), 1\right) \]
                      9. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot a + x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right)\right)\right)\right), 1\right) \]
                        3. +-commutativeN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + -1 \cdot a\right)\right)\right)\right), 1\right) \]
                        4. mul-1-negN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) + \left(\mathsf{neg}\left(a\right)\right)\right)\right)\right)\right), 1\right) \]
                        5. unsub-negN/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right) - a\right)\right)\right)\right), 1\right) \]
                        6. --lowering--.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\left(x \cdot \left(-1 \cdot \left({a}^{3} \cdot x\right) + {a}^{2}\right)\right), a\right)\right)\right)\right), 1\right) \]
                      10. Simplified49.3%

                        \[\leadsto \frac{1}{\color{blue}{1 + x \cdot \left(x \cdot \left(a \cdot a - x \cdot \left(a \cdot \left(a \cdot a\right)\right)\right) - a\right)}} - 1 \]
                      11. Taylor expanded in x around inf

                        \[\leadsto \color{blue}{-1} \]
                      12. Step-by-step derivation
                        1. Simplified34.9%

                          \[\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 2024192 
                        (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))