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

Percentage Accurate: 99.9% → 99.9%
Time: 9.4s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 69.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0.02:\\
\;\;\;\;\log t\\

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


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

    1. Initial program 99.9%

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

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

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

        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
    7. Applied rewrites65.8%

      \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(-z\right) - y}}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(-z\right) - y}}} \]
      3. remove-double-div65.9

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

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

    if -1e5 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 0.0200000000000000004

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \log t + \color{blue}{x \cdot \log y} \]
    7. Step-by-step derivation
      1. Applied rewrites95.0%

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

        \[\leadsto \log t \]
      3. Step-by-step derivation
        1. Applied rewrites94.3%

          \[\leadsto \log t \]
      4. Recombined 2 regimes into one program.
      5. Final simplification69.7%

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

      Alternative 3: 80.0% accurate, 0.6× speedup?

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

        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.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 z around inf

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

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

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
        7. Applied rewrites77.7%

          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
        8. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(-z\right) - y}}} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(-z\right) - y}}} \]
          3. remove-double-div77.9

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

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

        if -1e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 4e19

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

          \[\leadsto \log t - z \]
        7. Step-by-step derivation
          1. Applied rewrites98.3%

            \[\leadsto \log t - z \]

          if 4e19 < (-.f64 (*.f64 x (log.f64 y)) y)

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{x \cdot \log y} \]
          4. 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.f6483.2

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

            \[\leadsto \color{blue}{\log y \cdot x} \]
        8. Recombined 3 regimes into one program.
        9. Final simplification84.5%

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

        Alternative 4: 70.5% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\log y \cdot x - y \leq -100000:\\ \;\;\;\;\left(-z\right) - y\\ \mathbf{else}:\\ \;\;\;\;\log t - z\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= (- (* (log y) x) y) -100000.0) (- (- z) y) (- (log t) z)))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (((log(y) * x) - y) <= -100000.0) {
        		tmp = -z - y;
        	} else {
        		tmp = log(t) - 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 (((log(y) * x) - y) <= (-100000.0d0)) then
                tmp = -z - y
            else
                tmp = log(t) - z
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double tmp;
        	if (((Math.log(y) * x) - y) <= -100000.0) {
        		tmp = -z - y;
        	} else {
        		tmp = Math.log(t) - z;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	tmp = 0
        	if ((math.log(y) * x) - y) <= -100000.0:
        		tmp = -z - y
        	else:
        		tmp = math.log(t) - z
        	return tmp
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (Float64(Float64(log(y) * x) - y) <= -100000.0)
        		tmp = Float64(Float64(-z) - y);
        	else
        		tmp = Float64(log(t) - z);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if (((log(y) * x) - y) <= -100000.0)
        		tmp = -z - y;
        	else
        		tmp = log(t) - z;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision], -100000.0], N[((-z) - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\log y \cdot x - y \leq -100000:\\
        \;\;\;\;\left(-z\right) - y\\
        
        \mathbf{else}:\\
        \;\;\;\;\log t - z\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (-.f64 (*.f64 x (log.f64 y)) y) < -1e5

          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.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 z around inf

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

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

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
          7. Applied rewrites77.7%

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
          8. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(-z\right) - y}}} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(-z\right) - y}}} \]
            3. remove-double-div77.9

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

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

          if -1e5 < (-.f64 (*.f64 x (log.f64 y)) y)

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \log t - z \]
          8. Recombined 2 regimes into one program.
          9. Final simplification70.0%

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

          Alternative 5: 88.6% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+18}:\\ \;\;\;\;\log y \cdot x - z\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{+146}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= x -4.2e+18)
             (- (* (log y) x) z)
             (if (<= x 3.4e+146) (- (- (log t) y) z) (fma (log y) x (- y)))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (x <= -4.2e+18) {
          		tmp = (log(y) * x) - z;
          	} else if (x <= 3.4e+146) {
          		tmp = (log(t) - y) - z;
          	} else {
          		tmp = fma(log(y), x, -y);
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (x <= -4.2e+18)
          		tmp = Float64(Float64(log(y) * x) - z);
          	elseif (x <= 3.4e+146)
          		tmp = Float64(Float64(log(t) - y) - z);
          	else
          		tmp = fma(log(y), x, Float64(-y));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[x, -4.2e+18], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 3.4e+146], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + (-y)), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -4.2 \cdot 10^{+18}:\\
          \;\;\;\;\log y \cdot x - z\\
          
          \mathbf{elif}\;x \leq 3.4 \cdot 10^{+146}:\\
          \;\;\;\;\left(\log t - y\right) - z\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\log y, x, -y\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if x < -4.2e18

            1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

              \[\leadsto x \cdot \log y - z \]
            7. Step-by-step derivation
              1. Applied rewrites85.4%

                \[\leadsto \log y \cdot x - z \]

              if -4.2e18 < x < 3.39999999999999991e146

              1. Initial program 100.0%

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

                \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
              4. Step-by-step derivation
                1. 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.f6497.4

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

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

              if 3.39999999999999991e146 < x

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{\mathsf{neg}\left(y\right)}\right) \]
                2. lower-neg.f6494.1

                  \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-y}\right) \]
              7. Applied rewrites94.1%

                \[\leadsto \mathsf{fma}\left(\log y, x, \color{blue}{-y}\right) \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 6: 88.8% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x - z\\ \mathbf{if}\;x \leq -4.2 \cdot 10^{+18}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+136}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (- (* (log y) x) z)))
               (if (<= x -4.2e+18) t_1 (if (<= x 8.2e+136) (- (- (log t) y) z) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = (log(y) * x) - z;
            	double tmp;
            	if (x <= -4.2e+18) {
            		tmp = t_1;
            	} else if (x <= 8.2e+136) {
            		tmp = (log(t) - y) - z;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: t_1
                real(8) :: tmp
                t_1 = (log(y) * x) - z
                if (x <= (-4.2d+18)) then
                    tmp = t_1
                else if (x <= 8.2d+136) then
                    tmp = (log(t) - y) - z
                else
                    tmp = t_1
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double t_1 = (Math.log(y) * x) - z;
            	double tmp;
            	if (x <= -4.2e+18) {
            		tmp = t_1;
            	} else if (x <= 8.2e+136) {
            		tmp = (Math.log(t) - y) - z;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	t_1 = (math.log(y) * x) - z
            	tmp = 0
            	if x <= -4.2e+18:
            		tmp = t_1
            	elif x <= 8.2e+136:
            		tmp = (math.log(t) - y) - z
            	else:
            		tmp = t_1
            	return tmp
            
            function code(x, y, z, t)
            	t_1 = Float64(Float64(log(y) * x) - z)
            	tmp = 0.0
            	if (x <= -4.2e+18)
            		tmp = t_1;
            	elseif (x <= 8.2e+136)
            		tmp = Float64(Float64(log(t) - y) - z);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	t_1 = (log(y) * x) - z;
            	tmp = 0.0;
            	if (x <= -4.2e+18)
            		tmp = t_1;
            	elseif (x <= 8.2e+136)
            		tmp = (log(t) - y) - z;
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -4.2e+18], t$95$1, If[LessEqual[x, 8.2e+136], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \log y \cdot x - z\\
            \mathbf{if}\;x \leq -4.2 \cdot 10^{+18}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;x \leq 8.2 \cdot 10^{+136}:\\
            \;\;\;\;\left(\log t - y\right) - z\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -4.2e18 or 8.1999999999999995e136 < 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 y around 0

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot \log y - z \]
              7. Step-by-step derivation
                1. Applied rewrites85.1%

                  \[\leadsto \log y \cdot x - z \]

                if -4.2e18 < x < 8.1999999999999995e136

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{\log t - \left(y + z\right)} \]
                4. Step-by-step derivation
                  1. 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.f6497.4

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

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

              Alternative 7: 84.5% accurate, 1.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -1.28 \cdot 10^{+107}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+146}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (* (log y) x)))
                 (if (<= x -1.28e+107) t_1 (if (<= x 3.8e+146) (- (- (log t) y) z) t_1))))
              double code(double x, double y, double z, double t) {
              	double t_1 = log(y) * x;
              	double tmp;
              	if (x <= -1.28e+107) {
              		tmp = t_1;
              	} else if (x <= 3.8e+146) {
              		tmp = (log(t) - y) - z;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: t_1
                  real(8) :: tmp
                  t_1 = log(y) * x
                  if (x <= (-1.28d+107)) then
                      tmp = t_1
                  else if (x <= 3.8d+146) then
                      tmp = (log(t) - y) - z
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double t_1 = Math.log(y) * x;
              	double tmp;
              	if (x <= -1.28e+107) {
              		tmp = t_1;
              	} else if (x <= 3.8e+146) {
              		tmp = (Math.log(t) - y) - z;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = math.log(y) * x
              	tmp = 0
              	if x <= -1.28e+107:
              		tmp = t_1
              	elif x <= 3.8e+146:
              		tmp = (math.log(t) - y) - z
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(log(y) * x)
              	tmp = 0.0
              	if (x <= -1.28e+107)
              		tmp = t_1;
              	elseif (x <= 3.8e+146)
              		tmp = Float64(Float64(log(t) - y) - z);
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = log(y) * x;
              	tmp = 0.0;
              	if (x <= -1.28e+107)
              		tmp = t_1;
              	elseif (x <= 3.8e+146)
              		tmp = (log(t) - y) - z;
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.28e+107], t$95$1, If[LessEqual[x, 3.8e+146], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \log y \cdot x\\
              \mathbf{if}\;x \leq -1.28 \cdot 10^{+107}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;x \leq 3.8 \cdot 10^{+146}:\\
              \;\;\;\;\left(\log t - y\right) - z\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -1.2799999999999999e107 or 3.79999999999999979e146 < x

                1. Initial program 99.7%

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

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

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

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

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

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

                if -1.2799999999999999e107 < x < 3.79999999999999979e146

                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.f6493.3

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

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

              Alternative 8: 48.1% accurate, 23.8× speedup?

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

                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.f6437.8

                    \[\leadsto \color{blue}{-z} \]
                5. Applied rewrites37.8%

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

                if 2.15e93 < y

                1. Initial program 99.9%

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

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

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

                    \[\leadsto \color{blue}{-y} \]
                5. Applied rewrites68.3%

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

              Alternative 9: 58.3% accurate, 35.8× speedup?

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

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

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

                  \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
              7. Applied rewrites57.7%

                \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(-z\right)} - y}} \]
              8. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{1}{\frac{1}{\left(-z\right) - y}}} \]
                2. lift-/.f64N/A

                  \[\leadsto \frac{1}{\color{blue}{\frac{1}{\left(-z\right) - y}}} \]
                3. remove-double-div57.8

                  \[\leadsto \color{blue}{\left(-z\right) - y} \]
              9. Applied rewrites57.8%

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

              Alternative 10: 29.6% accurate, 71.7× speedup?

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

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

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

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

                  \[\leadsto \color{blue}{-y} \]
              5. Applied rewrites29.8%

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

              Reproduce

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