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

Percentage Accurate: 99.9% → 99.9%
Time: 9.2s
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: 68.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+113}:\\
\;\;\;\;\log t - y\\

\mathbf{elif}\;t\_1 \leq 10^{+19}:\\
\;\;\;\;\log t - z\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\log t + x \cdot \log y\right) - y} \]
    6. 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.f6478.7

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

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

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

        \[\leadsto \log t - y \]

      if -5e113 < (-.f64 (*.f64 x (log.f64 y)) y) < 1e19

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \log t - z \]

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

        1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\color{blue}{\mathsf{fma}\left({\log y}^{2} \cdot x, \frac{x}{\mathsf{fma}\left(\log y, x, y\right)}, -y \cdot \frac{y}{\mathsf{fma}\left(\log y, x, y\right)}\right)} - z\right) + \log t \]
        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.f6479.7

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

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

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

      Alternative 3: 89.4% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.013 \lor \neg \left(z \leq 6.2 \cdot 10^{+18}\right):\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= z -0.013) (not (<= z 6.2e+18)))
         (- (- (log t) y) z)
         (- (fma (log y) x (log t)) y)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -0.013) || !(z <= 6.2e+18)) {
      		tmp = (log(t) - y) - z;
      	} else {
      		tmp = fma(log(y), x, log(t)) - y;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if ((z <= -0.013) || !(z <= 6.2e+18))
      		tmp = Float64(Float64(log(t) - y) - z);
      	else
      		tmp = Float64(fma(log(y), x, log(t)) - y);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.013], N[Not[LessEqual[z, 6.2e+18]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -0.013 \lor \neg \left(z \leq 6.2 \cdot 10^{+18}\right):\\
      \;\;\;\;\left(\log t - y\right) - z\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - y\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -0.0129999999999999994 or 6.2e18 < 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. 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.f6486.6

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

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

        if -0.0129999999999999994 < z < 6.2e18

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 89.6% accurate, 1.0× speedup?

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

        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.f6495.9

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

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

        if 3.8000000000000003e47 < 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. 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.f6486.9

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

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

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

      Alternative 5: 48.8% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.1 \lor \neg \left(z \leq 4.8 \cdot 10^{+28}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{-1}{y}\right)}^{-1}\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= z -1.1) (not (<= z 4.8e+28))) (- z) (pow (/ -1.0 y) -1.0)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -1.1) || !(z <= 4.8e+28)) {
      		tmp = -z;
      	} else {
      		tmp = pow((-1.0 / y), -1.0);
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: tmp
          if ((z <= (-1.1d0)) .or. (.not. (z <= 4.8d+28))) then
              tmp = -z
          else
              tmp = ((-1.0d0) / y) ** (-1.0d0)
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -1.1) || !(z <= 4.8e+28)) {
      		tmp = -z;
      	} else {
      		tmp = Math.pow((-1.0 / y), -1.0);
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if (z <= -1.1) or not (z <= 4.8e+28):
      		tmp = -z
      	else:
      		tmp = math.pow((-1.0 / y), -1.0)
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if ((z <= -1.1) || !(z <= 4.8e+28))
      		tmp = Float64(-z);
      	else
      		tmp = Float64(-1.0 / y) ^ -1.0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if ((z <= -1.1) || ~((z <= 4.8e+28)))
      		tmp = -z;
      	else
      		tmp = (-1.0 / y) ^ -1.0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1], N[Not[LessEqual[z, 4.8e+28]], $MachinePrecision]], (-z), N[Power[N[(-1.0 / y), $MachinePrecision], -1.0], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -1.1 \lor \neg \left(z \leq 4.8 \cdot 10^{+28}\right):\\
      \;\;\;\;-z\\
      
      \mathbf{else}:\\
      \;\;\;\;{\left(\frac{-1}{y}\right)}^{-1}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.1000000000000001 or 4.79999999999999962e28 < 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.f6467.2

            \[\leadsto \color{blue}{-z} \]
        5. Applied rewrites67.2%

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

        if -1.1000000000000001 < z < 4.79999999999999962e28

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

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

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

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

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

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

      Alternative 6: 81.9% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.36 \cdot 10^{+108} \lor \neg \left(x \leq 1.35 \cdot 10^{+235}\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 -1.36e+108) (not (<= x 1.35e+235)))
         (* (log y) x)
         (- (- (log t) y) z)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((x <= -1.36e+108) || !(x <= 1.35e+235)) {
      		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 <= (-1.36d+108)) .or. (.not. (x <= 1.35d+235))) 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 <= -1.36e+108) || !(x <= 1.35e+235)) {
      		tmp = Math.log(y) * x;
      	} else {
      		tmp = (Math.log(t) - y) - z;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if (x <= -1.36e+108) or not (x <= 1.35e+235):
      		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 <= -1.36e+108) || !(x <= 1.35e+235))
      		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 <= -1.36e+108) || ~((x <= 1.35e+235)))
      		tmp = log(y) * x;
      	else
      		tmp = (log(t) - y) - z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.36e+108], N[Not[LessEqual[x, 1.35e+235]], $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 -1.36 \cdot 10^{+108} \lor \neg \left(x \leq 1.35 \cdot 10^{+235}\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 < -1.3599999999999999e108 or 1.3499999999999999e235 < 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. lift--.f64N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\color{blue}{\mathsf{fma}\left({\log y}^{2} \cdot x, \frac{x}{\mathsf{fma}\left(\log y, x, y\right)}, -y \cdot \frac{y}{\mathsf{fma}\left(\log y, x, y\right)}\right)} - z\right) + \log t \]
        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.f6477.5

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

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

        if -1.3599999999999999e108 < x < 1.3499999999999999e235

        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.f6487.9

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

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

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

      Alternative 7: 59.9% accurate, 1.8× speedup?

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

        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.f6492.5

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

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

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

            \[\leadsto \log t - z \]

          if 6.4999999999999998e112 < 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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\color{blue}{\frac{-1}{y}}} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification62.3%

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

        Alternative 8: 60.7% accurate, 1.9× speedup?

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

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \log t - z \]

            if -0.0269999999999999997 < z < 6.8e28

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \log t - y \]

              if 6.8e28 < 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.0

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

                \[\leadsto \color{blue}{-z} \]
            10. Recombined 3 regimes into one program.
            11. Final simplification64.6%

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

            Alternative 9: 30.3% accurate, 71.7× speedup?

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

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

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

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

                \[\leadsto \color{blue}{-z} \]
            5. Applied rewrites35.4%

              \[\leadsto \color{blue}{-z} \]
            6. Final simplification35.4%

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

            Reproduce

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