Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A

Percentage Accurate: 99.9% → 99.9%
Time: 10.2s
Alternatives: 13
Speedup: 1.0×

Specification

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

\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\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 13 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: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (log y) x (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
	return fma(log(y), x, ((log(t) - z) - y));
}
function code(x, y, z, t)
	return fma(log(y), x, Float64(Float64(log(t) - z) - y))
end
code[x_, y_, z_, t_] := N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right)
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. lift--.f64N/A

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right)} - \left(z - \log t\right) \]
    5. sub-negN/A

      \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(y\right)\right)\right)} - \left(z - \log t\right) \]
    6. associate--l+N/A

      \[\leadsto \color{blue}{x \cdot \log y + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \color{blue}{x \cdot \log y} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \color{blue}{\log y \cdot x} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
    9. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
    10. lower--.f64N/A

      \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)}\right) \]
    11. lower-neg.f64N/A

      \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - \left(z - \log t\right)\right) \]
    12. lower--.f6499.8

      \[\leadsto \mathsf{fma}\left(\log y, x, \left(-y\right) - \color{blue}{\left(z - \log t\right)}\right) \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(-y\right) - \left(z - \log t\right)\right)} \]
  5. Final simplification99.8%

    \[\leadsto \mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right) \]
  6. Add Preprocessing

Alternative 2: 69.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(t\_1 - y\right) - z\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+14}:\\
\;\;\;\;\frac{1}{\frac{1}{\left(-z\right) - y}}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\left(-y\right) + \log t\\

\mathbf{elif}\;t\_2 \leq 10^{+169}:\\
\;\;\;\;-z\\

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


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

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
      2. flip3-+N/A

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
      5. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
      6. flip3-+N/A

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
    5. Taylor expanded in z around inf

      \[\leadsto \frac{1}{\frac{1}{\color{blue}{-1 \cdot z} - y}} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} - y}} \]
      2. lower-neg.f6476.4

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
    7. Applied rewrites76.4%

      \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]

    if -5e14 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 5.00000000000000024e-5

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-1 \cdot y} + \log t \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} + \log t \]
      2. lower-neg.f6494.9

        \[\leadsto \color{blue}{\left(-y\right)} + \log t \]
    5. Applied rewrites94.9%

      \[\leadsto \color{blue}{\left(-y\right)} + \log t \]

    if 5.00000000000000024e-5 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 9.99999999999999934e168

    1. Initial program 99.7%

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

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

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

        \[\leadsto \color{blue}{-z} \]
    5. Applied rewrites61.4%

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

    if 9.99999999999999934e168 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z)

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\log y \cdot x} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\log y \cdot x} \]
      3. lower-log.f6469.2

        \[\leadsto \color{blue}{\log y} \cdot x \]
    5. Applied rewrites69.2%

      \[\leadsto \color{blue}{\log y \cdot x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification76.4%

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

Alternative 3: 92.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\ \mathbf{elif}\;t\_1 \leq -4000000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{\log y}{z}, x, \frac{-y}{z} - 1\right) \cdot z\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-8}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x (log y)) y)))
   (if (<= t_1 -4e+156)
     (fma (log y) x (- y))
     (if (<= t_1 -4000000000000.0)
       (* (fma (/ (log y) z) x (- (/ (- y) z) 1.0)) z)
       (if (<= t_1 5e-8) (- (- (log t) y) z) (fma (log y) x (- z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * log(y)) - y;
	double tmp;
	if (t_1 <= -4e+156) {
		tmp = fma(log(y), x, -y);
	} else if (t_1 <= -4000000000000.0) {
		tmp = fma((log(y) / z), x, ((-y / z) - 1.0)) * z;
	} else if (t_1 <= 5e-8) {
		tmp = (log(t) - y) - z;
	} else {
		tmp = fma(log(y), x, -z);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(x * log(y)) - y)
	tmp = 0.0
	if (t_1 <= -4e+156)
		tmp = fma(log(y), x, Float64(-y));
	elseif (t_1 <= -4000000000000.0)
		tmp = Float64(fma(Float64(log(y) / z), x, Float64(Float64(Float64(-y) / z) - 1.0)) * z);
	elseif (t_1 <= 5e-8)
		tmp = Float64(Float64(log(t) - y) - z);
	else
		tmp = fma(log(y), x, Float64(-z));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+156], N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision], If[LessEqual[t$95$1, -4000000000000.0], N[(N[(N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision] * x + N[(N[((-y) / z), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 5e-8], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-z)), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+156}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\

\mathbf{elif}\;t\_1 \leq -4000000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{\log y}{z}, x, \frac{-y}{z} - 1\right) \cdot z\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\left(\log t - y\right) - z\\

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


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

    1. Initial program 99.8%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
      4. lift--.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right)} - \left(z - \log t\right) \]
      5. sub-negN/A

        \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(y\right)\right)\right)} - \left(z - \log t\right) \]
      6. associate--l+N/A

        \[\leadsto \color{blue}{x \cdot \log y + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \log y} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \color{blue}{\log y \cdot x} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
      10. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)}\right) \]
      11. lower-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - \left(z - \log t\right)\right) \]
      12. lower--.f6499.8

        \[\leadsto \mathsf{fma}\left(\log y, x, \left(-y\right) - \color{blue}{\left(z - \log t\right)}\right) \]
    4. Applied rewrites99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(-y\right) - \left(z - \log t\right)\right)} \]
    5. Taylor expanded in y around inf

      \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-1 \cdot y}\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{neg}\left(y\right)}\right) \]
      2. lower-neg.f6491.4

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-y}\right) \]
    7. Applied rewrites91.4%

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

    if -3.9999999999999999e156 < (-.f64 (*.f64 x (log.f64 y)) y) < -4e12

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
      2. flip3-+N/A

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
      5. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
      6. flip3-+N/A

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
    5. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right) \cdot z} \]
    7. Applied rewrites94.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\log y}{z}, x, \frac{\log t - y}{z} - 1\right) \cdot z} \]
    8. Taylor expanded in y around inf

      \[\leadsto \mathsf{fma}\left(\frac{\log y}{z}, x, -1 \cdot \frac{y}{z} - 1\right) \cdot z \]
    9. Step-by-step derivation
      1. Applied rewrites93.9%

        \[\leadsto \mathsf{fma}\left(\frac{\log y}{z}, x, \frac{-y}{z} - 1\right) \cdot z \]

      if -4e12 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999998e-8

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
      4. Step-by-step derivation
        1. associate--r+N/A

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
        2. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
        3. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
        4. lower-log.f6498.4

          \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
      5. Applied rewrites98.4%

        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]

      if 4.9999999999999998e-8 < (-.f64 (*.f64 x (log.f64 y)) y)

      1. Initial program 99.6%

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

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

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

          \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
        4. lift--.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot \log y - y\right)} - \left(z - \log t\right) \]
        5. sub-negN/A

          \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(y\right)\right)\right)} - \left(z - \log t\right) \]
        6. associate--l+N/A

          \[\leadsto \color{blue}{x \cdot \log y + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
        7. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \log y} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \color{blue}{\log y \cdot x} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
        9. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
        10. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)}\right) \]
        11. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - \left(z - \log t\right)\right) \]
        12. lower--.f6499.6

          \[\leadsto \mathsf{fma}\left(\log y, x, \left(-y\right) - \color{blue}{\left(z - \log t\right)}\right) \]
      4. Applied rewrites99.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(-y\right) - \left(z - \log t\right)\right)} \]
      5. Taylor expanded in z around inf

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-1 \cdot z}\right) \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{neg}\left(z\right)}\right) \]
        2. lower-neg.f6497.5

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-z}\right) \]
      7. Applied rewrites97.5%

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-z}\right) \]
    10. Recombined 4 regimes into one program.
    11. Add Preprocessing

    Alternative 4: 90.6% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+168}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-8}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (- (* x (log y)) y)))
       (if (<= t_1 -2e+168)
         (fma (log y) x (- y))
         (if (<= t_1 5e-8) (- (- (log t) y) z) (fma (log y) x (- z))))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (x * log(y)) - y;
    	double tmp;
    	if (t_1 <= -2e+168) {
    		tmp = fma(log(y), x, -y);
    	} else if (t_1 <= 5e-8) {
    		tmp = (log(t) - y) - z;
    	} else {
    		tmp = fma(log(y), x, -z);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(x * log(y)) - y)
    	tmp = 0.0
    	if (t_1 <= -2e+168)
    		tmp = fma(log(y), x, Float64(-y));
    	elseif (t_1 <= 5e-8)
    		tmp = Float64(Float64(log(t) - y) - z);
    	else
    		tmp = fma(log(y), x, Float64(-z));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+168], N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision], If[LessEqual[t$95$1, 5e-8], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-z)), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \log y - y\\
    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+168}:\\
    \;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-8}:\\
    \;\;\;\;\left(\log t - y\right) - z\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (*.f64 x (log.f64 y)) y) < -1.9999999999999999e168

      1. Initial program 99.8%

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

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

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

          \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
        4. lift--.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot \log y - y\right)} - \left(z - \log t\right) \]
        5. sub-negN/A

          \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(y\right)\right)\right)} - \left(z - \log t\right) \]
        6. associate--l+N/A

          \[\leadsto \color{blue}{x \cdot \log y + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
        7. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \log y} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \color{blue}{\log y \cdot x} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
        9. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
        10. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)}\right) \]
        11. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - \left(z - \log t\right)\right) \]
        12. lower--.f6499.8

          \[\leadsto \mathsf{fma}\left(\log y, x, \left(-y\right) - \color{blue}{\left(z - \log t\right)}\right) \]
      4. Applied rewrites99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(-y\right) - \left(z - \log t\right)\right)} \]
      5. Taylor expanded in y around inf

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-1 \cdot y}\right) \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{neg}\left(y\right)}\right) \]
        2. lower-neg.f6493.3

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-y}\right) \]
      7. Applied rewrites93.3%

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

      if -1.9999999999999999e168 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999998e-8

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
      4. Step-by-step derivation
        1. associate--r+N/A

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
        2. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
        3. lower--.f64N/A

          \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
        4. lower-log.f6491.3

          \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
      5. Applied rewrites91.3%

        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]

      if 4.9999999999999998e-8 < (-.f64 (*.f64 x (log.f64 y)) y)

      1. Initial program 99.6%

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

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

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

          \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
        4. lift--.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot \log y - y\right)} - \left(z - \log t\right) \]
        5. sub-negN/A

          \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(y\right)\right)\right)} - \left(z - \log t\right) \]
        6. associate--l+N/A

          \[\leadsto \color{blue}{x \cdot \log y + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
        7. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \log y} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \color{blue}{\log y \cdot x} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
        9. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
        10. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)}\right) \]
        11. lower-neg.f64N/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - \left(z - \log t\right)\right) \]
        12. lower--.f6499.6

          \[\leadsto \mathsf{fma}\left(\log y, x, \left(-y\right) - \color{blue}{\left(z - \log t\right)}\right) \]
      4. Applied rewrites99.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(-y\right) - \left(z - \log t\right)\right)} \]
      5. Taylor expanded in z around inf

        \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-1 \cdot z}\right) \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{neg}\left(z\right)}\right) \]
        2. lower-neg.f6497.5

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-z}\right) \]
      7. Applied rewrites97.5%

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

    Alternative 5: 81.0% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t\_1 - y\\ \mathbf{if}\;t\_2 \leq -50000000:\\ \;\;\;\;\frac{1}{\frac{1}{\left(-z\right) - y}}\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+42}:\\ \;\;\;\;\left(-z\right) + \log t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
       (if (<= t_2 -50000000.0)
         (/ 1.0 (/ 1.0 (- (- z) y)))
         (if (<= t_2 2e+42) (+ (- z) (log t)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * log(y);
    	double t_2 = t_1 - y;
    	double tmp;
    	if (t_2 <= -50000000.0) {
    		tmp = 1.0 / (1.0 / (-z - y));
    	} else if (t_2 <= 2e+42) {
    		tmp = -z + log(t);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: t_2
        real(8) :: tmp
        t_1 = x * log(y)
        t_2 = t_1 - y
        if (t_2 <= (-50000000.0d0)) then
            tmp = 1.0d0 / (1.0d0 / (-z - y))
        else if (t_2 <= 2d+42) then
            tmp = -z + log(t)
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = x * Math.log(y);
    	double t_2 = t_1 - y;
    	double tmp;
    	if (t_2 <= -50000000.0) {
    		tmp = 1.0 / (1.0 / (-z - y));
    	} else if (t_2 <= 2e+42) {
    		tmp = -z + Math.log(t);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = x * math.log(y)
    	t_2 = t_1 - y
    	tmp = 0
    	if t_2 <= -50000000.0:
    		tmp = 1.0 / (1.0 / (-z - y))
    	elif t_2 <= 2e+42:
    		tmp = -z + math.log(t)
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(x * log(y))
    	t_2 = Float64(t_1 - y)
    	tmp = 0.0
    	if (t_2 <= -50000000.0)
    		tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(-z) - y)));
    	elseif (t_2 <= 2e+42)
    		tmp = Float64(Float64(-z) + log(t));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = x * log(y);
    	t_2 = t_1 - y;
    	tmp = 0.0;
    	if (t_2 <= -50000000.0)
    		tmp = 1.0 / (1.0 / (-z - y));
    	elseif (t_2 <= 2e+42)
    		tmp = -z + log(t);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -50000000.0], N[(1.0 / N[(1.0 / N[((-z) - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+42], N[((-z) + N[Log[t], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \log y\\
    t_2 := t\_1 - y\\
    \mathbf{if}\;t\_2 \leq -50000000:\\
    \;\;\;\;\frac{1}{\frac{1}{\left(-z\right) - y}}\\
    
    \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+42}:\\
    \;\;\;\;\left(-z\right) + \log t\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5e7

      1. Initial program 99.9%

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

          \[\leadsto \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
        2. flip3-+N/A

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

          \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
        5. clear-numN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
        6. flip3-+N/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}} \]
      4. Applied rewrites99.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
      5. Taylor expanded in z around inf

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{-1 \cdot z} - y}} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} - y}} \]
        2. lower-neg.f6476.0

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
      7. Applied rewrites76.0%

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]

      if -5e7 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.00000000000000009e42

      1. Initial program 99.9%

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} + \log t \]
        2. lower-neg.f6494.4

          \[\leadsto \color{blue}{\left(-z\right)} + \log t \]
      5. Applied rewrites94.4%

        \[\leadsto \color{blue}{\left(-z\right)} + \log t \]

      if 2.00000000000000009e42 < (-.f64 (*.f64 x (log.f64 y)) y)

      1. Initial program 99.6%

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

        \[\leadsto \color{blue}{x \cdot \log y} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\log y \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\log y \cdot x} \]
        3. lower-log.f6483.5

          \[\leadsto \color{blue}{\log y} \cdot x \]
      5. Applied rewrites83.5%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification82.5%

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

    Alternative 6: 99.3% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{\log y}{z}, x, \frac{-y}{z} - 1\right) \cdot z\\ \mathbf{if}\;z \leq -1400:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 520:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* (fma (/ (log y) z) x (- (/ (- y) z) 1.0)) z)))
       (if (<= z -1400.0)
         t_1
         (if (<= z 520.0) (- (fma (log y) x (log t)) y) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = fma((log(y) / z), x, ((-y / z) - 1.0)) * z;
    	double tmp;
    	if (z <= -1400.0) {
    		tmp = t_1;
    	} else if (z <= 520.0) {
    		tmp = fma(log(y), x, log(t)) - y;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(fma(Float64(log(y) / z), x, Float64(Float64(Float64(-y) / z) - 1.0)) * z)
    	tmp = 0.0
    	if (z <= -1400.0)
    		tmp = t_1;
    	elseif (z <= 520.0)
    		tmp = Float64(fma(log(y), x, log(t)) - y);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision] * x + N[(N[((-y) / z), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1400.0], t$95$1, If[LessEqual[z, 520.0], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(\frac{\log y}{z}, x, \frac{-y}{z} - 1\right) \cdot z\\
    \mathbf{if}\;z \leq -1400:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 520:\\
    \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1400 or 520 < z

      1. Initial program 99.8%

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

          \[\leadsto \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
        2. flip3-+N/A

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

          \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
        5. clear-numN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
        6. flip3-+N/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}} \]
      4. Applied rewrites99.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
      5. Taylor expanded in z around inf

        \[\leadsto \color{blue}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \color{blue}{\left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right) \cdot z} \]
      7. Applied rewrites99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\log y}{z}, x, \frac{\log t - y}{z} - 1\right) \cdot z} \]
      8. Taylor expanded in y around inf

        \[\leadsto \mathsf{fma}\left(\frac{\log y}{z}, x, -1 \cdot \frac{y}{z} - 1\right) \cdot z \]
      9. Step-by-step derivation
        1. Applied rewrites98.9%

          \[\leadsto \mathsf{fma}\left(\frac{\log y}{z}, x, \frac{-y}{z} - 1\right) \cdot z \]

        if -1400 < z < 520

        1. Initial program 99.8%

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

          \[\leadsto \color{blue}{\left(\log t + x \cdot \log y\right) - y} \]
        4. Step-by-step derivation
          1. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log t + x \cdot \log y\right) - y} \]
          2. +-commutativeN/A

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

            \[\leadsto \left(\color{blue}{\log y \cdot x} + \log t\right) - y \]
          4. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - y \]
          5. lower-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - y \]
          6. lower-log.f6499.0

            \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - y \]
        5. Applied rewrites99.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - y} \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 7: 99.9% accurate, 1.0× speedup?

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

        \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
      2. Add Preprocessing
      3. Add Preprocessing

      Alternative 8: 90.4% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\log y, x, -y\right)\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{+36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+62}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (fma (log y) x (- y))))
         (if (<= x -1.1e+36) t_1 (if (<= x 1.65e+62) (- (- (log t) y) z) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fma(log(y), x, -y);
      	double tmp;
      	if (x <= -1.1e+36) {
      		tmp = t_1;
      	} else if (x <= 1.65e+62) {
      		tmp = (log(t) - y) - z;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = fma(log(y), x, Float64(-y))
      	tmp = 0.0
      	if (x <= -1.1e+36)
      		tmp = t_1;
      	elseif (x <= 1.65e+62)
      		tmp = Float64(Float64(log(t) - y) - z);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision]}, If[LessEqual[x, -1.1e+36], t$95$1, If[LessEqual[x, 1.65e+62], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(\log y, x, -y\right)\\
      \mathbf{if}\;x \leq -1.1 \cdot 10^{+36}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 1.65 \cdot 10^{+62}:\\
      \;\;\;\;\left(\log t - y\right) - z\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -1.1e36 or 1.65e62 < x

        1. Initial program 99.7%

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

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

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

            \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
          4. lift--.f64N/A

            \[\leadsto \color{blue}{\left(x \cdot \log y - y\right)} - \left(z - \log t\right) \]
          5. sub-negN/A

            \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\mathsf{neg}\left(y\right)\right)\right)} - \left(z - \log t\right) \]
          6. associate--l+N/A

            \[\leadsto \color{blue}{x \cdot \log y + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
          7. lift-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \log y} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto \color{blue}{\log y \cdot x} + \left(\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right) \]
          9. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)\right)} \]
          10. lower--.f64N/A

            \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right) - \left(z - \log t\right)}\right) \]
          11. lower-neg.f64N/A

            \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - \left(z - \log t\right)\right) \]
          12. lower--.f6499.7

            \[\leadsto \mathsf{fma}\left(\log y, x, \left(-y\right) - \color{blue}{\left(z - \log t\right)}\right) \]
        4. Applied rewrites99.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \left(-y\right) - \left(z - \log t\right)\right)} \]
        5. Taylor expanded in y around inf

          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-1 \cdot y}\right) \]
        6. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{neg}\left(y\right)}\right) \]
          2. lower-neg.f6485.3

            \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-y}\right) \]
        7. Applied rewrites85.3%

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

        if -1.1e36 < x < 1.65e62

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
        4. Step-by-step derivation
          1. associate--r+N/A

            \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
          2. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
          4. lower-log.f6497.4

            \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
        5. Applied rewrites97.4%

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 9: 84.3% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -6.5 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+162}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* x (log y))))
         (if (<= x -6.5e+166) t_1 (if (<= x 4.6e+162) (- (- (log t) y) z) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = x * log(y);
      	double tmp;
      	if (x <= -6.5e+166) {
      		tmp = t_1;
      	} else if (x <= 4.6e+162) {
      		tmp = (log(t) - y) - z;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = x * log(y)
          if (x <= (-6.5d+166)) then
              tmp = t_1
          else if (x <= 4.6d+162) then
              tmp = (log(t) - y) - z
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = x * Math.log(y);
      	double tmp;
      	if (x <= -6.5e+166) {
      		tmp = t_1;
      	} else if (x <= 4.6e+162) {
      		tmp = (Math.log(t) - y) - z;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = x * math.log(y)
      	tmp = 0
      	if x <= -6.5e+166:
      		tmp = t_1
      	elif x <= 4.6e+162:
      		tmp = (math.log(t) - y) - z
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(x * log(y))
      	tmp = 0.0
      	if (x <= -6.5e+166)
      		tmp = t_1;
      	elseif (x <= 4.6e+162)
      		tmp = Float64(Float64(log(t) - y) - z);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = x * log(y);
      	tmp = 0.0;
      	if (x <= -6.5e+166)
      		tmp = t_1;
      	elseif (x <= 4.6e+162)
      		tmp = (log(t) - y) - z;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+166], t$95$1, If[LessEqual[x, 4.6e+162], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot \log y\\
      \mathbf{if}\;x \leq -6.5 \cdot 10^{+166}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 4.6 \cdot 10^{+162}:\\
      \;\;\;\;\left(\log t - y\right) - z\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -6.5000000000000005e166 or 4.59999999999999987e162 < x

        1. Initial program 99.6%

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

          \[\leadsto \color{blue}{x \cdot \log y} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\log y \cdot x} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\log y \cdot x} \]
          3. lower-log.f6485.7

            \[\leadsto \color{blue}{\log y} \cdot x \]
        5. Applied rewrites85.7%

          \[\leadsto \color{blue}{\log y \cdot x} \]

        if -6.5000000000000005e166 < x < 4.59999999999999987e162

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
        4. Step-by-step derivation
          1. associate--r+N/A

            \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
          2. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
          4. lower-log.f6488.6

            \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
        5. Applied rewrites88.6%

          \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification87.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+166}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+162}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
      5. Add Preprocessing

      Alternative 10: 71.6% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -6.5 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+162}:\\ \;\;\;\;\frac{1}{\frac{1}{\left(-z\right) - y}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* x (log y))))
         (if (<= x -6.5e+166)
           t_1
           (if (<= x 4.6e+162) (/ 1.0 (/ 1.0 (- (- z) y))) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = x * log(y);
      	double tmp;
      	if (x <= -6.5e+166) {
      		tmp = t_1;
      	} else if (x <= 4.6e+162) {
      		tmp = 1.0 / (1.0 / (-z - y));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = x * log(y)
          if (x <= (-6.5d+166)) then
              tmp = t_1
          else if (x <= 4.6d+162) then
              tmp = 1.0d0 / (1.0d0 / (-z - y))
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = x * Math.log(y);
      	double tmp;
      	if (x <= -6.5e+166) {
      		tmp = t_1;
      	} else if (x <= 4.6e+162) {
      		tmp = 1.0 / (1.0 / (-z - y));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = x * math.log(y)
      	tmp = 0
      	if x <= -6.5e+166:
      		tmp = t_1
      	elif x <= 4.6e+162:
      		tmp = 1.0 / (1.0 / (-z - y))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(x * log(y))
      	tmp = 0.0
      	if (x <= -6.5e+166)
      		tmp = t_1;
      	elseif (x <= 4.6e+162)
      		tmp = Float64(1.0 / Float64(1.0 / Float64(Float64(-z) - y)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = x * log(y);
      	tmp = 0.0;
      	if (x <= -6.5e+166)
      		tmp = t_1;
      	elseif (x <= 4.6e+162)
      		tmp = 1.0 / (1.0 / (-z - y));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+166], t$95$1, If[LessEqual[x, 4.6e+162], N[(1.0 / N[(1.0 / N[((-z) - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot \log y\\
      \mathbf{if}\;x \leq -6.5 \cdot 10^{+166}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 4.6 \cdot 10^{+162}:\\
      \;\;\;\;\frac{1}{\frac{1}{\left(-z\right) - y}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -6.5000000000000005e166 or 4.59999999999999987e162 < x

        1. Initial program 99.6%

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

          \[\leadsto \color{blue}{x \cdot \log y} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\log y \cdot x} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\log y \cdot x} \]
          3. lower-log.f6485.7

            \[\leadsto \color{blue}{\log y} \cdot x \]
        5. Applied rewrites85.7%

          \[\leadsto \color{blue}{\log y \cdot x} \]

        if -6.5000000000000005e166 < x < 4.59999999999999987e162

        1. Initial program 99.9%

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

            \[\leadsto \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
          2. flip3-+N/A

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

            \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
          5. clear-numN/A

            \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
          6. flip3-+N/A

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}} \]
        4. Applied rewrites99.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
        5. Taylor expanded in z around inf

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{-1 \cdot z} - y}} \]
        6. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} - y}} \]
          2. lower-neg.f6468.6

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
        7. Applied rewrites68.6%

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification72.7%

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

      Alternative 11: 58.0% accurate, 7.7× speedup?

      \[\begin{array}{l} \\ \frac{1}{\frac{1}{\left(-z\right) - y}} \end{array} \]
      (FPCore (x y z t) :precision binary64 (/ 1.0 (/ 1.0 (- (- z) y))))
      double code(double x, double y, double z, double t) {
      	return 1.0 / (1.0 / (-z - y));
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = 1.0d0 / (1.0d0 / (-z - y))
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return 1.0 / (1.0 / (-z - y));
      }
      
      def code(x, y, z, t):
      	return 1.0 / (1.0 / (-z - y))
      
      function code(x, y, z, t)
      	return Float64(1.0 / Float64(1.0 / Float64(Float64(-z) - y)))
      end
      
      function tmp = code(x, y, z, t)
      	tmp = 1.0 / (1.0 / (-z - y));
      end
      
      code[x_, y_, z_, t_] := N[(1.0 / N[(1.0 / N[((-z) - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{1}{\frac{1}{\left(-z\right) - y}}
      \end{array}
      
      Derivation
      1. Initial program 99.8%

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

          \[\leadsto \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
        2. flip3-+N/A

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

          \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
        5. clear-numN/A

          \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
        6. flip3-+N/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}} \]
      4. Applied rewrites99.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
      5. Taylor expanded in z around inf

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{-1 \cdot z} - y}} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} - y}} \]
        2. lower-neg.f6455.4

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
      7. Applied rewrites55.4%

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
      8. Add Preprocessing

      Alternative 12: 48.3% accurate, 14.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.3 \cdot 10^{+22}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+117}:\\ \;\;\;\;-y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= z -6.3e+22) (- z) (if (<= z 1.2e+117) (- y) (- z))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (z <= -6.3e+22) {
      		tmp = -z;
      	} else if (z <= 1.2e+117) {
      		tmp = -y;
      	} else {
      		tmp = -z;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: tmp
          if (z <= (-6.3d+22)) then
              tmp = -z
          else if (z <= 1.2d+117) then
              tmp = -y
          else
              tmp = -z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (z <= -6.3e+22) {
      		tmp = -z;
      	} else if (z <= 1.2e+117) {
      		tmp = -y;
      	} else {
      		tmp = -z;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if z <= -6.3e+22:
      		tmp = -z
      	elif z <= 1.2e+117:
      		tmp = -y
      	else:
      		tmp = -z
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (z <= -6.3e+22)
      		tmp = Float64(-z);
      	elseif (z <= 1.2e+117)
      		tmp = Float64(-y);
      	else
      		tmp = Float64(-z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (z <= -6.3e+22)
      		tmp = -z;
      	elseif (z <= 1.2e+117)
      		tmp = -y;
      	else
      		tmp = -z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[z, -6.3e+22], (-z), If[LessEqual[z, 1.2e+117], (-y), (-z)]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -6.3 \cdot 10^{+22}:\\
      \;\;\;\;-z\\
      
      \mathbf{elif}\;z \leq 1.2 \cdot 10^{+117}:\\
      \;\;\;\;-y\\
      
      \mathbf{else}:\\
      \;\;\;\;-z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -6.30000000000000021e22 or 1.1999999999999999e117 < z

        1. Initial program 99.9%

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

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

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

            \[\leadsto \color{blue}{-z} \]
        5. Applied rewrites66.0%

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

        if -6.30000000000000021e22 < z < 1.1999999999999999e117

        1. Initial program 99.8%

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

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

            \[\leadsto \color{blue}{\mathsf{neg}\left(y\right)} \]
          2. lower-neg.f6439.6

            \[\leadsto \color{blue}{-y} \]
        5. Applied rewrites39.6%

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

      Alternative 13: 30.7% accurate, 71.7× speedup?

      \[\begin{array}{l} \\ -y \end{array} \]
      (FPCore (x y z t) :precision binary64 (- y))
      double code(double x, double y, double z, double t) {
      	return -y;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = -y
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return -y;
      }
      
      def code(x, y, z, t):
      	return -y
      
      function code(x, y, z, t)
      	return Float64(-y)
      end
      
      function tmp = code(x, y, z, t)
      	tmp = -y;
      end
      
      code[x_, y_, z_, t_] := (-y)
      
      \begin{array}{l}
      
      \\
      -y
      \end{array}
      
      Derivation
      1. Initial program 99.8%

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

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

          \[\leadsto \color{blue}{\mathsf{neg}\left(y\right)} \]
        2. lower-neg.f6430.3

          \[\leadsto \color{blue}{-y} \]
      5. Applied rewrites30.3%

        \[\leadsto \color{blue}{-y} \]
      6. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2024235 
      (FPCore (x y z t)
        :name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
        :precision binary64
        (+ (- (- (* x (log y)) y) z) (log t)))