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

Percentage Accurate: 99.9% → 99.9%
Time: 17.7s
Alternatives: 11
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 11 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.9%

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

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

Alternative 2: 89.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+16} \lor \neg \left(x \leq 7.8 \cdot 10^{+43}\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25e16 or 7.8000000000000001e43 < x

    1. Initial program 99.7%

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

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

    if -1.25e16 < x < 7.8000000000000001e43

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    3. Step-by-step derivation
      1. +-commutative98.6%

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

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

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

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

Alternative 3: 89.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \log t + x \cdot \log y\\
\mathbf{if}\;z \leq -1.52 \cdot 10^{+122}:\\
\;\;\;\;t_1 - z\\

\mathbf{elif}\;z \leq 1600:\\
\;\;\;\;t_1 - y\\

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


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

    1. Initial program 100.0%

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

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

    if -1.52e122 < z < 1600

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

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

    if 1600 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    3. Step-by-step derivation
      1. +-commutative84.7%

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

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

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

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

Alternative 4: 83.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+148} \lor \neg \left(x \leq 6 \cdot 10^{+63} \lor \neg \left(x \leq 1.55 \cdot 10^{+103}\right) \land x \leq 2.55 \cdot 10^{+169}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.20000000000000013e148 or 5.99999999999999998e63 < x < 1.5500000000000001e103 or 2.55000000000000004e169 < x

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt[3]{\color{blue}{{x}^{3} \cdot {\log y}^{3}}} \]
    5. Step-by-step derivation
      1. pow-prod-down14.3%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(x \cdot \log y\right)}^{3}}} \]
      2. rem-cbrt-cube80.6%

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

        \[\leadsto \color{blue}{\log y \cdot x} \]
    6. Applied egg-rr80.6%

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

    if -7.20000000000000013e148 < x < 5.99999999999999998e63 or 1.5500000000000001e103 < x < 2.55000000000000004e169

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    3. Step-by-step derivation
      1. +-commutative88.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{+148} \lor \neg \left(x \leq 6 \cdot 10^{+63} \lor \neg \left(x \leq 1.55 \cdot 10^{+103}\right) \land x \leq 2.55 \cdot 10^{+169}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \end{array} \]

Alternative 5: 61.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -9.8 \cdot 10^{+54}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -4.7 \cdot 10^{-253}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 3.2 \cdot 10^{-171}:\\
\;\;\;\;\log t - z\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+63}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.80000000000000002e54 or 4.2000000000000004e63 < x

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \left(-y\right) - z\right)} + \log t \]
      6. add-cbrt-cube17.6%

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

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

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

      \[\leadsto \sqrt[3]{\color{blue}{{x}^{3} \cdot {\log y}^{3}}} \]
    5. Step-by-step derivation
      1. pow-prod-down15.7%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(x \cdot \log y\right)}^{3}}} \]
      2. rem-cbrt-cube66.1%

        \[\leadsto \color{blue}{x \cdot \log y} \]
      3. *-commutative66.1%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    6. Applied egg-rr66.1%

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

    if -9.80000000000000002e54 < x < -4.69999999999999981e-253 or 3.2000000000000001e-171 < x < 4.2000000000000004e63

    1. Initial program 100.0%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Step-by-step derivation
      1. add-cube-cbrt99.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot y} + \log t \]
    5. Step-by-step derivation
      1. mul-1-neg69.2%

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

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

    if -4.69999999999999981e-253 < x < 3.2000000000000001e-171

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{\log t - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -4.7 \cdot 10^{-253}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-171}:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+63}:\\ \;\;\;\;\log t - y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]

Alternative 6: 60.9% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+15} \lor \neg \left(x \leq 4.4 \cdot 10^{+63}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.4e15 or 4.3999999999999997e63 < x

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \left(-y\right) - z\right)} + \log t \]
      6. add-cbrt-cube20.2%

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

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

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

      \[\leadsto \sqrt[3]{\color{blue}{{x}^{3} \cdot {\log y}^{3}}} \]
    5. Step-by-step derivation
      1. pow-prod-down16.7%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(x \cdot \log y\right)}^{3}}} \]
      2. rem-cbrt-cube64.1%

        \[\leadsto \color{blue}{x \cdot \log y} \]
      3. *-commutative64.1%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    6. Applied egg-rr64.1%

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

    if -4.4e15 < x < 4.3999999999999997e63

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{\log t - z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.6%

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

Alternative 7: 47.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+122}:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq 1600:\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.60000000000000006e122 or 1600 < z

    1. Initial program 100.0%

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

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

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

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

    if -1.60000000000000006e122 < z < 1600

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \left(-y\right) - z\right)} + \log t \]
      6. add-cbrt-cube41.0%

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

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

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

      \[\leadsto \sqrt[3]{\color{blue}{{x}^{3} \cdot {\log y}^{3}}} \]
    5. Step-by-step derivation
      1. pow-prod-down12.7%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(x \cdot \log y\right)}^{3}}} \]
      2. rem-cbrt-cube38.6%

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

        \[\leadsto \color{blue}{\log y \cdot x} \]
    6. Applied egg-rr38.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+122}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1600:\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 8: 40.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+32}:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq 0.44:\\
\;\;\;\;\log t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.5000000000000001e32 or 0.440000000000000002 < 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 55.4%

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

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

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

    if -3.5000000000000001e32 < z < 0.440000000000000002

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\log t - z} \]
    4. Taylor expanded in z around 0 18.1%

      \[\leadsto \color{blue}{\log t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+32}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 0.44:\\ \;\;\;\;\log t\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 9: 29.1% accurate, 104.5× speedup?

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

\\
-z
\end{array}
Derivation
  1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{-z} \]
  4. Simplified25.2%

    \[\leadsto \color{blue}{-z} \]
  5. Final simplification25.2%

    \[\leadsto -z \]

Alternative 10: 2.2% accurate, 209.0× 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 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.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto y \]

Alternative 11: 2.3% accurate, 209.0× speedup?

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

\\
z
\end{array}
Derivation
  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt[3]{\color{blue}{-1 \cdot {z}^{3}}} \]
  5. Step-by-step derivation
    1. mul-1-neg7.5%

      \[\leadsto \sqrt[3]{\color{blue}{-{z}^{3}}} \]
    2. cube-neg7.5%

      \[\leadsto \sqrt[3]{\color{blue}{{\left(-z\right)}^{3}}} \]
  6. Simplified7.5%

    \[\leadsto \sqrt[3]{\color{blue}{{\left(-z\right)}^{3}}} \]
  7. Step-by-step derivation
    1. rem-cbrt-cube25.2%

      \[\leadsto \color{blue}{-z} \]
    2. add-sqr-sqrt10.8%

      \[\leadsto \color{blue}{\sqrt{-z} \cdot \sqrt{-z}} \]
    3. sqrt-unprod4.4%

      \[\leadsto \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \]
    4. sqr-neg4.4%

      \[\leadsto \sqrt{\color{blue}{z \cdot z}} \]
    5. sqrt-prod1.0%

      \[\leadsto \color{blue}{\sqrt{z} \cdot \sqrt{z}} \]
    6. add-sqr-sqrt2.3%

      \[\leadsto \color{blue}{z} \]
    7. add-log-exp2.1%

      \[\leadsto \color{blue}{\log \left(e^{z}\right)} \]
    8. *-un-lft-identity2.1%

      \[\leadsto \log \color{blue}{\left(1 \cdot e^{z}\right)} \]
    9. log-prod2.1%

      \[\leadsto \color{blue}{\log 1 + \log \left(e^{z}\right)} \]
    10. metadata-eval2.1%

      \[\leadsto \color{blue}{0} + \log \left(e^{z}\right) \]
    11. add-log-exp2.3%

      \[\leadsto 0 + \color{blue}{z} \]
  8. Applied egg-rr2.3%

    \[\leadsto \color{blue}{0 + z} \]
  9. Step-by-step derivation
    1. +-lft-identity2.3%

      \[\leadsto \color{blue}{z} \]
  10. Simplified2.3%

    \[\leadsto \color{blue}{z} \]
  11. Final simplification2.3%

    \[\leadsto z \]

Reproduce

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