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

Percentage Accurate: 99.9% → 99.9%
Time: 11.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} \\ \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.9%

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. +-commutativeN/A

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

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

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

      \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
    5. associate--r+N/A

      \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
    9. log-lowering-log.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
    11. log-lowering-log.f6499.9%

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
  4. Applied egg-rr99.9%

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

Alternative 2: 85.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -2000:\\
\;\;\;\;0 - \left(y + z\right)\\

\mathbf{elif}\;t\_1 \leq 10^{-12}:\\
\;\;\;\;\log t - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -9.99999999999999962e134 or 9.9999999999999998e-13 < (-.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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr99.8%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(x \cdot \log y\right)}, y\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), y\right) \]
      2. log-lowering-log.f6486.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), y\right) \]
    7. Simplified86.7%

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

    if -9.99999999999999962e134 < (-.f64 (*.f64 x (log.f64 y)) y) < -2e3

    1. Initial program 99.9%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr99.9%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
      3. --lowering--.f6479.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
    7. Simplified79.3%

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

    if -2e3 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.9999999999999998e-13

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \left(\log t - z\right) - \color{blue}{y} \]
      3. unsub-negN/A

        \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right), \color{blue}{y}\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
      7. log-lowering-log.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
    5. Simplified99.9%

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

      \[\leadsto \color{blue}{\log t - z} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\log t, \color{blue}{z}\right) \]
      2. log-lowering-log.f6499.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right) \]
    8. Simplified99.5%

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

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

Alternative 3: 98.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t\_1 - y\\ t_3 := \left(t\_1 - z\right) - y\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+26}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 10^{-12}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y)) (t_3 (- (- t_1 z) y)))
   (if (<= t_2 -5e+26) t_3 (if (<= t_2 1e-12) (- (- (log t) z) y) t_3))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double t_2 = t_1 - y;
	double t_3 = (t_1 - z) - y;
	double tmp;
	if (t_2 <= -5e+26) {
		tmp = t_3;
	} else if (t_2 <= 1e-12) {
		tmp = (log(t) - z) - y;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = t_1 - y
    t_3 = (t_1 - z) - y
    if (t_2 <= (-5d+26)) then
        tmp = t_3
    else if (t_2 <= 1d-12) then
        tmp = (log(t) - z) - y
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * Math.log(y);
	double t_2 = t_1 - y;
	double t_3 = (t_1 - z) - y;
	double tmp;
	if (t_2 <= -5e+26) {
		tmp = t_3;
	} else if (t_2 <= 1e-12) {
		tmp = (Math.log(t) - z) - y;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = t_1 - y
	t_3 = (t_1 - z) - y
	tmp = 0
	if t_2 <= -5e+26:
		tmp = t_3
	elif t_2 <= 1e-12:
		tmp = (math.log(t) - z) - y
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	t_2 = Float64(t_1 - y)
	t_3 = Float64(Float64(t_1 - z) - y)
	tmp = 0.0
	if (t_2 <= -5e+26)
		tmp = t_3;
	elseif (t_2 <= 1e-12)
		tmp = Float64(Float64(log(t) - z) - y);
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	t_2 = t_1 - y;
	t_3 = (t_1 - z) - y;
	tmp = 0.0;
	if (t_2 <= -5e+26)
		tmp = t_3;
	elseif (t_2 <= 1e-12)
		tmp = (log(t) - z) - y;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - z), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+26], t$95$3, If[LessEqual[t$95$2, 1e-12], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000001e26 or 9.9999999999999998e-13 < (-.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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr99.9%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(x \cdot \log y\right)}, z\right), y\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right), y\right) \]
      2. log-lowering-log.f6499.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right), y\right) \]
    7. Simplified99.4%

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

    if -5.0000000000000001e26 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.9999999999999998e-13

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \left(\log t - z\right) - \color{blue}{y} \]
      3. unsub-negN/A

        \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right), \color{blue}{y}\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
      7. log-lowering-log.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
    5. Simplified99.9%

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

Alternative 4: 99.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := t\_1 - z\\ \mathbf{if}\;t\_1 - y \leq -2000:\\ \;\;\;\;t\_2 - y\\ \mathbf{else}:\\ \;\;\;\;\log t + t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))) (t_2 (- t_1 z)))
   (if (<= (- t_1 y) -2000.0) (- t_2 y) (+ (log t) t_2))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double t_2 = t_1 - z;
	double tmp;
	if ((t_1 - y) <= -2000.0) {
		tmp = t_2 - y;
	} else {
		tmp = log(t) + 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) :: tmp
    t_1 = x * log(y)
    t_2 = t_1 - z
    if ((t_1 - y) <= (-2000.0d0)) then
        tmp = t_2 - y
    else
        tmp = log(t) + t_2
    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 - z;
	double tmp;
	if ((t_1 - y) <= -2000.0) {
		tmp = t_2 - y;
	} else {
		tmp = Math.log(t) + t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = t_1 - z
	tmp = 0
	if (t_1 - y) <= -2000.0:
		tmp = t_2 - y
	else:
		tmp = math.log(t) + t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	t_2 = Float64(t_1 - z)
	tmp = 0.0
	if (Float64(t_1 - y) <= -2000.0)
		tmp = Float64(t_2 - y);
	else
		tmp = Float64(log(t) + t_2);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	t_2 = t_1 - z;
	tmp = 0.0;
	if ((t_1 - y) <= -2000.0)
		tmp = t_2 - y;
	else
		tmp = log(t) + t_2;
	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 - z), $MachinePrecision]}, If[LessEqual[N[(t$95$1 - y), $MachinePrecision], -2000.0], N[(t$95$2 - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 99.9%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr99.9%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(x \cdot \log y\right)}, z\right), y\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right), y\right) \]
      2. log-lowering-log.f6498.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right), y\right) \]
    7. Simplified98.6%

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

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

    1. Initial program 99.9%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot \log y - z\right)}, \mathsf{log.f64}\left(t\right)\right) \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\left(x \cdot \log y\right), z\right), \mathsf{log.f64}\left(\color{blue}{t}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right), \mathsf{log.f64}\left(t\right)\right) \]
      3. log-lowering-log.f6499.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right), \mathsf{log.f64}\left(t\right)\right) \]
    5. Simplified99.6%

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e10 or 2.4999999999999999e-8 < z

    1. Initial program 99.9%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr99.9%

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(x \cdot \log y\right)}, z\right), y\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right), y\right) \]
      2. log-lowering-log.f6499.4%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right), y\right) \]
    7. Simplified99.4%

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

    if -1.7e10 < z < 2.4999999999999999e-8

    1. Initial program 99.9%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot \log y - y\right)}, \mathsf{log.f64}\left(t\right)\right) \]
    4. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\left(x \cdot \log y\right), y\right), \mathsf{log.f64}\left(\color{blue}{t}\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), y\right), \mathsf{log.f64}\left(t\right)\right) \]
      3. log-lowering-log.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), y\right), \mathsf{log.f64}\left(t\right)\right) \]
    5. Simplified99.7%

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

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

Alternative 6: 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 7: 69.1% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;x \leq -3.4 \cdot 10^{-136}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \leq 2.7 \cdot 10^{+38}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.29999999999999985e124 or 2.69999999999999996e38 < x

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\log y}\right) \]
      2. log-lowering-log.f6471.7%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right) \]
    5. Simplified71.7%

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

    if -2.29999999999999985e124 < x < -3.4e-136 or -1.31999999999999998e-238 < x < 2.69999999999999996e38

    1. Initial program 100.0%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f64100.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
      3. --lowering--.f6478.5%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
    7. Simplified78.5%

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

    if -3.4e-136 < x < -1.31999999999999998e-238

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \left(\log t - z\right) - \color{blue}{y} \]
      3. unsub-negN/A

        \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right), \color{blue}{y}\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
      7. log-lowering-log.f64100.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
    5. Simplified100.0%

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

      \[\leadsto \color{blue}{\log t - y} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\log t, \color{blue}{y}\right) \]
      2. log-lowering-log.f6490.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), y\right) \]
    8. Simplified90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+124}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-136}:\\ \;\;\;\;0 - \left(y + z\right)\\ \mathbf{elif}\;x \leq -1.32 \cdot 10^{-238}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+38}:\\ \;\;\;\;0 - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 88.9% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -28 or 1.49999999999999997e24 < x

    1. Initial program 99.8%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f6499.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr99.8%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(x \cdot \log y\right)}, y\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), y\right) \]
      2. log-lowering-log.f6483.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), y\right) \]
    7. Simplified83.9%

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

    if -28 < x < 1.49999999999999997e24

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \left(\log t - z\right) - \color{blue}{y} \]
      3. unsub-negN/A

        \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right), \color{blue}{y}\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
      7. log-lowering-log.f64100.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
    5. Simplified100.0%

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

Alternative 9: 70.5% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.49999999999999977e124 or 3.2999999999999999e38 < x

    1. Initial program 99.7%

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

      \[\leadsto \color{blue}{x \cdot \log y} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\log y}\right) \]
      2. log-lowering-log.f6471.7%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right) \]
    5. Simplified71.7%

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

    if -5.49999999999999977e124 < x < 3.2999999999999999e38

    1. Initial program 100.0%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f64100.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
      3. --lowering--.f6474.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
    7. Simplified74.3%

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

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

Alternative 10: 54.8% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-116}:\\
\;\;\;\;\log t\\

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


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

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \left(\log t - z\right) - \color{blue}{y} \]
      3. unsub-negN/A

        \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right), \color{blue}{y}\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
      7. log-lowering-log.f6463.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
    5. Simplified63.7%

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

      \[\leadsto \color{blue}{\log t - y} \]
    7. Step-by-step derivation
      1. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\log t, \color{blue}{y}\right) \]
      2. log-lowering-log.f6437.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), y\right) \]
    8. Simplified37.9%

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

      \[\leadsto \color{blue}{\log t} \]
    10. Step-by-step derivation
      1. log-lowering-log.f6437.9%

        \[\leadsto \mathsf{log.f64}\left(t\right) \]
    11. Simplified37.9%

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

    if 2.30000000000000002e-116 < y

    1. Initial program 99.9%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
      5. associate--r+N/A

        \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
      11. log-lowering-log.f6499.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
    4. Applied egg-rr99.9%

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
      2. neg-sub0N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
      3. --lowering--.f6469.3%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
    7. Simplified69.3%

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

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

Alternative 11: 48.1% accurate, 16.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -460000000000:\\ \;\;\;\;0 - z\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+117}:\\ \;\;\;\;0 - y\\ \mathbf{else}:\\ \;\;\;\;0 - z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -460000000000.0)
   (- 0.0 z)
   (if (<= z 1.9e+117) (- 0.0 y) (- 0.0 z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -460000000000.0) {
		tmp = 0.0 - z;
	} else if (z <= 1.9e+117) {
		tmp = 0.0 - y;
	} else {
		tmp = 0.0 - z;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-460000000000.0d0)) then
        tmp = 0.0d0 - z
    else if (z <= 1.9d+117) then
        tmp = 0.0d0 - y
    else
        tmp = 0.0d0 - z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -460000000000.0) {
		tmp = 0.0 - z;
	} else if (z <= 1.9e+117) {
		tmp = 0.0 - y;
	} else {
		tmp = 0.0 - z;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -460000000000.0:
		tmp = 0.0 - z
	elif z <= 1.9e+117:
		tmp = 0.0 - y
	else:
		tmp = 0.0 - z
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -460000000000.0)
		tmp = Float64(0.0 - z);
	elseif (z <= 1.9e+117)
		tmp = Float64(0.0 - y);
	else
		tmp = Float64(0.0 - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -460000000000.0)
		tmp = 0.0 - z;
	elseif (z <= 1.9e+117)
		tmp = 0.0 - y;
	else
		tmp = 0.0 - z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -460000000000.0], N[(0.0 - z), $MachinePrecision], If[LessEqual[z, 1.9e+117], N[(0.0 - y), $MachinePrecision], N[(0.0 - z), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+117}:\\
\;\;\;\;0 - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.6e11 or 1.9000000000000001e117 < z

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(z\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z} \]
      3. --lowering--.f6460.8%

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{z}\right) \]
    5. Simplified60.8%

      \[\leadsto \color{blue}{0 - z} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(z\right) \]
      2. neg-lowering-neg.f6460.8%

        \[\leadsto \mathsf{neg.f64}\left(z\right) \]
    7. Applied egg-rr60.8%

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

    if -4.6e11 < z < 1.9000000000000001e117

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{-1 \cdot y} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(y\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{y} \]
      3. --lowering--.f6444.0%

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{y}\right) \]
    5. Simplified44.0%

      \[\leadsto \color{blue}{0 - y} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(y\right) \]
      2. neg-lowering-neg.f6444.0%

        \[\leadsto \mathsf{neg.f64}\left(y\right) \]
    7. Applied egg-rr44.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -460000000000:\\ \;\;\;\;0 - z\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+117}:\\ \;\;\;\;0 - y\\ \mathbf{else}:\\ \;\;\;\;0 - z\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 58.3% accurate, 41.8× speedup?

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

\\
0 - \left(y + 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. Step-by-step derivation
    1. +-commutativeN/A

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

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

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

      \[\leadsto \left(\log t + x \cdot \log y\right) - \left(z + \color{blue}{y}\right) \]
    5. associate--r+N/A

      \[\leadsto \left(\left(\log t + x \cdot \log y\right) - z\right) - \color{blue}{y} \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\left(\left(\log t + x \cdot \log y\right) - z\right), \color{blue}{y}\right) \]
    7. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\left(\log t + x \cdot \log y\right), z\right), y\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\log t, \left(x \cdot \log y\right)\right), z\right), y\right) \]
    9. log-lowering-log.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \left(x \cdot \log y\right)\right), z\right), y\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \log y\right)\right), z\right), y\right) \]
    11. log-lowering-log.f6499.9%

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{log.f64}\left(t\right), \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right)\right), z\right), y\right) \]
  4. Applied egg-rr99.9%

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

    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
  6. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
    2. neg-sub0N/A

      \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
    3. --lowering--.f6457.7%

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
  7. Simplified57.7%

    \[\leadsto \color{blue}{\left(0 - z\right)} - y \]
  8. Final simplification57.7%

    \[\leadsto 0 - \left(y + z\right) \]
  9. Add Preprocessing

Alternative 13: 30.1% accurate, 69.7× speedup?

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

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

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

    \[\leadsto \color{blue}{-1 \cdot y} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(y\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{y} \]
    3. --lowering--.f6434.1%

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{y}\right) \]
  5. Simplified34.1%

    \[\leadsto \color{blue}{0 - y} \]
  6. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{neg}\left(y\right) \]
    2. neg-lowering-neg.f6434.1%

      \[\leadsto \mathsf{neg.f64}\left(y\right) \]
  7. Applied egg-rr34.1%

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

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

Reproduce

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