Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2

Percentage Accurate: 100.0% → 100.0%
Time: 11.5s
Alternatives: 19
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ e^{\left(x + y \cdot \log y\right) - z} \end{array} \]
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
	return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
	return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z):
	return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z)
	return exp(Float64(Float64(x + Float64(y * log(y))) - z))
end
function tmp = code(x, y, z)
	tmp = exp(((x + (y * log(y))) - z));
end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
e^{\left(x + y \cdot \log y\right) - z}
\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 19 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: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{\left(x + y \cdot \log y\right) - z} \end{array} \]
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
	return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
	return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z):
	return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z)
	return exp(Float64(Float64(x + Float64(y * log(y))) - z))
end
function tmp = code(x, y, z)
	tmp = exp(((x + (y * log(y))) - z));
end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{\left(x + y \cdot \log y\right) - z} \end{array} \]
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
	return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
	return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z):
	return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z)
	return exp(Float64(Float64(x + Float64(y * log(y))) - z))
end
function tmp = code(x, y, z)
	tmp = exp(((x + (y * log(y))) - z));
end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{\left(x + y \cdot \log y\right) - z} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 79.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + y \cdot \log y\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+53}:\\ \;\;\;\;e^{x}\\ \mathbf{elif}\;t\_0 \leq 10^{+38}:\\ \;\;\;\;e^{-z}\\ \mathbf{else}:\\ \;\;\;\;{y}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (* y (log y)))))
   (if (<= t_0 -1e+53) (exp x) (if (<= t_0 1e+38) (exp (- z)) (pow y y)))))
double code(double x, double y, double z) {
	double t_0 = x + (y * log(y));
	double tmp;
	if (t_0 <= -1e+53) {
		tmp = exp(x);
	} else if (t_0 <= 1e+38) {
		tmp = exp(-z);
	} else {
		tmp = pow(y, y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x + (y * log(y))
    if (t_0 <= (-1d+53)) then
        tmp = exp(x)
    else if (t_0 <= 1d+38) then
        tmp = exp(-z)
    else
        tmp = y ** y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + (y * Math.log(y));
	double tmp;
	if (t_0 <= -1e+53) {
		tmp = Math.exp(x);
	} else if (t_0 <= 1e+38) {
		tmp = Math.exp(-z);
	} else {
		tmp = Math.pow(y, y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x + (y * math.log(y))
	tmp = 0
	if t_0 <= -1e+53:
		tmp = math.exp(x)
	elif t_0 <= 1e+38:
		tmp = math.exp(-z)
	else:
		tmp = math.pow(y, y)
	return tmp
function code(x, y, z)
	t_0 = Float64(x + Float64(y * log(y)))
	tmp = 0.0
	if (t_0 <= -1e+53)
		tmp = exp(x);
	elseif (t_0 <= 1e+38)
		tmp = exp(Float64(-z));
	else
		tmp = y ^ y;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x + (y * log(y));
	tmp = 0.0;
	if (t_0 <= -1e+53)
		tmp = exp(x);
	elseif (t_0 <= 1e+38)
		tmp = exp(-z);
	else
		tmp = y ^ y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+53], N[Exp[x], $MachinePrecision], If[LessEqual[t$95$0, 1e+38], N[Exp[(-z)], $MachinePrecision], N[Power[y, y], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + y \cdot \log y\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+53}:\\
\;\;\;\;e^{x}\\

\mathbf{elif}\;t\_0 \leq 10^{+38}:\\
\;\;\;\;e^{-z}\\

\mathbf{else}:\\
\;\;\;\;{y}^{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (*.f64 y (log.f64 y))) < -9.9999999999999999e52

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f64100.0

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites100.0%

      \[\leadsto \color{blue}{e^{x - z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x}} \]
    7. Step-by-step derivation
      1. lower-exp.f6489.3

        \[\leadsto \color{blue}{e^{x}} \]
    8. Applied rewrites89.3%

      \[\leadsto \color{blue}{e^{x}} \]

    if -9.9999999999999999e52 < (+.f64 x (*.f64 y (log.f64 y))) < 9.99999999999999977e37

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6491.1

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites91.1%

      \[\leadsto e^{\color{blue}{-z}} \]

    if 9.99999999999999977e37 < (+.f64 x (*.f64 y (log.f64 y)))

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto e^{\color{blue}{-1 \cdot \left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)}} \]
      3. log-recN/A

        \[\leadsto e^{y \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right)} \]
      4. remove-double-negN/A

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
      5. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{y \cdot \log y}} \]
      6. lower-log.f6468.3

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
    5. Applied rewrites68.3%

      \[\leadsto e^{\color{blue}{y \cdot \log y}} \]
    6. Step-by-step derivation
      1. lift-log.f64N/A

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
      2. *-commutativeN/A

        \[\leadsto e^{\color{blue}{\log y \cdot y}} \]
      3. lift-log.f64N/A

        \[\leadsto e^{\color{blue}{\log y} \cdot y} \]
      4. exp-to-powN/A

        \[\leadsto \color{blue}{{y}^{y}} \]
      5. lower-pow.f6468.3

        \[\leadsto \color{blue}{{y}^{y}} \]
    7. Applied rewrites68.3%

      \[\leadsto \color{blue}{{y}^{y}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 48.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + y \cdot \log y\right) - z\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+103}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z \cdot \mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(0.25, z \cdot z, -1\right), \frac{2 + \frac{\frac{8 + \frac{-16}{z}}{z} - 4}{z}}{z}, 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ x (* y (log y))) z)))
   (if (<= t_0 -5e+39)
     (* x (* 0.16666666666666666 (* x x)))
     (if (<= t_0 4e+103)
       (fma
        (/ (* z (fma 0.0625 (* (* z z) (* z z)) -1.0)) (fma z (* z 0.25) 1.0))
        (/ 1.0 (fma 0.5 z 1.0))
        1.0)
       (fma
        (* z (fma 0.25 (* z z) -1.0))
        (/ (+ 2.0 (/ (- (/ (+ 8.0 (/ -16.0 z)) z) 4.0) z)) z)
        1.0)))))
double code(double x, double y, double z) {
	double t_0 = (x + (y * log(y))) - z;
	double tmp;
	if (t_0 <= -5e+39) {
		tmp = x * (0.16666666666666666 * (x * x));
	} else if (t_0 <= 4e+103) {
		tmp = fma(((z * fma(0.0625, ((z * z) * (z * z)), -1.0)) / fma(z, (z * 0.25), 1.0)), (1.0 / fma(0.5, z, 1.0)), 1.0);
	} else {
		tmp = fma((z * fma(0.25, (z * z), -1.0)), ((2.0 + ((((8.0 + (-16.0 / z)) / z) - 4.0) / z)) / z), 1.0);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(Float64(x + Float64(y * log(y))) - z)
	tmp = 0.0
	if (t_0 <= -5e+39)
		tmp = Float64(x * Float64(0.16666666666666666 * Float64(x * x)));
	elseif (t_0 <= 4e+103)
		tmp = fma(Float64(Float64(z * fma(0.0625, Float64(Float64(z * z) * Float64(z * z)), -1.0)) / fma(z, Float64(z * 0.25), 1.0)), Float64(1.0 / fma(0.5, z, 1.0)), 1.0);
	else
		tmp = fma(Float64(z * fma(0.25, Float64(z * z), -1.0)), Float64(Float64(2.0 + Float64(Float64(Float64(Float64(8.0 + Float64(-16.0 / z)) / z) - 4.0) / z)) / z), 1.0);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+39], N[(x * N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+103], N[(N[(N[(z * N[(0.0625 * N[(N[(z * z), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z * 0.25), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(0.5 * z + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(z * N[(0.25 * N[(z * z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 + N[(N[(N[(N[(8.0 + N[(-16.0 / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - 4.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + 1.0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x + y \cdot \log y\right) - z\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+103}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(0.25, z \cdot z, -1\right), \frac{2 + \frac{\frac{8 + \frac{-16}{z}}{z} - 4}{z}}{z}, 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < -5.00000000000000015e39

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6457.8

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites57.8%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites2.0%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites2.2%

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot {x}^{3}} \]
    12. Step-by-step derivation
      1. cube-multN/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      9. lower-*.f6419.6

        \[\leadsto x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
    13. Applied rewrites19.6%

      \[\leadsto \color{blue}{x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)} \]

    if -5.00000000000000015e39 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 4e103

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6467.9

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites67.9%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6448.4

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites48.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)} \]
    9. Step-by-step derivation
      1. lift-fma.f64N/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2}, -1\right) \cdot z} + 1 \]
      3. lift-fma.f64N/A

        \[\leadsto \color{blue}{\left(z \cdot \frac{1}{2} + -1\right)} \cdot z + 1 \]
      4. flip-+N/A

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

        \[\leadsto \color{blue}{\frac{\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z}{z \cdot \frac{1}{2} - -1}} + 1 \]
      6. div-invN/A

        \[\leadsto \color{blue}{\left(\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z\right) \cdot \frac{1}{z \cdot \frac{1}{2} - -1}} + 1 \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z, \frac{1}{z \cdot \frac{1}{2} - -1}, 1\right)} \]
    10. Applied rewrites48.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.25, z \cdot z, -1\right) \cdot z, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)} \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{1}{4} \cdot \color{blue}{\left(z \cdot z\right)} + -1\right) \cdot z, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}} \cdot z, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1\right) \cdot z}}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - \color{blue}{1}\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      8. swap-sqrN/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\color{blue}{\left(\frac{1}{4} \cdot \frac{1}{4}\right) \cdot \left(\left(z \cdot z\right) \cdot \left(z \cdot z\right)\right)} + \left(\mathsf{neg}\left(1\right)\right)\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\left(\frac{1}{4} \cdot \frac{1}{4}\right) \cdot \color{blue}{{\left(z \cdot z\right)}^{2}} + \left(\mathsf{neg}\left(1\right)\right)\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\left(\frac{1}{4} \cdot \frac{1}{4}\right) \cdot {\left(z \cdot z\right)}^{2} + \color{blue}{-1}\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{fma}\left(\frac{1}{4} \cdot \frac{1}{4}, {\left(z \cdot z\right)}^{2}, -1\right)} \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, {\left(z \cdot z\right)}^{2}, -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      13. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(z \cdot z\right) \cdot \left(z \cdot z\right)}, -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      14. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(z \cdot z\right) \cdot \left(z \cdot z\right)}, -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{16}, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right) \cdot z}{\color{blue}{\frac{1}{4} \cdot \left(z \cdot z\right) + \left(\mathsf{neg}\left(-1\right)\right)}}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
    12. Applied rewrites59.0%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right) \cdot z}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right) \]

    if 4e103 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z)

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6444.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites44.5%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6440.0

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites40.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)} \]
    9. Step-by-step derivation
      1. lift-fma.f64N/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2}, -1\right) \cdot z} + 1 \]
      3. lift-fma.f64N/A

        \[\leadsto \color{blue}{\left(z \cdot \frac{1}{2} + -1\right)} \cdot z + 1 \]
      4. flip-+N/A

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

        \[\leadsto \color{blue}{\frac{\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z}{z \cdot \frac{1}{2} - -1}} + 1 \]
      6. div-invN/A

        \[\leadsto \color{blue}{\left(\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z\right) \cdot \frac{1}{z \cdot \frac{1}{2} - -1}} + 1 \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z, \frac{1}{z \cdot \frac{1}{2} - -1}, 1\right)} \]
    10. Applied rewrites49.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.25, z \cdot z, -1\right) \cdot z, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)} \]
    11. Taylor expanded in z around -inf

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{4}, z \cdot z, -1\right) \cdot z, \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{16 \cdot \frac{1}{z} - 8}{z} - 4}{z} - 2}{z}}, 1\right) \]
    12. Applied rewrites65.5%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.25, z \cdot z, -1\right) \cdot z, \color{blue}{\frac{2 - \frac{4 - \frac{8 + \frac{-16}{z}}{z}}{z}}{z}}, 1\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + y \cdot \log y\right) - z \leq -5 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \mathbf{elif}\;\left(x + y \cdot \log y\right) - z \leq 4 \cdot 10^{+103}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z \cdot \mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(0.25, z \cdot z, -1\right), \frac{2 + \frac{\frac{8 + \frac{-16}{z}}{z} - 4}{z}}{z}, 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 32.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + y \cdot \log y\right) - z\\ t_1 := 0.5 \cdot \left(z \cdot z\right)\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10^{+130}:\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ x (* y (log y))) z)) (t_1 (* 0.5 (* z z))))
   (if (<= t_0 -1e+53) t_1 (if (<= t_0 1e+130) (+ x 1.0) t_1))))
double code(double x, double y, double z) {
	double t_0 = (x + (y * log(y))) - z;
	double t_1 = 0.5 * (z * z);
	double tmp;
	if (t_0 <= -1e+53) {
		tmp = t_1;
	} else if (t_0 <= 1e+130) {
		tmp = x + 1.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (x + (y * log(y))) - z
    t_1 = 0.5d0 * (z * z)
    if (t_0 <= (-1d+53)) then
        tmp = t_1
    else if (t_0 <= 1d+130) then
        tmp = x + 1.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = (x + (y * Math.log(y))) - z;
	double t_1 = 0.5 * (z * z);
	double tmp;
	if (t_0 <= -1e+53) {
		tmp = t_1;
	} else if (t_0 <= 1e+130) {
		tmp = x + 1.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + (y * math.log(y))) - z
	t_1 = 0.5 * (z * z)
	tmp = 0
	if t_0 <= -1e+53:
		tmp = t_1
	elif t_0 <= 1e+130:
		tmp = x + 1.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(x + Float64(y * log(y))) - z)
	t_1 = Float64(0.5 * Float64(z * z))
	tmp = 0.0
	if (t_0 <= -1e+53)
		tmp = t_1;
	elseif (t_0 <= 1e+130)
		tmp = Float64(x + 1.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (x + (y * log(y))) - z;
	t_1 = 0.5 * (z * z);
	tmp = 0.0;
	if (t_0 <= -1e+53)
		tmp = t_1;
	elseif (t_0 <= 1e+130)
		tmp = x + 1.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+53], t$95$1, If[LessEqual[t$95$0, 1e+130], N[(x + 1.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x + y \cdot \log y\right) - z\\
t_1 := 0.5 \cdot \left(z \cdot z\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 10^{+130}:\\
\;\;\;\;x + 1\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < -9.9999999999999999e52 or 1.0000000000000001e130 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z)

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6455.0

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites55.0%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6428.3

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites28.3%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6431.9

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites31.9%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if -9.9999999999999999e52 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 1.0000000000000001e130

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f6472.6

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites72.6%

      \[\leadsto \color{blue}{e^{x - z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x}} \]
    7. Step-by-step derivation
      1. lower-exp.f6454.5

        \[\leadsto \color{blue}{e^{x}} \]
    8. Applied rewrites54.5%

      \[\leadsto \color{blue}{e^{x}} \]
    9. Taylor expanded in x around 0

      \[\leadsto \color{blue}{1 + x} \]
    10. Step-by-step derivation
      1. lower-+.f6437.0

        \[\leadsto \color{blue}{1 + x} \]
    11. Applied rewrites37.0%

      \[\leadsto \color{blue}{1 + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification33.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + y \cdot \log y\right) - z \leq -1 \cdot 10^{+53}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;\left(x + y \cdot \log y\right) - z \leq 10^{+130}:\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 33.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{\left(x + y \cdot \log y\right) - z} \leq 0:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (exp (- (+ x (* y (log y))) z)) 0.0)
   (* 0.5 (* z z))
   (fma z (* z 0.5) 1.0)))
double code(double x, double y, double z) {
	double tmp;
	if (exp(((x + (y * log(y))) - z)) <= 0.0) {
		tmp = 0.5 * (z * z);
	} else {
		tmp = fma(z, (z * 0.5), 1.0);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (exp(Float64(Float64(x + Float64(y * log(y))) - z)) <= 0.0)
		tmp = Float64(0.5 * Float64(z * z));
	else
		tmp = fma(z, Float64(z * 0.5), 1.0);
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision], 0.0], N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;e^{\left(x + y \cdot \log y\right) - z} \leq 0:\\
\;\;\;\;0.5 \cdot \left(z \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z)) < 0.0

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6467.1

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites67.1%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f642.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites2.1%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6411.6

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites11.6%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if 0.0 < (exp.f64 (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z))

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6451.4

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites51.4%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6442.5

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites42.5%

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

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z}, 1\right) \]
    10. Step-by-step derivation
      1. lower-*.f6442.3

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{0.5 \cdot z}, 1\right) \]
    11. Applied rewrites42.3%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{0.5 \cdot z}, 1\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification33.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{\left(x + y \cdot \log y\right) - z} \leq 0:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 94.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{x - z}\\ \mathbf{if}\;z \leq -2700:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+51}:\\ \;\;\;\;e^{\mathsf{fma}\left(y, \log y, x\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (exp (- x z))))
   (if (<= z -2700.0) t_0 (if (<= z 4e+51) (exp (fma y (log y) x)) t_0))))
double code(double x, double y, double z) {
	double t_0 = exp((x - z));
	double tmp;
	if (z <= -2700.0) {
		tmp = t_0;
	} else if (z <= 4e+51) {
		tmp = exp(fma(y, log(y), x));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, y, z)
	t_0 = exp(Float64(x - z))
	tmp = 0.0
	if (z <= -2700.0)
		tmp = t_0;
	elseif (z <= 4e+51)
		tmp = exp(fma(y, log(y), x));
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -2700.0], t$95$0, If[LessEqual[z, 4e+51], N[Exp[N[(y * N[Log[y], $MachinePrecision] + x), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{x - z}\\
\mathbf{if}\;z \leq -2700:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 4 \cdot 10^{+51}:\\
\;\;\;\;e^{\mathsf{fma}\left(y, \log y, x\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2700 or 4e51 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f6494.2

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites94.2%

      \[\leadsto \color{blue}{e^{x - z}} \]

    if -2700 < z < 4e51

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6498.8

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites98.8%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 90.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \log y \leq 4 \cdot 10^{+109}:\\ \;\;\;\;e^{x - z}\\ \mathbf{else}:\\ \;\;\;\;{y}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= (* y (log y)) 4e+109) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
	double tmp;
	if ((y * log(y)) <= 4e+109) {
		tmp = exp((x - z));
	} else {
		tmp = pow(y, y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((y * log(y)) <= 4d+109) then
        tmp = exp((x - z))
    else
        tmp = y ** y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y * Math.log(y)) <= 4e+109) {
		tmp = Math.exp((x - z));
	} else {
		tmp = Math.pow(y, y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y * math.log(y)) <= 4e+109:
		tmp = math.exp((x - z))
	else:
		tmp = math.pow(y, y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (Float64(y * log(y)) <= 4e+109)
		tmp = exp(Float64(x - z));
	else
		tmp = y ^ y;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y * log(y)) <= 4e+109)
		tmp = exp((x - z));
	else
		tmp = y ^ y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision], 4e+109], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \cdot \log y \leq 4 \cdot 10^{+109}:\\
\;\;\;\;e^{x - z}\\

\mathbf{else}:\\
\;\;\;\;{y}^{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (log.f64 y)) < 3.99999999999999993e109

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f6491.6

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites91.6%

      \[\leadsto \color{blue}{e^{x - z}} \]

    if 3.99999999999999993e109 < (*.f64 y (log.f64 y))

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto e^{\color{blue}{-1 \cdot \left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)}} \]
      3. log-recN/A

        \[\leadsto e^{y \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right)} \]
      4. remove-double-negN/A

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
      5. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{y \cdot \log y}} \]
      6. lower-log.f6489.9

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
    5. Applied rewrites89.9%

      \[\leadsto e^{\color{blue}{y \cdot \log y}} \]
    6. Step-by-step derivation
      1. lift-log.f64N/A

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
      2. *-commutativeN/A

        \[\leadsto e^{\color{blue}{\log y \cdot y}} \]
      3. lift-log.f64N/A

        \[\leadsto e^{\color{blue}{\log y} \cdot y} \]
      4. exp-to-powN/A

        \[\leadsto \color{blue}{{y}^{y}} \]
      5. lower-pow.f6489.9

        \[\leadsto \color{blue}{{y}^{y}} \]
    7. Applied rewrites89.9%

      \[\leadsto \color{blue}{{y}^{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 73.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 0.26:\\ \;\;\;\;e^{x}\\ \mathbf{else}:\\ \;\;\;\;{y}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z) :precision binary64 (if (<= y 0.26) (exp x) (pow y y)))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 0.26) {
		tmp = exp(x);
	} else {
		tmp = pow(y, y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= 0.26d0) then
        tmp = exp(x)
    else
        tmp = y ** y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 0.26) {
		tmp = Math.exp(x);
	} else {
		tmp = Math.pow(y, y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 0.26:
		tmp = math.exp(x)
	else:
		tmp = math.pow(y, y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 0.26)
		tmp = exp(x);
	else
		tmp = y ^ y;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 0.26)
		tmp = exp(x);
	else
		tmp = y ^ y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 0.26], N[Exp[x], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.26:\\
\;\;\;\;e^{x}\\

\mathbf{else}:\\
\;\;\;\;{y}^{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 0.26000000000000001

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f6499.0

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites99.0%

      \[\leadsto \color{blue}{e^{x - z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x}} \]
    7. Step-by-step derivation
      1. lower-exp.f6468.8

        \[\leadsto \color{blue}{e^{x}} \]
    8. Applied rewrites68.8%

      \[\leadsto \color{blue}{e^{x}} \]

    if 0.26000000000000001 < y

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto e^{\color{blue}{-1 \cdot \left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(y \cdot \log \left(\frac{1}{y}\right)\right)}} \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{y}\right)\right)\right)}} \]
      3. log-recN/A

        \[\leadsto e^{y \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log y\right)\right)}\right)\right)} \]
      4. remove-double-negN/A

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
      5. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{y \cdot \log y}} \]
      6. lower-log.f6478.1

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
    5. Applied rewrites78.1%

      \[\leadsto e^{\color{blue}{y \cdot \log y}} \]
    6. Step-by-step derivation
      1. lift-log.f64N/A

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
      2. *-commutativeN/A

        \[\leadsto e^{\color{blue}{\log y \cdot y}} \]
      3. lift-log.f64N/A

        \[\leadsto e^{\color{blue}{\log y} \cdot y} \]
      4. exp-to-powN/A

        \[\leadsto \color{blue}{{y}^{y}} \]
      5. lower-pow.f6478.1

        \[\leadsto \color{blue}{{y}^{y}} \]
    7. Applied rewrites78.1%

      \[\leadsto \color{blue}{{y}^{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 61.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+74}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;e^{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -7.5e+74)
   (fma z (fma z (fma z -0.16666666666666666 0.5) -1.0) 1.0)
   (exp x)))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -7.5e+74) {
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	} else {
		tmp = exp(x);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -7.5e+74)
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	else
		tmp = exp(x);
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -7.5e+74], N[(z * N[(z * N[(z * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[Exp[x], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\

\mathbf{else}:\\
\;\;\;\;e^{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.5e74

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6496.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites96.5%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{1 + z \cdot \left(z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) - 1\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) + \color{blue}{-1}, 1\right) \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{-1}{6}} + \frac{1}{2}, -1\right), 1\right) \]
      8. lower-fma.f6489.8

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, -0.16666666666666666, 0.5\right)}, -1\right), 1\right) \]
    8. Applied rewrites89.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)} \]

    if -7.5e74 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f6474.5

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites74.5%

      \[\leadsto \color{blue}{e^{x - z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x}} \]
    7. Step-by-step derivation
      1. lower-exp.f6456.4

        \[\leadsto \color{blue}{e^{x}} \]
    8. Applied rewrites56.4%

      \[\leadsto \color{blue}{e^{x}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 49.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+154}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+61}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z \cdot \mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x, -1\right), \frac{-1}{1 - x}, x \cdot \left(x \cdot \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -2e+154)
   (* 0.5 (* z z))
   (if (<= z -1.55e+61)
     (fma
      (/ (* z (fma 0.0625 (* (* z z) (* z z)) -1.0)) (fma z (* z 0.25) 1.0))
      (/ 1.0 (fma 0.5 z 1.0))
      1.0)
     (if (<= z 9.2e+27)
       (fma
        (fma x x -1.0)
        (/ -1.0 (- 1.0 x))
        (* x (* x (fma x 0.16666666666666666 0.5))))
       (* x (* 0.16666666666666666 (* x x)))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2e+154) {
		tmp = 0.5 * (z * z);
	} else if (z <= -1.55e+61) {
		tmp = fma(((z * fma(0.0625, ((z * z) * (z * z)), -1.0)) / fma(z, (z * 0.25), 1.0)), (1.0 / fma(0.5, z, 1.0)), 1.0);
	} else if (z <= 9.2e+27) {
		tmp = fma(fma(x, x, -1.0), (-1.0 / (1.0 - x)), (x * (x * fma(x, 0.16666666666666666, 0.5))));
	} else {
		tmp = x * (0.16666666666666666 * (x * x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -2e+154)
		tmp = Float64(0.5 * Float64(z * z));
	elseif (z <= -1.55e+61)
		tmp = fma(Float64(Float64(z * fma(0.0625, Float64(Float64(z * z) * Float64(z * z)), -1.0)) / fma(z, Float64(z * 0.25), 1.0)), Float64(1.0 / fma(0.5, z, 1.0)), 1.0);
	elseif (z <= 9.2e+27)
		tmp = fma(fma(x, x, -1.0), Float64(-1.0 / Float64(1.0 - x)), Float64(x * Float64(x * fma(x, 0.16666666666666666, 0.5))));
	else
		tmp = Float64(x * Float64(0.16666666666666666 * Float64(x * x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -2e+154], N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.55e+61], N[(N[(N[(z * N[(0.0625 * N[(N[(z * z), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / N[(z * N[(z * 0.25), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(0.5 * z + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 9.2e+27], N[(N[(x * x + -1.0), $MachinePrecision] * N[(-1.0 / N[(1.0 - x), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(x * 0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \left(z \cdot z\right)\\

\mathbf{elif}\;z \leq -1.55 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z \cdot \mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x, -1\right), \frac{-1}{1 - x}, x \cdot \left(x \cdot \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.00000000000000007e154

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6497.7

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites97.7%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6497.7

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites97.7%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6497.7

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites97.7%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if -2.00000000000000007e154 < z < -1.55e61

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6482.1

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites82.1%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f645.4

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites5.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)} \]
    9. Step-by-step derivation
      1. lift-fma.f64N/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2}, -1\right) \cdot z} + 1 \]
      3. lift-fma.f64N/A

        \[\leadsto \color{blue}{\left(z \cdot \frac{1}{2} + -1\right)} \cdot z + 1 \]
      4. flip-+N/A

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

        \[\leadsto \color{blue}{\frac{\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z}{z \cdot \frac{1}{2} - -1}} + 1 \]
      6. div-invN/A

        \[\leadsto \color{blue}{\left(\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z\right) \cdot \frac{1}{z \cdot \frac{1}{2} - -1}} + 1 \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) - -1 \cdot -1\right) \cdot z, \frac{1}{z \cdot \frac{1}{2} - -1}, 1\right)} \]
    10. Applied rewrites43.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.25, z \cdot z, -1\right) \cdot z, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)} \]
    11. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{1}{4} \cdot \color{blue}{\left(z \cdot z\right)} + -1\right) \cdot z, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}} \cdot z, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - -1 \cdot -1\right) \cdot z}}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) - \color{blue}{1}\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(\left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) \cdot \left(\frac{1}{4} \cdot \left(z \cdot z\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      8. swap-sqrN/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\color{blue}{\left(\frac{1}{4} \cdot \frac{1}{4}\right) \cdot \left(\left(z \cdot z\right) \cdot \left(z \cdot z\right)\right)} + \left(\mathsf{neg}\left(1\right)\right)\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      9. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\left(\frac{1}{4} \cdot \frac{1}{4}\right) \cdot \color{blue}{{\left(z \cdot z\right)}^{2}} + \left(\mathsf{neg}\left(1\right)\right)\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\left(\frac{1}{4} \cdot \frac{1}{4}\right) \cdot {\left(z \cdot z\right)}^{2} + \color{blue}{-1}\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{fma}\left(\frac{1}{4} \cdot \frac{1}{4}, {\left(z \cdot z\right)}^{2}, -1\right)} \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\color{blue}{\frac{1}{16}}, {\left(z \cdot z\right)}^{2}, -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      13. pow2N/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(z \cdot z\right) \cdot \left(z \cdot z\right)}, -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      14. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{16}, \color{blue}{\left(z \cdot z\right) \cdot \left(z \cdot z\right)}, -1\right) \cdot z}{\frac{1}{4} \cdot \left(z \cdot z\right) - -1}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{1}{16}, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right) \cdot z}{\color{blue}{\frac{1}{4} \cdot \left(z \cdot z\right) + \left(\mathsf{neg}\left(-1\right)\right)}}, \frac{1}{\mathsf{fma}\left(\frac{1}{2}, z, 1\right)}, 1\right) \]
    12. Applied rewrites82.1%

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right) \cdot z}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right) \]

    if -1.55e61 < z < 9.2000000000000002e27

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6496.5

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites96.5%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites72.4%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites39.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \]
    11. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \left(x + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)}\right) \]
      11. sub-negN/A

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

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \frac{x \cdot x - \color{blue}{1}}{x + -1} \]
      14. sub-negN/A

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

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

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \frac{\mathsf{fma}\left(x, x, -1\right)}{\color{blue}{x + -1}} \]
      18. un-div-invN/A

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \mathsf{fma}\left(x, x, -1\right) \cdot \color{blue}{\frac{1}{x + -1}} \]
    12. Applied rewrites39.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, x, -1\right), \frac{-1}{1 - x}, x \cdot \left(x \cdot \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)\right)\right)} \]

    if 9.2000000000000002e27 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6454.7

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites54.7%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites26.1%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites18.0%

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot {x}^{3}} \]
    12. Step-by-step derivation
      1. cube-multN/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      9. lower-*.f6436.6

        \[\leadsto x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
    13. Applied rewrites36.6%

      \[\leadsto \color{blue}{x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification52.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+154}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{+61}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z \cdot \mathsf{fma}\left(0.0625, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\mathsf{fma}\left(z, z \cdot 0.25, 1\right)}, \frac{1}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x, -1\right), \frac{-1}{1 - x}, x \cdot \left(x \cdot \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 47.0% accurate, 3.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+74}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x, -1\right), \frac{-1}{1 - x}, x \cdot \left(x \cdot \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1e+74)
   (fma z (fma z (fma z -0.16666666666666666 0.5) -1.0) 1.0)
   (if (<= z 9.2e+27)
     (fma
      (fma x x -1.0)
      (/ -1.0 (- 1.0 x))
      (* x (* x (fma x 0.16666666666666666 0.5))))
     (* x (* 0.16666666666666666 (* x x))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1e+74) {
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	} else if (z <= 9.2e+27) {
		tmp = fma(fma(x, x, -1.0), (-1.0 / (1.0 - x)), (x * (x * fma(x, 0.16666666666666666, 0.5))));
	} else {
		tmp = x * (0.16666666666666666 * (x * x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -1e+74)
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	elseif (z <= 9.2e+27)
		tmp = fma(fma(x, x, -1.0), Float64(-1.0 / Float64(1.0 - x)), Float64(x * Float64(x * fma(x, 0.16666666666666666, 0.5))));
	else
		tmp = Float64(x * Float64(0.16666666666666666 * Float64(x * x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -1e+74], N[(z * N[(z * N[(z * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 9.2e+27], N[(N[(x * x + -1.0), $MachinePrecision] * N[(-1.0 / N[(1.0 - x), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(x * 0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(x, x, -1\right), \frac{-1}{1 - x}, x \cdot \left(x \cdot \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.99999999999999952e73

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6493.2

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites93.2%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{1 + z \cdot \left(z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) - 1\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) + \color{blue}{-1}, 1\right) \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{-1}{6}} + \frac{1}{2}, -1\right), 1\right) \]
      8. lower-fma.f6486.8

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, -0.16666666666666666, 0.5\right)}, -1\right), 1\right) \]
    8. Applied rewrites86.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)} \]

    if -9.99999999999999952e73 < z < 9.2000000000000002e27

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6495.1

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites95.1%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites71.4%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites40.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \]
    11. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \left(x + \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)}\right) \]
      11. sub-negN/A

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

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \frac{x \cdot x - \color{blue}{1}}{x + -1} \]
      14. sub-negN/A

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

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

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \frac{\mathsf{fma}\left(x, x, -1\right)}{\color{blue}{x + -1}} \]
      18. un-div-invN/A

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

        \[\leadsto x \cdot \left(x \cdot \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right)\right) + \mathsf{fma}\left(x, x, -1\right) \cdot \color{blue}{\frac{1}{x + -1}} \]
    12. Applied rewrites40.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(x, x, -1\right), \frac{-1}{1 - x}, x \cdot \left(x \cdot \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)\right)\right)} \]

    if 9.2000000000000002e27 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6454.7

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites54.7%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites26.1%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites18.0%

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot {x}^{3}} \]
    12. Step-by-step derivation
      1. cube-multN/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      9. lower-*.f6436.6

        \[\leadsto x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
    13. Applied rewrites36.6%

      \[\leadsto \color{blue}{x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 12: 47.0% accurate, 6.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+74}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1e+74)
   (fma z (fma z (fma z -0.16666666666666666 0.5) -1.0) 1.0)
   (if (<= z 9.2e+27)
     (fma x (fma x (fma x 0.16666666666666666 0.5) 1.0) 1.0)
     (* x (* 0.16666666666666666 (* x x))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1e+74) {
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	} else if (z <= 9.2e+27) {
		tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0);
	} else {
		tmp = x * (0.16666666666666666 * (x * x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -1e+74)
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	elseif (z <= 9.2e+27)
		tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0);
	else
		tmp = Float64(x * Float64(0.16666666666666666 * Float64(x * x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -1e+74], N[(z * N[(z * N[(z * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 9.2e+27], N[(x * N[(x * N[(x * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.99999999999999952e73

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6493.2

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites93.2%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{1 + z \cdot \left(z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) - 1\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot z\right) + \color{blue}{-1}, 1\right) \]
      5. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{-1}{6}} + \frac{1}{2}, -1\right), 1\right) \]
      8. lower-fma.f6486.8

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, -0.16666666666666666, 0.5\right)}, -1\right), 1\right) \]
    8. Applied rewrites86.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)} \]

    if -9.99999999999999952e73 < z < 9.2000000000000002e27

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6495.1

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites95.1%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites71.4%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites40.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \]

    if 9.2000000000000002e27 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6454.7

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites54.7%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites26.1%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites18.0%

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot {x}^{3}} \]
    12. Step-by-step derivation
      1. cube-multN/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      9. lower-*.f6436.6

        \[\leadsto x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
    13. Applied rewrites36.6%

      \[\leadsto \color{blue}{x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 13: 44.3% accurate, 6.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+130}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -4.4e+130)
   (* 0.5 (* z z))
   (if (<= z 9.2e+27)
     (fma x (fma x (fma x 0.16666666666666666 0.5) 1.0) 1.0)
     (* x (* 0.16666666666666666 (* x x))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -4.4e+130) {
		tmp = 0.5 * (z * z);
	} else if (z <= 9.2e+27) {
		tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0);
	} else {
		tmp = x * (0.16666666666666666 * (x * x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -4.4e+130)
		tmp = Float64(0.5 * Float64(z * z));
	elseif (z <= 9.2e+27)
		tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0);
	else
		tmp = Float64(x * Float64(0.16666666666666666 * Float64(x * x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -4.4e+130], N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+27], N[(x * N[(x * N[(x * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+130}:\\
\;\;\;\;0.5 \cdot \left(z \cdot z\right)\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.39999999999999987e130

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6495.9

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites95.9%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6486.4

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites86.4%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6486.4

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites86.4%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if -4.39999999999999987e130 < z < 9.2000000000000002e27

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6494.1

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites94.1%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites70.0%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites38.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)} \]

    if 9.2000000000000002e27 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6454.7

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites54.7%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites26.1%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites18.0%

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot {x}^{3}} \]
    12. Step-by-step derivation
      1. cube-multN/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      9. lower-*.f6436.6

        \[\leadsto x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
    13. Applied rewrites36.6%

      \[\leadsto \color{blue}{x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 44.2% accurate, 7.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+130}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, x \cdot 0.16666666666666666, 1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -4.4e+130)
   (* 0.5 (* z z))
   (if (<= z 9.2e+27)
     (fma x (fma x (* x 0.16666666666666666) 1.0) 1.0)
     (* x (* 0.16666666666666666 (* x x))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -4.4e+130) {
		tmp = 0.5 * (z * z);
	} else if (z <= 9.2e+27) {
		tmp = fma(x, fma(x, (x * 0.16666666666666666), 1.0), 1.0);
	} else {
		tmp = x * (0.16666666666666666 * (x * x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -4.4e+130)
		tmp = Float64(0.5 * Float64(z * z));
	elseif (z <= 9.2e+27)
		tmp = fma(x, fma(x, Float64(x * 0.16666666666666666), 1.0), 1.0);
	else
		tmp = Float64(x * Float64(0.16666666666666666 * Float64(x * x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -4.4e+130], N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+27], N[(x * N[(x * N[(x * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+130}:\\
\;\;\;\;0.5 \cdot \left(z \cdot z\right)\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, x \cdot 0.16666666666666666, 1\right), 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.39999999999999987e130

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6495.9

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites95.9%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6486.4

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites86.4%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6486.4

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites86.4%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if -4.39999999999999987e130 < z < 9.2000000000000002e27

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6494.1

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites94.1%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites70.0%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites38.9%

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

      \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\frac{1}{6} \cdot x}, 1\right), 1\right) \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{x \cdot \frac{1}{6}}, 1\right), 1\right) \]
      2. lower-*.f6438.5

        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{x \cdot 0.16666666666666666}, 1\right), 1\right) \]
    13. Applied rewrites38.5%

      \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{x \cdot 0.16666666666666666}, 1\right), 1\right) \]

    if 9.2000000000000002e27 < z

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6454.7

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites54.7%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites26.1%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites18.0%

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot {x}^{3}} \]
    12. Step-by-step derivation
      1. cube-multN/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      9. lower-*.f6436.6

        \[\leadsto x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
    13. Applied rewrites36.6%

      \[\leadsto \color{blue}{x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 44.2% accurate, 7.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+44}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+99}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -7.2e+44)
   (* 0.5 (* z z))
   (if (<= x 3.5e+99)
     (fma z (fma z 0.5 -1.0) 1.0)
     (* x (* 0.16666666666666666 (* x x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -7.2e+44) {
		tmp = 0.5 * (z * z);
	} else if (x <= 3.5e+99) {
		tmp = fma(z, fma(z, 0.5, -1.0), 1.0);
	} else {
		tmp = x * (0.16666666666666666 * (x * x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= -7.2e+44)
		tmp = Float64(0.5 * Float64(z * z));
	elseif (x <= 3.5e+99)
		tmp = fma(z, fma(z, 0.5, -1.0), 1.0);
	else
		tmp = Float64(x * Float64(0.16666666666666666 * Float64(x * x)));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[x, -7.2e+44], N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+99], N[(z * N[(z * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(0.16666666666666666 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+44}:\\
\;\;\;\;0.5 \cdot \left(z \cdot z\right)\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{+99}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.2e44

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6444.3

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites44.3%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6416.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites16.6%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6429.0

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites29.0%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if -7.2e44 < x < 3.4999999999999998e99

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6465.1

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites65.1%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6436.9

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites36.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)} \]

    if 3.4999999999999998e99 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x + y \cdot \log y}} \]
      2. +-commutativeN/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + x}} \]
      3. lower-fma.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(y, \log y, x\right)}} \]
      4. lower-log.f6490.7

        \[\leadsto e^{\mathsf{fma}\left(y, \color{blue}{\log y}, x\right)} \]
    5. Applied rewrites90.7%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log y, x\right)}} \]
    6. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{y}^{y} \cdot \left(\left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot \left(x \cdot x\right) + \left(x + 1\right)\right)} \]
    8. Applied rewrites89.0%

      \[\leadsto \color{blue}{{y}^{y} \cdot \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, x, 0.5\right), x \cdot x, 1 + x\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{1 + \left(x + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot x\right)\right)} \]
    10. Applied rewrites89.0%

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

      \[\leadsto \color{blue}{\frac{1}{6} \cdot {x}^{3}} \]
    12. Step-by-step derivation
      1. cube-multN/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\frac{1}{6} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
      9. lower-*.f6489.0

        \[\leadsto x \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
    13. Applied rewrites89.0%

      \[\leadsto \color{blue}{x \cdot \left(0.16666666666666666 \cdot \left(x \cdot x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 41.3% accurate, 8.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+44}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+129}:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -7.2e+44)
   (* 0.5 (* z z))
   (if (<= x 7.2e+129)
     (fma z (fma z 0.5 -1.0) 1.0)
     (fma x (fma x 0.5 1.0) 1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -7.2e+44) {
		tmp = 0.5 * (z * z);
	} else if (x <= 7.2e+129) {
		tmp = fma(z, fma(z, 0.5, -1.0), 1.0);
	} else {
		tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= -7.2e+44)
		tmp = Float64(0.5 * Float64(z * z));
	elseif (x <= 7.2e+129)
		tmp = fma(z, fma(z, 0.5, -1.0), 1.0);
	else
		tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[x, -7.2e+44], N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e+129], N[(z * N[(z * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+44}:\\
\;\;\;\;0.5 \cdot \left(z \cdot z\right)\\

\mathbf{elif}\;x \leq 7.2 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.2e44

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6444.3

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites44.3%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6416.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites16.6%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6429.0

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites29.0%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if -7.2e44 < x < 7.2000000000000002e129

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6464.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites64.5%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6436.3

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites36.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)} \]

    if 7.2000000000000002e129 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f64100.0

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites100.0%

      \[\leadsto \color{blue}{e^{x - z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x}} \]
    7. Step-by-step derivation
      1. lower-exp.f6489.5

        \[\leadsto \color{blue}{e^{x}} \]
    8. Applied rewrites89.5%

      \[\leadsto \color{blue}{e^{x}} \]
    9. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + x \cdot \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{x}\right)} + 1\right) \]
      15. rgt-mult-inverseN/A

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

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

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

        \[\leadsto 1 + \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{x} + \frac{1}{{x}^{2}}\right) \]
      19. cube-multN/A

        \[\leadsto 1 + \color{blue}{{x}^{3}} \cdot \left(\frac{1}{2} \cdot \frac{1}{x} + \frac{1}{{x}^{2}}\right) \]
    11. Applied rewrites72.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 41.2% accurate, 8.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+44}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+129}:\\ \;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -7.2e+44)
   (* 0.5 (* z z))
   (if (<= x 7.2e+129) (fma z (* z 0.5) 1.0) (fma x (fma x 0.5 1.0) 1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -7.2e+44) {
		tmp = 0.5 * (z * z);
	} else if (x <= 7.2e+129) {
		tmp = fma(z, (z * 0.5), 1.0);
	} else {
		tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= -7.2e+44)
		tmp = Float64(0.5 * Float64(z * z));
	elseif (x <= 7.2e+129)
		tmp = fma(z, Float64(z * 0.5), 1.0);
	else
		tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[x, -7.2e+44], N[(0.5 * N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e+129], N[(z * N[(z * 0.5), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+44}:\\
\;\;\;\;0.5 \cdot \left(z \cdot z\right)\\

\mathbf{elif}\;x \leq 7.2 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.2e44

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6444.3

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites44.3%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6416.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites16.6%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot {z}^{2}} \]
      2. unpow2N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(z \cdot z\right)} \]
      3. lower-*.f6429.0

        \[\leadsto 0.5 \cdot \color{blue}{\left(z \cdot z\right)} \]
    11. Applied rewrites29.0%

      \[\leadsto \color{blue}{0.5 \cdot \left(z \cdot z\right)} \]

    if -7.2e44 < x < 7.2000000000000002e129

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf

      \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
      2. lower-neg.f6464.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Applied rewrites64.5%

      \[\leadsto e^{\color{blue}{-z}} \]
    6. Taylor expanded in z around 0

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

        \[\leadsto \color{blue}{z \cdot \left(\frac{1}{2} \cdot z - 1\right) + 1} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{1}{2} \cdot z - 1, 1\right)} \]
      3. sub-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z + \left(\mathsf{neg}\left(1\right)\right)}, 1\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(1\right)\right), 1\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(z, z \cdot \frac{1}{2} + \color{blue}{-1}, 1\right) \]
      6. lower-fma.f6436.3

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Applied rewrites36.3%

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

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z}, 1\right) \]
    10. Step-by-step derivation
      1. lower-*.f6436.0

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{0.5 \cdot z}, 1\right) \]
    11. Applied rewrites36.0%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{0.5 \cdot z}, 1\right) \]

    if 7.2000000000000002e129 < x

    1. Initial program 100.0%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{e^{x - z}} \]
    4. Step-by-step derivation
      1. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{x - z}} \]
      2. lower--.f64100.0

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Applied rewrites100.0%

      \[\leadsto \color{blue}{e^{x - z}} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{e^{x}} \]
    7. Step-by-step derivation
      1. lower-exp.f6489.5

        \[\leadsto \color{blue}{e^{x}} \]
    8. Applied rewrites89.5%

      \[\leadsto \color{blue}{e^{x}} \]
    9. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + x \cdot \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{x}\right)} + 1\right) \]
      15. rgt-mult-inverseN/A

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

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

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

        \[\leadsto 1 + \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right) \cdot \left(\frac{1}{2} \cdot \frac{1}{x} + \frac{1}{{x}^{2}}\right) \]
      19. cube-multN/A

        \[\leadsto 1 + \color{blue}{{x}^{3}} \cdot \left(\frac{1}{2} \cdot \frac{1}{x} + \frac{1}{{x}^{2}}\right) \]
    11. Applied rewrites72.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification41.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+44}:\\ \;\;\;\;0.5 \cdot \left(z \cdot z\right)\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+129}:\\ \;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 15.1% accurate, 53.0× speedup?

\[\begin{array}{l} \\ x + 1 \end{array} \]
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
	return x + 1.0;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + 1.0d0
end function
public static double code(double x, double y, double z) {
	return x + 1.0;
}
def code(x, y, z):
	return x + 1.0
function code(x, y, z)
	return Float64(x + 1.0)
end
function tmp = code(x, y, z)
	tmp = x + 1.0;
end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}

\\
x + 1
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{\left(x + y \cdot \log y\right) - z} \]
  2. Add Preprocessing
  3. Taylor expanded in y around 0

    \[\leadsto \color{blue}{e^{x - z}} \]
  4. Step-by-step derivation
    1. lower-exp.f64N/A

      \[\leadsto \color{blue}{e^{x - z}} \]
    2. lower--.f6479.7

      \[\leadsto e^{\color{blue}{x - z}} \]
  5. Applied rewrites79.7%

    \[\leadsto \color{blue}{e^{x - z}} \]
  6. Taylor expanded in z around 0

    \[\leadsto \color{blue}{e^{x}} \]
  7. Step-by-step derivation
    1. lower-exp.f6452.6

      \[\leadsto \color{blue}{e^{x}} \]
  8. Applied rewrites52.6%

    \[\leadsto \color{blue}{e^{x}} \]
  9. Taylor expanded in x around 0

    \[\leadsto \color{blue}{1 + x} \]
  10. Step-by-step derivation
    1. lower-+.f6412.9

      \[\leadsto \color{blue}{1 + x} \]
  11. Applied rewrites12.9%

    \[\leadsto \color{blue}{1 + x} \]
  12. Final simplification12.9%

    \[\leadsto x + 1 \]
  13. Add Preprocessing

Alternative 19: 14.9% accurate, 212.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
	return 1.0;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 1.0d0
end function
public static double code(double x, double y, double z) {
	return 1.0;
}
def code(x, y, z):
	return 1.0
function code(x, y, z)
	return 1.0
end
function tmp = code(x, y, z)
	tmp = 1.0;
end
code[x_, y_, z_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 100.0%

    \[e^{\left(x + y \cdot \log y\right) - z} \]
  2. Add Preprocessing
  3. Taylor expanded in z around inf

    \[\leadsto e^{\color{blue}{-1 \cdot z}} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto e^{\color{blue}{\mathsf{neg}\left(z\right)}} \]
    2. lower-neg.f6456.0

      \[\leadsto e^{\color{blue}{-z}} \]
  5. Applied rewrites56.0%

    \[\leadsto e^{\color{blue}{-z}} \]
  6. Taylor expanded in z around 0

    \[\leadsto \color{blue}{1} \]
  7. Step-by-step derivation
    1. Applied rewrites12.5%

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

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

    \[\begin{array}{l} \\ e^{\left(x - z\right) + \log y \cdot y} \end{array} \]
    (FPCore (x y z) :precision binary64 (exp (+ (- x z) (* (log y) y))))
    double code(double x, double y, double z) {
    	return exp(((x - z) + (log(y) * y)));
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        code = exp(((x - z) + (log(y) * y)))
    end function
    
    public static double code(double x, double y, double z) {
    	return Math.exp(((x - z) + (Math.log(y) * y)));
    }
    
    def code(x, y, z):
    	return math.exp(((x - z) + (math.log(y) * y)))
    
    function code(x, y, z)
    	return exp(Float64(Float64(x - z) + Float64(log(y) * y)))
    end
    
    function tmp = code(x, y, z)
    	tmp = exp(((x - z) + (log(y) * y)));
    end
    
    code[x_, y_, z_] := N[Exp[N[(N[(x - z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    e^{\left(x - z\right) + \log y \cdot y}
    \end{array}
    

    Reproduce

    ?
    herbie shell --seed 2024214 
    (FPCore (x y z)
      :name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"
      :precision binary64
    
      :alt
      (! :herbie-platform default (exp (+ (- x z) (* (log y) y))))
    
      (exp (- (+ x (* y (log y))) z)))