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

Percentage Accurate: 100.0% → 100.0%
Time: 11.4s
Alternatives: 22
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 22 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: 73.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + y \cdot \log y\\ \mathbf{if}\;t\_0 \leq -50:\\ \;\;\;\;e^{x}\\ \mathbf{elif}\;t\_0 \leq -1 \cdot 10^{-147}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq 50000:\\ \;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;{y}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (* y (log y)))))
   (if (<= t_0 -50.0)
     (exp x)
     (if (<= t_0 -1e-147)
       (/ 1.0 (fma z (fma z (fma z (* z -0.25) 0.5) 1.0) 1.0))
       (if (<= t_0 50000.0)
         (fma z (fma z (fma z -0.16666666666666666 0.5) -1.0) 1.0)
         (pow y y))))))
double code(double x, double y, double z) {
	double t_0 = x + (y * log(y));
	double tmp;
	if (t_0 <= -50.0) {
		tmp = exp(x);
	} else if (t_0 <= -1e-147) {
		tmp = 1.0 / fma(z, fma(z, fma(z, (z * -0.25), 0.5), 1.0), 1.0);
	} else if (t_0 <= 50000.0) {
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	} else {
		tmp = pow(y, y);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(x + Float64(y * log(y)))
	tmp = 0.0
	if (t_0 <= -50.0)
		tmp = exp(x);
	elseif (t_0 <= -1e-147)
		tmp = Float64(1.0 / fma(z, fma(z, fma(z, Float64(z * -0.25), 0.5), 1.0), 1.0));
	elseif (t_0 <= 50000.0)
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	else
		tmp = y ^ y;
	end
	return 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, -50.0], N[Exp[x], $MachinePrecision], If[LessEqual[t$95$0, -1e-147], N[(1.0 / N[(z * N[(z * N[(z * N[(z * -0.25), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 50000.0], N[(z * N[(z * N[(z * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[Power[y, y], $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_0 \leq 50000:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\

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


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

    1. Initial program 99.9%

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

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Simplified98.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.f6489.4

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

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

    if -50 < (+.f64 x (*.f64 y (log.f64 y))) < -9.9999999999999997e-148

    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.6

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

      \[\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.f6456.5

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

      \[\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. flip-+N/A

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{1}{2}, -1\right), 1\right)}}} \]
      8. lower-/.f6456.5

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)}}} \]
    10. Applied egg-rr56.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{-1}{4}}, \frac{1}{2}\right), 1\right), 1\right)} \]
      11. lower-*.f6481.8

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified81.8%

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

    if -9.9999999999999997e-148 < (+.f64 x (*.f64 y (log.f64 y))) < 5e4

    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.f64100.0

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

      \[\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.f6474.9

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

      \[\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 5e4 < (+.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.f6476.5

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

      \[\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. pow-to-expN/A

        \[\leadsto \color{blue}{{y}^{y}} \]
      5. lift-pow.f6476.5

        \[\leadsto \color{blue}{{y}^{y}} \]
    7. Applied egg-rr76.5%

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

Alternative 3: 50.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + y \cdot \log y\right) - z\\ \mathbf{if}\;t\_0 \leq -4 \cdot 10^{+107}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq -5 \cdot 10^{+21}:\\ \;\;\;\;\frac{1}{\frac{2 + \frac{4 + \frac{4 + \frac{-8}{z \cdot z}}{z}}{z}}{z \cdot z}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+139}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, z \cdot \left(\mathsf{fma}\left(z, 0.5, -1\right) \cdot \mathsf{fma}\left(z, 0.5, -1\right)\right), -1\right)}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), -1\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot z, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ x (* y (log y))) z)))
   (if (<= t_0 -4e+107)
     (/ 1.0 (fma z (fma z (fma z (* z -0.25) 0.5) 1.0) 1.0))
     (if (<= t_0 -5e+21)
       (/ 1.0 (/ (+ 2.0 (/ (+ 4.0 (/ (+ 4.0 (/ -8.0 (* z z))) z)) z)) (* z z)))
       (if (<= t_0 2e+139)
         (/
          (fma z (* z (* (fma z 0.5 -1.0) (fma z 0.5 -1.0))) -1.0)
          (fma z (fma z 0.5 -1.0) -1.0))
         (fma (* z (fma (* z z) 0.25 -1.0)) (/ 1.0 (fma z 0.5 1.0)) 1.0))))))
double code(double x, double y, double z) {
	double t_0 = (x + (y * log(y))) - z;
	double tmp;
	if (t_0 <= -4e+107) {
		tmp = 1.0 / fma(z, fma(z, fma(z, (z * -0.25), 0.5), 1.0), 1.0);
	} else if (t_0 <= -5e+21) {
		tmp = 1.0 / ((2.0 + ((4.0 + ((4.0 + (-8.0 / (z * z))) / z)) / z)) / (z * z));
	} else if (t_0 <= 2e+139) {
		tmp = fma(z, (z * (fma(z, 0.5, -1.0) * fma(z, 0.5, -1.0))), -1.0) / fma(z, fma(z, 0.5, -1.0), -1.0);
	} else {
		tmp = fma((z * fma((z * z), 0.25, -1.0)), (1.0 / fma(z, 0.5, 1.0)), 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 <= -4e+107)
		tmp = Float64(1.0 / fma(z, fma(z, fma(z, Float64(z * -0.25), 0.5), 1.0), 1.0));
	elseif (t_0 <= -5e+21)
		tmp = Float64(1.0 / Float64(Float64(2.0 + Float64(Float64(4.0 + Float64(Float64(4.0 + Float64(-8.0 / Float64(z * z))) / z)) / z)) / Float64(z * z)));
	elseif (t_0 <= 2e+139)
		tmp = Float64(fma(z, Float64(z * Float64(fma(z, 0.5, -1.0) * fma(z, 0.5, -1.0))), -1.0) / fma(z, fma(z, 0.5, -1.0), -1.0));
	else
		tmp = fma(Float64(z * fma(Float64(z * z), 0.25, -1.0)), Float64(1.0 / fma(z, 0.5, 1.0)), 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, -4e+107], N[(1.0 / N[(z * N[(z * N[(z * N[(z * -0.25), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -5e+21], N[(1.0 / N[(N[(2.0 + N[(N[(4.0 + N[(N[(4.0 + N[(-8.0 / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+139], N[(N[(z * N[(z * N[(N[(z * 0.5 + -1.0), $MachinePrecision] * N[(z * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(z * N[(z * 0.5 + -1.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(z * z), $MachinePrecision] * 0.25 + -1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * 0.5 + 1.0), $MachinePrecision]), $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 -4 \cdot 10^{+107}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\

\mathbf{elif}\;t\_0 \leq -5 \cdot 10^{+21}:\\
\;\;\;\;\frac{1}{\frac{2 + \frac{4 + \frac{4 + \frac{-8}{z \cdot z}}{z}}{z}}{z \cdot z}}\\

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

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


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

    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.9

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified64.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.f642.1

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

      \[\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. flip-+N/A

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)}}} \]
    10. Applied egg-rr2.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified68.5%

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

    if -3.9999999999999999e107 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < -5e21

    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.f6431.4

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified31.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.f642.9

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

      \[\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. flip-+N/A

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{1}{2}, -1\right), 1\right)}}} \]
      8. lower-/.f642.9

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)}}} \]
    10. Applied egg-rr2.9%

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{2 + -1 \cdot \frac{-1 \cdot \frac{4 - 8 \cdot \frac{1}{{z}^{2}}}{z} - 4}{z}}{{z}^{2}}}} \]
    13. Simplified37.8%

      \[\leadsto \frac{1}{\color{blue}{\frac{2 + \frac{4 + \frac{4 + \frac{-8}{z \cdot z}}{z}}{z}}{z \cdot z}}} \]

    if -5e21 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 2.00000000000000007e139

    1. Initial program 99.9%

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified49.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.f6438.0

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified38.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. flip-+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000007e139 < (-.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.f6441.2

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot z, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 4: 80.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + y \cdot \log y\\ \mathbf{if}\;t\_0 \leq -50:\\ \;\;\;\;e^{x}\\ \mathbf{elif}\;t\_0 \leq 50000:\\ \;\;\;\;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 -50.0) (exp x) (if (<= t_0 50000.0) (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 <= -50.0) {
		tmp = exp(x);
	} else if (t_0 <= 50000.0) {
		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 <= (-50.0d0)) then
        tmp = exp(x)
    else if (t_0 <= 50000.0d0) 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 <= -50.0) {
		tmp = Math.exp(x);
	} else if (t_0 <= 50000.0) {
		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 <= -50.0:
		tmp = math.exp(x)
	elif t_0 <= 50000.0:
		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 <= -50.0)
		tmp = exp(x);
	elseif (t_0 <= 50000.0)
		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 <= -50.0)
		tmp = exp(x);
	elseif (t_0 <= 50000.0)
		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, -50.0], N[Exp[x], $MachinePrecision], If[LessEqual[t$95$0, 50000.0], 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 -50:\\
\;\;\;\;e^{x}\\

\mathbf{elif}\;t\_0 \leq 50000:\\
\;\;\;\;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))) < -50

    1. Initial program 99.9%

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

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Simplified98.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.f6489.4

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

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

    if -50 < (+.f64 x (*.f64 y (log.f64 y))) < 5e4

    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. Simplified97.7%

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

    if 5e4 < (+.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.f6476.5

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

      \[\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. pow-to-expN/A

        \[\leadsto \color{blue}{{y}^{y}} \]
      5. lift-pow.f6476.5

        \[\leadsto \color{blue}{{y}^{y}} \]
    7. Applied egg-rr76.5%

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

Alternative 5: 95.0% accurate, 0.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(y, \log y, x\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y (log.f64 y)) < -4.9999999999999998e-303

    1. Initial program 99.9%

      \[e^{\left(x + y \cdot \log y\right) - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-log.f64N/A

        \[\leadsto e^{\left(x + y \cdot \color{blue}{\log y}\right) - z} \]
      2. lift-*.f64N/A

        \[\leadsto e^{\left(x + \color{blue}{y \cdot \log y}\right) - z} \]
      3. +-commutativeN/A

        \[\leadsto e^{\color{blue}{\left(y \cdot \log y + x\right)} - z} \]
      4. associate--l+N/A

        \[\leadsto e^{\color{blue}{y \cdot \log y + \left(x - z\right)}} \]
      5. exp-sumN/A

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

        \[\leadsto \color{blue}{e^{y \cdot \log y} \cdot e^{x - z}} \]
      7. lift-*.f64N/A

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

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

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

        \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x - z} \]
      11. lower-pow.f64N/A

        \[\leadsto \color{blue}{{y}^{y}} \cdot e^{x - z} \]
      12. lower-exp.f64N/A

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

        \[\leadsto {y}^{y} \cdot e^{\color{blue}{x - z}} \]
    4. Applied egg-rr100.0%

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

    if -4.9999999999999998e-303 < (*.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 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.9

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

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

Alternative 6: 50.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 -2 \cdot 10^{+34}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+139}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, z \cdot \left(\mathsf{fma}\left(z, 0.5, -1\right) \cdot \mathsf{fma}\left(z, 0.5, -1\right)\right), -1\right)}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), -1\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot z, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ x (* y (log y))) z)))
   (if (<= t_0 -2e+34)
     (/ 1.0 (fma z (fma z (fma z (* z -0.25) 0.5) 1.0) 1.0))
     (if (<= t_0 2e+139)
       (/
        (fma z (* z (* (fma z 0.5 -1.0) (fma z 0.5 -1.0))) -1.0)
        (fma z (fma z 0.5 -1.0) -1.0))
       (fma (* z (fma (* z z) 0.25 -1.0)) (/ 1.0 (fma z 0.5 1.0)) 1.0)))))
double code(double x, double y, double z) {
	double t_0 = (x + (y * log(y))) - z;
	double tmp;
	if (t_0 <= -2e+34) {
		tmp = 1.0 / fma(z, fma(z, fma(z, (z * -0.25), 0.5), 1.0), 1.0);
	} else if (t_0 <= 2e+139) {
		tmp = fma(z, (z * (fma(z, 0.5, -1.0) * fma(z, 0.5, -1.0))), -1.0) / fma(z, fma(z, 0.5, -1.0), -1.0);
	} else {
		tmp = fma((z * fma((z * z), 0.25, -1.0)), (1.0 / fma(z, 0.5, 1.0)), 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 <= -2e+34)
		tmp = Float64(1.0 / fma(z, fma(z, fma(z, Float64(z * -0.25), 0.5), 1.0), 1.0));
	elseif (t_0 <= 2e+139)
		tmp = Float64(fma(z, Float64(z * Float64(fma(z, 0.5, -1.0) * fma(z, 0.5, -1.0))), -1.0) / fma(z, fma(z, 0.5, -1.0), -1.0));
	else
		tmp = fma(Float64(z * fma(Float64(z * z), 0.25, -1.0)), Float64(1.0 / fma(z, 0.5, 1.0)), 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, -2e+34], N[(1.0 / N[(z * N[(z * N[(z * N[(z * -0.25), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+139], N[(N[(z * N[(z * N[(N[(z * 0.5 + -1.0), $MachinePrecision] * N[(z * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(z * N[(z * 0.5 + -1.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(z * z), $MachinePrecision] * 0.25 + -1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * 0.5 + 1.0), $MachinePrecision]), $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 -2 \cdot 10^{+34}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\

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

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


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

    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.f6460.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified60.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.f642.2

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

      \[\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. flip-+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified58.6%

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

    if -1.99999999999999989e34 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 2.00000000000000007e139

    1. Initial program 99.9%

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

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified46.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.f6436.3

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

      \[\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. flip-+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000007e139 < (-.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.f6441.2

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot z, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 49.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + y \cdot \log y\right) - z\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-12}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+139}:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.25, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\mathsf{fma}\left(z, z \cdot 0.5, -1\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot z, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ x (* y (log y))) z)))
   (if (<= t_0 2e-12)
     (/ 1.0 (fma z (fma z (fma z (* z -0.25) 0.5) 1.0) 1.0))
     (if (<= t_0 2e+139)
       (/ (fma 0.25 (* (* z z) (* z z)) -1.0) (fma z (* z 0.5) -1.0))
       (fma (* z (fma (* z z) 0.25 -1.0)) (/ 1.0 (fma z 0.5 1.0)) 1.0)))))
double code(double x, double y, double z) {
	double t_0 = (x + (y * log(y))) - z;
	double tmp;
	if (t_0 <= 2e-12) {
		tmp = 1.0 / fma(z, fma(z, fma(z, (z * -0.25), 0.5), 1.0), 1.0);
	} else if (t_0 <= 2e+139) {
		tmp = fma(0.25, ((z * z) * (z * z)), -1.0) / fma(z, (z * 0.5), -1.0);
	} else {
		tmp = fma((z * fma((z * z), 0.25, -1.0)), (1.0 / fma(z, 0.5, 1.0)), 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 <= 2e-12)
		tmp = Float64(1.0 / fma(z, fma(z, fma(z, Float64(z * -0.25), 0.5), 1.0), 1.0));
	elseif (t_0 <= 2e+139)
		tmp = Float64(fma(0.25, Float64(Float64(z * z) * Float64(z * z)), -1.0) / fma(z, Float64(z * 0.5), -1.0));
	else
		tmp = fma(Float64(z * fma(Float64(z * z), 0.25, -1.0)), Float64(1.0 / fma(z, 0.5, 1.0)), 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, 2e-12], N[(1.0 / N[(z * N[(z * N[(z * N[(z * -0.25), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+139], N[(N[(0.25 * N[(N[(z * z), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(z * N[(z * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(z * z), $MachinePrecision] * 0.25 + -1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * 0.5 + 1.0), $MachinePrecision]), $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 2 \cdot 10^{-12}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\

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

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


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

    1. Initial program 99.9%

      \[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.f6466.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified66.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.f6426.9

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

      \[\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. flip-+N/A

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{1}{2}, -1\right), 1\right)}}} \]
      8. lower-/.f6426.9

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)}}} \]
    10. Applied egg-rr26.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified65.2%

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

    if 1.99999999999999996e-12 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 2.00000000000000007e139

    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.f6422.0

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified22.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.f643.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified3.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 \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z}, 1\right) \]
    10. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{{\left(z \cdot \left(z \cdot \frac{1}{2}\right)\right)}^{2}} + \left(\mathsf{neg}\left(1\right)\right)}{z \cdot \left(z \cdot \frac{1}{2}\right) - 1} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{{\color{blue}{\left(\left(z \cdot z\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\mathsf{neg}\left(1\right)\right)}{z \cdot \left(z \cdot \frac{1}{2}\right) - 1} \]
      9. lift-*.f64N/A

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

        \[\leadsto \frac{{\color{blue}{\left(\frac{1}{2} \cdot \left(z \cdot z\right)\right)}}^{2} + \left(\mathsf{neg}\left(1\right)\right)}{z \cdot \left(z \cdot \frac{1}{2}\right) - 1} \]
      11. unpow-prod-downN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.25, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.5, -1\right)}} \]
    13. Applied egg-rr18.0%

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

    if 2.00000000000000007e139 < (-.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.f6441.2

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot z, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 32.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + y \cdot \log y\right) - z\\ t_1 := z \cdot \left(z \cdot 0.5\right)\\ \mathbf{if}\;t\_0 \leq -200:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 1.6 \cdot 10^{+108}:\\ \;\;\;\;1 - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ x (* y (log y))) z)) (t_1 (* z (* z 0.5))))
   (if (<= t_0 -200.0) t_1 (if (<= t_0 1.6e+108) (- 1.0 z) t_1))))
double code(double x, double y, double z) {
	double t_0 = (x + (y * log(y))) - z;
	double t_1 = z * (z * 0.5);
	double tmp;
	if (t_0 <= -200.0) {
		tmp = t_1;
	} else if (t_0 <= 1.6e+108) {
		tmp = 1.0 - z;
	} 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 = z * (z * 0.5d0)
    if (t_0 <= (-200.0d0)) then
        tmp = t_1
    else if (t_0 <= 1.6d+108) then
        tmp = 1.0d0 - z
    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 = z * (z * 0.5);
	double tmp;
	if (t_0 <= -200.0) {
		tmp = t_1;
	} else if (t_0 <= 1.6e+108) {
		tmp = 1.0 - z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + (y * math.log(y))) - z
	t_1 = z * (z * 0.5)
	tmp = 0
	if t_0 <= -200.0:
		tmp = t_1
	elif t_0 <= 1.6e+108:
		tmp = 1.0 - z
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(x + Float64(y * log(y))) - z)
	t_1 = Float64(z * Float64(z * 0.5))
	tmp = 0.0
	if (t_0 <= -200.0)
		tmp = t_1;
	elseif (t_0 <= 1.6e+108)
		tmp = Float64(1.0 - z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (x + (y * log(y))) - z;
	t_1 = z * (z * 0.5);
	tmp = 0.0;
	if (t_0 <= -200.0)
		tmp = t_1;
	elseif (t_0 <= 1.6e+108)
		tmp = 1.0 - z;
	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[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200.0], t$95$1, If[LessEqual[t$95$0, 1.6e+108], N[(1.0 - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_0 \leq 1.6 \cdot 10^{+108}:\\
\;\;\;\;1 - z\\

\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) < -200 or 1.6e108 < (-.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.f6447.6

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

      \[\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.f6424.8

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

      \[\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. unpow2N/A

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(z \cdot 0.5\right)} \]
    11. Simplified31.2%

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

    if -200 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 1.6e108

    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.5

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

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

      \[\leadsto \color{blue}{1 + -1 \cdot z} \]
    7. Step-by-step derivation
      1. neg-mul-1N/A

        \[\leadsto 1 + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \color{blue}{1 - z} \]
      3. lower--.f6444.1

        \[\leadsto \color{blue}{1 - z} \]
    8. Simplified44.1%

      \[\leadsto \color{blue}{1 - z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 93.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+77}:\\
\;\;\;\;e^{x - z}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{e^{z - x}}\\


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

    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. Simplified100.0%

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

    if -1.9000000000000001e77 < z < 1e19

    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.f6499.2

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

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

    if 1e19 < 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--.f6488.9

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

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

        \[\leadsto \color{blue}{\frac{e^{x}}{e^{z}}} \]
      2. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{e^{z}}{e^{x}}}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\frac{e^{z}}{e^{x}}}} \]
      4. div-expN/A

        \[\leadsto \frac{1}{\color{blue}{e^{z - x}}} \]
      5. unpow1N/A

        \[\leadsto \frac{1}{e^{\color{blue}{{z}^{1}} - x}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{1}{e^{{z}^{\color{blue}{\left(3 - 2\right)}} - x}} \]
      7. pow-divN/A

        \[\leadsto \frac{1}{e^{\color{blue}{\frac{{z}^{3}}{{z}^{2}}} - x}} \]
      8. sqr-powN/A

        \[\leadsto \frac{1}{e^{\frac{\color{blue}{{z}^{\left(\frac{3}{2}\right)} \cdot {z}^{\left(\frac{3}{2}\right)}}}{{z}^{2}} - x}} \]
      9. pow-prod-downN/A

        \[\leadsto \frac{1}{e^{\frac{\color{blue}{{\left(z \cdot z\right)}^{\left(\frac{3}{2}\right)}}}{{z}^{2}} - x}} \]
      10. sqr-negN/A

        \[\leadsto \frac{1}{e^{\frac{{\color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot \left(\mathsf{neg}\left(z\right)\right)\right)}}^{\left(\frac{3}{2}\right)}}{{z}^{2}} - x}} \]
      11. lift-neg.f64N/A

        \[\leadsto \frac{1}{e^{\frac{{\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \left(\mathsf{neg}\left(z\right)\right)\right)}^{\left(\frac{3}{2}\right)}}{{z}^{2}} - x}} \]
      12. lift-neg.f64N/A

        \[\leadsto \frac{1}{e^{\frac{{\left(\left(\mathsf{neg}\left(z\right)\right) \cdot \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)}^{\left(\frac{3}{2}\right)}}{{z}^{2}} - x}} \]
      13. unpow-prod-downN/A

        \[\leadsto \frac{1}{e^{\frac{\color{blue}{{\left(\mathsf{neg}\left(z\right)\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\mathsf{neg}\left(z\right)\right)}^{\left(\frac{3}{2}\right)}}}{{z}^{2}} - x}} \]
      14. sqr-powN/A

        \[\leadsto \frac{1}{e^{\frac{\color{blue}{{\left(\mathsf{neg}\left(z\right)\right)}^{3}}}{{z}^{2}} - x}} \]
      15. pow2N/A

        \[\leadsto \frac{1}{e^{\frac{{\left(\mathsf{neg}\left(z\right)\right)}^{3}}{\color{blue}{z \cdot z}} - x}} \]
      16. lift-neg.f64N/A

        \[\leadsto \frac{1}{e^{\frac{{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}}^{3}}{z \cdot z} - x}} \]
      17. cube-negN/A

        \[\leadsto \frac{1}{e^{\frac{\color{blue}{\mathsf{neg}\left({z}^{3}\right)}}{z \cdot z} - x}} \]
      18. neg-sub0N/A

        \[\leadsto \frac{1}{e^{\frac{\color{blue}{0 - {z}^{3}}}{z \cdot z} - x}} \]
      19. metadata-evalN/A

        \[\leadsto \frac{1}{e^{\frac{\color{blue}{{0}^{3}} - {z}^{3}}{z \cdot z} - x}} \]
      20. +-lft-identityN/A

        \[\leadsto \frac{1}{e^{\frac{{0}^{3} - {z}^{3}}{z \cdot \color{blue}{\left(0 + z\right)}} - x}} \]
      21. +-commutativeN/A

        \[\leadsto \frac{1}{e^{\frac{{0}^{3} - {z}^{3}}{z \cdot \color{blue}{\left(z + 0\right)}} - x}} \]
      22. distribute-rgt-outN/A

        \[\leadsto \frac{1}{e^{\frac{{0}^{3} - {z}^{3}}{\color{blue}{z \cdot z + 0 \cdot z}} - x}} \]
      23. +-lft-identityN/A

        \[\leadsto \frac{1}{e^{\frac{{0}^{3} - {z}^{3}}{\color{blue}{0 + \left(z \cdot z + 0 \cdot z\right)}} - x}} \]
      24. metadata-evalN/A

        \[\leadsto \frac{1}{e^{\frac{{0}^{3} - {z}^{3}}{\color{blue}{0 \cdot 0} + \left(z \cdot z + 0 \cdot z\right)} - x}} \]
      25. flip3--N/A

        \[\leadsto \frac{1}{e^{\color{blue}{\left(0 - z\right)} - x}} \]
      26. neg-sub0N/A

        \[\leadsto \frac{1}{e^{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} - x}} \]
      27. lift-neg.f64N/A

        \[\leadsto \frac{1}{e^{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} - x}} \]
    7. Applied egg-rr88.9%

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

Alternative 10: 53.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\left(x + y \cdot \log y\right) - z \leq 2 \cdot 10^{+34}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\

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


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

    1. Initial program 99.9%

      \[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.f6462.2

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

      \[\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.f6425.3

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

      \[\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. flip-+N/A

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{1}{2}, -1\right), 1\right)}}} \]
      8. lower-/.f6425.3

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)}}} \]
    10. Applied egg-rr25.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot \frac{-1}{4}}, \frac{1}{2}\right), 1\right), 1\right)} \]
      11. lower-*.f6461.0

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified61.0%

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

    if 1.99999999999999989e34 < (-.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.f6437.1

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified37.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.f6433.5

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

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

        \[\leadsto \mathsf{fma}\left(z, \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}}, 1\right) \]
      2. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \frac{\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right)}{\color{blue}{\frac{{\left(z \cdot \frac{1}{2}\right)}^{3} - {-1}^{3}}{\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) + \left(-1 \cdot -1 + \left(z \cdot \frac{1}{2}\right) \cdot -1\right)}}} + \left(\mathsf{neg}\left(\frac{1}{z \cdot \frac{1}{2} - -1}\right)\right), 1\right) \]
      6. associate-/r/N/A

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(\frac{\left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right)}{{\left(z \cdot \frac{1}{2}\right)}^{3} - {-1}^{3}}, \left(z \cdot \frac{1}{2}\right) \cdot \left(z \cdot \frac{1}{2}\right) + \left(-1 \cdot -1 + \left(z \cdot \frac{1}{2}\right) \cdot -1\right), \mathsf{neg}\left(\frac{1}{z \cdot \frac{1}{2} - -1}\right)\right)}, 1\right) \]
    10. Applied egg-rr2.2%

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

      \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(\color{blue}{\frac{2 - 16 \cdot \frac{1}{{z}^{3}}}{z}}, \mathsf{fma}\left(z, z \cdot \frac{1}{4}, \mathsf{fma}\left(z, \frac{-1}{2}, 1\right)\right), \mathsf{neg}\left(\frac{1}{\mathsf{fma}\left(z, \frac{1}{2}, 1\right)}\right)\right), 1\right) \]
    12. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(\frac{2 + \frac{-16}{z \cdot \color{blue}{\left(z \cdot z\right)}}}{z}, \mathsf{fma}\left(z, z \cdot \frac{1}{4}, \mathsf{fma}\left(z, \frac{-1}{2}, 1\right)\right), \mathsf{neg}\left(\frac{1}{\mathsf{fma}\left(z, \frac{1}{2}, 1\right)}\right)\right), 1\right) \]
      13. lower-*.f6450.9

        \[\leadsto \mathsf{fma}\left(z, \mathsf{fma}\left(\frac{2 + \frac{-16}{z \cdot \color{blue}{\left(z \cdot z\right)}}}{z}, \mathsf{fma}\left(z, z \cdot 0.25, \mathsf{fma}\left(z, -0.5, 1\right)\right), -\frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}\right), 1\right) \]
    13. Simplified50.9%

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

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

Alternative 11: 48.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\left(x + y \cdot \log y\right) - z \leq -2 \cdot 10^{+34}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\

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


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

    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.f6460.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified60.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.f642.2

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

      \[\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. flip-+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified58.6%

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

    if -1.99999999999999989e34 < (-.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.f6443.7

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified43.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.f6440.9

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot z, 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 33.0% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x + y \cdot \log y \leq -200:\\
\;\;\;\;z \cdot \left(z \cdot 0.5\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 (+.f64 x (*.f64 y (log.f64 y))) < -200

    1. Initial program 99.9%

      \[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.f6434.6

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

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

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

      \[\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. unpow2N/A

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(z \cdot 0.5\right)} \]
    11. Simplified36.5%

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

    if -200 < (+.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 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.f6452.1

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified52.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.f6434.2

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

      \[\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. *-commutativeN/A

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

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

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

Alternative 13: 70.6% accurate, 1.8× speedup?

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

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

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

\mathbf{elif}\;z \leq 6.5 \cdot 10^{+107}:\\
\;\;\;\;e^{x}\\

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


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

    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.f6489.6

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

      \[\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.f6489.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified89.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. unpow2N/A

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

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

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

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

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

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

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

    if -1.8999999999999999e154 < z < -1.14999999999999997e77

    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.f6490.2

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified5.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 \mathsf{fma}\left(z, \color{blue}{\frac{1}{2} \cdot z}, 1\right) \]
    10. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{{\left(z \cdot \left(z \cdot \frac{1}{2}\right)\right)}^{2}} + \left(\mathsf{neg}\left(1\right)\right)}{z \cdot \left(z \cdot \frac{1}{2}\right) - 1} \]
      7. lift-*.f64N/A

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

        \[\leadsto \frac{{\color{blue}{\left(\left(z \cdot z\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\mathsf{neg}\left(1\right)\right)}{z \cdot \left(z \cdot \frac{1}{2}\right) - 1} \]
      9. lift-*.f64N/A

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

        \[\leadsto \frac{{\color{blue}{\left(\frac{1}{2} \cdot \left(z \cdot z\right)\right)}}^{2} + \left(\mathsf{neg}\left(1\right)\right)}{z \cdot \left(z \cdot \frac{1}{2}\right) - 1} \]
      11. unpow-prod-downN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(0.25, \left(z \cdot z\right) \cdot \left(z \cdot z\right), -1\right)}{\color{blue}{\mathsf{fma}\left(z, z \cdot 0.5, -1\right)}} \]
    13. Applied egg-rr90.2%

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

    if -1.14999999999999997e77 < z < 6.5000000000000006e107

    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--.f6462.0

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Simplified62.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.f6457.1

        \[\leadsto \color{blue}{e^{x}} \]
    8. Simplified57.1%

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

    if 6.5000000000000006e107 < 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.f6476.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified76.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.f6421.1

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

      \[\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. flip-+N/A

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{1}{2}, -1\right), 1\right)}}} \]
      8. lower-/.f6421.1

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)}}} \]
    10. Applied egg-rr21.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified76.5%

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 14: 90.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{+66}:\\ \;\;\;\;e^{x - z}\\ \mathbf{else}:\\ \;\;\;\;{y}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 1.7e+66) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 1.7e+66) {
		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 <= 1.7d+66) 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 <= 1.7e+66) {
		tmp = Math.exp((x - z));
	} else {
		tmp = Math.pow(y, y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 1.7e+66:
		tmp = math.exp((x - z))
	else:
		tmp = math.pow(y, y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 1.7e+66)
		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 <= 1.7e+66)
		tmp = exp((x - z));
	else
		tmp = y ^ y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 1.7e+66], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}

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

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


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

    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.9

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

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

    if 1.70000000000000015e66 < 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.f6485.8

        \[\leadsto e^{y \cdot \color{blue}{\log y}} \]
    5. Simplified85.8%

      \[\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. pow-to-expN/A

        \[\leadsto \color{blue}{{y}^{y}} \]
      5. lift-pow.f6485.8

        \[\leadsto \color{blue}{{y}^{y}} \]
    7. Applied egg-rr85.8%

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

Alternative 15: 51.4% accurate, 4.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+88}:\\ \;\;\;\;\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 3.15 \cdot 10^{+106}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -3.1e+88)
   (fma z (fma z (fma z -0.16666666666666666 0.5) -1.0) 1.0)
   (if (<= z 3.15e+106)
     (fma x (fma x 0.5 1.0) 1.0)
     (/ 1.0 (fma z (fma z (fma z (* z -0.25) 0.5) 1.0) 1.0)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -3.1e+88) {
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	} else if (z <= 3.15e+106) {
		tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
	} else {
		tmp = 1.0 / fma(z, fma(z, fma(z, (z * -0.25), 0.5), 1.0), 1.0);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -3.1e+88)
		tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
	elseif (z <= 3.15e+106)
		tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
	else
		tmp = Float64(1.0 / fma(z, fma(z, fma(z, Float64(z * -0.25), 0.5), 1.0), 1.0));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -3.1e+88], N[(z * N[(z * N[(z * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[z, 3.15e+106], N[(x * N[(x * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(1.0 / N[(z * N[(z * N[(z * N[(z * -0.25), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+88}:\\
\;\;\;\;\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 3.15 \cdot 10^{+106}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\

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


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

    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.f6489.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified89.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.f6481.7

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

      \[\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 -3.1000000000000001e88 < z < 3.14999999999999987e106

    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--.f6461.6

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Simplified61.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.f6456.8

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

      \[\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 \color{blue}{x \cdot \left(1 + \frac{1}{2} \cdot x\right) + 1} \]
      2. lower-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.5, 1\right)}, 1\right) \]
    11. Simplified32.4%

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

    if 3.14999999999999987e106 < 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.f6476.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified76.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.f6421.1

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

      \[\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. flip-+N/A

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{1}{2}, -1\right), 1\right)}}} \]
      8. lower-/.f6421.1

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)}}} \]
    10. Applied egg-rr21.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, \color{blue}{z \cdot -0.25}, 0.5\right), 1\right), 1\right)} \]
    13. Simplified76.5%

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, z \cdot -0.25, 0.5\right), 1\right), 1\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 49.6% accurate, 5.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+88}:\\
\;\;\;\;\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 5 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\

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


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

    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.f6489.5

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified89.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.f6481.7

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

      \[\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 -3.1000000000000001e88 < z < 5.00000000000000004e154

    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--.f6462.5

        \[\leadsto e^{\color{blue}{x - z}} \]
    5. Simplified62.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.f6455.1

        \[\leadsto \color{blue}{e^{x}} \]
    8. Simplified55.1%

      \[\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 \color{blue}{x \cdot \left(1 + \frac{1}{2} \cdot x\right) + 1} \]
      2. lower-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.5, 1\right)}, 1\right) \]
    11. Simplified31.4%

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

    if 5.00000000000000004e154 < 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.f6478.7

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified78.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.f6422.8

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

      \[\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. flip-+N/A

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \frac{1}{2}, -1\right), 1\right)}}} \]
      8. lower-/.f6422.8

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

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

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

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(0.5, z, 1\right)}, 1\right)} \]
    13. Simplified78.7%

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(0.5, z, 1\right), 1\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 46.2% accurate, 6.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -185:\\
\;\;\;\;z \cdot \left(z \cdot 0.5\right)\\

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

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


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

    1. Initial program 99.9%

      \[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.f6433.8

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified33.8%

      \[\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.f6414.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified14.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. unpow2N/A

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

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

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

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

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

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

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

    if -185 < x < 9.00000000000000042e102

    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.f6459.9

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

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

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

      \[\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.00000000000000042e102 < 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--.f6497.4

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

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

        \[\leadsto \color{blue}{e^{x}} \]
    8. Simplified87.0%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)}, 1\right), 1\right) \]
    11. Simplified87.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)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 18: 45.0% accurate, 6.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -210:\\
\;\;\;\;z \cdot \left(z \cdot 0.5\right)\\

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

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


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

    1. Initial program 99.9%

      \[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.f6433.8

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified33.8%

      \[\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.f6414.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified14.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. unpow2N/A

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

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

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

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

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

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

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

    if -210 < x < 9.4999999999999992e102

    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.f6459.9

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified59.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.f6436.6

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

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

    if 9.4999999999999992e102 < 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--.f6497.4

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

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

        \[\leadsto \color{blue}{e^{x}} \]
    8. Simplified87.0%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.16666666666666666, 0.5\right)}, 1\right), 1\right) \]
    11. Simplified87.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)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 42.0% accurate, 8.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -210:\\ \;\;\;\;z \cdot \left(z \cdot 0.5\right)\\ \mathbf{elif}\;x \leq 1.95 \cdot 10^{+142}:\\ \;\;\;\;\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 -210.0)
   (* z (* z 0.5))
   (if (<= x 1.95e+142)
     (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 <= -210.0) {
		tmp = z * (z * 0.5);
	} else if (x <= 1.95e+142) {
		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 <= -210.0)
		tmp = Float64(z * Float64(z * 0.5));
	elseif (x <= 1.95e+142)
		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, -210.0], N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+142], 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 -210:\\
\;\;\;\;z \cdot \left(z \cdot 0.5\right)\\

\mathbf{elif}\;x \leq 1.95 \cdot 10^{+142}:\\
\;\;\;\;\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 < -210

    1. Initial program 99.9%

      \[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.f6433.8

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified33.8%

      \[\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.f6414.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified14.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. unpow2N/A

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

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

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

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

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

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

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

    if -210 < x < 1.95e142

    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.f6459.0

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified59.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.f6435.9

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

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

    if 1.95e142 < 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. Simplified100.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.f6490.8

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

      \[\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 \color{blue}{x \cdot \left(1 + \frac{1}{2} \cdot x\right) + 1} \]
      2. lower-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.5, 1\right)}, 1\right) \]
    11. Simplified85.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 20: 41.8% accurate, 8.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -210:\\ \;\;\;\;z \cdot \left(z \cdot 0.5\right)\\ \mathbf{elif}\;x \leq 1.95 \cdot 10^{+142}:\\ \;\;\;\;\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 -210.0)
   (* z (* z 0.5))
   (if (<= x 1.95e+142) (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 <= -210.0) {
		tmp = z * (z * 0.5);
	} else if (x <= 1.95e+142) {
		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 <= -210.0)
		tmp = Float64(z * Float64(z * 0.5));
	elseif (x <= 1.95e+142)
		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, -210.0], N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+142], 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 -210:\\
\;\;\;\;z \cdot \left(z \cdot 0.5\right)\\

\mathbf{elif}\;x \leq 1.95 \cdot 10^{+142}:\\
\;\;\;\;\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 < -210

    1. Initial program 99.9%

      \[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.f6433.8

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified33.8%

      \[\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.f6414.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, 0.5, -1\right)}, 1\right) \]
    8. Simplified14.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. unpow2N/A

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

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

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

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

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

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

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

    if -210 < x < 1.95e142

    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.f6459.0

        \[\leadsto e^{\color{blue}{-z}} \]
    5. Simplified59.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.f6435.9

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

      \[\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. *-commutativeN/A

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

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

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

    if 1.95e142 < 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. Simplified100.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.f6490.8

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

      \[\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 \color{blue}{x \cdot \left(1 + \frac{1}{2} \cdot x\right) + 1} \]
      2. lower-fma.f64N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(x, 0.5, 1\right)}, 1\right) \]
    11. Simplified85.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 21: 15.0% accurate, 53.0× speedup?

\[\begin{array}{l} \\ 1 - z \end{array} \]
(FPCore (x y z) :precision binary64 (- 1.0 z))
double code(double x, double y, double z) {
	return 1.0 - z;
}
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 - z
end function
public static double code(double x, double y, double z) {
	return 1.0 - z;
}
def code(x, y, z):
	return 1.0 - z
function code(x, y, z)
	return Float64(1.0 - z)
end
function tmp = code(x, y, z)
	tmp = 1.0 - z;
end
code[x_, y_, z_] := N[(1.0 - z), $MachinePrecision]
\begin{array}{l}

\\
1 - z
\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.f6448.6

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

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

    \[\leadsto \color{blue}{1 + -1 \cdot z} \]
  7. Step-by-step derivation
    1. neg-mul-1N/A

      \[\leadsto 1 + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
    2. unsub-negN/A

      \[\leadsto \color{blue}{1 - z} \]
    3. lower--.f6413.7

      \[\leadsto \color{blue}{1 - z} \]
  8. Simplified13.7%

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

Alternative 22: 14.7% 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.f6448.6

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

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

    \[\leadsto \color{blue}{1} \]
  7. Step-by-step derivation
    1. Simplified13.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 2024208 
    (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)))