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

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

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

\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - 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. associate-+l-99.9%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{0 - \left(z - \log t\right)}\right) - y \]
    10. associate-+l-99.9%

      \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\left(0 - z\right) + \log t}\right) - y \]
    11. neg-sub099.9%

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

      \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\log t + \left(-z\right)}\right) - y \]
    13. unsub-neg99.9%

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

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

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

Alternative 2: 83.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ t_2 := \left(-y\right) - z\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+222}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq -5.4 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq -1000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 10^{+34}:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x (log y)) y)) (t_2 (- (- y) z)))
   (if (<= t_1 -5e+222)
     t_1
     (if (<= t_1 -2e+68)
       t_2
       (if (<= t_1 -5.4e+42)
         t_1
         (if (<= t_1 -1000.0) t_2 (if (<= t_1 1e+34) (- (log t) z) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * log(y)) - y;
	double t_2 = -y - z;
	double tmp;
	if (t_1 <= -5e+222) {
		tmp = t_1;
	} else if (t_1 <= -2e+68) {
		tmp = t_2;
	} else if (t_1 <= -5.4e+42) {
		tmp = t_1;
	} else if (t_1 <= -1000.0) {
		tmp = t_2;
	} else if (t_1 <= 1e+34) {
		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)) - y
    t_2 = -y - z
    if (t_1 <= (-5d+222)) then
        tmp = t_1
    else if (t_1 <= (-2d+68)) then
        tmp = t_2
    else if (t_1 <= (-5.4d+42)) then
        tmp = t_1
    else if (t_1 <= (-1000.0d0)) then
        tmp = t_2
    else if (t_1 <= 1d+34) 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)) - y;
	double t_2 = -y - z;
	double tmp;
	if (t_1 <= -5e+222) {
		tmp = t_1;
	} else if (t_1 <= -2e+68) {
		tmp = t_2;
	} else if (t_1 <= -5.4e+42) {
		tmp = t_1;
	} else if (t_1 <= -1000.0) {
		tmp = t_2;
	} else if (t_1 <= 1e+34) {
		tmp = Math.log(t) - z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * math.log(y)) - y
	t_2 = -y - z
	tmp = 0
	if t_1 <= -5e+222:
		tmp = t_1
	elif t_1 <= -2e+68:
		tmp = t_2
	elif t_1 <= -5.4e+42:
		tmp = t_1
	elif t_1 <= -1000.0:
		tmp = t_2
	elif t_1 <= 1e+34:
		tmp = math.log(t) - z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * log(y)) - y)
	t_2 = Float64(Float64(-y) - z)
	tmp = 0.0
	if (t_1 <= -5e+222)
		tmp = t_1;
	elseif (t_1 <= -2e+68)
		tmp = t_2;
	elseif (t_1 <= -5.4e+42)
		tmp = t_1;
	elseif (t_1 <= -1000.0)
		tmp = t_2;
	elseif (t_1 <= 1e+34)
		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)) - y;
	t_2 = -y - z;
	tmp = 0.0;
	if (t_1 <= -5e+222)
		tmp = t_1;
	elseif (t_1 <= -2e+68)
		tmp = t_2;
	elseif (t_1 <= -5.4e+42)
		tmp = t_1;
	elseif (t_1 <= -1000.0)
		tmp = t_2;
	elseif (t_1 <= 1e+34)
		tmp = log(t) - 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]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+222], t$95$1, If[LessEqual[t$95$1, -2e+68], t$95$2, If[LessEqual[t$95$1, -5.4e+42], t$95$1, If[LessEqual[t$95$1, -1000.0], t$95$2, If[LessEqual[t$95$1, 1e+34], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+68}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_1 \leq -1000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq 10^{+34}:\\
\;\;\;\;\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.00000000000000023e222 or -1.99999999999999991e68 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.4000000000000001e42 or 9.99999999999999946e33 < (-.f64 (*.f64 x (log.f64 y)) y)

    1. Initial program 99.7%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.7%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt98.8%

        \[\leadsto \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 \]
      2. pow398.8%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    7. Applied egg-rr98.8%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in z around 0 88.9%

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

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

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

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

    if -5.00000000000000023e222 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999991e68 or -5.4000000000000001e42 < (-.f64 (*.f64 x (log.f64 y)) y) < -1e3

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 96.2%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt96.0%

        \[\leadsto \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 \]
      2. pow396.0%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    7. Applied egg-rr96.0%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in x around 0 79.6%

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. neg-mul-179.6%

        \[\leadsto \color{blue}{-\left(y + z\right)} \]
      2. neg-sub079.6%

        \[\leadsto \color{blue}{0 - \left(y + z\right)} \]
      3. associate--r+79.6%

        \[\leadsto \color{blue}{\left(0 - y\right) - z} \]
      4. neg-sub079.6%

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

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

    if -1e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.99999999999999946e33

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-log-exp55.9%

        \[\leadsto \color{blue}{\log \left(e^{\left(x \cdot \log y - y\right) - \left(z - \log t\right)}\right)} \]
      2. associate--r-55.9%

        \[\leadsto \log \left(e^{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}\right) \]
      3. exp-sum55.9%

        \[\leadsto \log \color{blue}{\left(e^{\left(x \cdot \log y - y\right) - z} \cdot e^{\log t}\right)} \]
      4. associate--l-55.9%

        \[\leadsto \log \left(e^{\color{blue}{x \cdot \log y - \left(y + z\right)}} \cdot e^{\log t}\right) \]
      5. add-exp-log55.9%

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

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

      \[\leadsto \log \color{blue}{\left(t \cdot e^{-\left(y + z\right)}\right)} \]
    8. Step-by-step derivation
      1. distribute-neg-in54.8%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) + \left(-z\right)}}\right) \]
      2. unsub-neg54.8%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) - z}}\right) \]
    9. Simplified54.8%

      \[\leadsto \log \color{blue}{\left(t \cdot e^{\left(-y\right) - z}\right)} \]
    10. Taylor expanded in y around 0 53.0%

      \[\leadsto \color{blue}{\log \left(t \cdot e^{-z}\right)} \]
    11. Step-by-step derivation
      1. log-prod53.0%

        \[\leadsto \color{blue}{\log t + \log \left(e^{-z}\right)} \]
      2. rem-log-exp94.7%

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

        \[\leadsto \color{blue}{\log t - z} \]
    12. Simplified94.7%

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

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

Alternative 3: 87.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t_1 - y\\ t_3 := \left(-y\right) - z\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+222}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq -5.4 \cdot 10^{+42}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq -1000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 0.02:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;t_1 - z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y)) (t_3 (- (- y) z)))
   (if (<= t_2 -5e+222)
     t_2
     (if (<= t_2 -2e+68)
       t_3
       (if (<= t_2 -5.4e+42)
         t_2
         (if (<= t_2 -1000.0)
           t_3
           (if (<= t_2 0.02) (- (log t) z) (- t_1 z))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double t_2 = t_1 - y;
	double t_3 = -y - z;
	double tmp;
	if (t_2 <= -5e+222) {
		tmp = t_2;
	} else if (t_2 <= -2e+68) {
		tmp = t_3;
	} else if (t_2 <= -5.4e+42) {
		tmp = t_2;
	} else if (t_2 <= -1000.0) {
		tmp = t_3;
	} else if (t_2 <= 0.02) {
		tmp = log(t) - z;
	} else {
		tmp = t_1 - 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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = t_1 - y
    t_3 = -y - z
    if (t_2 <= (-5d+222)) then
        tmp = t_2
    else if (t_2 <= (-2d+68)) then
        tmp = t_3
    else if (t_2 <= (-5.4d+42)) then
        tmp = t_2
    else if (t_2 <= (-1000.0d0)) then
        tmp = t_3
    else if (t_2 <= 0.02d0) then
        tmp = log(t) - z
    else
        tmp = t_1 - 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 t_2 = t_1 - y;
	double t_3 = -y - z;
	double tmp;
	if (t_2 <= -5e+222) {
		tmp = t_2;
	} else if (t_2 <= -2e+68) {
		tmp = t_3;
	} else if (t_2 <= -5.4e+42) {
		tmp = t_2;
	} else if (t_2 <= -1000.0) {
		tmp = t_3;
	} else if (t_2 <= 0.02) {
		tmp = Math.log(t) - z;
	} else {
		tmp = t_1 - z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = t_1 - y
	t_3 = -y - z
	tmp = 0
	if t_2 <= -5e+222:
		tmp = t_2
	elif t_2 <= -2e+68:
		tmp = t_3
	elif t_2 <= -5.4e+42:
		tmp = t_2
	elif t_2 <= -1000.0:
		tmp = t_3
	elif t_2 <= 0.02:
		tmp = math.log(t) - z
	else:
		tmp = t_1 - z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	t_2 = Float64(t_1 - y)
	t_3 = Float64(Float64(-y) - z)
	tmp = 0.0
	if (t_2 <= -5e+222)
		tmp = t_2;
	elseif (t_2 <= -2e+68)
		tmp = t_3;
	elseif (t_2 <= -5.4e+42)
		tmp = t_2;
	elseif (t_2 <= -1000.0)
		tmp = t_3;
	elseif (t_2 <= 0.02)
		tmp = Float64(log(t) - z);
	else
		tmp = Float64(t_1 - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	t_2 = t_1 - y;
	t_3 = -y - z;
	tmp = 0.0;
	if (t_2 <= -5e+222)
		tmp = t_2;
	elseif (t_2 <= -2e+68)
		tmp = t_3;
	elseif (t_2 <= -5.4e+42)
		tmp = t_2;
	elseif (t_2 <= -1000.0)
		tmp = t_3;
	elseif (t_2 <= 0.02)
		tmp = log(t) - z;
	else
		tmp = t_1 - z;
	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]}, Block[{t$95$3 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+222], t$95$2, If[LessEqual[t$95$2, -2e+68], t$95$3, If[LessEqual[t$95$2, -5.4e+42], t$95$2, If[LessEqual[t$95$2, -1000.0], t$95$3, If[LessEqual[t$95$2, 0.02], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - y\\
t_3 := \left(-y\right) - z\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+222}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{+68}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_2 \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq -1000:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_2 \leq 0.02:\\
\;\;\;\;\log t - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000023e222 or -1.99999999999999991e68 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.4000000000000001e42

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.8%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt99.0%

        \[\leadsto \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 \]
      2. pow399.1%

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

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in z around 0 95.0%

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

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

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

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

    if -5.00000000000000023e222 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999991e68 or -5.4000000000000001e42 < (-.f64 (*.f64 x (log.f64 y)) y) < -1e3

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 96.2%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt96.0%

        \[\leadsto \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 \]
      2. pow396.0%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    7. Applied egg-rr96.0%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in x around 0 79.6%

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. neg-mul-179.6%

        \[\leadsto \color{blue}{-\left(y + z\right)} \]
      2. neg-sub079.6%

        \[\leadsto \color{blue}{0 - \left(y + z\right)} \]
      3. associate--r+79.6%

        \[\leadsto \color{blue}{\left(0 - y\right) - z} \]
      4. neg-sub079.6%

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

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

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

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-log-exp58.6%

        \[\leadsto \color{blue}{\log \left(e^{\left(x \cdot \log y - y\right) - \left(z - \log t\right)}\right)} \]
      2. associate--r-58.6%

        \[\leadsto \log \left(e^{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}\right) \]
      3. exp-sum58.6%

        \[\leadsto \log \color{blue}{\left(e^{\left(x \cdot \log y - y\right) - z} \cdot e^{\log t}\right)} \]
      4. associate--l-58.6%

        \[\leadsto \log \left(e^{\color{blue}{x \cdot \log y - \left(y + z\right)}} \cdot e^{\log t}\right) \]
      5. add-exp-log58.6%

        \[\leadsto \log \left(e^{x \cdot \log y - \left(y + z\right)} \cdot \color{blue}{t}\right) \]
    6. Applied egg-rr58.6%

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

      \[\leadsto \log \color{blue}{\left(t \cdot e^{-\left(y + z\right)}\right)} \]
    8. Step-by-step derivation
      1. distribute-neg-in57.5%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) + \left(-z\right)}}\right) \]
      2. unsub-neg57.5%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) - z}}\right) \]
    9. Simplified57.5%

      \[\leadsto \log \color{blue}{\left(t \cdot e^{\left(-y\right) - z}\right)} \]
    10. Taylor expanded in y around 0 55.5%

      \[\leadsto \color{blue}{\log \left(t \cdot e^{-z}\right)} \]
    11. Step-by-step derivation
      1. log-prod55.5%

        \[\leadsto \color{blue}{\log t + \log \left(e^{-z}\right)} \]
      2. rem-log-exp95.2%

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

        \[\leadsto \color{blue}{\log t - z} \]
    12. Simplified95.2%

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

    if 0.0200000000000000004 < (-.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. Step-by-step derivation
      1. associate-+l-99.6%

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.6%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt98.6%

        \[\leadsto \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 \]
      2. pow398.5%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    7. Applied egg-rr98.5%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in y around 0 97.8%

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

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

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

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

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

Alternative 4: 88.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t_1 - y\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+222}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{+68}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;t_2 \leq -5.4 \cdot 10^{+42}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0.02:\\ \;\;\;\;\left(\log t - z\right) - y\\ \mathbf{else}:\\ \;\;\;\;t_1 - z\\ \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 -5e+222)
     t_2
     (if (<= t_2 -2e+68)
       (- (- y) z)
       (if (<= t_2 -5.4e+42)
         t_2
         (if (<= t_2 0.02) (- (- (log t) z) y) (- t_1 z)))))))
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 <= -5e+222) {
		tmp = t_2;
	} else if (t_2 <= -2e+68) {
		tmp = -y - z;
	} else if (t_2 <= -5.4e+42) {
		tmp = t_2;
	} else if (t_2 <= 0.02) {
		tmp = (log(t) - z) - y;
	} else {
		tmp = t_1 - 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) :: t_2
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = t_1 - y
    if (t_2 <= (-5d+222)) then
        tmp = t_2
    else if (t_2 <= (-2d+68)) then
        tmp = -y - z
    else if (t_2 <= (-5.4d+42)) then
        tmp = t_2
    else if (t_2 <= 0.02d0) then
        tmp = (log(t) - z) - y
    else
        tmp = t_1 - 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 t_2 = t_1 - y;
	double tmp;
	if (t_2 <= -5e+222) {
		tmp = t_2;
	} else if (t_2 <= -2e+68) {
		tmp = -y - z;
	} else if (t_2 <= -5.4e+42) {
		tmp = t_2;
	} else if (t_2 <= 0.02) {
		tmp = (Math.log(t) - z) - y;
	} else {
		tmp = t_1 - z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = t_1 - y
	tmp = 0
	if t_2 <= -5e+222:
		tmp = t_2
	elif t_2 <= -2e+68:
		tmp = -y - z
	elif t_2 <= -5.4e+42:
		tmp = t_2
	elif t_2 <= 0.02:
		tmp = (math.log(t) - z) - y
	else:
		tmp = t_1 - z
	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 <= -5e+222)
		tmp = t_2;
	elseif (t_2 <= -2e+68)
		tmp = Float64(Float64(-y) - z);
	elseif (t_2 <= -5.4e+42)
		tmp = t_2;
	elseif (t_2 <= 0.02)
		tmp = Float64(Float64(log(t) - z) - y);
	else
		tmp = Float64(t_1 - z);
	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 <= -5e+222)
		tmp = t_2;
	elseif (t_2 <= -2e+68)
		tmp = -y - z;
	elseif (t_2 <= -5.4e+42)
		tmp = t_2;
	elseif (t_2 <= 0.02)
		tmp = (log(t) - z) - y;
	else
		tmp = t_1 - z;
	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, -5e+222], t$95$2, If[LessEqual[t$95$2, -2e+68], N[((-y) - z), $MachinePrecision], If[LessEqual[t$95$2, -5.4e+42], t$95$2, If[LessEqual[t$95$2, 0.02], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{+68}:\\
\;\;\;\;\left(-y\right) - z\\

\mathbf{elif}\;t_2 \leq -5.4 \cdot 10^{+42}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq 0.02:\\
\;\;\;\;\left(\log t - z\right) - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5.00000000000000023e222 or -1.99999999999999991e68 < (-.f64 (*.f64 x (log.f64 y)) y) < -5.4000000000000001e42

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.8%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt99.0%

        \[\leadsto \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 \]
      2. pow399.1%

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

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in z around 0 95.0%

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

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

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

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

    if -5.00000000000000023e222 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999991e68

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.9%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt99.6%

        \[\leadsto \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 \]
      2. pow399.7%

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

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in x around 0 81.9%

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. neg-mul-181.9%

        \[\leadsto \color{blue}{-\left(y + z\right)} \]
      2. neg-sub081.9%

        \[\leadsto \color{blue}{0 - \left(y + z\right)} \]
      3. associate--r+81.9%

        \[\leadsto \color{blue}{\left(0 - y\right) - z} \]
      4. neg-sub081.9%

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

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

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

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) + \left(-\left(z - \log t\right)\right)} \]
      3. sub-neg100.0%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y + \left(-\left(z - \log t\right)\right)\right) + \left(-y\right)} \]
      7. unsub-neg100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, -\left(z - \log t\right)\right)} - y \]
      9. neg-sub0100.0%

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{0 - \left(z - \log t\right)}\right) - y \]
      10. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\left(0 - z\right) + \log t}\right) - y \]
      11. neg-sub0100.0%

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

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\log t + \left(-z\right)}\right) - y \]
      13. unsub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \log t - z\right) - y} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 93.2%

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

    if 0.0200000000000000004 < (-.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. Step-by-step derivation
      1. associate-+l-99.6%

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.6%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt98.6%

        \[\leadsto \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 \]
      2. pow398.5%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    7. Applied egg-rr98.5%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in y around 0 97.8%

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

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

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

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

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

Alternative 5: 99.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ \mathbf{if}\;t_1 \leq -30000 \lor \neg \left(t_1 \leq 0.02\right):\\ \;\;\;\;t_1 - z\\ \mathbf{else}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x (log y)) y)))
   (if (or (<= t_1 -30000.0) (not (<= t_1 0.02)))
     (- t_1 z)
     (- (- (log t) z) y))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * log(y)) - y;
	double tmp;
	if ((t_1 <= -30000.0) || !(t_1 <= 0.02)) {
		tmp = t_1 - z;
	} 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 = (x * log(y)) - y
    if ((t_1 <= (-30000.0d0)) .or. (.not. (t_1 <= 0.02d0))) then
        tmp = t_1 - z
    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 = (x * Math.log(y)) - y;
	double tmp;
	if ((t_1 <= -30000.0) || !(t_1 <= 0.02)) {
		tmp = t_1 - z;
	} else {
		tmp = (Math.log(t) - z) - y;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * math.log(y)) - y
	tmp = 0
	if (t_1 <= -30000.0) or not (t_1 <= 0.02):
		tmp = t_1 - z
	else:
		tmp = (math.log(t) - z) - y
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * log(y)) - y)
	tmp = 0.0
	if ((t_1 <= -30000.0) || !(t_1 <= 0.02))
		tmp = Float64(t_1 - z);
	else
		tmp = Float64(Float64(log(t) - z) - y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * log(y)) - y;
	tmp = 0.0;
	if ((t_1 <= -30000.0) || ~((t_1 <= 0.02)))
		tmp = t_1 - z;
	else
		tmp = (log(t) - z) - y;
	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[Or[LessEqual[t$95$1, -30000.0], N[Not[LessEqual[t$95$1, 0.02]], $MachinePrecision]], N[(t$95$1 - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t_1 \leq -30000 \lor \neg \left(t_1 \leq 0.02\right):\\
\;\;\;\;t_1 - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -3e4 or 0.0200000000000000004 < (-.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. Step-by-step derivation
      1. associate-+l-99.8%

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 98.7%

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

    if -3e4 < (-.f64 (*.f64 x (log.f64 y)) y) < 0.0200000000000000004

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) + \left(-\left(z - \log t\right)\right)} \]
      3. sub-neg100.0%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y + \left(-\left(z - \log t\right)\right)\right) + \left(-y\right)} \]
      7. unsub-neg100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, -\left(z - \log t\right)\right)} - y \]
      9. neg-sub0100.0%

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{0 - \left(z - \log t\right)}\right) - y \]
      10. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\left(0 - z\right) + \log t}\right) - y \]
      11. neg-sub0100.0%

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

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\log t + \left(-z\right)}\right) - y \]
      13. unsub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \log t - z\right) - y} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 98.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \log y - y \leq -30000 \lor \neg \left(x \cdot \log y - y \leq 0.02\right):\\ \;\;\;\;\left(x \cdot \log y - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 99.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t_1 \leq -30000:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \left(-y\right) - z\right)\\

\mathbf{elif}\;t_1 \leq 0.02:\\
\;\;\;\;\left(\log t - z\right) - y\\

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


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

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 98.5%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt98.0%

        \[\leadsto \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 \]
      2. pow398.1%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    7. Applied egg-rr98.1%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Step-by-step derivation
      1. rem-cube-cbrt98.5%

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

        \[\leadsto \color{blue}{x \cdot \log y - \left(y + z\right)} \]
      3. *-commutative98.5%

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

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

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

    if -3e4 < (-.f64 (*.f64 x (log.f64 y)) y) < 0.0200000000000000004

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) + \left(-\left(z - \log t\right)\right)} \]
      3. sub-neg100.0%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y + \left(-\left(z - \log t\right)\right)\right) + \left(-y\right)} \]
      7. unsub-neg100.0%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, -\left(z - \log t\right)\right)} - y \]
      9. neg-sub0100.0%

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{0 - \left(z - \log t\right)}\right) - y \]
      10. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\left(0 - z\right) + \log t}\right) - y \]
      11. neg-sub0100.0%

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

        \[\leadsto \mathsf{fma}\left(x, \log y, \color{blue}{\log t + \left(-z\right)}\right) - y \]
      13. unsub-neg100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log y, \log t - z\right) - y} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 98.9%

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

    if 0.0200000000000000004 < (-.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. Step-by-step derivation
      1. associate-+l-99.6%

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.6%

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

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

Alternative 7: 99.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 98.2%

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

    if 460 < y

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 98.8%

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

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

Alternative 8: 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.9%

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

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

Alternative 9: 68.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t - y\\ t_2 := x \cdot \log y\\ t_3 := \left(-y\right) - z\\ \mathbf{if}\;x \leq -6.3 \cdot 10^{+187}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-229}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{-173}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-118}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (log t) y)) (t_2 (* x (log y))) (t_3 (- (- y) z)))
   (if (<= x -6.3e+187)
     t_2
     (if (<= x 9.2e-229)
       t_3
       (if (<= x 2.05e-173)
         t_1
         (if (<= x 8e-118)
           t_3
           (if (<= x 8e-22) t_1 (if (<= x 3.05e+196) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = log(t) - y;
	double t_2 = x * log(y);
	double t_3 = -y - z;
	double tmp;
	if (x <= -6.3e+187) {
		tmp = t_2;
	} else if (x <= 9.2e-229) {
		tmp = t_3;
	} else if (x <= 2.05e-173) {
		tmp = t_1;
	} else if (x <= 8e-118) {
		tmp = t_3;
	} else if (x <= 8e-22) {
		tmp = t_1;
	} else if (x <= 3.05e+196) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = log(t) - y
    t_2 = x * log(y)
    t_3 = -y - z
    if (x <= (-6.3d+187)) then
        tmp = t_2
    else if (x <= 9.2d-229) then
        tmp = t_3
    else if (x <= 2.05d-173) then
        tmp = t_1
    else if (x <= 8d-118) then
        tmp = t_3
    else if (x <= 8d-22) then
        tmp = t_1
    else if (x <= 3.05d+196) then
        tmp = t_3
    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 = Math.log(t) - y;
	double t_2 = x * Math.log(y);
	double t_3 = -y - z;
	double tmp;
	if (x <= -6.3e+187) {
		tmp = t_2;
	} else if (x <= 9.2e-229) {
		tmp = t_3;
	} else if (x <= 2.05e-173) {
		tmp = t_1;
	} else if (x <= 8e-118) {
		tmp = t_3;
	} else if (x <= 8e-22) {
		tmp = t_1;
	} else if (x <= 3.05e+196) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.log(t) - y
	t_2 = x * math.log(y)
	t_3 = -y - z
	tmp = 0
	if x <= -6.3e+187:
		tmp = t_2
	elif x <= 9.2e-229:
		tmp = t_3
	elif x <= 2.05e-173:
		tmp = t_1
	elif x <= 8e-118:
		tmp = t_3
	elif x <= 8e-22:
		tmp = t_1
	elif x <= 3.05e+196:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(log(t) - y)
	t_2 = Float64(x * log(y))
	t_3 = Float64(Float64(-y) - z)
	tmp = 0.0
	if (x <= -6.3e+187)
		tmp = t_2;
	elseif (x <= 9.2e-229)
		tmp = t_3;
	elseif (x <= 2.05e-173)
		tmp = t_1;
	elseif (x <= 8e-118)
		tmp = t_3;
	elseif (x <= 8e-22)
		tmp = t_1;
	elseif (x <= 3.05e+196)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = log(t) - y;
	t_2 = x * log(y);
	t_3 = -y - z;
	tmp = 0.0;
	if (x <= -6.3e+187)
		tmp = t_2;
	elseif (x <= 9.2e-229)
		tmp = t_3;
	elseif (x <= 2.05e-173)
		tmp = t_1;
	elseif (x <= 8e-118)
		tmp = t_3;
	elseif (x <= 8e-22)
		tmp = t_1;
	elseif (x <= 3.05e+196)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -6.3e+187], t$95$2, If[LessEqual[x, 9.2e-229], t$95$3, If[LessEqual[x, 2.05e-173], t$95$1, If[LessEqual[x, 8e-118], t$95$3, If[LessEqual[x, 8e-22], t$95$1, If[LessEqual[x, 3.05e+196], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log t - y\\
t_2 := x \cdot \log y\\
t_3 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -6.3 \cdot 10^{+187}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 9.2 \cdot 10^{-229}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq 2.05 \cdot 10^{-173}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 8 \cdot 10^{-118}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq 8 \cdot 10^{-22}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.30000000000000005e187 or 3.05000000000000018e196 < 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 - y\right) - \left(z - \log t\right)} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 95.1%

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

    if -6.30000000000000005e187 < x < 9.19999999999999983e-229 or 2.0499999999999999e-173 < x < 7.99999999999999988e-118 or 8.0000000000000004e-22 < x < 3.05000000000000018e196

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 89.6%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt89.2%

        \[\leadsto \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 \]
      2. pow389.3%

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

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in x around 0 71.0%

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. neg-mul-171.0%

        \[\leadsto \color{blue}{-\left(y + z\right)} \]
      2. neg-sub071.0%

        \[\leadsto \color{blue}{0 - \left(y + z\right)} \]
      3. associate--r+71.0%

        \[\leadsto \color{blue}{\left(0 - y\right) - z} \]
      4. neg-sub071.0%

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

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

    if 9.19999999999999983e-229 < x < 2.0499999999999999e-173 or 7.99999999999999988e-118 < x < 8.0000000000000004e-22

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-log-exp51.0%

        \[\leadsto \color{blue}{\log \left(e^{\left(x \cdot \log y - y\right) - \left(z - \log t\right)}\right)} \]
      2. associate--r-51.0%

        \[\leadsto \log \left(e^{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}\right) \]
      3. exp-sum51.0%

        \[\leadsto \log \color{blue}{\left(e^{\left(x \cdot \log y - y\right) - z} \cdot e^{\log t}\right)} \]
      4. associate--l-51.0%

        \[\leadsto \log \left(e^{\color{blue}{x \cdot \log y - \left(y + z\right)}} \cdot e^{\log t}\right) \]
      5. add-exp-log51.0%

        \[\leadsto \log \left(e^{x \cdot \log y - \left(y + z\right)} \cdot \color{blue}{t}\right) \]
    6. Applied egg-rr51.0%

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

      \[\leadsto \log \color{blue}{\left(t \cdot e^{-\left(y + z\right)}\right)} \]
    8. Step-by-step derivation
      1. distribute-neg-in51.0%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) + \left(-z\right)}}\right) \]
      2. unsub-neg51.0%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) - z}}\right) \]
    9. Simplified51.0%

      \[\leadsto \log \color{blue}{\left(t \cdot e^{\left(-y\right) - z}\right)} \]
    10. Taylor expanded in z around 0 47.7%

      \[\leadsto \color{blue}{\log \left(t \cdot e^{-y}\right)} \]
    11. Step-by-step derivation
      1. exp-neg47.7%

        \[\leadsto \log \left(t \cdot \color{blue}{\frac{1}{e^{y}}}\right) \]
      2. associate-*r/47.7%

        \[\leadsto \log \color{blue}{\left(\frac{t \cdot 1}{e^{y}}\right)} \]
      3. log-div50.5%

        \[\leadsto \color{blue}{\log \left(t \cdot 1\right) - \log \left(e^{y}\right)} \]
      4. *-rgt-identity50.5%

        \[\leadsto \log \color{blue}{t} - \log \left(e^{y}\right) \]
      5. rem-log-exp82.5%

        \[\leadsto \log t - \color{blue}{y} \]
    12. Simplified82.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.3 \cdot 10^{+187}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{-229}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{-173}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-118}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-22}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \left(-y\right) - z\\ \mathbf{if}\;x \leq -2.8 \cdot 10^{+189}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-284}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-187}:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-118}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-22}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\ \;\;\;\;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 (- (- y) z)))
   (if (<= x -2.8e+189)
     t_1
     (if (<= x 4e-284)
       t_2
       (if (<= x 2.5e-187)
         (- (log t) z)
         (if (<= x 2.4e-118)
           t_2
           (if (<= x 6.8e-22)
             (- (log t) y)
             (if (<= x 3.05e+196) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double t_2 = -y - z;
	double tmp;
	if (x <= -2.8e+189) {
		tmp = t_1;
	} else if (x <= 4e-284) {
		tmp = t_2;
	} else if (x <= 2.5e-187) {
		tmp = log(t) - z;
	} else if (x <= 2.4e-118) {
		tmp = t_2;
	} else if (x <= 6.8e-22) {
		tmp = log(t) - y;
	} else if (x <= 3.05e+196) {
		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 = -y - z
    if (x <= (-2.8d+189)) then
        tmp = t_1
    else if (x <= 4d-284) then
        tmp = t_2
    else if (x <= 2.5d-187) then
        tmp = log(t) - z
    else if (x <= 2.4d-118) then
        tmp = t_2
    else if (x <= 6.8d-22) then
        tmp = log(t) - y
    else if (x <= 3.05d+196) 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 = -y - z;
	double tmp;
	if (x <= -2.8e+189) {
		tmp = t_1;
	} else if (x <= 4e-284) {
		tmp = t_2;
	} else if (x <= 2.5e-187) {
		tmp = Math.log(t) - z;
	} else if (x <= 2.4e-118) {
		tmp = t_2;
	} else if (x <= 6.8e-22) {
		tmp = Math.log(t) - y;
	} else if (x <= 3.05e+196) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = -y - z
	tmp = 0
	if x <= -2.8e+189:
		tmp = t_1
	elif x <= 4e-284:
		tmp = t_2
	elif x <= 2.5e-187:
		tmp = math.log(t) - z
	elif x <= 2.4e-118:
		tmp = t_2
	elif x <= 6.8e-22:
		tmp = math.log(t) - y
	elif x <= 3.05e+196:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	t_2 = Float64(Float64(-y) - z)
	tmp = 0.0
	if (x <= -2.8e+189)
		tmp = t_1;
	elseif (x <= 4e-284)
		tmp = t_2;
	elseif (x <= 2.5e-187)
		tmp = Float64(log(t) - z);
	elseif (x <= 2.4e-118)
		tmp = t_2;
	elseif (x <= 6.8e-22)
		tmp = Float64(log(t) - y);
	elseif (x <= 3.05e+196)
		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 = -y - z;
	tmp = 0.0;
	if (x <= -2.8e+189)
		tmp = t_1;
	elseif (x <= 4e-284)
		tmp = t_2;
	elseif (x <= 2.5e-187)
		tmp = log(t) - z;
	elseif (x <= 2.4e-118)
		tmp = t_2;
	elseif (x <= 6.8e-22)
		tmp = log(t) - y;
	elseif (x <= 3.05e+196)
		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[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -2.8e+189], t$95$1, If[LessEqual[x, 4e-284], t$95$2, If[LessEqual[x, 2.5e-187], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 2.4e-118], t$95$2, If[LessEqual[x, 6.8e-22], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 3.05e+196], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+189}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 4 \cdot 10^{-284}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-118}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 6.8 \cdot 10^{-22}:\\
\;\;\;\;\log t - y\\

\mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.80000000000000006e189 or 3.05000000000000018e196 < 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 - y\right) - \left(z - \log t\right)} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 95.1%

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

    if -2.80000000000000006e189 < x < 4.00000000000000015e-284 or 2.4999999999999998e-187 < x < 2.4000000000000001e-118 or 6.7999999999999997e-22 < x < 3.05000000000000018e196

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 89.5%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt89.1%

        \[\leadsto \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 \]
      2. pow389.2%

        \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    7. Applied egg-rr89.2%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in x around 0 70.8%

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. neg-mul-170.8%

        \[\leadsto \color{blue}{-\left(y + z\right)} \]
      2. neg-sub070.8%

        \[\leadsto \color{blue}{0 - \left(y + z\right)} \]
      3. associate--r+70.8%

        \[\leadsto \color{blue}{\left(0 - y\right) - z} \]
      4. neg-sub070.8%

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

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

    if 4.00000000000000015e-284 < x < 2.4999999999999998e-187

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-log-exp55.8%

        \[\leadsto \color{blue}{\log \left(e^{\left(x \cdot \log y - y\right) - \left(z - \log t\right)}\right)} \]
      2. associate--r-55.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}\right) \]
      3. exp-sum55.8%

        \[\leadsto \log \color{blue}{\left(e^{\left(x \cdot \log y - y\right) - z} \cdot e^{\log t}\right)} \]
      4. associate--l-55.8%

        \[\leadsto \log \left(e^{\color{blue}{x \cdot \log y - \left(y + z\right)}} \cdot e^{\log t}\right) \]
      5. add-exp-log55.8%

        \[\leadsto \log \left(e^{x \cdot \log y - \left(y + z\right)} \cdot \color{blue}{t}\right) \]
    6. Applied egg-rr55.8%

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

      \[\leadsto \log \color{blue}{\left(t \cdot e^{-\left(y + z\right)}\right)} \]
    8. Step-by-step derivation
      1. distribute-neg-in55.8%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) + \left(-z\right)}}\right) \]
      2. unsub-neg55.8%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) - z}}\right) \]
    9. Simplified55.8%

      \[\leadsto \log \color{blue}{\left(t \cdot e^{\left(-y\right) - z}\right)} \]
    10. Taylor expanded in y around 0 51.8%

      \[\leadsto \color{blue}{\log \left(t \cdot e^{-z}\right)} \]
    11. Step-by-step derivation
      1. log-prod51.8%

        \[\leadsto \color{blue}{\log t + \log \left(e^{-z}\right)} \]
      2. rem-log-exp81.9%

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

        \[\leadsto \color{blue}{\log t - z} \]
    12. Simplified81.9%

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

    if 2.4000000000000001e-118 < x < 6.7999999999999997e-22

    1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-log-exp46.4%

        \[\leadsto \color{blue}{\log \left(e^{\left(x \cdot \log y - y\right) - \left(z - \log t\right)}\right)} \]
      2. associate--r-46.4%

        \[\leadsto \log \left(e^{\color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t}}\right) \]
      3. exp-sum46.4%

        \[\leadsto \log \color{blue}{\left(e^{\left(x \cdot \log y - y\right) - z} \cdot e^{\log t}\right)} \]
      4. associate--l-46.4%

        \[\leadsto \log \left(e^{\color{blue}{x \cdot \log y - \left(y + z\right)}} \cdot e^{\log t}\right) \]
      5. add-exp-log46.4%

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

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

      \[\leadsto \log \color{blue}{\left(t \cdot e^{-\left(y + z\right)}\right)} \]
    8. Step-by-step derivation
      1. distribute-neg-in46.4%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) + \left(-z\right)}}\right) \]
      2. unsub-neg46.4%

        \[\leadsto \log \left(t \cdot e^{\color{blue}{\left(-y\right) - z}}\right) \]
    9. Simplified46.4%

      \[\leadsto \log \color{blue}{\left(t \cdot e^{\left(-y\right) - z}\right)} \]
    10. Taylor expanded in z around 0 44.7%

      \[\leadsto \color{blue}{\log \left(t \cdot e^{-y}\right)} \]
    11. Step-by-step derivation
      1. exp-neg44.7%

        \[\leadsto \log \left(t \cdot \color{blue}{\frac{1}{e^{y}}}\right) \]
      2. associate-*r/44.7%

        \[\leadsto \log \color{blue}{\left(\frac{t \cdot 1}{e^{y}}\right)} \]
      3. log-div48.9%

        \[\leadsto \color{blue}{\log \left(t \cdot 1\right) - \log \left(e^{y}\right)} \]
      4. *-rgt-identity48.9%

        \[\leadsto \log \color{blue}{t} - \log \left(e^{y}\right) \]
      5. rem-log-exp83.9%

        \[\leadsto \log t - \color{blue}{y} \]
    12. Simplified83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{+189}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-284}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-187}:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-118}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-22}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 3.05 \cdot 10^{+196}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 70.4% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+188} \lor \neg \left(x \leq 1.75 \cdot 10^{+197}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7999999999999998e188 or 1.75e197 < 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 - y\right) - \left(z - \log t\right)} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 95.1%

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

    if -3.7999999999999998e188 < x < 1.75e197

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 83.2%

      \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
    6. Step-by-step derivation
      1. add-cube-cbrt82.9%

        \[\leadsto \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 \]
      2. pow382.9%

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

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
    8. Taylor expanded in x around 0 67.6%

      \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
    9. Step-by-step derivation
      1. neg-mul-167.6%

        \[\leadsto \color{blue}{-\left(y + z\right)} \]
      2. neg-sub067.6%

        \[\leadsto \color{blue}{0 - \left(y + z\right)} \]
      3. associate--r+67.6%

        \[\leadsto \color{blue}{\left(0 - y\right) - z} \]
      4. neg-sub067.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{+188} \lor \neg \left(x \leq 1.75 \cdot 10^{+197}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(-y\right) - z\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 47.5% accurate, 34.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+101} \lor \neg \left(z \leq 3.9 \cdot 10^{+133}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.24999999999999997e101 or 3.90000000000000014e133 < z

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 78.0%

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

        \[\leadsto \color{blue}{-z} \]
    7. Simplified78.0%

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

    if -1.24999999999999997e101 < z < 3.90000000000000014e133

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 37.3%

      \[\leadsto \color{blue}{-1 \cdot y} \]
    6. Step-by-step derivation
      1. neg-mul-137.3%

        \[\leadsto \color{blue}{-y} \]
    7. Simplified37.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+101} \lor \neg \left(z \leq 3.9 \cdot 10^{+133}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 57.8% accurate, 52.3× 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.9%

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

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

    \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in z around inf 86.0%

    \[\leadsto \left(x \cdot \log y - y\right) - \color{blue}{z} \]
  6. Step-by-step derivation
    1. add-cube-cbrt85.5%

      \[\leadsto \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 \]
    2. pow385.6%

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
  7. Applied egg-rr85.6%

    \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x \cdot \log y}\right)}^{3}} - y\right) - z \]
  8. Taylor expanded in x around 0 57.1%

    \[\leadsto \color{blue}{-1 \cdot \left(y + z\right)} \]
  9. Step-by-step derivation
    1. neg-mul-157.1%

      \[\leadsto \color{blue}{-\left(y + z\right)} \]
    2. neg-sub057.1%

      \[\leadsto \color{blue}{0 - \left(y + z\right)} \]
    3. associate--r+57.1%

      \[\leadsto \color{blue}{\left(0 - y\right) - z} \]
    4. neg-sub057.1%

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

    \[\leadsto \color{blue}{\left(-y\right) - z} \]
  11. Final simplification57.1%

    \[\leadsto \left(-y\right) - z \]
  12. Add Preprocessing

Alternative 14: 30.0% 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.9%

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

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

    \[\leadsto \color{blue}{\left(x \cdot \log y - y\right) - \left(z - \log t\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around inf 28.9%

    \[\leadsto \color{blue}{-1 \cdot y} \]
  6. Step-by-step derivation
    1. neg-mul-128.9%

      \[\leadsto \color{blue}{-y} \]
  7. Simplified28.9%

    \[\leadsto \color{blue}{-y} \]
  8. Final simplification28.9%

    \[\leadsto -y \]
  9. Add Preprocessing

Reproduce

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