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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, \log y, \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-define99.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. Add Preprocessing
  5. Add Preprocessing

Alternative 2: 87.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+176}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq -500:\\
\;\;\;\;\left(-y\right) - z\\

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-29}:\\
\;\;\;\;\log t - y\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\log t - z\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

    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-define99.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. Add Preprocessing
    5. Taylor expanded in y around inf 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(1 - y \cdot \color{blue}{\frac{-1}{z}}\right) \cdot \left(-z\right) \]
    12. Taylor expanded in y around 0 83.7%

      \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
    13. Step-by-step derivation
      1. mul-1-neg83.7%

        \[\leadsto -1 \cdot y + \color{blue}{\left(-z\right)} \]
      2. sub-neg83.7%

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      3. mul-1-neg83.7%

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

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

    if -500 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999989e-29

    1. Initial program 99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-y\right)} + \log t \]
    7. Simplified85.5%

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

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

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

        \[\leadsto \color{blue}{\log t - y} \]
    10. Simplified85.5%

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

    if -1.99999999999999989e-29 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999998e-8

    1. Initial program 100.0%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Step-by-step derivation
      1. 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-define100.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. Add Preprocessing
    5. Taylor expanded in z around inf 99.1%

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

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

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

      \[\leadsto \color{blue}{\log t + -1 \cdot z} \]
    9. Step-by-step derivation
      1. mul-1-neg99.1%

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

        \[\leadsto \color{blue}{\log t - z} \]
    10. Simplified99.1%

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

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

    1. Initial program 99.7%

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

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

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

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

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

Alternative 3: 83.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-29}:\\
\;\;\;\;\log t - y\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\log t - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (-.f64 (*.f64 x (log.f64 y)) y) < -2e176 or 4.9999999999999998e-8 < (-.f64 (*.f64 x (log.f64 y)) y)

    1. Initial program 99.8%

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

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

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

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

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

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

    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-define99.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. Add Preprocessing
    5. Taylor expanded in y around inf 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(1 - y \cdot \color{blue}{\frac{-1}{z}}\right) \cdot \left(-z\right) \]
    12. Taylor expanded in y around 0 83.7%

      \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
    13. Step-by-step derivation
      1. mul-1-neg83.7%

        \[\leadsto -1 \cdot y + \color{blue}{\left(-z\right)} \]
      2. sub-neg83.7%

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      3. mul-1-neg83.7%

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

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

    if -500 < (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999989e-29

    1. Initial program 99.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-y\right)} + \log t \]
    7. Simplified85.5%

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

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

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

        \[\leadsto \color{blue}{\log t - y} \]
    10. Simplified85.5%

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

    if -1.99999999999999989e-29 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999998e-8

    1. Initial program 100.0%

      \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
    2. Step-by-step derivation
      1. 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-define100.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. Add Preprocessing
    5. Taylor expanded in z around inf 99.1%

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

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

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

      \[\leadsto \color{blue}{\log t + -1 \cdot z} \]
    9. Step-by-step derivation
      1. mul-1-neg99.1%

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

        \[\leadsto \color{blue}{\log t - z} \]
    10. Simplified99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 88.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \log y - z\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{+91}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -2.3e+57)
   (- (* x (log y)) z)
   (if (<= x 1.22e+91) (- (- (log t) z) y) (fma (log y) x (- z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -2.3e+57) {
		tmp = (x * log(y)) - z;
	} else if (x <= 1.22e+91) {
		tmp = (log(t) - z) - y;
	} else {
		tmp = fma(log(y), x, -z);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -2.3e+57)
		tmp = Float64(Float64(x * log(y)) - z);
	elseif (x <= 1.22e+91)
		tmp = Float64(Float64(log(t) - z) - y);
	else
		tmp = fma(log(y), x, Float64(-z));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.3e+57], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 1.22e+91], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-z)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+57}:\\
\;\;\;\;x \cdot \log y - z\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, -z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2999999999999999e57

    1. Initial program 99.7%

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

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

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

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

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

    if -2.2999999999999999e57 < x < 1.2199999999999999e91

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2199999999999999e91 < x

    1. Initial program 99.7%

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

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

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

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

      \[\leadsto x \cdot \log y - \color{blue}{z} \]
    6. Step-by-step derivation
      1. *-commutative87.7%

        \[\leadsto \color{blue}{\log y \cdot x} - z \]
      2. fma-neg87.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, -z\right)} \]
    7. Applied egg-rr87.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, -z\right)} \]
  3. Recombined 3 regimes into one program.
  4. 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: 70.3% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ t_2 := \left(-y\right) - z\\ \mathbf{if}\;x \leq -4 \cdot 10^{+130}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{+113}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -2.22 \cdot 10^{+108}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+95}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+159} \lor \neg \left(x \leq 3 \cdot 10^{+160}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (log y))) (t_2 (- (- y) z)))
   (if (<= x -4e+130)
     t_1
     (if (<= x -1.4e+113)
       t_2
       (if (<= x -2.22e+108)
         t_1
         (if (<= x 4.1e+95)
           t_2
           (if (or (<= x 1.25e+159) (not (<= x 3e+160))) t_1 (- z))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * log(y);
	double t_2 = -y - z;
	double tmp;
	if (x <= -4e+130) {
		tmp = t_1;
	} else if (x <= -1.4e+113) {
		tmp = t_2;
	} else if (x <= -2.22e+108) {
		tmp = t_1;
	} else if (x <= 4.1e+95) {
		tmp = t_2;
	} else if ((x <= 1.25e+159) || !(x <= 3e+160)) {
		tmp = t_1;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * log(y)
    t_2 = -y - z
    if (x <= (-4d+130)) then
        tmp = t_1
    else if (x <= (-1.4d+113)) then
        tmp = t_2
    else if (x <= (-2.22d+108)) then
        tmp = t_1
    else if (x <= 4.1d+95) then
        tmp = t_2
    else if ((x <= 1.25d+159) .or. (.not. (x <= 3d+160))) then
        tmp = t_1
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * Math.log(y);
	double t_2 = -y - z;
	double tmp;
	if (x <= -4e+130) {
		tmp = t_1;
	} else if (x <= -1.4e+113) {
		tmp = t_2;
	} else if (x <= -2.22e+108) {
		tmp = t_1;
	} else if (x <= 4.1e+95) {
		tmp = t_2;
	} else if ((x <= 1.25e+159) || !(x <= 3e+160)) {
		tmp = t_1;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * math.log(y)
	t_2 = -y - z
	tmp = 0
	if x <= -4e+130:
		tmp = t_1
	elif x <= -1.4e+113:
		tmp = t_2
	elif x <= -2.22e+108:
		tmp = t_1
	elif x <= 4.1e+95:
		tmp = t_2
	elif (x <= 1.25e+159) or not (x <= 3e+160):
		tmp = t_1
	else:
		tmp = -z
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * log(y))
	t_2 = Float64(Float64(-y) - z)
	tmp = 0.0
	if (x <= -4e+130)
		tmp = t_1;
	elseif (x <= -1.4e+113)
		tmp = t_2;
	elseif (x <= -2.22e+108)
		tmp = t_1;
	elseif (x <= 4.1e+95)
		tmp = t_2;
	elseif ((x <= 1.25e+159) || !(x <= 3e+160))
		tmp = t_1;
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * log(y);
	t_2 = -y - z;
	tmp = 0.0;
	if (x <= -4e+130)
		tmp = t_1;
	elseif (x <= -1.4e+113)
		tmp = t_2;
	elseif (x <= -2.22e+108)
		tmp = t_1;
	elseif (x <= 4.1e+95)
		tmp = t_2;
	elseif ((x <= 1.25e+159) || ~((x <= 3e+160)))
		tmp = t_1;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -4e+130], t$95$1, If[LessEqual[x, -1.4e+113], t$95$2, If[LessEqual[x, -2.22e+108], t$95$1, If[LessEqual[x, 4.1e+95], t$95$2, If[Or[LessEqual[x, 1.25e+159], N[Not[LessEqual[x, 3e+160]], $MachinePrecision]], t$95$1, (-z)]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.4 \cdot 10^{+113}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -2.22 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{+95}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 1.25 \cdot 10^{+159} \lor \neg \left(x \leq 3 \cdot 10^{+160}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.0000000000000002e130 or -1.39999999999999999e113 < x < -2.22e108 or 4.09999999999999986e95 < x < 1.25000000000000001e159 or 2.9999999999999999e160 < x

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000002e130 < x < -1.39999999999999999e113 or -2.22e108 < x < 4.09999999999999986e95

    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-define100.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. Add Preprocessing
    5. Taylor expanded in y around inf 91.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(1 + -1 \cdot \frac{y \cdot \left(\frac{\log t}{y} - \left(1 + -1 \cdot \frac{x \cdot \log y}{y}\right)\right)}{z}\right) \cdot z} \]
      3. distribute-rgt-neg-in91.0%

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

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

      \[\leadsto \left(1 - y \cdot \color{blue}{\frac{-1}{z}}\right) \cdot \left(-z\right) \]
    12. Taylor expanded in y around 0 69.7%

      \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
    13. Step-by-step derivation
      1. mul-1-neg69.7%

        \[\leadsto -1 \cdot y + \color{blue}{\left(-z\right)} \]
      2. sub-neg69.7%

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      3. mul-1-neg69.7%

        \[\leadsto \color{blue}{\left(-y\right)} - z \]
    14. Simplified69.7%

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

    if 1.25000000000000001e159 < x < 2.9999999999999999e160

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto x \cdot \log y - \color{blue}{z} \]
    6. Taylor expanded in x around 0 100.0%

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

        \[\leadsto \color{blue}{-z} \]
    8. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+130}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{+113}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;x \leq -2.22 \cdot 10^{+108}:\\ \;\;\;\;x \cdot \log y\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+95}:\\ \;\;\;\;\left(-y\right) - z\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+159} \lor \neg \left(x \leq 3 \cdot 10^{+160}\right):\\ \;\;\;\;x \cdot \log y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 67.9% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq -8.5 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \log y\\

\mathbf{elif}\;z \leq 5.9 \cdot 10^{-65}:\\
\;\;\;\;\log t - y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.5999999999999999e40 or 5.89999999999999978e-65 < z

    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-define99.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. Add Preprocessing
    5. Taylor expanded in y around inf 74.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(1 + -1 \cdot \frac{y \cdot \left(\frac{\log t}{y} - \left(1 + -1 \cdot \frac{x \cdot \log y}{y}\right)\right)}{z}\right) \cdot z} \]
      3. distribute-rgt-neg-in85.6%

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

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

      \[\leadsto \left(1 - y \cdot \color{blue}{\frac{-1}{z}}\right) \cdot \left(-z\right) \]
    12. Taylor expanded in y around 0 76.3%

      \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
    13. Step-by-step derivation
      1. mul-1-neg76.3%

        \[\leadsto -1 \cdot y + \color{blue}{\left(-z\right)} \]
      2. sub-neg76.3%

        \[\leadsto \color{blue}{-1 \cdot y - z} \]
      3. mul-1-neg76.3%

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

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

    if -1.5999999999999999e40 < z < -8.5e19

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e19 < z < 5.89999999999999978e-65

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{\left(x \cdot \log y + \left(\left(-y\right) - z\right)\right)} + \log t \]
      3. fma-define99.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. Add Preprocessing
    5. Taylor expanded in y around inf 69.4%

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

        \[\leadsto \color{blue}{\left(-y\right)} + \log t \]
    7. Simplified69.4%

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

      \[\leadsto \color{blue}{\log t + -1 \cdot y} \]
    9. Step-by-step derivation
      1. mul-1-neg69.4%

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

        \[\leadsto \color{blue}{\log t - y} \]
    10. Simplified69.4%

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

Alternative 9: 89.0% accurate, 1.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.9999999999999999e57 or 2.5999999999999999e92 < x

    1. Initial program 99.7%

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

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

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

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

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

    if -5.9999999999999999e57 < x < 2.5999999999999999e92

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 48.0% accurate, 29.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9 \cdot 10^{+72}:\\
\;\;\;\;-z\\

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


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

    1. Initial program 99.8%

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

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

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

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

      \[\leadsto x \cdot \log y - \color{blue}{z} \]
    6. Taylor expanded in x around 0 32.0%

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

        \[\leadsto \color{blue}{-z} \]
    8. Simplified32.0%

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

    if 2.90000000000000017e72 < y

    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-define100.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. Add Preprocessing
    5. Taylor expanded in y around inf 67.0%

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

        \[\leadsto \color{blue}{\left(-y\right)} + \log t \]
    7. Simplified67.0%

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

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

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

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

Alternative 11: 57.7% accurate, 52.3× speedup?

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

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

    \[\left(\left(x \cdot \log y - y\right) - z\right) + \log t \]
  2. Step-by-step derivation
    1. 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-define99.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. Add Preprocessing
  5. Taylor expanded in y around inf 81.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\left(1 + -1 \cdot \frac{y \cdot \left(\frac{\log t}{y} - \left(1 + -1 \cdot \frac{x \cdot \log y}{y}\right)\right)}{z}\right) \cdot z} \]
    3. distribute-rgt-neg-in77.6%

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

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

    \[\leadsto \left(1 - y \cdot \color{blue}{\frac{-1}{z}}\right) \cdot \left(-z\right) \]
  12. Taylor expanded in y around 0 54.9%

    \[\leadsto \color{blue}{-1 \cdot y + -1 \cdot z} \]
  13. Step-by-step derivation
    1. mul-1-neg54.9%

      \[\leadsto -1 \cdot y + \color{blue}{\left(-z\right)} \]
    2. sub-neg54.9%

      \[\leadsto \color{blue}{-1 \cdot y - z} \]
    3. mul-1-neg54.9%

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

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

Alternative 12: 29.6% 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-define99.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. Add Preprocessing
  5. Taylor expanded in y around inf 47.0%

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

      \[\leadsto \color{blue}{\left(-y\right)} + \log t \]
  7. Simplified47.0%

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

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

      \[\leadsto \color{blue}{-y} \]
  10. Simplified29.8%

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

Alternative 13: 2.3% accurate, 209.0× 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 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-define99.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. Add Preprocessing
  5. Taylor expanded in x around inf 78.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(\left(\sqrt[3]{\log y + \frac{\log t - \left(y + z\right)}{x}} \cdot \sqrt[3]{\log y + \frac{\log t - \left(y + z\right)}{x}}\right) \cdot \sqrt[3]{\log y + \frac{\log t - \left(y + z\right)}{x}}\right)} \]
    2. pow377.3%

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

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

    \[\leadsto x \cdot \color{blue}{\frac{\log t - \left(y + z\right)}{x}} \]
  11. Step-by-step derivation
    1. associate-*r/63.3%

      \[\leadsto \color{blue}{\frac{x \cdot \left(\log t - \left(y + z\right)\right)}{x}} \]
  12. Applied egg-rr63.3%

    \[\leadsto \color{blue}{\frac{x \cdot \left(\log t - \left(y + z\right)\right)}{x}} \]
  13. Step-by-step derivation
    1. *-commutative63.3%

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

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

    \[\leadsto \frac{\color{blue}{-1 \cdot \left(x \cdot y\right)}}{x} \]
  16. Step-by-step derivation
    1. associate-*r*27.3%

      \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot y}}{x} \]
    2. neg-mul-127.3%

      \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot y}{x} \]
  17. Simplified27.3%

    \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot y}}{x} \]
  18. Step-by-step derivation
    1. *-commutative27.3%

      \[\leadsto \frac{\color{blue}{y \cdot \left(-x\right)}}{x} \]
    2. associate-/l*29.8%

      \[\leadsto \color{blue}{y \cdot \frac{-x}{x}} \]
    3. add-sqr-sqrt12.8%

      \[\leadsto y \cdot \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{x} \]
    4. sqrt-unprod10.2%

      \[\leadsto y \cdot \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{x} \]
    5. sqr-neg10.2%

      \[\leadsto y \cdot \frac{\sqrt{\color{blue}{x \cdot x}}}{x} \]
    6. sqrt-unprod1.2%

      \[\leadsto y \cdot \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{x} \]
    7. add-sqr-sqrt2.3%

      \[\leadsto y \cdot \frac{\color{blue}{x}}{x} \]
    8. *-inverses2.3%

      \[\leadsto y \cdot \color{blue}{1} \]
  19. Applied egg-rr2.3%

    \[\leadsto \color{blue}{y \cdot 1} \]
  20. Step-by-step derivation
    1. *-rgt-identity2.3%

      \[\leadsto \color{blue}{y} \]
  21. Simplified2.3%

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

Reproduce

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