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

Percentage Accurate: 99.9% → 99.9%
Time: 9.7s
Alternatives: 10
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 10 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, \left(-y\right) - z\right) + \log t \end{array} \]
(FPCore (x y z t) :precision binary64 (+ (fma x (log y) (- (- y) z)) (log t)))
double code(double x, double y, double z, double t) {
	return fma(x, log(y), (-y - z)) + log(t);
}
function code(x, y, z, t)
	return Float64(fma(x, log(y), Float64(Float64(-y) - z)) + log(t))
end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[((-y) - z), $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(x, \log y, \left(-y\right) - z\right) + \log t
\end{array}
Derivation
  1. Initial program 99.9%

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

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

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

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

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

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

Alternative 2: 98.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -5e14 or 0.5 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z)

    1. Initial program 99.9%

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

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

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

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

    if -5e14 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 0.5

    1. Initial program 100.0%

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -5e11 or 0.5 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z)

    1. Initial program 99.9%

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

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

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

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

    if -5e11 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 0.5

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \log y} + \log t \]
    5. Taylor expanded in x around 0 97.6%

      \[\leadsto \color{blue}{\log t + x \cdot \log y} \]
    6. Step-by-step derivation
      1. log-pow97.6%

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

        \[\leadsto \color{blue}{\log \left(t \cdot {y}^{x}\right)} \]
    7. Simplified97.6%

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

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

Alternative 4: 99.9% accurate, 0.7× speedup?

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

\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Derivation
  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 6: 98.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+22} \lor \neg \left(x \leq 1.85 \cdot 10^{-6}\right):\\
\;\;\;\;\left(x \cdot \log y - y\right) - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5500000000000001e22 or 1.8500000000000001e-6 < x

    1. Initial program 99.8%

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

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

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

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

    if -1.5500000000000001e22 < x < 1.8500000000000001e-6

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.6% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+87} \lor \neg \left(z \leq 6 \cdot 10^{+20}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2000000000000001e87 or 6e20 < 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. sub-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e87 < z < 6e20

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\log t + -1 \cdot y} \]
    8. Step-by-step derivation
      1. mul-1-neg64.3%

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

        \[\leadsto \color{blue}{\log t - y} \]
    9. Simplified64.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+87} \lor \neg \left(z \leq 6 \cdot 10^{+20}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\log t - y\\ \end{array} \]

Alternative 8: 69.7% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 47.5% accurate, 34.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+98} \lor \neg \left(z \leq 8.5 \cdot 10^{+20}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.79999999999999958e98 or 8.5e20 < 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. sub-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.79999999999999958e98 < z < 8.5e20

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-y} \]
    9. Simplified42.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.8 \cdot 10^{+98} \lor \neg \left(z \leq 8.5 \cdot 10^{+20}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]

Alternative 10: 30.0% accurate, 104.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-y} \]
  9. Simplified30.0%

    \[\leadsto \color{blue}{-y} \]
  10. Final simplification30.0%

    \[\leadsto -y \]

Reproduce

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