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

Percentage Accurate: 99.9% → 99.9%
Time: 12.8s
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, 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.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. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.5% 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^{+33} \lor \neg \left(t\_2 \leq 2 \cdot 10^{-67}\right):\\ \;\;\;\;\left(t\_1 - z\right) - y\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
   (if (or (<= t_2 -5e+33) (not (<= t_2 2e-67)))
     (- (- t_1 z) y)
     (- (log t) (+ y 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+33) || !(t_2 <= 2e-67)) {
		tmp = (t_1 - z) - 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = t_1 - y
    if ((t_2 <= (-5d+33)) .or. (.not. (t_2 <= 2d-67))) then
        tmp = (t_1 - z) - 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 t_1 = x * Math.log(y);
	double t_2 = t_1 - y;
	double tmp;
	if ((t_2 <= -5e+33) || !(t_2 <= 2e-67)) {
		tmp = (t_1 - z) - y;
	} else {
		tmp = Math.log(t) - (y + 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+33) or not (t_2 <= 2e-67):
		tmp = (t_1 - z) - y
	else:
		tmp = math.log(t) - (y + 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+33) || !(t_2 <= 2e-67))
		tmp = Float64(Float64(t_1 - z) - y);
	else
		tmp = Float64(log(t) - Float64(y + 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+33) || ~((t_2 <= 2e-67)))
		tmp = (t_1 - z) - y;
	else
		tmp = log(t) - (y + 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[Or[LessEqual[t$95$2, -5e+33], N[Not[LessEqual[t$95$2, 2e-67]], $MachinePrecision]], N[(N[(t$95$1 - z), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $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^{+33} \lor \neg \left(t\_2 \leq 2 \cdot 10^{-67}\right):\\
\;\;\;\;\left(t\_1 - z\right) - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -4.99999999999999973e33 or 1.99999999999999989e-67 < (-.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)} \]
      2. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999973e33 < (-.f64 (*.f64 x (log.f64 y)) y) < 1.99999999999999989e-67

    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 x around 0 99.3%

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

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

Alternative 3: 99.3% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.15e-6

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

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

    if 1.15e-6 < 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. sub-neg99.9%

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

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

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

        \[\leadsto \left(-y\right) + \color{blue}{\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-undefine99.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. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

Alternative 4: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - y \]
  8. 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.8%

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

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

Alternative 6: 68.7% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{+144} \lor \neg \left(x \leq 5.9 \cdot 10^{+32} \lor \neg \left(x \leq 5.6 \cdot 10^{+83}\right) \land \left(x \leq 1.12 \cdot 10^{+104} \lor \neg \left(x \leq 2.5 \cdot 10^{+157}\right) \land x \leq 3.3 \cdot 10^{+212}\right)\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) - y\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -9.2e+144)
         (not
          (or (<= x 5.9e+32)
              (and (not (<= x 5.6e+83))
                   (or (<= x 1.12e+104)
                       (and (not (<= x 2.5e+157)) (<= x 3.3e+212)))))))
   (* x (log y))
   (- (- z) y)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -9.2e+144) || !((x <= 5.9e+32) || (!(x <= 5.6e+83) && ((x <= 1.12e+104) || (!(x <= 2.5e+157) && (x <= 3.3e+212)))))) {
		tmp = x * log(y);
	} else {
		tmp = -z - y;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x <= (-9.2d+144)) .or. (.not. (x <= 5.9d+32) .or. (.not. (x <= 5.6d+83)) .and. (x <= 1.12d+104) .or. (.not. (x <= 2.5d+157)) .and. (x <= 3.3d+212))) then
        tmp = x * log(y)
    else
        tmp = -z - y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -9.2e+144) || !((x <= 5.9e+32) || (!(x <= 5.6e+83) && ((x <= 1.12e+104) || (!(x <= 2.5e+157) && (x <= 3.3e+212)))))) {
		tmp = x * Math.log(y);
	} else {
		tmp = -z - y;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -9.2e+144) or not ((x <= 5.9e+32) or (not (x <= 5.6e+83) and ((x <= 1.12e+104) or (not (x <= 2.5e+157) and (x <= 3.3e+212))))):
		tmp = x * math.log(y)
	else:
		tmp = -z - y
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -9.2e+144) || !((x <= 5.9e+32) || (!(x <= 5.6e+83) && ((x <= 1.12e+104) || (!(x <= 2.5e+157) && (x <= 3.3e+212))))))
		tmp = Float64(x * log(y));
	else
		tmp = Float64(Float64(-z) - y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -9.2e+144) || ~(((x <= 5.9e+32) || (~((x <= 5.6e+83)) && ((x <= 1.12e+104) || (~((x <= 2.5e+157)) && (x <= 3.3e+212)))))))
		tmp = x * log(y);
	else
		tmp = -z - y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.2e+144], N[Not[Or[LessEqual[x, 5.9e+32], And[N[Not[LessEqual[x, 5.6e+83]], $MachinePrecision], Or[LessEqual[x, 1.12e+104], And[N[Not[LessEqual[x, 2.5e+157]], $MachinePrecision], LessEqual[x, 3.3e+212]]]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[((-z) - y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+144} \lor \neg \left(x \leq 5.9 \cdot 10^{+32} \lor \neg \left(x \leq 5.6 \cdot 10^{+83}\right) \land \left(x \leq 1.12 \cdot 10^{+104} \lor \neg \left(x \leq 2.5 \cdot 10^{+157}\right) \land x \leq 3.3 \cdot 10^{+212}\right)\right):\\
\;\;\;\;x \cdot \log y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.2000000000000006e144 or 5.89999999999999965e32 < x < 5.6000000000000001e83 or 1.12000000000000003e104 < x < 2.49999999999999988e157 or 3.3e212 < 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)} \]
      2. associate--l-99.5%

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

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

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

    if -9.2000000000000006e144 < x < 5.89999999999999965e32 or 5.6000000000000001e83 < x < 1.12000000000000003e104 or 2.49999999999999988e157 < x < 3.3e212

    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 + \left(-y\right)\right)} - \left(z - \log t\right) \]
      3. +-commutative100.0%

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

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

        \[\leadsto \left(-y\right) + \color{blue}{\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-undefine100.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. Step-by-step derivation
      1. fma-undefine100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{+144} \lor \neg \left(x \leq 5.9 \cdot 10^{+32} \lor \neg \left(x \leq 5.6 \cdot 10^{+83}\right) \land \left(x \leq 1.12 \cdot 10^{+104} \lor \neg \left(x \leq 2.5 \cdot 10^{+157}\right) \land x \leq 3.3 \cdot 10^{+212}\right)\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) - y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 81.2% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -1.48 \cdot 10^{+144}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+32}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+82} \lor \neg \left(x \leq 2.3 \cdot 10^{+104} \lor \neg \left(x \leq 2.9 \cdot 10^{+157}\right) \land x \leq 4.1 \cdot 10^{+210}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) - y\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))))
   (if (<= x -1.48e+144)
     t_1
     (if (<= x 5.5e+32)
       (- (log t) (+ y z))
       (if (or (<= x 1.6e+82)
               (not
                (or (<= x 2.3e+104)
                    (and (not (<= x 2.9e+157)) (<= x 4.1e+210)))))
         t_1
         (- (- z) y))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double tmp;
	if (x <= -1.48e+144) {
		tmp = t_1;
	} else if (x <= 5.5e+32) {
		tmp = log(t) - (y + z);
	} else if ((x <= 1.6e+82) || !((x <= 2.3e+104) || (!(x <= 2.9e+157) && (x <= 4.1e+210)))) {
		tmp = t_1;
	} else {
		tmp = -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)
    if (x <= (-1.48d+144)) then
        tmp = t_1
    else if (x <= 5.5d+32) then
        tmp = log(t) - (y + z)
    else if ((x <= 1.6d+82) .or. (.not. (x <= 2.3d+104) .or. (.not. (x <= 2.9d+157)) .and. (x <= 4.1d+210))) then
        tmp = t_1
    else
        tmp = -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);
	double tmp;
	if (x <= -1.48e+144) {
		tmp = t_1;
	} else if (x <= 5.5e+32) {
		tmp = Math.log(t) - (y + z);
	} else if ((x <= 1.6e+82) || !((x <= 2.3e+104) || (!(x <= 2.9e+157) && (x <= 4.1e+210)))) {
		tmp = t_1;
	} else {
		tmp = -z - y;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	tmp = 0
	if x <= -1.48e+144:
		tmp = t_1
	elif x <= 5.5e+32:
		tmp = math.log(t) - (y + z)
	elif (x <= 1.6e+82) or not ((x <= 2.3e+104) or (not (x <= 2.9e+157) and (x <= 4.1e+210))):
		tmp = t_1
	else:
		tmp = -z - y
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	tmp = 0.0
	if (x <= -1.48e+144)
		tmp = t_1;
	elseif (x <= 5.5e+32)
		tmp = Float64(log(t) - Float64(y + z));
	elseif ((x <= 1.6e+82) || !((x <= 2.3e+104) || (!(x <= 2.9e+157) && (x <= 4.1e+210))))
		tmp = t_1;
	else
		tmp = Float64(Float64(-z) - y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	tmp = 0.0;
	if (x <= -1.48e+144)
		tmp = t_1;
	elseif (x <= 5.5e+32)
		tmp = log(t) - (y + z);
	elseif ((x <= 1.6e+82) || ~(((x <= 2.3e+104) || (~((x <= 2.9e+157)) && (x <= 4.1e+210)))))
		tmp = t_1;
	else
		tmp = -z - y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.48e+144], t$95$1, If[LessEqual[x, 5.5e+32], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.6e+82], N[Not[Or[LessEqual[x, 2.3e+104], And[N[Not[LessEqual[x, 2.9e+157]], $MachinePrecision], LessEqual[x, 4.1e+210]]]], $MachinePrecision]], t$95$1, N[((-z) - y), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq 1.6 \cdot 10^{+82} \lor \neg \left(x \leq 2.3 \cdot 10^{+104} \lor \neg \left(x \leq 2.9 \cdot 10^{+157}\right) \land x \leq 4.1 \cdot 10^{+210}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.4800000000000001e144 or 5.49999999999999984e32 < x < 1.59999999999999987e82 or 2.29999999999999985e104 < x < 2.89999999999999988e157 or 4.10000000000000001e210 < 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)} \]
      2. associate--l-99.5%

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

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

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

    if -1.4800000000000001e144 < x < 5.49999999999999984e32

    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 92.5%

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

    if 1.59999999999999987e82 < x < 2.29999999999999985e104 or 2.89999999999999988e157 < x < 4.10000000000000001e210

    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 + \left(-y\right)\right)} - \left(z - \log t\right) \]
      3. +-commutative100.0%

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

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

        \[\leadsto \left(-y\right) + \color{blue}{\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-undefine100.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. Step-by-step derivation
      1. fma-undefine100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.48 \cdot 10^{+144}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+32}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{+82} \lor \neg \left(x \leq 2.3 \cdot 10^{+104} \lor \neg \left(x \leq 2.9 \cdot 10^{+157}\right) \land x \leq 4.1 \cdot 10^{+210}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) - y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 89.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - z\\ \mathbf{if}\;x \leq -1.4 \cdot 10^{+114}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{+77}:\\ \;\;\;\;\left(-z\right) - y\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{+32} \lor \neg \left(x \leq 2.85 \cdot 10^{+32}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x (log y)) z)))
   (if (<= x -1.4e+114)
     t_1
     (if (<= x -8.5e+77)
       (- (- z) y)
       (if (or (<= x -1.15e+32) (not (<= x 2.85e+32)))
         t_1
         (- (log t) (+ y z)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * log(y)) - z;
	double tmp;
	if (x <= -1.4e+114) {
		tmp = t_1;
	} else if (x <= -8.5e+77) {
		tmp = -z - y;
	} else if ((x <= -1.15e+32) || !(x <= 2.85e+32)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (x * log(y)) - z
    if (x <= (-1.4d+114)) then
        tmp = t_1
    else if (x <= (-8.5d+77)) then
        tmp = -z - y
    else if ((x <= (-1.15d+32)) .or. (.not. (x <= 2.85d+32))) then
        tmp = t_1
    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 t_1 = (x * Math.log(y)) - z;
	double tmp;
	if (x <= -1.4e+114) {
		tmp = t_1;
	} else if (x <= -8.5e+77) {
		tmp = -z - y;
	} else if ((x <= -1.15e+32) || !(x <= 2.85e+32)) {
		tmp = t_1;
	} else {
		tmp = Math.log(t) - (y + z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * math.log(y)) - z
	tmp = 0
	if x <= -1.4e+114:
		tmp = t_1
	elif x <= -8.5e+77:
		tmp = -z - y
	elif (x <= -1.15e+32) or not (x <= 2.85e+32):
		tmp = t_1
	else:
		tmp = math.log(t) - (y + z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * log(y)) - z)
	tmp = 0.0
	if (x <= -1.4e+114)
		tmp = t_1;
	elseif (x <= -8.5e+77)
		tmp = Float64(Float64(-z) - y);
	elseif ((x <= -1.15e+32) || !(x <= 2.85e+32))
		tmp = t_1;
	else
		tmp = Float64(log(t) - Float64(y + z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * log(y)) - z;
	tmp = 0.0;
	if (x <= -1.4e+114)
		tmp = t_1;
	elseif (x <= -8.5e+77)
		tmp = -z - y;
	elseif ((x <= -1.15e+32) || ~((x <= 2.85e+32)))
		tmp = t_1;
	else
		tmp = log(t) - (y + z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -1.4e+114], t$95$1, If[LessEqual[x, -8.5e+77], N[((-z) - y), $MachinePrecision], If[Or[LessEqual[x, -1.15e+32], N[Not[LessEqual[x, 2.85e+32]], $MachinePrecision]], t$95$1, N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -8.5 \cdot 10^{+77}:\\
\;\;\;\;\left(-z\right) - y\\

\mathbf{elif}\;x \leq -1.15 \cdot 10^{+32} \lor \neg \left(x \leq 2.85 \cdot 10^{+32}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.4e114 or -8.50000000000000018e77 < x < -1.15e32 or 2.85e32 < 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 87.3%

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

    if -1.4e114 < x < -8.50000000000000018e77

    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 + \left(-y\right)\right)} - \left(z - \log t\right) \]
      3. +-commutative100.0%

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

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

        \[\leadsto \left(-y\right) + \color{blue}{\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-undefine100.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. Step-by-step derivation
      1. fma-undefine100.0%

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

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

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

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

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

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

    if -1.15e32 < x < 2.85e32

    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 97.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+114}:\\ \;\;\;\;x \cdot \log y - z\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{+77}:\\ \;\;\;\;\left(-z\right) - y\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{+32} \lor \neg \left(x \leq 2.85 \cdot 10^{+32}\right):\\ \;\;\;\;x \cdot \log y - z\\ \mathbf{else}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 69.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \left(-z\right) - y\\ \mathbf{if}\;x \leq -2.15 \cdot 10^{+144}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-124}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -5.6 \cdot 10^{-288}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+104}:\\ \;\;\;\;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 (- (- z) y)))
   (if (<= x -2.15e+144)
     t_1
     (if (<= x -1.05e-124)
       t_2
       (if (<= x -5.6e-288) (- (log t) y) (if (<= x 2.4e+104) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double t_2 = -z - y;
	double tmp;
	if (x <= -2.15e+144) {
		tmp = t_1;
	} else if (x <= -1.05e-124) {
		tmp = t_2;
	} else if (x <= -5.6e-288) {
		tmp = log(t) - y;
	} else if (x <= 2.4e+104) {
		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 = -z - y
    if (x <= (-2.15d+144)) then
        tmp = t_1
    else if (x <= (-1.05d-124)) then
        tmp = t_2
    else if (x <= (-5.6d-288)) then
        tmp = log(t) - y
    else if (x <= 2.4d+104) 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 = -z - y;
	double tmp;
	if (x <= -2.15e+144) {
		tmp = t_1;
	} else if (x <= -1.05e-124) {
		tmp = t_2;
	} else if (x <= -5.6e-288) {
		tmp = Math.log(t) - y;
	} else if (x <= 2.4e+104) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = -z - y
	tmp = 0
	if x <= -2.15e+144:
		tmp = t_1
	elif x <= -1.05e-124:
		tmp = t_2
	elif x <= -5.6e-288:
		tmp = math.log(t) - y
	elif x <= 2.4e+104:
		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(-z) - y)
	tmp = 0.0
	if (x <= -2.15e+144)
		tmp = t_1;
	elseif (x <= -1.05e-124)
		tmp = t_2;
	elseif (x <= -5.6e-288)
		tmp = Float64(log(t) - y);
	elseif (x <= 2.4e+104)
		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 = -z - y;
	tmp = 0.0;
	if (x <= -2.15e+144)
		tmp = t_1;
	elseif (x <= -1.05e-124)
		tmp = t_2;
	elseif (x <= -5.6e-288)
		tmp = log(t) - y;
	elseif (x <= 2.4e+104)
		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[((-z) - y), $MachinePrecision]}, If[LessEqual[x, -2.15e+144], t$95$1, If[LessEqual[x, -1.05e-124], t$95$2, If[LessEqual[x, -5.6e-288], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 2.4e+104], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-124}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \leq 2.4 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.14999999999999992e144 or 2.4e104 < x

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

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

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

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

    if -2.14999999999999992e144 < x < -1.05e-124 or -5.5999999999999999e-288 < x < 2.4e104

    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 + \left(-y\right)\right)} - \left(z - \log t\right) \]
      3. +-commutative99.9%

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

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

        \[\leadsto \left(-y\right) + \color{blue}{\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-undefine100.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. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

    if -1.05e-124 < x < -5.5999999999999999e-288

    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 + \left(-y\right)\right)} - \left(z - \log t\right) \]
      3. +-commutative100.0%

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

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

        \[\leadsto \left(-y\right) + \color{blue}{\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-undefine100.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. Step-by-step derivation
      1. fma-undefine100.0%

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

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

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

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

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

Alternative 10: 89.3% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.1 \lor \neg \left(x \leq 6.5 \cdot 10^{+31}\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 -3.1) (not (<= x 6.5e+31)))
   (- (* x (log y)) y)
   (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -3.1) || !(x <= 6.5e+31)) {
		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 <= (-3.1d0)) .or. (.not. (x <= 6.5d+31))) 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 <= -3.1) || !(x <= 6.5e+31)) {
		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 <= -3.1) or not (x <= 6.5e+31):
		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 <= -3.1) || !(x <= 6.5e+31))
		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 <= -3.1) || ~((x <= 6.5e+31)))
		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, -3.1], N[Not[LessEqual[x, 6.5e+31]], $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 -3.1 \lor \neg \left(x \leq 6.5 \cdot 10^{+31}\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 < -3.10000000000000009 or 6.5000000000000004e31 < 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 78.6%

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

    if -3.10000000000000009 < x < 6.5000000000000004e31

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

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

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

Alternative 11: 48.5% accurate, 17.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+53} \lor \neg \left(z \leq 3 \cdot 10^{+74}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.59999999999999998e53 or 3e74 < 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)} \]
      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 71.2%

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

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

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

    if -2.59999999999999998e53 < z < 3e74

    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 y around inf 36.3%

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

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

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

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

Alternative 12: 58.0% accurate, 52.3× speedup?

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

\\
\left(-z\right) - y
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 30.8% accurate, 104.5× speedup?

\[\begin{array}{l} \\ -y \end{array} \]
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
	return -y;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = -y
end function
public static double code(double x, double y, double z, double t) {
	return -y;
}
def code(x, y, z, t):
	return -y
function code(x, y, z, t)
	return Float64(-y)
end
function tmp = code(x, y, z, t)
	tmp = -y;
end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}

\\
-y
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. 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 y around inf 26.7%

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

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

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

Reproduce

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