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

Percentage Accurate: 99.9% → 99.9%
Time: 9.5s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(\log y, x, \left(\log t - 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. Taylor expanded in x around 0

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

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

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

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

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

      \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
    6. mul-1-negN/A

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

      \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
    8. distribute-rgt-neg-inN/A

      \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
    9. metadata-evalN/A

      \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
    10. cancel-sign-subN/A

      \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
    11. mul-1-negN/A

      \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
    12. *-inversesN/A

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

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

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

      \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
    16. sub-negN/A

      \[\leadsto \color{blue}{x \cdot \log y + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right) \cdot x\right)\right)} \]
  5. Applied rewrites99.9%

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

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

Alternative 2: 73.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+253}:\\ \;\;\;\;{\left(\frac{-1}{y}\right)}^{-1}\\ \mathbf{elif}\;t\_1 \leq -5000000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+20}:\\ \;\;\;\;\left(-z\right) + \log t\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (* x (log y)) y)))
   (if (<= t_1 -2e+253)
     (pow (/ -1.0 y) -1.0)
     (if (<= t_1 -5000000000000.0)
       (fma (/ (- y) z) z (- z))
       (if (<= t_1 2e+20) (+ (- z) (log t)) (* (log y) x))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * log(y)) - y;
	double tmp;
	if (t_1 <= -2e+253) {
		tmp = pow((-1.0 / y), -1.0);
	} else if (t_1 <= -5000000000000.0) {
		tmp = fma((-y / z), z, -z);
	} else if (t_1 <= 2e+20) {
		tmp = -z + log(t);
	} else {
		tmp = log(y) * x;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(x * log(y)) - y)
	tmp = 0.0
	if (t_1 <= -2e+253)
		tmp = Float64(-1.0 / y) ^ -1.0;
	elseif (t_1 <= -5000000000000.0)
		tmp = fma(Float64(Float64(-y) / z), z, Float64(-z));
	elseif (t_1 <= 2e+20)
		tmp = Float64(Float64(-z) + log(t));
	else
		tmp = Float64(log(y) * x);
	end
	return 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+253], N[Power[N[(-1.0 / y), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[t$95$1, -5000000000000.0], N[(N[((-y) / z), $MachinePrecision] * z + (-z)), $MachinePrecision], If[LessEqual[t$95$1, 2e+20], N[((-z) + N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+253}:\\
\;\;\;\;{\left(\frac{-1}{y}\right)}^{-1}\\

\mathbf{elif}\;t\_1 \leq -5000000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\

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

\mathbf{else}:\\
\;\;\;\;\log y \cdot x\\


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

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}} \]
      3. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
      5. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
      6. flip3-+N/A

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

      \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
    5. Taylor expanded in y around inf

      \[\leadsto \frac{1}{\color{blue}{\frac{-1}{y}}} \]
    6. Step-by-step derivation
      1. lower-/.f6461.8

        \[\leadsto \frac{1}{\color{blue}{\frac{-1}{y}}} \]
    7. Applied rewrites61.8%

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

    if -1.9999999999999999e253 < (-.f64 (*.f64 x (log.f64 y)) y) < -5e12

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
      6. mul-1-negN/A

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

        \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
      9. metadata-evalN/A

        \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
      10. cancel-sign-subN/A

        \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
      11. mul-1-negN/A

        \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
      12. *-inversesN/A

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

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

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

        \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
      16. sub-negN/A

        \[\leadsto \color{blue}{x \cdot \log y + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right) \cdot x\right)\right)} \]
    5. Applied rewrites99.9%

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

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

        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
      2. distribute-lft-inN/A

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
      3. *-rgt-identityN/A

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

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
      6. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
      7. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
      8. distribute-lft-neg-outN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
      9. remove-double-negN/A

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

        \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
      11. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}, z, \mathsf{neg}\left(z\right)\right)} \]
    8. Applied rewrites80.4%

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

      \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{y}{z}, z, -z\right) \]
    10. Step-by-step derivation
      1. Applied rewrites58.7%

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

      if -5e12 < (-.f64 (*.f64 x (log.f64 y)) y) < 2e20

      1. Initial program 100.0%

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

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

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

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

          \[\leadsto \left(\color{blue}{\frac{\left(x \cdot \log y\right) \cdot \left(x \cdot \log y\right) - y \cdot y}{x \cdot \log y + y}} + \left(\mathsf{neg}\left(z\right)\right)\right) + \log t \]
        5. div-invN/A

          \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y\right) \cdot \left(x \cdot \log y\right) - y \cdot y\right) \cdot \frac{1}{x \cdot \log y + y}} + \left(\mathsf{neg}\left(z\right)\right)\right) + \log t \]
        6. difference-of-squaresN/A

          \[\leadsto \left(\color{blue}{\left(\left(x \cdot \log y + y\right) \cdot \left(x \cdot \log y - y\right)\right)} \cdot \frac{1}{x \cdot \log y + y} + \left(\mathsf{neg}\left(z\right)\right)\right) + \log t \]
        7. lift--.f64N/A

          \[\leadsto \left(\left(\left(x \cdot \log y + y\right) \cdot \color{blue}{\left(x \cdot \log y - y\right)}\right) \cdot \frac{1}{x \cdot \log y + y} + \left(\mathsf{neg}\left(z\right)\right)\right) + \log t \]
        8. associate-*l*N/A

          \[\leadsto \left(\color{blue}{\left(x \cdot \log y + y\right) \cdot \left(\left(x \cdot \log y - y\right) \cdot \frac{1}{x \cdot \log y + y}\right)} + \left(\mathsf{neg}\left(z\right)\right)\right) + \log t \]
        9. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \log y + y, \left(x \cdot \log y - y\right) \cdot \frac{1}{x \cdot \log y + y}, \mathsf{neg}\left(z\right)\right)} + \log t \]
      4. Applied rewrites100.0%

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} + \log t \]
        2. lower-neg.f6497.2

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

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

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

      1. Initial program 99.6%

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

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

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

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

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

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

          \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
        6. mul-1-negN/A

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

          \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
        9. metadata-evalN/A

          \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
        10. cancel-sign-subN/A

          \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
        11. mul-1-negN/A

          \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
        12. *-inversesN/A

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

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

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

          \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
        16. sub-negN/A

          \[\leadsto \color{blue}{x \cdot \log y + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right) \cdot x\right)\right)} \]
      5. Applied rewrites99.6%

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

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

          \[\leadsto \color{blue}{\log y \cdot x} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\log y \cdot x} \]
        3. lower-log.f6486.3

          \[\leadsto \color{blue}{\log y} \cdot x \]
      8. Applied rewrites86.3%

        \[\leadsto \color{blue}{\log y \cdot x} \]
    11. Recombined 4 regimes into one program.
    12. Final simplification74.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \log y - y \leq -2 \cdot 10^{+253}:\\ \;\;\;\;{\left(\frac{-1}{y}\right)}^{-1}\\ \mathbf{elif}\;x \cdot \log y - y \leq -5000000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\ \mathbf{elif}\;x \cdot \log y - y \leq 2 \cdot 10^{+20}:\\ \;\;\;\;\left(-z\right) + \log t\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]
    13. Add Preprocessing

    Alternative 3: 89.9% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+98} \lor \neg \left(z \leq 2.45 \cdot 10^{+20}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t - y\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (or (<= z -1.3e+98) (not (<= z 2.45e+20)))
       (fma (/ (* (log y) x) z) z (- z))
       (fma (log y) x (- (log t) y))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if ((z <= -1.3e+98) || !(z <= 2.45e+20)) {
    		tmp = fma(((log(y) * x) / z), z, -z);
    	} else {
    		tmp = fma(log(y), x, (log(t) - y));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if ((z <= -1.3e+98) || !(z <= 2.45e+20))
    		tmp = fma(Float64(Float64(log(y) * x) / z), z, Float64(-z));
    	else
    		tmp = fma(log(y), x, Float64(log(t) - y));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.3e+98], N[Not[LessEqual[z, 2.45e+20]], $MachinePrecision]], N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision] * z + (-z)), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -1.3 \cdot 10^{+98} \lor \neg \left(z \leq 2.45 \cdot 10^{+20}\right):\\
    \;\;\;\;\mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, -z\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\log y, x, \log t - y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.3e98 or 2.45e20 < z

      1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
        6. mul-1-negN/A

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

          \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
        9. metadata-evalN/A

          \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
        10. cancel-sign-subN/A

          \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
        11. mul-1-negN/A

          \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
        12. *-inversesN/A

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

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

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

          \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
        16. sub-negN/A

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

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

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

          \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
        2. distribute-lft-inN/A

          \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
        3. *-rgt-identityN/A

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
        6. *-commutativeN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
        7. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
        8. distribute-lft-neg-outN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
        9. remove-double-negN/A

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

          \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
        11. lower-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x \cdot \log y}{z}, z, -z\right) \]
      10. Step-by-step derivation
        1. Applied rewrites86.1%

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

        if -1.3e98 < z < 2.45e20

        1. Initial program 99.8%

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - y \]
          5. lower-log.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - y \]
          6. lower-log.f6498.8

            \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - y \]
        5. Applied rewrites98.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - y} \]
        6. Step-by-step derivation
          1. Applied rewrites98.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t - y\right)} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification93.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+98} \lor \neg \left(z \leq 2.45 \cdot 10^{+20}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t - y\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 4: 89.9% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+98} \lor \neg \left(z \leq 2.45 \cdot 10^{+20}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (or (<= z -1.3e+98) (not (<= z 2.45e+20)))
           (fma (/ (* (log y) x) z) z (- z))
           (- (fma (log y) x (log t)) y)))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if ((z <= -1.3e+98) || !(z <= 2.45e+20)) {
        		tmp = fma(((log(y) * x) / z), z, -z);
        	} else {
        		tmp = fma(log(y), x, log(t)) - y;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if ((z <= -1.3e+98) || !(z <= 2.45e+20))
        		tmp = fma(Float64(Float64(log(y) * x) / z), z, Float64(-z));
        	else
        		tmp = Float64(fma(log(y), x, log(t)) - y);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.3e+98], N[Not[LessEqual[z, 2.45e+20]], $MachinePrecision]], N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision] * z + (-z)), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -1.3 \cdot 10^{+98} \lor \neg \left(z \leq 2.45 \cdot 10^{+20}\right):\\
        \;\;\;\;\mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, -z\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -1.3e98 or 2.45e20 < z

          1. Initial program 100.0%

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

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

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

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

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

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

              \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
            6. mul-1-negN/A

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

              \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
            8. distribute-rgt-neg-inN/A

              \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
            9. metadata-evalN/A

              \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
            10. cancel-sign-subN/A

              \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
            11. mul-1-negN/A

              \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
            12. *-inversesN/A

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

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

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

              \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
            16. sub-negN/A

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

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

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

              \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
            2. distribute-lft-inN/A

              \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
            3. *-rgt-identityN/A

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

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
            6. *-commutativeN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
            7. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
            8. distribute-lft-neg-outN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
            9. remove-double-negN/A

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

              \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
            11. lower-fma.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(\frac{x \cdot \log y}{z}, z, -z\right) \]
          10. Step-by-step derivation
            1. Applied rewrites86.1%

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

            if -1.3e98 < z < 2.45e20

            1. Initial program 99.8%

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - y \]
              5. lower-log.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - y \]
              6. lower-log.f6498.8

                \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - y \]
            5. Applied rewrites98.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - y} \]
          11. Recombined 2 regimes into one program.
          12. Final simplification93.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+98} \lor \neg \left(z \leq 2.45 \cdot 10^{+20}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\log y \cdot x}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\ \end{array} \]
          13. Add Preprocessing

          Alternative 5: 62.8% accurate, 1.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ t_2 := \frac{-y}{z}\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{+87}:\\ \;\;\;\;z \cdot \left(t\_2 + -1\right)\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-51}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-162}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_2, z, -z\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* (log y) x)) (t_2 (/ (- y) z)))
             (if (<= z -1.05e+87)
               (* z (+ t_2 -1.0))
               (if (<= z -1.4e-51)
                 t_1
                 (if (<= z 1.55e-162)
                   (- (log t) y)
                   (if (<= z 7.8e-22) t_1 (fma t_2 z (- z))))))))
          double code(double x, double y, double z, double t) {
          	double t_1 = log(y) * x;
          	double t_2 = -y / z;
          	double tmp;
          	if (z <= -1.05e+87) {
          		tmp = z * (t_2 + -1.0);
          	} else if (z <= -1.4e-51) {
          		tmp = t_1;
          	} else if (z <= 1.55e-162) {
          		tmp = log(t) - y;
          	} else if (z <= 7.8e-22) {
          		tmp = t_1;
          	} else {
          		tmp = fma(t_2, z, -z);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = Float64(log(y) * x)
          	t_2 = Float64(Float64(-y) / z)
          	tmp = 0.0
          	if (z <= -1.05e+87)
          		tmp = Float64(z * Float64(t_2 + -1.0));
          	elseif (z <= -1.4e-51)
          		tmp = t_1;
          	elseif (z <= 1.55e-162)
          		tmp = Float64(log(t) - y);
          	elseif (z <= 7.8e-22)
          		tmp = t_1;
          	else
          		tmp = fma(t_2, z, Float64(-z));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[((-y) / z), $MachinePrecision]}, If[LessEqual[z, -1.05e+87], N[(z * N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e-51], t$95$1, If[LessEqual[z, 1.55e-162], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[z, 7.8e-22], t$95$1, N[(t$95$2 * z + (-z)), $MachinePrecision]]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \log y \cdot x\\
          t_2 := \frac{-y}{z}\\
          \mathbf{if}\;z \leq -1.05 \cdot 10^{+87}:\\
          \;\;\;\;z \cdot \left(t\_2 + -1\right)\\
          
          \mathbf{elif}\;z \leq -1.4 \cdot 10^{-51}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq 1.55 \cdot 10^{-162}:\\
          \;\;\;\;\log t - y\\
          
          \mathbf{elif}\;z \leq 7.8 \cdot 10^{-22}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(t\_2, z, -z\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if z < -1.05e87

            1. Initial program 99.9%

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

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

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

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

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

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

                \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
              6. mul-1-negN/A

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

                \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
              8. distribute-rgt-neg-inN/A

                \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
              9. metadata-evalN/A

                \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
              10. cancel-sign-subN/A

                \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
              11. mul-1-negN/A

                \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
              12. *-inversesN/A

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

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

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

                \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
              16. sub-negN/A

                \[\leadsto \color{blue}{x \cdot \log y + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right) \cdot x\right)\right)} \]
            5. Applied rewrites99.9%

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

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

                \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
              2. distribute-lft-inN/A

                \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
              3. *-rgt-identityN/A

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

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
              6. *-commutativeN/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
              7. mul-1-negN/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
              8. distribute-lft-neg-outN/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
              9. remove-double-negN/A

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

                \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
              11. lower-fma.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{y}{z}, z, -z\right) \]
            10. Step-by-step derivation
              1. Applied rewrites84.6%

                \[\leadsto \mathsf{fma}\left(\frac{-y}{z}, z, -z\right) \]
              2. Step-by-step derivation
                1. Applied rewrites84.6%

                  \[\leadsto z \cdot \color{blue}{\left(\frac{-y}{z} + -1\right)} \]

                if -1.05e87 < z < -1.4e-51 or 1.5499999999999999e-162 < z < 7.79999999999999996e-22

                1. Initial program 99.8%

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

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

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

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

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

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

                    \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
                  6. mul-1-negN/A

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

                    \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
                  8. distribute-rgt-neg-inN/A

                    \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
                  9. metadata-evalN/A

                    \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
                  10. cancel-sign-subN/A

                    \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
                  11. mul-1-negN/A

                    \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
                  12. *-inversesN/A

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

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

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

                    \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
                  16. sub-negN/A

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

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

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

                    \[\leadsto \color{blue}{\log y \cdot x} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\log y \cdot x} \]
                  3. lower-log.f6465.5

                    \[\leadsto \color{blue}{\log y} \cdot x \]
                8. Applied rewrites65.5%

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

                if -1.4e-51 < z < 1.5499999999999999e-162

                1. Initial program 99.8%

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

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

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

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - y \]
                  5. lower-log.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - y \]
                  6. lower-log.f6499.8

                    \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - y \]
                5. Applied rewrites99.8%

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

                  \[\leadsto \log t - y \]
                7. Step-by-step derivation
                  1. Applied rewrites61.6%

                    \[\leadsto \log t - y \]

                  if 7.79999999999999996e-22 < z

                  1. Initial program 99.9%

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

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

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

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

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

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

                      \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
                    6. mul-1-negN/A

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

                      \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
                    8. distribute-rgt-neg-inN/A

                      \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
                    9. metadata-evalN/A

                      \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
                    10. cancel-sign-subN/A

                      \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
                    11. mul-1-negN/A

                      \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
                    12. *-inversesN/A

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

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

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

                      \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
                    16. sub-negN/A

                      \[\leadsto \color{blue}{x \cdot \log y + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right) \cdot x\right)\right)} \]
                  5. Applied rewrites99.9%

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

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

                      \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
                    2. distribute-lft-inN/A

                      \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
                    3. *-rgt-identityN/A

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

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

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
                    6. *-commutativeN/A

                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
                    7. mul-1-negN/A

                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
                    8. distribute-lft-neg-outN/A

                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
                    9. remove-double-negN/A

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

                      \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
                    11. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}, z, \mathsf{neg}\left(z\right)\right)} \]
                  8. Applied rewrites99.8%

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

                    \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{y}{z}, z, -z\right) \]
                  10. Step-by-step derivation
                    1. Applied rewrites79.7%

                      \[\leadsto \mathsf{fma}\left(\frac{-y}{z}, z, -z\right) \]
                  11. Recombined 4 regimes into one program.
                  12. Final simplification71.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+87}:\\ \;\;\;\;z \cdot \left(\frac{-y}{z} + -1\right)\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-51}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-162}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-22}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\ \end{array} \]
                  13. Add Preprocessing

                  Alternative 6: 83.8% accurate, 1.8× speedup?

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

                    1. Initial program 99.7%

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

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

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

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

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

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

                        \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
                      6. mul-1-negN/A

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

                        \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
                      8. distribute-rgt-neg-inN/A

                        \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
                      9. metadata-evalN/A

                        \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
                      10. cancel-sign-subN/A

                        \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
                      11. mul-1-negN/A

                        \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
                      12. *-inversesN/A

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

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

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

                        \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
                      16. sub-negN/A

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

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

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

                        \[\leadsto \color{blue}{\log y \cdot x} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\log y \cdot x} \]
                      3. lower-log.f6478.1

                        \[\leadsto \color{blue}{\log y} \cdot x \]
                    8. Applied rewrites78.1%

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

                    if -6.79999999999999993e136 < x < 8.49999999999999966e136

                    1. Initial program 99.9%

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

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

                        \[\leadsto \color{blue}{\left(\log t - y\right) - z} \]
                      2. lower--.f64N/A

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

                        \[\leadsto \color{blue}{\left(\log t - y\right)} - z \]
                      4. lower-log.f6488.2

                        \[\leadsto \left(\color{blue}{\log t} - y\right) - z \]
                    5. Applied rewrites88.2%

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

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

                  Alternative 7: 68.9% accurate, 1.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+62} \lor \neg \left(z \leq 420\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;\log t - y\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (or (<= z -1.3e+62) (not (<= z 420.0)))
                     (fma (/ (- y) z) z (- z))
                     (- (log t) y)))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z <= -1.3e+62) || !(z <= 420.0)) {
                  		tmp = fma((-y / z), z, -z);
                  	} else {
                  		tmp = log(t) - y;
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if ((z <= -1.3e+62) || !(z <= 420.0))
                  		tmp = fma(Float64(Float64(-y) / z), z, Float64(-z));
                  	else
                  		tmp = Float64(log(t) - y);
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.3e+62], N[Not[LessEqual[z, 420.0]], $MachinePrecision]], N[(N[((-y) / z), $MachinePrecision] * z + (-z)), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -1.3 \cdot 10^{+62} \lor \neg \left(z \leq 420\right):\\
                  \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\log t - y\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -1.29999999999999992e62 or 420 < z

                    1. Initial program 100.0%

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

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

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

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

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

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

                        \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
                      6. mul-1-negN/A

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

                        \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
                      8. distribute-rgt-neg-inN/A

                        \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
                      9. metadata-evalN/A

                        \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
                      10. cancel-sign-subN/A

                        \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
                      11. mul-1-negN/A

                        \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
                      12. *-inversesN/A

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

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

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

                        \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
                      16. sub-negN/A

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

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

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

                        \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
                      2. distribute-lft-inN/A

                        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
                      3. *-rgt-identityN/A

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

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

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
                      6. *-commutativeN/A

                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
                      7. mul-1-negN/A

                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
                      8. distribute-lft-neg-outN/A

                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
                      9. remove-double-negN/A

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

                        \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
                      11. lower-fma.f64N/A

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

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

                      \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{y}{z}, z, -z\right) \]
                    10. Step-by-step derivation
                      1. Applied rewrites80.2%

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

                      if -1.29999999999999992e62 < z < 420

                      1. Initial program 99.8%

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right)} - y \]
                        5. lower-log.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\log y}, x, \log t\right) - y \]
                        6. lower-log.f6499.4

                          \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\log t}\right) - y \]
                      5. Applied rewrites99.4%

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

                        \[\leadsto \log t - y \]
                      7. Step-by-step derivation
                        1. Applied rewrites53.5%

                          \[\leadsto \log t - y \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification65.5%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+62} \lor \neg \left(z \leq 420\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;\log t - y\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 8: 58.2% accurate, 6.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-14}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (if (or (<= z -1.55e-25) (not (<= z 5.4e-14)))
                         (fma (/ (- y) z) z (- z))
                         (- y)))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if ((z <= -1.55e-25) || !(z <= 5.4e-14)) {
                      		tmp = fma((-y / z), z, -z);
                      	} else {
                      		tmp = -y;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if ((z <= -1.55e-25) || !(z <= 5.4e-14))
                      		tmp = fma(Float64(Float64(-y) / z), z, Float64(-z));
                      	else
                      		tmp = Float64(-y);
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e-25], N[Not[LessEqual[z, 5.4e-14]], $MachinePrecision]], N[(N[((-y) / z), $MachinePrecision] * z + (-z)), $MachinePrecision], (-y)]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -1.55 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-14}\right):\\
                      \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;-y\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -1.54999999999999997e-25 or 5.3999999999999997e-14 < z

                        1. Initial program 99.9%

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

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

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

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

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

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

                            \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
                          6. mul-1-negN/A

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

                            \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
                          8. distribute-rgt-neg-inN/A

                            \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
                          9. metadata-evalN/A

                            \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
                          10. cancel-sign-subN/A

                            \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
                          11. mul-1-negN/A

                            \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
                          12. *-inversesN/A

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

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

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

                            \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
                          16. sub-negN/A

                            \[\leadsto \color{blue}{x \cdot \log y + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right) \cdot x\right)\right)} \]
                        5. Applied rewrites99.9%

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

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

                            \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
                          2. distribute-lft-inN/A

                            \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
                          3. *-rgt-identityN/A

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

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

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
                          6. *-commutativeN/A

                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
                          7. mul-1-negN/A

                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
                          8. distribute-lft-neg-outN/A

                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
                          9. remove-double-negN/A

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

                            \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
                          11. lower-fma.f64N/A

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

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

                          \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{y}{z}, z, -z\right) \]
                        10. Step-by-step derivation
                          1. Applied rewrites74.1%

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

                          if -1.54999999999999997e-25 < z < 5.3999999999999997e-14

                          1. Initial program 99.8%

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

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

                              \[\leadsto \color{blue}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}} \]
                            3. clear-numN/A

                              \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
                            4. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
                            5. clear-numN/A

                              \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
                            6. flip3-+N/A

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

                            \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
                          5. Taylor expanded in y around inf

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

                              \[\leadsto \color{blue}{\mathsf{neg}\left(y\right)} \]
                            2. lower-neg.f6434.1

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-14}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-y}{z}, z, -z\right)\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]
                        13. Add Preprocessing

                        Alternative 9: 58.1% accurate, 6.3× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-14}\right):\\ \;\;\;\;z \cdot \left(\frac{-y}{z} + -1\right)\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (or (<= z -1.55e-25) (not (<= z 5.4e-14)))
                           (* z (+ (/ (- y) z) -1.0))
                           (- y)))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if ((z <= -1.55e-25) || !(z <= 5.4e-14)) {
                        		tmp = z * ((-y / z) + -1.0);
                        	} 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 <= (-1.55d-25)) .or. (.not. (z <= 5.4d-14))) then
                                tmp = z * ((-y / z) + (-1.0d0))
                            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 <= -1.55e-25) || !(z <= 5.4e-14)) {
                        		tmp = z * ((-y / z) + -1.0);
                        	} else {
                        		tmp = -y;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if (z <= -1.55e-25) or not (z <= 5.4e-14):
                        		tmp = z * ((-y / z) + -1.0)
                        	else:
                        		tmp = -y
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if ((z <= -1.55e-25) || !(z <= 5.4e-14))
                        		tmp = Float64(z * Float64(Float64(Float64(-y) / z) + -1.0));
                        	else
                        		tmp = Float64(-y);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if ((z <= -1.55e-25) || ~((z <= 5.4e-14)))
                        		tmp = z * ((-y / z) + -1.0);
                        	else
                        		tmp = -y;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e-25], N[Not[LessEqual[z, 5.4e-14]], $MachinePrecision]], N[(z * N[(N[((-y) / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], (-y)]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;z \leq -1.55 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-14}\right):\\
                        \;\;\;\;z \cdot \left(\frac{-y}{z} + -1\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;-y\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if z < -1.54999999999999997e-25 or 5.3999999999999997e-14 < z

                          1. Initial program 99.9%

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

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

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

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

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

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

                              \[\leadsto x \cdot \log y + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right)\right)\right)} \]
                            6. mul-1-negN/A

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

                              \[\leadsto x \cdot \log y + \left(\mathsf{neg}\left(\color{blue}{\left(\log t - \left(y + z\right)\right) \cdot -1}\right)\right) \]
                            8. distribute-rgt-neg-inN/A

                              \[\leadsto x \cdot \log y + \color{blue}{\left(\log t - \left(y + z\right)\right) \cdot \left(\mathsf{neg}\left(-1\right)\right)} \]
                            9. metadata-evalN/A

                              \[\leadsto x \cdot \log y + \left(\log t - \left(y + z\right)\right) \cdot \color{blue}{1} \]
                            10. cancel-sign-subN/A

                              \[\leadsto \color{blue}{x \cdot \log y - \left(\mathsf{neg}\left(\left(\log t - \left(y + z\right)\right)\right)\right) \cdot 1} \]
                            11. mul-1-negN/A

                              \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \left(\log t - \left(y + z\right)\right)\right)} \cdot 1 \]
                            12. *-inversesN/A

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

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

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

                              \[\leadsto x \cdot \log y - \color{blue}{\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right)} \cdot x \]
                            16. sub-negN/A

                              \[\leadsto \color{blue}{x \cdot \log y + \left(\mathsf{neg}\left(\left(-1 \cdot \frac{\log t - \left(y + z\right)}{x}\right) \cdot x\right)\right)} \]
                          5. Applied rewrites99.9%

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

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

                              \[\leadsto -1 \cdot \left(z \cdot \color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z} + 1\right)}\right) \]
                            2. distribute-lft-inN/A

                              \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) + z \cdot 1\right)} \]
                            3. *-rgt-identityN/A

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

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

                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)\right)} + -1 \cdot z \]
                            6. *-commutativeN/A

                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(-1 \cdot \frac{\left(\log t + x \cdot \log y\right) - y}{z}\right) \cdot z}\right)\right) + -1 \cdot z \]
                            7. mul-1-negN/A

                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z}\right)\right)} \cdot z\right)\right) + -1 \cdot z \]
                            8. distribute-lft-neg-outN/A

                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z\right)\right)}\right)\right) + -1 \cdot z \]
                            9. remove-double-negN/A

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

                              \[\leadsto \frac{\left(\log t + x \cdot \log y\right) - y}{z} \cdot z + \color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \]
                            11. lower-fma.f64N/A

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

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

                            \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{y}{z}, z, -z\right) \]
                          10. Step-by-step derivation
                            1. Applied rewrites74.1%

                              \[\leadsto \mathsf{fma}\left(\frac{-y}{z}, z, -z\right) \]
                            2. Step-by-step derivation
                              1. Applied rewrites74.1%

                                \[\leadsto z \cdot \color{blue}{\left(\frac{-y}{z} + -1\right)} \]

                              if -1.54999999999999997e-25 < z < 5.3999999999999997e-14

                              1. Initial program 99.8%

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

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

                                  \[\leadsto \color{blue}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}} \]
                                3. clear-numN/A

                                  \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
                                4. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
                                5. clear-numN/A

                                  \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
                                6. flip3-+N/A

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

                                \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
                              5. Taylor expanded in y around inf

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

                                  \[\leadsto \color{blue}{\mathsf{neg}\left(y\right)} \]
                                2. lower-neg.f6434.1

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-14}\right):\\ \;\;\;\;z \cdot \left(\frac{-y}{z} + -1\right)\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 10: 48.9% accurate, 14.3× speedup?

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

                              1. Initial program 100.0%

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

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

                                  \[\leadsto \color{blue}{\mathsf{neg}\left(z\right)} \]
                                2. lower-neg.f6470.0

                                  \[\leadsto \color{blue}{-z} \]
                              5. Applied rewrites70.0%

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

                              if -1.3e98 < z < 2e20

                              1. Initial program 99.8%

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

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

                                  \[\leadsto \color{blue}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}} \]
                                3. clear-numN/A

                                  \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
                                4. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{1}{\frac{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}}} \]
                                5. clear-numN/A

                                  \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{{\left(\left(x \cdot \log y - y\right) - z\right)}^{3} + {\log t}^{3}}{\left(\left(x \cdot \log y - y\right) - z\right) \cdot \left(\left(x \cdot \log y - y\right) - z\right) + \left(\log t \cdot \log t - \left(\left(x \cdot \log y - y\right) - z\right) \cdot \log t\right)}}}} \]
                                6. flip3-+N/A

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

                                \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(\mathsf{fma}\left(\log y, x, \log t\right) - z\right) - y}}} \]
                              5. Taylor expanded in y around inf

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

                                  \[\leadsto \color{blue}{\mathsf{neg}\left(y\right)} \]
                                2. lower-neg.f6434.6

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

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

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

                            Alternative 11: 30.1% accurate, 71.7× speedup?

                            \[\begin{array}{l} \\ -z \end{array} \]
                            (FPCore (x y z t) :precision binary64 (- z))
                            double code(double x, double y, double z, double t) {
                            	return -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 = -z
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	return -z;
                            }
                            
                            def code(x, y, z, t):
                            	return -z
                            
                            function code(x, y, z, t)
                            	return Float64(-z)
                            end
                            
                            function tmp = code(x, y, z, t)
                            	tmp = -z;
                            end
                            
                            code[x_, y_, z_, t_] := (-z)
                            
                            \begin{array}{l}
                            
                            \\
                            -z
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.9%

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

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

                                \[\leadsto \color{blue}{\mathsf{neg}\left(z\right)} \]
                              2. lower-neg.f6431.0

                                \[\leadsto \color{blue}{-z} \]
                            5. Applied rewrites31.0%

                              \[\leadsto \color{blue}{-z} \]
                            6. Final simplification31.0%

                              \[\leadsto -z \]
                            7. Add Preprocessing

                            Alternative 12: 2.2% accurate, 215.0× speedup?

                            \[\begin{array}{l} \\ z \end{array} \]
                            (FPCore (x y z t) :precision binary64 z)
                            double code(double x, double y, double z, double t) {
                            	return 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 = z
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	return z;
                            }
                            
                            def code(x, y, z, t):
                            	return z
                            
                            function code(x, y, z, t)
                            	return z
                            end
                            
                            function tmp = code(x, y, z, t)
                            	tmp = z;
                            end
                            
                            code[x_, y_, z_, t_] := z
                            
                            \begin{array}{l}
                            
                            \\
                            z
                            \end{array}
                            
                            Derivation
                            1. Initial program 99.9%

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

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

                                \[\leadsto \color{blue}{\mathsf{neg}\left(z\right)} \]
                              2. lower-neg.f6431.0

                                \[\leadsto \color{blue}{-z} \]
                            5. Applied rewrites31.0%

                              \[\leadsto \color{blue}{-z} \]
                            6. Step-by-step derivation
                              1. Applied rewrites12.1%

                                \[\leadsto \frac{0 - z \cdot z}{\color{blue}{0 + z}} \]
                              2. Step-by-step derivation
                                1. Applied rewrites2.2%

                                  \[\leadsto z \]
                                2. Final simplification2.2%

                                  \[\leadsto z \]
                                3. Add Preprocessing

                                Reproduce

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