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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 90.1% accurate, 0.6× speedup?

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

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

\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) < -5.0000000000000004e90

    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. associate--l-99.9%

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

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

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

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

    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. associate--l-100.0%

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

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

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

    if 4.9999999999999998e-8 < (-.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)} \]
      2. associate--l-99.7%

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

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

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

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

Alternative 3: 88.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+65} \lor \neg \left(z \leq 1.42 \cdot 10^{+109}\right):\\
\;\;\;\;\log t - \left(y + z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.7999999999999999e65 or 1.4200000000000001e109 < z

    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. associate--l-100.0%

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

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

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

    if -6.7999999999999999e65 < z < 1.4200000000000001e109

    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)} \]
      2. associate--l-99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+65} \lor \neg \left(z \leq 1.42 \cdot 10^{+109}\right):\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y + \left(\log t - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.3% accurate, 1.0× speedup?

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

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

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


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

    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. associate--l-99.9%

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

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

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

    if 340 < y

    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. associate--l-99.9%

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

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

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

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

      \[\leadsto y \cdot \left(\log y \cdot \frac{x}{y} + \left(-1 + \color{blue}{-1 \cdot \frac{z}{y}}\right)\right) \]
    8. Step-by-step derivation
      1. neg-mul-198.7%

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

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

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

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

Alternative 5: 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 6: 49.8% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -225000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-102}:\\ \;\;\;\;-y\\ \mathbf{elif}\;x \leq -1.85 \cdot 10^{-283}:\\ \;\;\;\;-z\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-94}:\\ \;\;\;\;-y\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+73}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= x -225000000.0)
     t_1
     (if (<= x -1.6e-102)
       (- y)
       (if (<= x -1.85e-283)
         (- z)
         (if (<= x 3.5e-94) (- y) (if (<= x 4.6e+73) (- z) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -225000000.0) {
		tmp = t_1;
	} else if (x <= -1.6e-102) {
		tmp = -y;
	} else if (x <= -1.85e-283) {
		tmp = -z;
	} else if (x <= 3.5e-94) {
		tmp = -y;
	} else if (x <= 4.6e+73) {
		tmp = -z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * log(y)
    if (x <= (-225000000.0d0)) then
        tmp = t_1
    else if (x <= (-1.6d-102)) then
        tmp = -y
    else if (x <= (-1.85d-283)) then
        tmp = -z
    else if (x <= 3.5d-94) then
        tmp = -y
    else if (x <= 4.6d+73) then
        tmp = -z
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * Math.log(y);
	double tmp;
	if (x <= -225000000.0) {
		tmp = t_1;
	} else if (x <= -1.6e-102) {
		tmp = -y;
	} else if (x <= -1.85e-283) {
		tmp = -z;
	} else if (x <= 3.5e-94) {
		tmp = -y;
	} else if (x <= 4.6e+73) {
		tmp = -z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	tmp = 0
	if x <= -225000000.0:
		tmp = t_1
	elif x <= -1.6e-102:
		tmp = -y
	elif x <= -1.85e-283:
		tmp = -z
	elif x <= 3.5e-94:
		tmp = -y
	elif x <= 4.6e+73:
		tmp = -z
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -225000000.0)
		tmp = t_1;
	elseif (x <= -1.6e-102)
		tmp = Float64(-y);
	elseif (x <= -1.85e-283)
		tmp = Float64(-z);
	elseif (x <= 3.5e-94)
		tmp = Float64(-y);
	elseif (x <= 4.6e+73)
		tmp = Float64(-z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	tmp = 0.0;
	if (x <= -225000000.0)
		tmp = t_1;
	elseif (x <= -1.6e-102)
		tmp = -y;
	elseif (x <= -1.85e-283)
		tmp = -z;
	elseif (x <= 3.5e-94)
		tmp = -y;
	elseif (x <= 4.6e+73)
		tmp = -z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -225000000.0], t$95$1, If[LessEqual[x, -1.6e-102], (-y), If[LessEqual[x, -1.85e-283], (-z), If[LessEqual[x, 3.5e-94], (-y), If[LessEqual[x, 4.6e+73], (-z), t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -225000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.6 \cdot 10^{-102}:\\
\;\;\;\;-y\\

\mathbf{elif}\;x \leq -1.85 \cdot 10^{-283}:\\
\;\;\;\;-z\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-94}:\\
\;\;\;\;-y\\

\mathbf{elif}\;x \leq 4.6 \cdot 10^{+73}:\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.25e8 or 4.6e73 < x

    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)} \]
      2. associate--l-99.8%

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+70.7%

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

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

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

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

    if -2.25e8 < x < -1.59999999999999993e-102 or -1.85e-283 < x < 3.49999999999999998e-94

    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. associate--l-100.0%

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

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

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

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

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

    if -1.59999999999999993e-102 < x < -1.85e-283 or 3.49999999999999998e-94 < x < 4.6e73

    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. associate--l-100.0%

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

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

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

        \[\leadsto \color{blue}{-z} \]
    7. Simplified50.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -225000000:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-102}:\\ \;\;\;\;-y\\ \mathbf{elif}\;x \leq -1.85 \cdot 10^{-283}:\\ \;\;\;\;-z\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-94}:\\ \;\;\;\;-y\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+73}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 60.4% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \log t - y\\ \mathbf{if}\;x \leq -480000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{-203}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-280}:\\ \;\;\;\;-z\\ \mathbf{elif}\;x \leq 0.065:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+68}:\\ \;\;\;\;-z\\ \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 -480000000.0)
     t_1
     (if (<= x -1.1e-203)
       t_2
       (if (<= x -2e-280)
         (- z)
         (if (<= x 0.065) t_2 (if (<= x 2e+68) (- z) 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 <= -480000000.0) {
		tmp = t_1;
	} else if (x <= -1.1e-203) {
		tmp = t_2;
	} else if (x <= -2e-280) {
		tmp = -z;
	} else if (x <= 0.065) {
		tmp = t_2;
	} else if (x <= 2e+68) {
		tmp = -z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = log(t) - y
    if (x <= (-480000000.0d0)) then
        tmp = t_1
    else if (x <= (-1.1d-203)) then
        tmp = t_2
    else if (x <= (-2d-280)) then
        tmp = -z
    else if (x <= 0.065d0) then
        tmp = t_2
    else if (x <= 2d+68) then
        tmp = -z
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * Math.log(y);
	double t_2 = Math.log(t) - y;
	double tmp;
	if (x <= -480000000.0) {
		tmp = t_1;
	} else if (x <= -1.1e-203) {
		tmp = t_2;
	} else if (x <= -2e-280) {
		tmp = -z;
	} else if (x <= 0.065) {
		tmp = t_2;
	} else if (x <= 2e+68) {
		tmp = -z;
	} 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 <= -480000000.0:
		tmp = t_1
	elif x <= -1.1e-203:
		tmp = t_2
	elif x <= -2e-280:
		tmp = -z
	elif x <= 0.065:
		tmp = t_2
	elif x <= 2e+68:
		tmp = -z
	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 <= -480000000.0)
		tmp = t_1;
	elseif (x <= -1.1e-203)
		tmp = t_2;
	elseif (x <= -2e-280)
		tmp = Float64(-z);
	elseif (x <= 0.065)
		tmp = t_2;
	elseif (x <= 2e+68)
		tmp = Float64(-z);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	t_2 = log(t) - y;
	tmp = 0.0;
	if (x <= -480000000.0)
		tmp = t_1;
	elseif (x <= -1.1e-203)
		tmp = t_2;
	elseif (x <= -2e-280)
		tmp = -z;
	elseif (x <= 0.065)
		tmp = t_2;
	elseif (x <= 2e+68)
		tmp = -z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -480000000.0], t$95$1, If[LessEqual[x, -1.1e-203], t$95$2, If[LessEqual[x, -2e-280], (-z), If[LessEqual[x, 0.065], t$95$2, If[LessEqual[x, 2e+68], (-z), t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -480000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.1 \cdot 10^{-203}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -2 \cdot 10^{-280}:\\
\;\;\;\;-z\\

\mathbf{elif}\;x \leq 0.065:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 2 \cdot 10^{+68}:\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.8e8 or 1.99999999999999991e68 < x

    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)} \]
      2. associate--l-99.8%

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+70.7%

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

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

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

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

    if -4.8e8 < x < -1.1e-203 or -1.9999999999999999e-280 < x < 0.065000000000000002

    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. associate--l-100.0%

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

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

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

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

    if -1.1e-203 < x < -1.9999999999999999e-280 or 0.065000000000000002 < x < 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)} \]
      2. associate--l-100.0%

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

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

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

        \[\leadsto \color{blue}{-z} \]
    7. Simplified64.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -480000000:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{-203}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-280}:\\ \;\;\;\;-z\\ \mathbf{elif}\;x \leq 0.065:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+68}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \log t - z\\ t_2 := x \cdot \log y\\ t_3 := \log t - y\\ \mathbf{if}\;x \leq -240000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-102}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-282}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-97}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (log t) z)) (t_2 (* x (log y))) (t_3 (- (log t) y)))
   (if (<= x -240000000.0)
     t_2
     (if (<= x -6.5e-102)
       t_3
       (if (<= x -7e-282)
         t_1
         (if (<= x 1.6e-97) t_3 (if (<= x 2.7e+64) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = log(t) - z;
	double t_2 = x * log(y);
	double t_3 = log(t) - y;
	double tmp;
	if (x <= -240000000.0) {
		tmp = t_2;
	} else if (x <= -6.5e-102) {
		tmp = t_3;
	} else if (x <= -7e-282) {
		tmp = t_1;
	} else if (x <= 1.6e-97) {
		tmp = t_3;
	} else if (x <= 2.7e+64) {
		tmp = t_1;
	} 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) - z
    t_2 = x * log(y)
    t_3 = log(t) - y
    if (x <= (-240000000.0d0)) then
        tmp = t_2
    else if (x <= (-6.5d-102)) then
        tmp = t_3
    else if (x <= (-7d-282)) then
        tmp = t_1
    else if (x <= 1.6d-97) then
        tmp = t_3
    else if (x <= 2.7d+64) then
        tmp = t_1
    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) - z;
	double t_2 = x * Math.log(y);
	double t_3 = Math.log(t) - y;
	double tmp;
	if (x <= -240000000.0) {
		tmp = t_2;
	} else if (x <= -6.5e-102) {
		tmp = t_3;
	} else if (x <= -7e-282) {
		tmp = t_1;
	} else if (x <= 1.6e-97) {
		tmp = t_3;
	} else if (x <= 2.7e+64) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = math.log(t) - z
	t_2 = x * math.log(y)
	t_3 = math.log(t) - y
	tmp = 0
	if x <= -240000000.0:
		tmp = t_2
	elif x <= -6.5e-102:
		tmp = t_3
	elif x <= -7e-282:
		tmp = t_1
	elif x <= 1.6e-97:
		tmp = t_3
	elif x <= 2.7e+64:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(log(t) - z)
	t_2 = Float64(x * log(y))
	t_3 = Float64(log(t) - y)
	tmp = 0.0
	if (x <= -240000000.0)
		tmp = t_2;
	elseif (x <= -6.5e-102)
		tmp = t_3;
	elseif (x <= -7e-282)
		tmp = t_1;
	elseif (x <= 1.6e-97)
		tmp = t_3;
	elseif (x <= 2.7e+64)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = log(t) - z;
	t_2 = x * log(y);
	t_3 = log(t) - y;
	tmp = 0.0;
	if (x <= -240000000.0)
		tmp = t_2;
	elseif (x <= -6.5e-102)
		tmp = t_3;
	elseif (x <= -7e-282)
		tmp = t_1;
	elseif (x <= 1.6e-97)
		tmp = t_3;
	elseif (x <= 2.7e+64)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -240000000.0], t$95$2, If[LessEqual[x, -6.5e-102], t$95$3, If[LessEqual[x, -7e-282], t$95$1, If[LessEqual[x, 1.6e-97], t$95$3, If[LessEqual[x, 2.7e+64], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \log t - z\\
t_2 := x \cdot \log y\\
t_3 := \log t - y\\
\mathbf{if}\;x \leq -240000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -6.5 \cdot 10^{-102}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq -7 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.6 \cdot 10^{-97}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq 2.7 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.4e8 or 2.7e64 < x

    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)} \]
      2. associate--l-99.8%

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+70.7%

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

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

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

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

    if -2.4e8 < x < -6.5000000000000003e-102 or -7.00000000000000013e-282 < x < 1.5999999999999999e-97

    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. associate--l-100.0%

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

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

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

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

    if -6.5000000000000003e-102 < x < -7.00000000000000013e-282 or 1.5999999999999999e-97 < x < 2.7e64

    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. associate--l-100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -240000000:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-102}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-282}:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-97}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+64}:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.2% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+90} \lor \neg \left(x \leq 1.55 \cdot 10^{+88}\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1999999999999999e90 or 1.5500000000000001e88 < x

    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)} \]
      2. associate--l-99.7%

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

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

      \[\leadsto \color{blue}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+66.5%

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

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

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

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

    if -2.1999999999999999e90 < x < 1.5500000000000001e88

    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. associate--l-100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+90} \lor \neg \left(x \leq 1.55 \cdot 10^{+88}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 89.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+84} \lor \neg \left(x \leq 7.6 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot \log y - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.85e84 or 7.60000000000000041e67 < x

    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)} \]
      2. associate--l-99.7%

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

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

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

    if -1.85e84 < x < 7.60000000000000041e67

    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. associate--l-100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{+84} \lor \neg \left(x \leq 7.6 \cdot 10^{+67}\right):\\ \;\;\;\;x \cdot \log y - y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 46.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-277}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 1.32 \cdot 10^{-188}:\\ \;\;\;\;\log t\\ \mathbf{elif}\;y \leq 2600000000000:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y 5.2e-277)
   (- z)
   (if (<= y 1.32e-188) (log t) (if (<= y 2600000000000.0) (- z) (- y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 5.2e-277) {
		tmp = -z;
	} else if (y <= 1.32e-188) {
		tmp = log(t);
	} else if (y <= 2600000000000.0) {
		tmp = -z;
	} else {
		tmp = -y;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 5.2d-277) then
        tmp = -z
    else if (y <= 1.32d-188) then
        tmp = log(t)
    else if (y <= 2600000000000.0d0) then
        tmp = -z
    else
        tmp = -y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 5.2e-277) {
		tmp = -z;
	} else if (y <= 1.32e-188) {
		tmp = Math.log(t);
	} else if (y <= 2600000000000.0) {
		tmp = -z;
	} else {
		tmp = -y;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= 5.2e-277:
		tmp = -z
	elif y <= 1.32e-188:
		tmp = math.log(t)
	elif y <= 2600000000000.0:
		tmp = -z
	else:
		tmp = -y
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 5.2e-277)
		tmp = Float64(-z);
	elseif (y <= 1.32e-188)
		tmp = log(t);
	elseif (y <= 2600000000000.0)
		tmp = Float64(-z);
	else
		tmp = Float64(-y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 5.2e-277)
		tmp = -z;
	elseif (y <= 1.32e-188)
		tmp = log(t);
	elseif (y <= 2600000000000.0)
		tmp = -z;
	else
		tmp = -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, 5.2e-277], (-z), If[LessEqual[y, 1.32e-188], N[Log[t], $MachinePrecision], If[LessEqual[y, 2600000000000.0], (-z), (-y)]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-277}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq 1.32 \cdot 10^{-188}:\\
\;\;\;\;\log t\\

\mathbf{elif}\;y \leq 2600000000000:\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 5.2e-277 or 1.32e-188 < y < 2.6e12

    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)} \]
      2. associate--l-99.8%

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

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

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

        \[\leadsto \color{blue}{-z} \]
    7. Simplified40.2%

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

    if 5.2e-277 < y < 1.32e-188

    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. associate--l-100.0%

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

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

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

      \[\leadsto \color{blue}{\log t - y} \]
    7. Taylor expanded in y around 0 43.0%

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

    if 2.6e12 < y

    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. associate--l-99.9%

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

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

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

        \[\leadsto \color{blue}{-y} \]
    7. Simplified65.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-277}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 1.32 \cdot 10^{-188}:\\ \;\;\;\;\log t\\ \mathbf{elif}\;y \leq 2600000000000:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 48.0% accurate, 29.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 36000000000000:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \end{array} \]
(FPCore (x y z t) :precision binary64 (if (<= y 36000000000000.0) (- z) (- y)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 36000000000000.0) {
		tmp = -z;
	} else {
		tmp = -y;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= 36000000000000.0d0) then
        tmp = -z
    else
        tmp = -y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 36000000000000.0) {
		tmp = -z;
	} else {
		tmp = -y;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= 36000000000000.0:
		tmp = -z
	else:
		tmp = -y
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 36000000000000.0)
		tmp = Float64(-z);
	else
		tmp = Float64(-y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= 36000000000000.0)
		tmp = -z;
	else
		tmp = -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, 36000000000000.0], (-z), (-y)]
\begin{array}{l}

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

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


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

    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. associate--l-99.9%

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

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

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

        \[\leadsto \color{blue}{-z} \]
    7. Simplified35.5%

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

    if 3.6e13 < y

    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. associate--l-99.9%

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

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

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

        \[\leadsto \color{blue}{-y} \]
    7. Simplified65.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 36000000000000:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 29.7% 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)} \]
    2. associate--l-99.9%

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

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

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

      \[\leadsto \color{blue}{-y} \]
  7. Simplified30.1%

    \[\leadsto \color{blue}{-y} \]
  8. Final simplification30.1%

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

Reproduce

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