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

Percentage Accurate: 99.9% → 99.9%
Time: 10.2s
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} \\ \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}
Derivation
  1. Initial program 99.9%

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

Alternative 2: 54.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+28}:\\
\;\;\;\;\log t\\

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


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

    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.f6449.0

        \[\leadsto \color{blue}{-y} \]
    5. Applied rewrites49.0%

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

    if -4e7 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 9.99999999999999958e27

    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. sub-negN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \log t - \color{blue}{z} \]
    7. Step-by-step derivation
      1. Applied rewrites91.9%

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

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

          \[\leadsto \log t \]

        if 9.99999999999999958e27 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z)

        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 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.f6443.6

            \[\leadsto \color{blue}{-z} \]
        5. Applied rewrites43.6%

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

      Alternative 3: 67.8% accurate, 0.6× speedup?

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

        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} + \log t \]
        4. Step-by-step derivation
          1. mul-1-negN/A

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

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

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

        if -4e7 < (-.f64 (*.f64 x (log.f64 y)) y) < 2e-16

        1. Initial program 100.0%

          \[\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. sub-negN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \log t - \color{blue}{z} \]
        7. Step-by-step derivation
          1. Applied rewrites98.6%

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

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

          1. Initial program 99.7%

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

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

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

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

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

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

        Alternative 4: 67.5% accurate, 0.6× speedup?

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

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

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

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

          if -1.99999999999999989e119 < (-.f64 (*.f64 x (log.f64 y)) y) < 2e-16

          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. sub-negN/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \log t - \color{blue}{z} \]
          7. Step-by-step derivation
            1. Applied rewrites75.6%

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

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

            1. Initial program 99.7%

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

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

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

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

              \[\leadsto \color{blue}{x \cdot \log y} \]
          8. Recombined 3 regimes into one program.
          9. Add Preprocessing

          Alternative 5: 89.0% accurate, 1.0× speedup?

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

            1. Initial program 100.0%

              \[\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. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

              if -4.3e21 < z < 2.3e94

              1. Initial program 99.8%

                \[\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.f6435.0

                  \[\leadsto \color{blue}{-y} \]
              5. Applied rewrites35.0%

                \[\leadsto \color{blue}{-y} \]
              6. Taylor expanded in z around 0

                \[\leadsto \color{blue}{\left(\log t + x \cdot \log y\right) - y} \]
              7. 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. lower-fma.f64N/A

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

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

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

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

              if 2.3e94 < 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}{\log t - \left(y + z\right)} \]
              4. Step-by-step derivation
                1. lower--.f64N/A

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

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

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

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

            Alternative 6: 89.7% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x, \log y, -z\right)\\ \mathbf{if}\;x \leq -1.65 \cdot 10^{+45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5 \cdot 10^{+70}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (fma x (log y) (- z))))
               (if (<= x -1.65e+45) t_1 (if (<= x 5e+70) (- (log t) (+ y z)) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = fma(x, log(y), -z);
            	double tmp;
            	if (x <= -1.65e+45) {
            		tmp = t_1;
            	} else if (x <= 5e+70) {
            		tmp = log(t) - (y + z);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t)
            	t_1 = fma(x, log(y), Float64(-z))
            	tmp = 0.0
            	if (x <= -1.65e+45)
            		tmp = t_1;
            	elseif (x <= 5e+70)
            		tmp = Float64(log(t) - Float64(y + z));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision] + (-z)), $MachinePrecision]}, If[LessEqual[x, -1.65e+45], t$95$1, If[LessEqual[x, 5e+70], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \mathsf{fma}\left(x, \log y, -z\right)\\
            \mathbf{if}\;x \leq -1.65 \cdot 10^{+45}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;x \leq 5 \cdot 10^{+70}:\\
            \;\;\;\;\log t - \left(y + z\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -1.65e45 or 5.0000000000000002e70 < x

              1. Initial program 99.8%

                \[\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. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

                if -1.65e45 < x < 5.0000000000000002e70

                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. lower--.f64N/A

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

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

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

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

              Alternative 7: 83.3% accurate, 1.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y\\ \mathbf{if}\;x \leq -6 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+121}:\\ \;\;\;\;\log t - \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (* x (log y))))
                 (if (<= x -6e+46) t_1 (if (<= x 3.8e+121) (- (log t) (+ y z)) t_1))))
              double code(double x, double y, double z, double t) {
              	double t_1 = x * log(y);
              	double tmp;
              	if (x <= -6e+46) {
              		tmp = t_1;
              	} else if (x <= 3.8e+121) {
              		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 = x * log(y)
                  if (x <= (-6d+46)) then
                      tmp = t_1
                  else if (x <= 3.8d+121) 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 = x * Math.log(y);
              	double tmp;
              	if (x <= -6e+46) {
              		tmp = t_1;
              	} else if (x <= 3.8e+121) {
              		tmp = Math.log(t) - (y + z);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = x * math.log(y)
              	tmp = 0
              	if x <= -6e+46:
              		tmp = t_1
              	elif x <= 3.8e+121:
              		tmp = math.log(t) - (y + z)
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(x * log(y))
              	tmp = 0.0
              	if (x <= -6e+46)
              		tmp = t_1;
              	elseif (x <= 3.8e+121)
              		tmp = Float64(log(t) - Float64(y + z));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = x * log(y);
              	tmp = 0.0;
              	if (x <= -6e+46)
              		tmp = t_1;
              	elseif (x <= 3.8e+121)
              		tmp = log(t) - (y + z);
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+46], t$95$1, If[LessEqual[x, 3.8e+121], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := x \cdot \log y\\
              \mathbf{if}\;x \leq -6 \cdot 10^{+46}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;x \leq 3.8 \cdot 10^{+121}:\\
              \;\;\;\;\log t - \left(y + z\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -6.00000000000000047e46 or 3.8e121 < 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. lower-*.f64N/A

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

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

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

                if -6.00000000000000047e46 < x < 3.8e121

                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. lower--.f64N/A

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

                    \[\leadsto \color{blue}{\log t} - \left(y + z\right) \]
                  3. lower-+.f6492.1

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

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

              Alternative 8: 60.5% accurate, 2.0× speedup?

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

                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. sub-negN/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \log t - \color{blue}{z} \]
                7. Step-by-step derivation
                  1. Applied rewrites58.8%

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

                  if 4e7 < 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.f6453.7

                      \[\leadsto \color{blue}{-y} \]
                  5. Applied rewrites53.7%

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

                Alternative 9: 48.4% accurate, 14.3× speedup?

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

                  1. Initial program 99.9%

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

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

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

                      \[\leadsto \color{blue}{-z} \]
                  5. Applied rewrites66.3%

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

                  if -4.3e21 < z < 3.7000000000000002e83

                  1. Initial program 99.8%

                    \[\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.f6435.8

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

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

                Alternative 10: 30.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.f6428.6

                    \[\leadsto \color{blue}{-y} \]
                5. Applied rewrites28.6%

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

                Reproduce

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