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

Percentage Accurate: 99.9% → 99.9%
Time: 11.8s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.7× speedup?

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

\\
\mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\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. Step-by-step derivation
    1. associate--l-N/A

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

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

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

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

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \left(\mathsf{neg}\left(\left(\left(y + z\right) - \log t\right)\right)\right)\right) \]
    7. neg-lowering-neg.f64N/A

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\left(y + \left(z - \log t\right)\right)\right)\right) \]
    9. +-lowering-+.f64N/A

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\mathsf{+.f64}\left(y, \mathsf{\_.f64}\left(z, \log t\right)\right)\right)\right) \]
    11. log-lowering-log.f6499.9%

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\mathsf{+.f64}\left(y, \mathsf{\_.f64}\left(z, \mathsf{log.f64}\left(t\right)\right)\right)\right)\right) \]
  4. Applied egg-rr99.9%

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

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

Alternative 2: 88.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\log y, x, 0 - y\right)\\ \mathbf{if}\;x \leq -3.45 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{+114}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (fma (log y) x (- 0.0 y))))
   (if (<= x -3.45e+93) t_1 (if (<= x 4.8e+114) (- (- (log t) z) y) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = fma(log(y), x, (0.0 - y));
	double tmp;
	if (x <= -3.45e+93) {
		tmp = t_1;
	} else if (x <= 4.8e+114) {
		tmp = (log(t) - z) - y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = fma(log(y), x, Float64(0.0 - y))
	tmp = 0.0
	if (x <= -3.45e+93)
		tmp = t_1;
	elseif (x <= 4.8e+114)
		tmp = Float64(Float64(log(t) - z) - y);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x + N[(0.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.45e+93], t$95$1, If[LessEqual[x, 4.8e+114], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log y, x, 0 - y\right)\\
\mathbf{if}\;x \leq -3.45 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.4499999999999998e93 or 4.8e114 < x

    1. Initial program 99.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \left(\mathsf{neg}\left(\left(\left(y + z\right) - \log t\right)\right)\right)\right) \]
      7. neg-lowering-neg.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\left(y + \left(z - \log t\right)\right)\right)\right) \]
      9. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\mathsf{+.f64}\left(y, \mathsf{\_.f64}\left(z, \log t\right)\right)\right)\right) \]
      11. log-lowering-log.f6499.7%

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\mathsf{+.f64}\left(y, \mathsf{\_.f64}\left(z, \mathsf{log.f64}\left(t\right)\right)\right)\right)\right) \]
    4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\color{blue}{y}\right)\right) \]
    6. Step-by-step derivation
      1. Simplified89.0%

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

      if -3.4499999999999998e93 < x < 4.8e114

      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. +-commutativeN/A

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

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

          \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
        4. --lowering--.f64N/A

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

          \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
        7. log-lowering-log.f6496.4%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
      5. Simplified96.4%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.45 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, 0 - y\right)\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{+114}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, 0 - y\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 89.2% accurate, 1.0× speedup?

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

      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 \mathsf{+.f64}\left(\color{blue}{\left(x \cdot \log y - z\right)}, \mathsf{log.f64}\left(t\right)\right) \]
      4. Step-by-step derivation
        1. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\left(x \cdot \log y\right), z\right), \mathsf{log.f64}\left(\color{blue}{t}\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \log y\right), z\right), \mathsf{log.f64}\left(t\right)\right) \]
        3. log-lowering-log.f6494.9%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right), z\right), \mathsf{log.f64}\left(t\right)\right) \]
      5. Simplified94.9%

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

      if 1.35e90 < y

      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. associate--l-N/A

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

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

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

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

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

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \left(\mathsf{neg}\left(\left(\left(y + z\right) - \log t\right)\right)\right)\right) \]
        7. neg-lowering-neg.f64N/A

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

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\left(y + \left(z - \log t\right)\right)\right)\right) \]
        9. +-lowering-+.f64N/A

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

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\mathsf{+.f64}\left(y, \mathsf{\_.f64}\left(z, \log t\right)\right)\right)\right) \]
        11. log-lowering-log.f6499.9%

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\mathsf{+.f64}\left(y, \mathsf{\_.f64}\left(z, \mathsf{log.f64}\left(t\right)\right)\right)\right)\right) \]
      4. Applied egg-rr99.9%

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

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{log.f64}\left(y\right), x, \mathsf{neg.f64}\left(\color{blue}{y}\right)\right) \]
      6. Step-by-step derivation
        1. Simplified92.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.35 \cdot 10^{+90}:\\ \;\;\;\;\log t + \left(\log y \cdot x - z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, 0 - y\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 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 5: 82.8% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -7 \cdot 10^{+159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+164}:\\ \;\;\;\;\left(\log t - z\right) - y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (log y) x)))
         (if (<= x -7e+159) t_1 (if (<= x 7.2e+164) (- (- (log t) z) y) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = log(y) * x;
      	double tmp;
      	if (x <= -7e+159) {
      		tmp = t_1;
      	} else if (x <= 7.2e+164) {
      		tmp = (log(t) - z) - y;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = log(y) * x
          if (x <= (-7d+159)) then
              tmp = t_1
          else if (x <= 7.2d+164) then
              tmp = (log(t) - z) - y
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = Math.log(y) * x;
      	double tmp;
      	if (x <= -7e+159) {
      		tmp = t_1;
      	} else if (x <= 7.2e+164) {
      		tmp = (Math.log(t) - z) - y;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = math.log(y) * x
      	tmp = 0
      	if x <= -7e+159:
      		tmp = t_1
      	elif x <= 7.2e+164:
      		tmp = (math.log(t) - z) - y
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(log(y) * x)
      	tmp = 0.0
      	if (x <= -7e+159)
      		tmp = t_1;
      	elseif (x <= 7.2e+164)
      		tmp = Float64(Float64(log(t) - z) - y);
      	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 <= -7e+159)
      		tmp = t_1;
      	elseif (x <= 7.2e+164)
      		tmp = (log(t) - z) - y;
      	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, -7e+159], t$95$1, If[LessEqual[x, 7.2e+164], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \log y \cdot x\\
      \mathbf{if}\;x \leq -7 \cdot 10^{+159}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 7.2 \cdot 10^{+164}:\\
      \;\;\;\;\left(\log t - z\right) - y\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -6.9999999999999999e159 or 7.19999999999999981e164 < 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. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\log y}\right) \]
          2. log-lowering-log.f6475.0%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right) \]
        5. Simplified75.0%

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

        if -6.9999999999999999e159 < x < 7.19999999999999981e164

        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. +-commutativeN/A

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6491.9%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified91.9%

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

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

      Alternative 6: 69.2% accurate, 1.8× speedup?

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

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6482.6%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified82.6%

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

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
          2. neg-sub0N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
          3. --lowering--.f6481.2%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
        8. Simplified81.2%

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

        if -550 < z < 5.5000000000000005e-26

        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. +-commutativeN/A

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6467.1%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified67.1%

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

          \[\leadsto \color{blue}{\log t - y} \]
        7. Step-by-step derivation
          1. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\log t, \color{blue}{y}\right) \]
          2. log-lowering-log.f6466.5%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), y\right) \]
        8. Simplified66.5%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -550:\\ \;\;\;\;\left(0 - y\right) - z\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-26}:\\ \;\;\;\;\log t - y\\ \mathbf{else}:\\ \;\;\;\;\left(0 - y\right) - z\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 70.4% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -9 \cdot 10^{+159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+165}:\\ \;\;\;\;\left(0 - 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 -9e+159) t_1 (if (<= x 6.2e+165) (- (- 0.0 y) z) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = log(y) * x;
      	double tmp;
      	if (x <= -9e+159) {
      		tmp = t_1;
      	} else if (x <= 6.2e+165) {
      		tmp = (0.0 - 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 <= (-9d+159)) then
              tmp = t_1
          else if (x <= 6.2d+165) then
              tmp = (0.0d0 - 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 <= -9e+159) {
      		tmp = t_1;
      	} else if (x <= 6.2e+165) {
      		tmp = (0.0 - y) - z;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = math.log(y) * x
      	tmp = 0
      	if x <= -9e+159:
      		tmp = t_1
      	elif x <= 6.2e+165:
      		tmp = (0.0 - 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 <= -9e+159)
      		tmp = t_1;
      	elseif (x <= 6.2e+165)
      		tmp = Float64(Float64(0.0 - 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 <= -9e+159)
      		tmp = t_1;
      	elseif (x <= 6.2e+165)
      		tmp = (0.0 - 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, -9e+159], t$95$1, If[LessEqual[x, 6.2e+165], N[(N[(0.0 - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \log y \cdot x\\
      \mathbf{if}\;x \leq -9 \cdot 10^{+159}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 6.2 \cdot 10^{+165}:\\
      \;\;\;\;\left(0 - y\right) - z\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -9.00000000000000053e159 or 6.2000000000000003e165 < 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. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\log y}\right) \]
          2. log-lowering-log.f6475.0%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{log.f64}\left(y\right)\right) \]
        5. Simplified75.0%

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

        if -9.00000000000000053e159 < x < 6.2000000000000003e165

        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. +-commutativeN/A

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6491.9%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified91.9%

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

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
          2. neg-sub0N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
          3. --lowering--.f6471.2%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
        8. Simplified71.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+159}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+165}:\\ \;\;\;\;\left(0 - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 69.4% accurate, 1.9× speedup?

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

        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. +-commutativeN/A

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6472.6%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified72.6%

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

          \[\leadsto \color{blue}{\log t - z} \]
        7. Step-by-step derivation
          1. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\log t, \color{blue}{z}\right) \]
          2. log-lowering-log.f6471.7%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right) \]
        8. Simplified71.7%

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

        if 5.5e14 < 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 x around 0

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

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6478.0%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified78.0%

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

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
          2. neg-sub0N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
          3. --lowering--.f6478.0%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
        8. Simplified78.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.5 \cdot 10^{+14}:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;\left(0 - y\right) - z\\ \end{array} \]
      5. Add Preprocessing

      Alternative 9: 55.0% accurate, 2.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 10^{-171}:\\ \;\;\;\;\log t\\ \mathbf{else}:\\ \;\;\;\;\left(0 - y\right) - z\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= y 1e-171) (log t) (- (- 0.0 y) z)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= 1e-171) {
      		tmp = log(t);
      	} else {
      		tmp = (0.0 - y) - z;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: tmp
          if (y <= 1d-171) then
              tmp = log(t)
          else
              tmp = (0.0d0 - y) - z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= 1e-171) {
      		tmp = Math.log(t);
      	} else {
      		tmp = (0.0 - y) - z;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if y <= 1e-171:
      		tmp = math.log(t)
      	else:
      		tmp = (0.0 - y) - z
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (y <= 1e-171)
      		tmp = log(t);
      	else
      		tmp = Float64(Float64(0.0 - y) - z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (y <= 1e-171)
      		tmp = log(t);
      	else
      		tmp = (0.0 - y) - z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[y, 1e-171], N[Log[t], $MachinePrecision], N[(N[(0.0 - y), $MachinePrecision] - z), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq 10^{-171}:\\
      \;\;\;\;\log t\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(0 - y\right) - z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 9.9999999999999998e-172

        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. +-commutativeN/A

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6473.4%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified73.4%

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

          \[\leadsto \color{blue}{\log t - y} \]
        7. Step-by-step derivation
          1. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\log t, \color{blue}{y}\right) \]
          2. log-lowering-log.f6441.6%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), y\right) \]
        8. Simplified41.6%

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

          \[\leadsto \color{blue}{\log t} \]
        10. Step-by-step derivation
          1. log-lowering-log.f6441.6%

            \[\leadsto \mathsf{log.f64}\left(t\right) \]
        11. Simplified41.6%

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

        if 9.9999999999999998e-172 < 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 x around 0

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

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

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

            \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
          4. --lowering--.f64N/A

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

            \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
          7. log-lowering-log.f6475.9%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
        5. Simplified75.9%

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

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
          2. neg-sub0N/A

            \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
          3. --lowering--.f6468.3%

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
        8. Simplified68.3%

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

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

      Alternative 10: 47.6% accurate, 26.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{+93}:\\ \;\;\;\;0 - z\\ \mathbf{else}:\\ \;\;\;\;0 - y\\ \end{array} \end{array} \]
      (FPCore (x y z t) :precision binary64 (if (<= y 2.2e+93) (- 0.0 z) (- 0.0 y)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= 2.2e+93) {
      		tmp = 0.0 - z;
      	} else {
      		tmp = 0.0 - 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.2d+93) then
              tmp = 0.0d0 - z
          else
              tmp = 0.0d0 - y
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= 2.2e+93) {
      		tmp = 0.0 - z;
      	} else {
      		tmp = 0.0 - y;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if y <= 2.2e+93:
      		tmp = 0.0 - z
      	else:
      		tmp = 0.0 - y
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (y <= 2.2e+93)
      		tmp = Float64(0.0 - z);
      	else
      		tmp = Float64(0.0 - y);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (y <= 2.2e+93)
      		tmp = 0.0 - z;
      	else
      		tmp = 0.0 - y;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e+93], N[(0.0 - z), $MachinePrecision], N[(0.0 - y), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq 2.2 \cdot 10^{+93}:\\
      \;\;\;\;0 - z\\
      
      \mathbf{else}:\\
      \;\;\;\;0 - y\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < 2.20000000000000021e93

        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 \mathsf{neg}\left(z\right) \]
          2. neg-sub0N/A

            \[\leadsto 0 - \color{blue}{z} \]
          3. --lowering--.f6442.8%

            \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{z}\right) \]
        5. Simplified42.8%

          \[\leadsto \color{blue}{0 - z} \]
        6. Step-by-step derivation
          1. sub0-negN/A

            \[\leadsto \mathsf{neg}\left(z\right) \]
          2. neg-lowering-neg.f6442.8%

            \[\leadsto \mathsf{neg.f64}\left(z\right) \]
        7. Applied egg-rr42.8%

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

        if 2.20000000000000021e93 < 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 \mathsf{neg}\left(y\right) \]
          2. neg-sub0N/A

            \[\leadsto 0 - \color{blue}{y} \]
          3. --lowering--.f6470.7%

            \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{y}\right) \]
        5. Simplified70.7%

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

            \[\leadsto \mathsf{neg}\left(y\right) \]
          2. neg-lowering-neg.f6470.7%

            \[\leadsto \mathsf{neg.f64}\left(y\right) \]
        7. Applied egg-rr70.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{+93}:\\ \;\;\;\;0 - z\\ \mathbf{else}:\\ \;\;\;\;0 - y\\ \end{array} \]
      5. Add Preprocessing

      Alternative 11: 57.6% accurate, 41.8× speedup?

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

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

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

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

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

          \[\leadsto \left(\log t + \left(\mathsf{neg}\left(z\right)\right)\right) - y \]
        4. --lowering--.f64N/A

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

          \[\leadsto \mathsf{\_.f64}\left(\left(\log t - z\right), y\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\log t, z\right), y\right) \]
        7. log-lowering-log.f6475.3%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(\mathsf{log.f64}\left(t\right), z\right), y\right) \]
      5. Simplified75.3%

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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot z\right)}, y\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(z\right)\right), y\right) \]
        2. neg-sub0N/A

          \[\leadsto \mathsf{\_.f64}\left(\left(0 - z\right), y\right) \]
        3. --lowering--.f6459.7%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, z\right), y\right) \]
      8. Simplified59.7%

        \[\leadsto \color{blue}{\left(0 - z\right)} - y \]
      9. Final simplification59.7%

        \[\leadsto \left(0 - y\right) - z \]
      10. Add Preprocessing

      Alternative 12: 29.3% accurate, 69.7× speedup?

      \[\begin{array}{l} \\ 0 - y \end{array} \]
      (FPCore (x y z t) :precision binary64 (- 0.0 y))
      double code(double x, double y, double z, double t) {
      	return 0.0 - 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 = 0.0d0 - y
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return 0.0 - y;
      }
      
      def code(x, y, z, t):
      	return 0.0 - y
      
      function code(x, y, z, t)
      	return Float64(0.0 - y)
      end
      
      function tmp = code(x, y, z, t)
      	tmp = 0.0 - y;
      end
      
      code[x_, y_, z_, t_] := N[(0.0 - y), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      0 - 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 \mathsf{neg}\left(y\right) \]
        2. neg-sub0N/A

          \[\leadsto 0 - \color{blue}{y} \]
        3. --lowering--.f6432.5%

          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{y}\right) \]
      5. Simplified32.5%

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

          \[\leadsto \mathsf{neg}\left(y\right) \]
        2. neg-lowering-neg.f6432.5%

          \[\leadsto \mathsf{neg.f64}\left(y\right) \]
      7. Applied egg-rr32.5%

        \[\leadsto \color{blue}{-y} \]
      8. Final simplification32.5%

        \[\leadsto 0 - y \]
      9. Add Preprocessing

      Reproduce

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