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

Percentage Accurate: 99.9% → 99.9%
Time: 9.0s
Alternatives: 9
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 9 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: 66.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+45}:\\
\;\;\;\;\log t - y\\

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-y} \]
    8. Applied rewrites63.9%

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

    if -1.9999999999999998e228 < (-.f64 (*.f64 x (log.f64 y)) y) < -9.9999999999999998e178 or 5.00000000000000031e-10 < (-.f64 (*.f64 x (log.f64 y)) y)

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y} \cdot x \]
    7. Applied rewrites69.6%

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

    if -9.9999999999999998e178 < (-.f64 (*.f64 x (log.f64 y)) y) < -3.9999999999999997e45

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \log t - y \]

      if -3.9999999999999997e45 < (-.f64 (*.f64 x (log.f64 y)) y) < 5.00000000000000031e-10

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \log t - z \]
      10. Recombined 4 regimes into one program.
      11. Final simplification75.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \log y - y \leq -2 \cdot 10^{+228}:\\ \;\;\;\;-y\\ \mathbf{elif}\;x \cdot \log y - y \leq -1 \cdot 10^{+179}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \cdot \log y - y \leq -4 \cdot 10^{+45}:\\ \;\;\;\;\log t - y\\ \mathbf{elif}\;x \cdot \log y - y \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\log t - z\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]
      12. Add Preprocessing

      Alternative 3: 91.0% accurate, 0.5× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        if -9.9999999999999998e178 < (-.f64 (*.f64 x (log.f64 y)) y) < -0.0100000000000000002

        1. Initial program 100.0%

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

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

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

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

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

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

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

        if -0.0100000000000000002 < (-.f64 (*.f64 x (log.f64 y)) y)

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\log y, x, \log t\right) - z} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification96.1%

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

      Alternative 4: 87.7% accurate, 1.0× speedup?

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

        1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        if -9.9999999999999999e45 < x < 7.39999999999999996e171

        1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+46} \lor \neg \left(x \leq 7.4 \cdot 10^{+171}\right):\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\ \mathbf{else}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \end{array} \]
      5. Add Preprocessing

      Alternative 5: 84.4% accurate, 1.8× speedup?

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

        1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\log y} \cdot x \]
        7. Applied rewrites74.4%

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

        if -2.2999999999999999e129 < x < 6.50000000000000053e141

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

      Alternative 6: 61.0% accurate, 1.9× speedup?

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

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

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

        if -8.5e12 < z < 6.49999999999999972e48

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 61.0% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7800000000:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+48}:\\ \;\;\;\;\log t - y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= z -7800000000.0)
           (- (log t) z)
           (if (<= z 6.5e+48) (- (log t) y) (- z))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= -7800000000.0) {
        		tmp = log(t) - z;
        	} else if (z <= 6.5e+48) {
        		tmp = log(t) - 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 <= (-7800000000.0d0)) then
                tmp = log(t) - z
            else if (z <= 6.5d+48) then
                tmp = log(t) - 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 <= -7800000000.0) {
        		tmp = Math.log(t) - z;
        	} else if (z <= 6.5e+48) {
        		tmp = Math.log(t) - y;
        	} else {
        		tmp = -z;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	tmp = 0
        	if z <= -7800000000.0:
        		tmp = math.log(t) - z
        	elif z <= 6.5e+48:
        		tmp = math.log(t) - y
        	else:
        		tmp = -z
        	return tmp
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (z <= -7800000000.0)
        		tmp = Float64(log(t) - z);
        	elseif (z <= 6.5e+48)
        		tmp = Float64(log(t) - y);
        	else
        		tmp = Float64(-z);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if (z <= -7800000000.0)
        		tmp = log(t) - z;
        	elseif (z <= 6.5e+48)
        		tmp = log(t) - y;
        	else
        		tmp = -z;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[z, -7800000000.0], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[z, 6.5e+48], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], (-z)]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -7800000000:\\
        \;\;\;\;\log t - z\\
        
        \mathbf{elif}\;z \leq 6.5 \cdot 10^{+48}:\\
        \;\;\;\;\log t - y\\
        
        \mathbf{else}:\\
        \;\;\;\;-z\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -7.8e9

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \log t - z \]
          9. Step-by-step derivation
            1. Applied rewrites64.5%

              \[\leadsto \log t - z \]

            if -7.8e9 < z < 6.49999999999999972e48

            1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \log t - y \]

              if 6.49999999999999972e48 < 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.f6470.1

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

                \[\leadsto \color{blue}{-z} \]
            8. Recombined 3 regimes into one program.
            9. Final simplification65.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7800000000:\\ \;\;\;\;\log t - z\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{+48}:\\ \;\;\;\;\log t - y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
            10. Add Preprocessing

            Alternative 8: 48.9% accurate, 14.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8500000000000 \lor \neg \left(z \leq 6.5 \cdot 10^{+48}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;-y\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (or (<= z -8500000000000.0) (not (<= z 6.5e+48))) (- z) (- y)))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if ((z <= -8500000000000.0) || !(z <= 6.5e+48)) {
            		tmp = -z;
            	} else {
            		tmp = -y;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: tmp
                if ((z <= (-8500000000000.0d0)) .or. (.not. (z <= 6.5d+48))) then
                    tmp = -z
                else
                    tmp = -y
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double tmp;
            	if ((z <= -8500000000000.0) || !(z <= 6.5e+48)) {
            		tmp = -z;
            	} else {
            		tmp = -y;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	tmp = 0
            	if (z <= -8500000000000.0) or not (z <= 6.5e+48):
            		tmp = -z
            	else:
            		tmp = -y
            	return tmp
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if ((z <= -8500000000000.0) || !(z <= 6.5e+48))
            		tmp = Float64(-z);
            	else
            		tmp = Float64(-y);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if ((z <= -8500000000000.0) || ~((z <= 6.5e+48)))
            		tmp = -z;
            	else
            		tmp = -y;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8500000000000.0], N[Not[LessEqual[z, 6.5e+48]], $MachinePrecision]], (-z), (-y)]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -8500000000000 \lor \neg \left(z \leq 6.5 \cdot 10^{+48}\right):\\
            \;\;\;\;-z\\
            
            \mathbf{else}:\\
            \;\;\;\;-y\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -8.5e12 or 6.49999999999999972e48 < 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.7

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

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

              if -8.5e12 < z < 6.49999999999999972e48

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{-y} \]
              8. Applied rewrites34.9%

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

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

            Alternative 9: 30.5% 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. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{-y} \]
            8. Applied rewrites27.0%

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

            Reproduce

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