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

Percentage Accurate: 99.9% → 99.9%
Time: 11.3s
Alternatives: 14
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 14 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} \\ \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 2: 78.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t\_1 - y\\ \mathbf{if}\;t\_2 \leq -5.3 \cdot 10^{+296}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -2000:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+87}:\\ \;\;\;\;\log t - 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)))
   (if (<= t_2 -5.3e+296)
     t_1
     (if (<= t_2 -2000.0) (- (- y) z) (if (<= t_2 5e+87) (- (log t) 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;
	double tmp;
	if (t_2 <= -5.3e+296) {
		tmp = t_1;
	} else if (t_2 <= -2000.0) {
		tmp = -y - z;
	} else if (t_2 <= 5e+87) {
		tmp = log(t) - 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
    if (t_2 <= (-5.3d+296)) then
        tmp = t_1
    else if (t_2 <= (-2000.0d0)) then
        tmp = -y - z
    else if (t_2 <= 5d+87) then
        tmp = log(t) - 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;
	double tmp;
	if (t_2 <= -5.3e+296) {
		tmp = t_1;
	} else if (t_2 <= -2000.0) {
		tmp = -y - z;
	} else if (t_2 <= 5e+87) {
		tmp = Math.log(t) - z;
	} 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 <= -5.3e+296:
		tmp = t_1
	elif t_2 <= -2000.0:
		tmp = -y - z
	elif t_2 <= 5e+87:
		tmp = math.log(t) - z
	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 <= -5.3e+296)
		tmp = t_1;
	elseif (t_2 <= -2000.0)
		tmp = Float64(Float64(-y) - z);
	elseif (t_2 <= 5e+87)
		tmp = Float64(log(t) - 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;
	tmp = 0.0;
	if (t_2 <= -5.3e+296)
		tmp = t_1;
	elseif (t_2 <= -2000.0)
		tmp = -y - z;
	elseif (t_2 <= 5e+87)
		tmp = log(t) - 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[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5.3e+296], t$95$1, If[LessEqual[t$95$2, -2000.0], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$2, 5e+87], N[(N[Log[t], $MachinePrecision] - z), $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 -5.3 \cdot 10^{+296}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -2000:\\
\;\;\;\;\left(-y\right) - z\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+87}:\\
\;\;\;\;\log t - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5.3000000000000004e296 or 4.9999999999999998e87 < (-.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. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \log y} \]
      2. log-lowering-log.f6479.5

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

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

    if -5.3000000000000004e296 < (-.f64 (*.f64 x (log.f64 y)) y) < -2e3

    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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6498.2

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot y + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
      3. sub-negN/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      4. --lowering--.f64N/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - z \]
      6. neg-lowering-neg.f6471.5

        \[\leadsto \color{blue}{\left(-y\right)} - z \]
    10. Simplified71.5%

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

    if -2e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999998e87

    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. neg-lowering-neg.f6491.3

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

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

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

        \[\leadsto \color{blue}{\log t - z} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{\log t - z} \]
      4. log-lowering-log.f6491.3

        \[\leadsto \color{blue}{\log t} - z \]
    7. Applied egg-rr91.3%

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

Alternative 3: 69.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot \log y - y\right) - z\\ \mathbf{if}\;t\_1 \leq -2000:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-9}:\\ \;\;\;\;\log t\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (- (* x (log y)) y) z)))
   (if (<= t_1 -2000.0) (- (- y) z) (if (<= t_1 4e-9) (log t) (- z)))))
double code(double x, double y, double z, double t) {
	double t_1 = ((x * log(y)) - y) - z;
	double tmp;
	if (t_1 <= -2000.0) {
		tmp = -y - z;
	} else if (t_1 <= 4e-9) {
		tmp = log(t);
	} 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) :: t_1
    real(8) :: tmp
    t_1 = ((x * log(y)) - y) - z
    if (t_1 <= (-2000.0d0)) then
        tmp = -y - z
    else if (t_1 <= 4d-9) then
        tmp = log(t)
    else
        tmp = -z
    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)) - y) - z;
	double tmp;
	if (t_1 <= -2000.0) {
		tmp = -y - z;
	} else if (t_1 <= 4e-9) {
		tmp = Math.log(t);
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = ((x * math.log(y)) - y) - z
	tmp = 0
	if t_1 <= -2000.0:
		tmp = -y - z
	elif t_1 <= 4e-9:
		tmp = math.log(t)
	else:
		tmp = -z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(Float64(x * log(y)) - y) - z)
	tmp = 0.0
	if (t_1 <= -2000.0)
		tmp = Float64(Float64(-y) - z);
	elseif (t_1 <= 4e-9)
		tmp = log(t);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = ((x * log(y)) - y) - z;
	tmp = 0.0;
	if (t_1 <= -2000.0)
		tmp = -y - z;
	elseif (t_1 <= 4e-9)
		tmp = log(t);
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -2000.0], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$1, 4e-9], N[Log[t], $MachinePrecision], (-z)]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-9}:\\
\;\;\;\;\log t\\

\mathbf{else}:\\
\;\;\;\;-z\\


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

    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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6498.4

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot y + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
      3. sub-negN/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      4. --lowering--.f64N/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - z \]
      6. neg-lowering-neg.f6471.4

        \[\leadsto \color{blue}{\left(-y\right)} - z \]
    10. Simplified71.4%

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

    if -2e3 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 4.00000000000000025e-9

    1. Initial program 100.0%

      \[\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. neg-lowering-neg.f6496.9

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

      \[\leadsto \color{blue}{\left(-z\right)} + \log t \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{\log t} \]
    7. Step-by-step derivation
      1. log-lowering-log.f6496.8

        \[\leadsto \color{blue}{\log t} \]
    8. Simplified96.8%

      \[\leadsto \color{blue}{\log t} \]

    if 4.00000000000000025e-9 < (-.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 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. neg-lowering-neg.f6451.0

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -215 or 3.90000000000000025e-7 < z

    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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6499.1

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(\left(\frac{x \cdot \log y}{z} - \frac{y}{z}\right) - 1\right)} \]
      4. div-subN/A

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{x \cdot \log y - y}{z} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      6. metadata-evalN/A

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

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

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

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

        \[\leadsto z \cdot \left(\frac{\color{blue}{x \cdot \log y} - y}{z} + -1\right) \]
      11. log-lowering-log.f6499.3

        \[\leadsto z \cdot \left(\frac{x \cdot \color{blue}{\log y} - y}{z} + -1\right) \]
    10. Simplified99.3%

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

    if -215 < z < 3.90000000000000025e-7

    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. +-commutativeN/A

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \log t - y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

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

Alternative 5: 70.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot \log y - y \leq -2000:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\log t - z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (- (* x (log y)) y) -2000.0) (- (- y) z) (- (log t) z)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x * log(y)) - y) <= -2000.0) {
		tmp = -y - z;
	} else {
		tmp = log(t) - 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 (((x * log(y)) - y) <= (-2000.0d0)) then
        tmp = -y - z
    else
        tmp = log(t) - z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((x * Math.log(y)) - y) <= -2000.0) {
		tmp = -y - z;
	} else {
		tmp = Math.log(t) - z;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x * math.log(y)) - y) <= -2000.0:
		tmp = -y - z
	else:
		tmp = math.log(t) - z
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(Float64(x * log(y)) - y) <= -2000.0)
		tmp = Float64(Float64(-y) - z);
	else
		tmp = Float64(log(t) - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((x * log(y)) - y) <= -2000.0)
		tmp = -y - z;
	else
		tmp = log(t) - z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], -2000.0], N[((-y) - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot \log y - y \leq -2000:\\
\;\;\;\;\left(-y\right) - z\\

\mathbf{else}:\\
\;\;\;\;\log t - z\\


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

    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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6498.2

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot y + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
      3. sub-negN/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      4. --lowering--.f64N/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - z \]
      6. neg-lowering-neg.f6468.3

        \[\leadsto \color{blue}{\left(-y\right)} - z \]
    10. Simplified68.3%

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

    if -2e3 < (-.f64 (*.f64 x (log.f64 y)) y)

    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 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. neg-lowering-neg.f6470.8

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

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

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

        \[\leadsto \color{blue}{\log t - z} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{\log t - z} \]
      4. log-lowering-log.f6470.8

        \[\leadsto \color{blue}{\log t} - z \]
    7. Applied egg-rr70.8%

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

Alternative 6: 99.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0068:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, \log t - z\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{x \cdot \log y - z}{y} + -1\right)\\


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

    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 0

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log y}, \log t + \left(\mathsf{neg}\left(z\right)\right)\right) \]
      6. unsub-negN/A

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

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

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

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

    if 0.00679999999999999962 < y

    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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6498.6

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(\color{blue}{\frac{-1 \cdot \left(x \cdot \log \left(\frac{1}{y}\right)\right)}{y}} - \frac{z}{y}\right) - 1\right) \]
      5. div-subN/A

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{-1 \cdot \left(x \cdot \log \left(\frac{1}{y}\right)\right) - z}{y} + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
      7. metadata-evalN/A

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

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

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

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

Alternative 7: 99.1% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\log y - \frac{y + z}{x}\right)\\ \mathbf{if}\;x \leq -16800000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.85:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (log y) (/ (+ y z) x)))))
   (if (<= x -16800000000000.0) t_1 (if (<= x 1.85) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (log(y) - ((y + z) / x));
	double tmp;
	if (x <= -16800000000000.0) {
		tmp = t_1;
	} else if (x <= 1.85) {
		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) - ((y + z) / x))
    if (x <= (-16800000000000.0d0)) then
        tmp = t_1
    else if (x <= 1.85d0) 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) - ((y + z) / x));
	double tmp;
	if (x <= -16800000000000.0) {
		tmp = t_1;
	} else if (x <= 1.85) {
		tmp = Math.log(t) - (y + z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (math.log(y) - ((y + z) / x))
	tmp = 0
	if x <= -16800000000000.0:
		tmp = t_1
	elif x <= 1.85:
		tmp = math.log(t) - (y + z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(log(y) - Float64(Float64(y + z) / x)))
	tmp = 0.0
	if (x <= -16800000000000.0)
		tmp = t_1;
	elseif (x <= 1.85)
		tmp = Float64(log(t) - Float64(y + z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (log(y) - ((y + z) / x));
	tmp = 0.0;
	if (x <= -16800000000000.0)
		tmp = t_1;
	elseif (x <= 1.85)
		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[(N[Log[y], $MachinePrecision] - N[(N[(y + z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -16800000000000.0], t$95$1, If[LessEqual[x, 1.85], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 1.85:\\
\;\;\;\;\log t - \left(y + z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.68e13 or 1.8500000000000001 < 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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6499.0

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

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

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

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

        \[\leadsto x \cdot \left(\log y + \frac{\color{blue}{-1 \cdot y + -1 \cdot z}}{x}\right) \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \left(\log y + \frac{-1 \cdot y + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)}}{x}\right) \]
      4. sub-negN/A

        \[\leadsto x \cdot \left(\log y + \frac{\color{blue}{-1 \cdot y - z}}{x}\right) \]
      5. div-subN/A

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

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

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

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

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

        \[\leadsto x \cdot \left(\log y + \left(\color{blue}{\frac{-1 \cdot y}{x}} - \frac{z}{x}\right)\right) \]
      11. div-subN/A

        \[\leadsto x \cdot \left(\log y + \color{blue}{\frac{-1 \cdot y - z}{x}}\right) \]
      12. sub-negN/A

        \[\leadsto x \cdot \left(\log y + \frac{\color{blue}{-1 \cdot y + \left(\mathsf{neg}\left(z\right)\right)}}{x}\right) \]
      13. mul-1-negN/A

        \[\leadsto x \cdot \left(\log y + \frac{-1 \cdot y + \color{blue}{-1 \cdot z}}{x}\right) \]
      14. distribute-lft-inN/A

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

        \[\leadsto x \cdot \left(\log y + \color{blue}{-1 \cdot \frac{y + z}{x}}\right) \]
      16. mul-1-negN/A

        \[\leadsto x \cdot \left(\log y + \color{blue}{\left(\mathsf{neg}\left(\frac{y + z}{x}\right)\right)}\right) \]
      17. unsub-negN/A

        \[\leadsto x \cdot \color{blue}{\left(\log y - \frac{y + z}{x}\right)} \]
      18. --lowering--.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\log y - \frac{y + z}{x}\right)} \]
      19. log-lowering-log.f64N/A

        \[\leadsto x \cdot \left(\color{blue}{\log y} - \frac{y + z}{x}\right) \]
    10. Simplified99.1%

      \[\leadsto \color{blue}{x \cdot \left(\log y - \frac{y + z}{x}\right)} \]

    if -1.68e13 < x < 1.8500000000000001

    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. --lowering--.f64N/A

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

        \[\leadsto \color{blue}{\log t} - \left(y + z\right) \]
      3. +-lowering-+.f6499.1

        \[\leadsto \log t - \color{blue}{\left(y + z\right)} \]
    5. Simplified99.1%

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

Alternative 8: 88.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t\_1 - z\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{+85}:\\ \;\;\;\;t\_1 - y\\ \mathbf{elif}\;x \leq -2.45 \cdot 10^{+14}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+96}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))) (t_2 (- t_1 z)))
   (if (<= x -3.4e+85)
     (- t_1 y)
     (if (<= x -2.45e+14) t_2 (if (<= x 3.1e+96) (- (log t) (+ y z)) t_2)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double t_2 = t_1 - z;
	double tmp;
	if (x <= -3.4e+85) {
		tmp = t_1 - y;
	} else if (x <= -2.45e+14) {
		tmp = t_2;
	} else if (x <= 3.1e+96) {
		tmp = log(t) - (y + z);
	} else {
		tmp = t_2;
	}
	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 - z
    if (x <= (-3.4d+85)) then
        tmp = t_1 - y
    else if (x <= (-2.45d+14)) then
        tmp = t_2
    else if (x <= 3.1d+96) then
        tmp = log(t) - (y + z)
    else
        tmp = t_2
    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 - z;
	double tmp;
	if (x <= -3.4e+85) {
		tmp = t_1 - y;
	} else if (x <= -2.45e+14) {
		tmp = t_2;
	} else if (x <= 3.1e+96) {
		tmp = Math.log(t) - (y + z);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = t_1 - z
	tmp = 0
	if x <= -3.4e+85:
		tmp = t_1 - y
	elif x <= -2.45e+14:
		tmp = t_2
	elif x <= 3.1e+96:
		tmp = math.log(t) - (y + z)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	t_2 = Float64(t_1 - z)
	tmp = 0.0
	if (x <= -3.4e+85)
		tmp = Float64(t_1 - y);
	elseif (x <= -2.45e+14)
		tmp = t_2;
	elseif (x <= 3.1e+96)
		tmp = Float64(log(t) - Float64(y + z));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	t_2 = t_1 - z;
	tmp = 0.0;
	if (x <= -3.4e+85)
		tmp = t_1 - y;
	elseif (x <= -2.45e+14)
		tmp = t_2;
	elseif (x <= 3.1e+96)
		tmp = log(t) - (y + z);
	else
		tmp = t_2;
	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 - z), $MachinePrecision]}, If[LessEqual[x, -3.4e+85], N[(t$95$1 - y), $MachinePrecision], If[LessEqual[x, -2.45e+14], t$95$2, If[LessEqual[x, 3.1e+96], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - z\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{+85}:\\
\;\;\;\;t\_1 - y\\

\mathbf{elif}\;x \leq -2.45 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{+96}:\\
\;\;\;\;\log t - \left(y + z\right)\\

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


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

    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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6499.4

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

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

      \[\leadsto \color{blue}{x \cdot \log y - y} \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

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

        \[\leadsto \color{blue}{x \cdot \log y} - y \]
      3. log-lowering-log.f6487.9

        \[\leadsto x \cdot \color{blue}{\log y} - y \]
    10. Simplified87.9%

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

    if -3.4000000000000003e85 < x < -2.45e14 or 3.0999999999999998e96 < 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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6499.5

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

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

      \[\leadsto \color{blue}{x \cdot \log y - z} \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

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

        \[\leadsto \color{blue}{x \cdot \log y} - z \]
      3. log-lowering-log.f6489.8

        \[\leadsto x \cdot \color{blue}{\log y} - z \]
    10. Simplified89.8%

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

    if -2.45e14 < x < 3.0999999999999998e96

    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. --lowering--.f64N/A

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

        \[\leadsto \color{blue}{\log t} - \left(y + z\right) \]
      3. +-lowering-+.f6494.6

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

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

Alternative 9: 89.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ \mathbf{if}\;x \leq -2.4 \cdot 10^{+85}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+29}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x (log y)) y)))
   (if (<= x -2.4e+85) t_1 (if (<= x 1.45e+29) (- (log t) (+ y z)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * log(y)) - y;
	double tmp;
	if (x <= -2.4e+85) {
		tmp = t_1;
	} else if (x <= 1.45e+29) {
		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)) - y
    if (x <= (-2.4d+85)) then
        tmp = t_1
    else if (x <= 1.45d+29) 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)) - y;
	double tmp;
	if (x <= -2.4e+85) {
		tmp = t_1;
	} else if (x <= 1.45e+29) {
		tmp = Math.log(t) - (y + z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * math.log(y)) - y
	tmp = 0
	if x <= -2.4e+85:
		tmp = t_1
	elif x <= 1.45e+29:
		tmp = math.log(t) - (y + z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * log(y)) - y)
	tmp = 0.0
	if (x <= -2.4e+85)
		tmp = t_1;
	elseif (x <= 1.45e+29)
		tmp = Float64(log(t) - Float64(y + z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * log(y)) - y;
	tmp = 0.0;
	if (x <= -2.4e+85)
		tmp = t_1;
	elseif (x <= 1.45e+29)
		tmp = log(t) - (y + z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -2.4e+85], t$95$1, If[LessEqual[x, 1.45e+29], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.45 \cdot 10^{+29}:\\
\;\;\;\;\log t - \left(y + z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.39999999999999997e85 or 1.45e29 < 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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6499.5

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

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

      \[\leadsto \color{blue}{x \cdot \log y - y} \]
    9. Step-by-step derivation
      1. --lowering--.f64N/A

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

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

        \[\leadsto x \cdot \color{blue}{\log y} - y \]
    10. Simplified83.0%

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

    if -2.39999999999999997e85 < x < 1.45e29

    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. --lowering--.f64N/A

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

        \[\leadsto \color{blue}{\log t} - \left(y + z\right) \]
      3. +-lowering-+.f6493.0

        \[\leadsto \log t - \color{blue}{\left(y + z\right)} \]
    5. Simplified93.0%

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

Alternative 10: 84.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -5 \cdot 10^{+136}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{+131}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= x -5e+136) t_1 (if (<= x 2.9e+131) (- (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 <= -5e+136) {
		tmp = t_1;
	} else if (x <= 2.9e+131) {
		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 <= (-5d+136)) then
        tmp = t_1
    else if (x <= 2.9d+131) 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 <= -5e+136) {
		tmp = t_1;
	} else if (x <= 2.9e+131) {
		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 <= -5e+136:
		tmp = t_1
	elif x <= 2.9e+131:
		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 <= -5e+136)
		tmp = t_1;
	elseif (x <= 2.9e+131)
		tmp = Float64(log(t) - Float64(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 <= -5e+136)
		tmp = t_1;
	elseif (x <= 2.9e+131)
		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, -5e+136], t$95$1, If[LessEqual[x, 2.9e+131], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -5 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{+131}:\\
\;\;\;\;\log t - \left(y + z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.0000000000000002e136 or 2.9000000000000001e131 < 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. *-lowering-*.f64N/A

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

        \[\leadsto x \cdot \color{blue}{\log y} \]
    5. Simplified76.3%

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

    if -5.0000000000000002e136 < x < 2.9000000000000001e131

    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. --lowering--.f64N/A

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

        \[\leadsto \color{blue}{\log t} - \left(y + z\right) \]
      3. +-lowering-+.f6486.2

        \[\leadsto \log t - \color{blue}{\left(y + z\right)} \]
    5. Simplified86.2%

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

Alternative 11: 69.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-y\right) - z\\ \mathbf{if}\;z \leq -250:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+16}:\\ \;\;\;\;\log t - y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (- y) z)))
   (if (<= z -250.0) t_1 (if (<= z 9.2e+16) (- (log t) y) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = -y - z;
	double tmp;
	if (z <= -250.0) {
		tmp = t_1;
	} else if (z <= 9.2e+16) {
		tmp = log(t) - 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 = -y - z
    if (z <= (-250.0d0)) then
        tmp = t_1
    else if (z <= 9.2d+16) then
        tmp = log(t) - 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 = -y - z;
	double tmp;
	if (z <= -250.0) {
		tmp = t_1;
	} else if (z <= 9.2e+16) {
		tmp = Math.log(t) - y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -y - z
	tmp = 0
	if z <= -250.0:
		tmp = t_1
	elif z <= 9.2e+16:
		tmp = math.log(t) - y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(-y) - z)
	tmp = 0.0
	if (z <= -250.0)
		tmp = t_1;
	elseif (z <= 9.2e+16)
		tmp = Float64(log(t) - y);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -y - z;
	tmp = 0.0;
	if (z <= -250.0)
		tmp = t_1;
	elseif (z <= 9.2e+16)
		tmp = log(t) - y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[z, -250.0], t$95$1, If[LessEqual[z, 9.2e+16], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-y\right) - z\\
\mathbf{if}\;z \leq -250:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{+16}:\\
\;\;\;\;\log t - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -250 or 9.2e16 < z

    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. 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)}} \]
      2. 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}}}} \]
      3. /-lowering-/.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}}}} \]
      4. 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)}}}} \]
      5. flip3-+N/A

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
      2. log-lowering-log.f6499.1

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. distribute-lft-inN/A

        \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
      2. mul-1-negN/A

        \[\leadsto -1 \cdot y + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
      3. sub-negN/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      4. --lowering--.f64N/A

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      5. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - z \]
      6. neg-lowering-neg.f6480.4

        \[\leadsto \color{blue}{\left(-y\right)} - z \]
    10. Simplified80.4%

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

    if -250 < z < 9.2e16

    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. +-commutativeN/A

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\log t - y} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \color{blue}{\log t - y} \]
      2. log-lowering-log.f6459.2

        \[\leadsto \color{blue}{\log t} - y \]
    8. Simplified59.2%

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

Alternative 12: 46.7% accurate, 23.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4 \cdot 10^{+150}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \end{array} \]
(FPCore (x y z t) :precision binary64 (if (<= y 4e+150) (- z) (- y)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 4e+150) {
		tmp = -z;
	} else {
		tmp = -y;
	}
	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 (y <= 4d+150) then
        tmp = -z
    else
        tmp = -y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 4e+150) {
		tmp = -z;
	} else {
		tmp = -y;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= 4e+150:
		tmp = -z
	else:
		tmp = -y
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 4e+150)
		tmp = Float64(-z);
	else
		tmp = Float64(-y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 4e+150)
		tmp = -z;
	else
		tmp = -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, 4e+150], (-z), (-y)]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{+150}:\\
\;\;\;\;-z\\

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


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

    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 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. neg-lowering-neg.f6439.0

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

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

    if 3.99999999999999992e150 < y

    1. Initial program 100.0%

      \[\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. neg-lowering-neg.f6482.7

        \[\leadsto \color{blue}{-y} \]
    5. Simplified82.7%

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

Alternative 13: 58.3% accurate, 35.8× speedup?

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

\\
\left(-y\right) - z
\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. 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)}} \]
    2. 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}}}} \]
    3. /-lowering-/.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}}}} \]
    4. 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)}}}} \]
    5. flip3-+N/A

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

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

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

      \[\leadsto \frac{1}{\frac{1}{\color{blue}{x \cdot \log y} - \left(y + z\right)}} \]
    2. log-lowering-log.f6484.8

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

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

    \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
  9. Step-by-step derivation
    1. distribute-lft-inN/A

      \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
    2. mul-1-negN/A

      \[\leadsto -1 \cdot y + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
    3. sub-negN/A

      \[\leadsto \color{blue}{-1 \cdot y - z} \]
    4. --lowering--.f64N/A

      \[\leadsto \color{blue}{-1 \cdot y - z} \]
    5. mul-1-negN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(y\right)\right)} - z \]
    6. neg-lowering-neg.f6455.6

      \[\leadsto \color{blue}{\left(-y\right)} - z \]
  10. Simplified55.6%

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

Alternative 14: 30.2% 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. neg-lowering-neg.f6425.0

      \[\leadsto \color{blue}{-y} \]
  5. Simplified25.0%

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

Reproduce

?
herbie shell --seed 2024199 
(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)))