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

Percentage Accurate: 99.9% → 99.9%
Time: 10.2s
Alternatives: 10
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 10 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, 0.7× speedup?

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

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

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. Step-by-step derivation
    1. +-commutative99.8%

      \[\leadsto \color{blue}{\log t + \left(\left(x \cdot \log y - y\right) - z\right)} \]
    2. associate--l-99.8%

      \[\leadsto \log t + \color{blue}{\left(x \cdot \log y - \left(y + z\right)\right)} \]
    3. associate-+r-99.8%

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

      \[\leadsto \color{blue}{\left(x \cdot \log y + \log t\right)} - \left(y + z\right) \]
    5. associate--l+99.8%

      \[\leadsto \color{blue}{x \cdot \log y + \left(\log t - \left(y + z\right)\right)} \]
    6. fma-def99.8%

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

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

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

Alternative 2: 89.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+70} \lor \neg \left(x \leq 1.9 \cdot 10^{+133}\right):\\ \;\;\;\;\left(\log t + x \cdot \log y\right) - y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -4.8e+70) (not (<= x 1.9e+133)))
   (- (+ (log t) (* x (log y))) y)
   (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4.8e+70) || !(x <= 1.9e+133)) {
		tmp = (log(t) + (x * log(y))) - y;
	} else {
		tmp = log(t) - (y + 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 <= (-4.8d+70)) .or. (.not. (x <= 1.9d+133))) then
        tmp = (log(t) + (x * log(y))) - y
    else
        tmp = log(t) - (y + z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4.8e+70) || !(x <= 1.9e+133)) {
		tmp = (Math.log(t) + (x * Math.log(y))) - y;
	} else {
		tmp = Math.log(t) - (y + z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -4.8e+70) or not (x <= 1.9e+133):
		tmp = (math.log(t) + (x * math.log(y))) - y
	else:
		tmp = math.log(t) - (y + z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -4.8e+70) || !(x <= 1.9e+133))
		tmp = Float64(Float64(log(t) + Float64(x * log(y))) - y);
	else
		tmp = Float64(log(t) - Float64(y + z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -4.8e+70) || ~((x <= 1.9e+133)))
		tmp = (log(t) + (x * log(y))) - y;
	else
		tmp = log(t) - (y + z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.8e+70], N[Not[LessEqual[x, 1.9e+133]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+70} \lor \neg \left(x \leq 1.9 \cdot 10^{+133}\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\

\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.79999999999999974e70 or 1.9000000000000001e133 < x

    1. Initial program 99.5%

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

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

    if -4.79999999999999974e70 < x < 1.9000000000000001e133

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+70} \lor \neg \left(x \leq 1.9 \cdot 10^{+133}\right):\\ \;\;\;\;\left(\log t + x \cdot \log y\right) - y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]

Alternative 3: 86.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{+140}:\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - z\\

\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\


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

    1. Initial program 99.8%

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

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

    if 2.1000000000000002e140 < y

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.1 \cdot 10^{+140}:\\ \;\;\;\;\left(\log t + x \cdot \log y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]

Alternative 4: 99.9% accurate, 1.0× speedup?

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

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

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. Final simplification99.8%

    \[\leadsto \log t + \left(\left(x \cdot \log y - y\right) - z\right) \]

Alternative 5: 48.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;z \leq -5400000:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-70}:\\ \;\;\;\;-y\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-186}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-231}:\\ \;\;\;\;-y\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-285}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\ \;\;\;\;-y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= z -5400000.0)
     (- z)
     (if (<= z -1.42e-70)
       (- y)
       (if (<= z -6.8e-186)
         t_1
         (if (<= z -4.5e-231)
           (- y)
           (if (<= z -4.3e-285) t_1 (if (<= z 1.595e+35) (- y) (- z)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double tmp;
	if (z <= -5400000.0) {
		tmp = -z;
	} else if (z <= -1.42e-70) {
		tmp = -y;
	} else if (z <= -6.8e-186) {
		tmp = t_1;
	} else if (z <= -4.5e-231) {
		tmp = -y;
	} else if (z <= -4.3e-285) {
		tmp = t_1;
	} else if (z <= 1.595e+35) {
		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) :: t_1
    real(8) :: tmp
    t_1 = x * log(y)
    if (z <= (-5400000.0d0)) then
        tmp = -z
    else if (z <= (-1.42d-70)) then
        tmp = -y
    else if (z <= (-6.8d-186)) then
        tmp = t_1
    else if (z <= (-4.5d-231)) then
        tmp = -y
    else if (z <= (-4.3d-285)) then
        tmp = t_1
    else if (z <= 1.595d+35) 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 t_1 = x * Math.log(y);
	double tmp;
	if (z <= -5400000.0) {
		tmp = -z;
	} else if (z <= -1.42e-70) {
		tmp = -y;
	} else if (z <= -6.8e-186) {
		tmp = t_1;
	} else if (z <= -4.5e-231) {
		tmp = -y;
	} else if (z <= -4.3e-285) {
		tmp = t_1;
	} else if (z <= 1.595e+35) {
		tmp = -y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	tmp = 0
	if z <= -5400000.0:
		tmp = -z
	elif z <= -1.42e-70:
		tmp = -y
	elif z <= -6.8e-186:
		tmp = t_1
	elif z <= -4.5e-231:
		tmp = -y
	elif z <= -4.3e-285:
		tmp = t_1
	elif z <= 1.595e+35:
		tmp = -y
	else:
		tmp = -z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (z <= -5400000.0)
		tmp = Float64(-z);
	elseif (z <= -1.42e-70)
		tmp = Float64(-y);
	elseif (z <= -6.8e-186)
		tmp = t_1;
	elseif (z <= -4.5e-231)
		tmp = Float64(-y);
	elseif (z <= -4.3e-285)
		tmp = t_1;
	elseif (z <= 1.595e+35)
		tmp = Float64(-y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	tmp = 0.0;
	if (z <= -5400000.0)
		tmp = -z;
	elseif (z <= -1.42e-70)
		tmp = -y;
	elseif (z <= -6.8e-186)
		tmp = t_1;
	elseif (z <= -4.5e-231)
		tmp = -y;
	elseif (z <= -4.3e-285)
		tmp = t_1;
	elseif (z <= 1.595e+35)
		tmp = -y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5400000.0], (-z), If[LessEqual[z, -1.42e-70], (-y), If[LessEqual[z, -6.8e-186], t$95$1, If[LessEqual[z, -4.5e-231], (-y), If[LessEqual[z, -4.3e-285], t$95$1, If[LessEqual[z, 1.595e+35], (-y), (-z)]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -5400000:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq -1.42 \cdot 10^{-70}:\\
\;\;\;\;-y\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-186}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-231}:\\
\;\;\;\;-y\\

\mathbf{elif}\;z \leq -4.3 \cdot 10^{-285}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\
\;\;\;\;-y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4e6 or 1.595e35 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-1 \cdot z} \]
    3. Step-by-step derivation
      1. neg-mul-167.1%

        \[\leadsto \color{blue}{-z} \]
    4. Simplified67.1%

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

    if -5.4e6 < z < -1.42000000000000002e-70 or -6.7999999999999999e-186 < z < -4.4999999999999998e-231 or -4.30000000000000011e-285 < z < 1.595e35

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{-1 \cdot y} \]
    3. Step-by-step derivation
      1. mul-1-neg53.7%

        \[\leadsto \color{blue}{-y} \]
    4. Simplified53.7%

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

    if -1.42000000000000002e-70 < z < -6.7999999999999999e-186 or -4.4999999999999998e-231 < z < -4.30000000000000011e-285

    1. Initial program 99.6%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Step-by-step derivation
      1. associate--l-99.6%

        \[\leadsto \color{blue}{\left(x \cdot \log y - \left(y + z\right)\right)} + \log t \]
      2. associate-+l-99.6%

        \[\leadsto \color{blue}{x \cdot \log y - \left(\left(y + z\right) - \log t\right)} \]
      3. add-cube-cbrt99.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right) \cdot \sqrt[3]{\log y}\right)} - \left(\left(y + z\right) - \log t\right) \]
      4. associate-*r*99.2%

        \[\leadsto \color{blue}{\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right)\right) \cdot \sqrt[3]{\log y}} - \left(\left(y + z\right) - \log t\right) \]
      5. fma-neg99.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right), \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
      6. pow299.2%

        \[\leadsto \mathsf{fma}\left(x \cdot \color{blue}{{\left(\sqrt[3]{\log y}\right)}^{2}}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right) \]
    3. Applied egg-rr99.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot {\left(\sqrt[3]{\log y}\right)}^{2}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
    4. Taylor expanded in x around inf 54.5%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \left(\log y \cdot x\right)} \]
    5. Step-by-step derivation
      1. pow-base-154.5%

        \[\leadsto \color{blue}{1} \cdot \left(\log y \cdot x\right) \]
      2. *-lft-identity54.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5400000:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-70}:\\ \;\;\;\;-y\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-186}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-231}:\\ \;\;\;\;-y\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-285}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\ \;\;\;\;-y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 6: 82.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.16 \cdot 10^{+218} \lor \neg \left(x \leq -5.2 \cdot 10^{+175}\right) \land \left(x \leq -1.22 \cdot 10^{+89} \lor \neg \left(x \leq 2.2 \cdot 10^{+130}\right)\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -1.16e+218)
         (and (not (<= x -5.2e+175))
              (or (<= x -1.22e+89) (not (<= x 2.2e+130)))))
   (* x (log y))
   (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.16e+218) || (!(x <= -5.2e+175) && ((x <= -1.22e+89) || !(x <= 2.2e+130)))) {
		tmp = x * log(y);
	} else {
		tmp = log(t) - (y + 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 <= (-1.16d+218)) .or. (.not. (x <= (-5.2d+175))) .and. (x <= (-1.22d+89)) .or. (.not. (x <= 2.2d+130))) then
        tmp = x * log(y)
    else
        tmp = log(t) - (y + z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.16e+218) || (!(x <= -5.2e+175) && ((x <= -1.22e+89) || !(x <= 2.2e+130)))) {
		tmp = x * Math.log(y);
	} else {
		tmp = Math.log(t) - (y + z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -1.16e+218) or (not (x <= -5.2e+175) and ((x <= -1.22e+89) or not (x <= 2.2e+130))):
		tmp = x * math.log(y)
	else:
		tmp = math.log(t) - (y + z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -1.16e+218) || (!(x <= -5.2e+175) && ((x <= -1.22e+89) || !(x <= 2.2e+130))))
		tmp = Float64(x * log(y));
	else
		tmp = Float64(log(t) - Float64(y + z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -1.16e+218) || (~((x <= -5.2e+175)) && ((x <= -1.22e+89) || ~((x <= 2.2e+130)))))
		tmp = x * log(y);
	else
		tmp = log(t) - (y + z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.16e+218], And[N[Not[LessEqual[x, -5.2e+175]], $MachinePrecision], Or[LessEqual[x, -1.22e+89], N[Not[LessEqual[x, 2.2e+130]], $MachinePrecision]]]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.16 \cdot 10^{+218} \lor \neg \left(x \leq -5.2 \cdot 10^{+175}\right) \land \left(x \leq -1.22 \cdot 10^{+89} \lor \neg \left(x \leq 2.2 \cdot 10^{+130}\right)\right):\\
\;\;\;\;x \cdot \log y\\

\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15999999999999994e218 or -5.2000000000000001e175 < x < -1.22e89 or 2.19999999999999993e130 < x

    1. Initial program 99.5%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Step-by-step derivation
      1. associate--l-99.5%

        \[\leadsto \color{blue}{\left(x \cdot \log y - \left(y + z\right)\right)} + \log t \]
      2. associate-+l-99.5%

        \[\leadsto \color{blue}{x \cdot \log y - \left(\left(y + z\right) - \log t\right)} \]
      3. add-cube-cbrt98.5%

        \[\leadsto x \cdot \color{blue}{\left(\left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right) \cdot \sqrt[3]{\log y}\right)} - \left(\left(y + z\right) - \log t\right) \]
      4. associate-*r*98.6%

        \[\leadsto \color{blue}{\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right)\right) \cdot \sqrt[3]{\log y}} - \left(\left(y + z\right) - \log t\right) \]
      5. fma-neg98.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right), \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
      6. pow298.6%

        \[\leadsto \mathsf{fma}\left(x \cdot \color{blue}{{\left(\sqrt[3]{\log y}\right)}^{2}}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right) \]
    3. Applied egg-rr98.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot {\left(\sqrt[3]{\log y}\right)}^{2}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
    4. Taylor expanded in x around inf 80.3%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \left(\log y \cdot x\right)} \]
    5. Step-by-step derivation
      1. pow-base-180.3%

        \[\leadsto \color{blue}{1} \cdot \left(\log y \cdot x\right) \]
      2. *-lft-identity80.3%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    6. Simplified80.3%

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

    if -1.15999999999999994e218 < x < -5.2000000000000001e175 or -1.22e89 < x < 2.19999999999999993e130

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.16 \cdot 10^{+218} \lor \neg \left(x \leq -5.2 \cdot 10^{+175}\right) \land \left(x \leq -1.22 \cdot 10^{+89} \lor \neg \left(x \leq 2.2 \cdot 10^{+130}\right)\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]

Alternative 7: 59.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -5400000:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-231}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -6.4 \cdot 10^{-277}:\\
\;\;\;\;x \cdot \log y\\

\mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4e6 or 1.595e35 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-1 \cdot z} \]
    3. Step-by-step derivation
      1. neg-mul-167.1%

        \[\leadsto \color{blue}{-z} \]
    4. Simplified67.1%

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

    if -5.4e6 < z < -3.80000000000000013e-231 or -6.3999999999999996e-277 < z < 1.595e35

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\left(\log y \cdot x + \log t\right) - y} \]
    3. Taylor expanded in x around 0 67.0%

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

    if -3.80000000000000013e-231 < z < -6.3999999999999996e-277

    1. Initial program 99.6%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Step-by-step derivation
      1. associate--l-99.6%

        \[\leadsto \color{blue}{\left(x \cdot \log y - \left(y + z\right)\right)} + \log t \]
      2. associate-+l-99.6%

        \[\leadsto \color{blue}{x \cdot \log y - \left(\left(y + z\right) - \log t\right)} \]
      3. add-cube-cbrt98.8%

        \[\leadsto x \cdot \color{blue}{\left(\left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right) \cdot \sqrt[3]{\log y}\right)} - \left(\left(y + z\right) - \log t\right) \]
      4. associate-*r*98.3%

        \[\leadsto \color{blue}{\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right)\right) \cdot \sqrt[3]{\log y}} - \left(\left(y + z\right) - \log t\right) \]
      5. fma-neg98.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right), \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
      6. pow298.3%

        \[\leadsto \mathsf{fma}\left(x \cdot \color{blue}{{\left(\sqrt[3]{\log y}\right)}^{2}}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right) \]
    3. Applied egg-rr98.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot {\left(\sqrt[3]{\log y}\right)}^{2}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
    4. Taylor expanded in x around inf 82.8%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \left(\log y \cdot x\right)} \]
    5. Step-by-step derivation
      1. pow-base-182.8%

        \[\leadsto \color{blue}{1} \cdot \left(\log y \cdot x\right) \]
      2. *-lft-identity82.8%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    6. Simplified82.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5400000:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-231}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-277}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\ \;\;\;\;\log t - y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 8: 56.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \log t - z\\
\mathbf{if}\;y \leq 3.4 \cdot 10^{-189}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-182}:\\
\;\;\;\;x \cdot \log y\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{+165}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 3.4000000000000001e-189 or 4.7999999999999997e-182 < y < 1.3999999999999999e165

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\left(\log y \cdot x + \log t\right) - z} \]
    3. Taylor expanded in x around 0 60.7%

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

    if 3.4000000000000001e-189 < y < 4.7999999999999997e-182

    1. Initial program 99.1%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Step-by-step derivation
      1. associate--l-99.1%

        \[\leadsto \color{blue}{\left(x \cdot \log y - \left(y + z\right)\right)} + \log t \]
      2. associate-+l-99.1%

        \[\leadsto \color{blue}{x \cdot \log y - \left(\left(y + z\right) - \log t\right)} \]
      3. add-cube-cbrt98.1%

        \[\leadsto x \cdot \color{blue}{\left(\left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right) \cdot \sqrt[3]{\log y}\right)} - \left(\left(y + z\right) - \log t\right) \]
      4. associate-*r*98.1%

        \[\leadsto \color{blue}{\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right)\right) \cdot \sqrt[3]{\log y}} - \left(\left(y + z\right) - \log t\right) \]
      5. fma-neg98.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \left(\sqrt[3]{\log y} \cdot \sqrt[3]{\log y}\right), \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
      6. pow298.1%

        \[\leadsto \mathsf{fma}\left(x \cdot \color{blue}{{\left(\sqrt[3]{\log y}\right)}^{2}}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right) \]
    3. Applied egg-rr98.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot {\left(\sqrt[3]{\log y}\right)}^{2}, \sqrt[3]{\log y}, -\left(\left(y + z\right) - \log t\right)\right)} \]
    4. Taylor expanded in x around inf 99.1%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \left(\log y \cdot x\right)} \]
    5. Step-by-step derivation
      1. pow-base-199.1%

        \[\leadsto \color{blue}{1} \cdot \left(\log y \cdot x\right) \]
      2. *-lft-identity99.1%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    6. Simplified99.1%

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

    if 1.3999999999999999e165 < y

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-1 \cdot y} \]
    3. Step-by-step derivation
      1. mul-1-neg88.0%

        \[\leadsto \color{blue}{-y} \]
    4. Simplified88.0%

      \[\leadsto \color{blue}{-y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.4 \cdot 10^{-189}:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-182}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+165}:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]

Alternative 9: 47.9% accurate, 34.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5400000:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\
\;\;\;\;-y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4e6 or 1.595e35 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-1 \cdot z} \]
    3. Step-by-step derivation
      1. neg-mul-167.1%

        \[\leadsto \color{blue}{-z} \]
    4. Simplified67.1%

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

    if -5.4e6 < z < 1.595e35

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{-1 \cdot y} \]
    3. Step-by-step derivation
      1. mul-1-neg42.9%

        \[\leadsto \color{blue}{-y} \]
    4. Simplified42.9%

      \[\leadsto \color{blue}{-y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5400000:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1.595 \cdot 10^{+35}:\\ \;\;\;\;-y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 10: 30.8% accurate, 104.5× 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. Taylor expanded in y around inf 28.0%

    \[\leadsto \color{blue}{-1 \cdot y} \]
  3. Step-by-step derivation
    1. mul-1-neg28.0%

      \[\leadsto \color{blue}{-y} \]
  4. Simplified28.0%

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

    \[\leadsto -y \]

Reproduce

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