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

Percentage Accurate: 99.9% → 99.9%
Time: 8.6s
Alternatives: 11
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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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 11 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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} \\ \mathsf{fma}\left(\log y, x, \log t\right) - \left(z + y\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (- (fma (log y) x (log t)) (+ z y)))
double code(double x, double y, double z, double t) {
	return fma(log(y), x, log(t)) - (z + y);
}
function code(x, y, z, t)
	return Float64(fma(log(y), x, log(t)) - Float64(z + y))
end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - N[(z + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 74.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+174}:\\ \;\;\;\;\log t + \left(-y\right)\\ \mathbf{elif}\;t\_1 \leq -200000:\\ \;\;\;\;\left(\frac{-y}{z} - 1\right) \cdot z\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+32}:\\ \;\;\;\;\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+174)
     (+ (log t) (- y))
     (if (<= t_1 -200000.0)
       (* (- (/ (- y) z) 1.0) z)
       (if (<= t_1 5e+32) (- (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+174) {
		tmp = log(t) + -y;
	} else if (t_1 <= -200000.0) {
		tmp = ((-y / z) - 1.0) * z;
	} else if (t_1 <= 5e+32) {
		tmp = log(t) - z;
	} else {
		tmp = log(y) * x;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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+174)) then
        tmp = log(t) + -y
    else if (t_1 <= (-200000.0d0)) then
        tmp = ((-y / z) - 1.0d0) * z
    else if (t_1 <= 5d+32) 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+174) {
		tmp = Math.log(t) + -y;
	} else if (t_1 <= -200000.0) {
		tmp = ((-y / z) - 1.0) * z;
	} else if (t_1 <= 5e+32) {
		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+174:
		tmp = math.log(t) + -y
	elif t_1 <= -200000.0:
		tmp = ((-y / z) - 1.0) * z
	elif t_1 <= 5e+32:
		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+174)
		tmp = Float64(log(t) + Float64(-y));
	elseif (t_1 <= -200000.0)
		tmp = Float64(Float64(Float64(Float64(-y) / z) - 1.0) * z);
	elseif (t_1 <= 5e+32)
		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+174)
		tmp = log(t) + -y;
	elseif (t_1 <= -200000.0)
		tmp = ((-y / z) - 1.0) * z;
	elseif (t_1 <= 5e+32)
		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+174], N[(N[Log[t], $MachinePrecision] + (-y)), $MachinePrecision], If[LessEqual[t$95$1, -200000.0], N[(N[(N[((-y) / z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 5e+32], 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^{+174}:\\
\;\;\;\;\log t + \left(-y\right)\\

\mathbf{elif}\;t\_1 \leq -200000:\\
\;\;\;\;\left(\frac{-y}{z} - 1\right) \cdot z\\

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

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


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

    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 \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. fp-cancel-sub-sign-invN/A

        \[\leadsto \left(\frac{\color{blue}{\left(x \cdot \log y\right) \cdot \left(x \cdot \log y\right) + \left(\mathsf{neg}\left(y\right)\right) \cdot y}}{x \cdot \log y + y} - z\right) + \log t \]
      4. div-addN/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{\left(\mathsf{neg}\left(y\right)\right) \cdot y}{x \cdot \log y + y}\right)} - z\right) + \log t \]
      5. lift-*.f64N/A

        \[\leadsto \left(\left(\frac{\color{blue}{\left(x \cdot \log y\right)} \cdot \left(x \cdot \log y\right)}{x \cdot \log y + y} + \frac{\left(\mathsf{neg}\left(y\right)\right) \cdot y}{x \cdot \log y + y}\right) - z\right) + \log t \]
      6. 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} + \frac{\left(\mathsf{neg}\left(y\right)\right) \cdot y}{x \cdot \log y + y}\right) - z\right) + \log t \]
      7. swap-sqrN/A

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\frac{-1 \cdot {y}^{2}}{y + x \cdot \log y}} + \frac{{x}^{2} \cdot {\log y}^{2}}{y + x \cdot \log y}\right) + \log t \]
      2. div-add-revN/A

        \[\leadsto \color{blue}{\frac{-1 \cdot {y}^{2} + {x}^{2} \cdot {\log y}^{2}}{y + x \cdot \log y}} + \log t \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot {y}^{2} + {x}^{2} \cdot {\log y}^{2}}{y + x \cdot \log y}} + \log t \]
    7. Applied rewrites6.8%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-y, y, \left({\log y}^{2} \cdot x\right) \cdot x\right)}{\mathsf{fma}\left(\log y, x, y\right)}} + \log t \]
    8. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto \color{blue}{\log t + \frac{\mathsf{fma}\left(-y, y, \left({\log y}^{2} \cdot x\right) \cdot x\right)}{\mathsf{fma}\left(\log y, x, y\right)}} \]
      3. lower-+.f646.8

        \[\leadsto \color{blue}{\log t + \frac{\mathsf{fma}\left(-y, y, \left({\log y}^{2} \cdot x\right) \cdot x\right)}{\mathsf{fma}\left(\log y, x, y\right)}} \]
    9. Applied rewrites92.8%

      \[\leadsto \color{blue}{\log t + \left(\log y \cdot x - y\right)} \]
    10. Taylor expanded in x around 0

      \[\leadsto \log t + -1 \cdot \color{blue}{y} \]
    11. Step-by-step derivation
      1. Applied rewrites56.2%

        \[\leadsto \log t + \left(-y\right) \]

      if -4.9999999999999997e174 < (-.f64 (*.f64 x (log.f64 y)) y) < -2e5

      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}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
      4. Applied rewrites89.7%

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

        \[\leadsto \left(x \cdot \left(\left(\frac{\log t}{x \cdot z} + \frac{\log y}{z}\right) - \frac{y}{x \cdot z}\right) - 1\right) \cdot z \]
      6. Step-by-step derivation
        1. Applied rewrites82.4%

          \[\leadsto \left(\left(\frac{\frac{\log t - y}{z}}{x} + \frac{\log y}{z}\right) \cdot x - 1\right) \cdot z \]
        2. Taylor expanded in y around inf

          \[\leadsto \left(-1 \cdot \frac{y}{z} - 1\right) \cdot z \]
        3. Step-by-step derivation
          1. Applied rewrites70.3%

            \[\leadsto \left(\frac{-y}{z} - 1\right) \cdot z \]

          if -2e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999997e32

          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} \]
          5. Applied rewrites99.9%

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

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

              \[\leadsto \log t - z \]

            if 4.9999999999999997e32 < (-.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 \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
              2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 3: 70.0% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \log y - y\\ \mathbf{if}\;t\_1 \leq -200000:\\ \;\;\;\;\left(\frac{-y}{z} - 1\right) \cdot z\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+32}:\\ \;\;\;\;\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 -200000.0)
               (* (- (/ (- y) z) 1.0) z)
               (if (<= t_1 5e+32) (- (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 <= -200000.0) {
          		tmp = ((-y / z) - 1.0) * z;
          	} else if (t_1 <= 5e+32) {
          		tmp = log(t) - z;
          	} else {
          		tmp = log(y) * x;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t)
          use fmin_fmax_functions
              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 <= (-200000.0d0)) then
                  tmp = ((-y / z) - 1.0d0) * z
              else if (t_1 <= 5d+32) 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 <= -200000.0) {
          		tmp = ((-y / z) - 1.0) * z;
          	} else if (t_1 <= 5e+32) {
          		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 <= -200000.0:
          		tmp = ((-y / z) - 1.0) * z
          	elif t_1 <= 5e+32:
          		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 <= -200000.0)
          		tmp = Float64(Float64(Float64(Float64(-y) / z) - 1.0) * z);
          	elseif (t_1 <= 5e+32)
          		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 <= -200000.0)
          		tmp = ((-y / z) - 1.0) * z;
          	elseif (t_1 <= 5e+32)
          		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, -200000.0], N[(N[(N[((-y) / z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t$95$1, 5e+32], 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 -200000:\\
          \;\;\;\;\left(\frac{-y}{z} - 1\right) \cdot z\\
          
          \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+32}:\\
          \;\;\;\;\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) < -2e5

            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}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
            4. Applied rewrites80.8%

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

              \[\leadsto \left(x \cdot \left(\left(\frac{\log t}{x \cdot z} + \frac{\log y}{z}\right) - \frac{y}{x \cdot z}\right) - 1\right) \cdot z \]
            6. Step-by-step derivation
              1. Applied rewrites71.3%

                \[\leadsto \left(\left(\frac{\frac{\log t - y}{z}}{x} + \frac{\log y}{z}\right) \cdot x - 1\right) \cdot z \]
              2. Taylor expanded in y around inf

                \[\leadsto \left(-1 \cdot \frac{y}{z} - 1\right) \cdot z \]
              3. Step-by-step derivation
                1. Applied rewrites56.1%

                  \[\leadsto \left(\frac{-y}{z} - 1\right) \cdot z \]

                if -2e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999997e32

                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} \]
                5. Applied rewrites99.9%

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

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

                    \[\leadsto \log t - z \]

                  if 4.9999999999999997e32 < (-.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 \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
                    2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 4: 89.1% accurate, 1.0× speedup?

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

                  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} \]
                  5. Applied rewrites94.0%

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

                  if 8.19999999999999959e67 < y < 5.2e131

                  1. Initial program 99.7%

                    \[\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} \]
                  5. Applied rewrites87.3%

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

                  if 5.2e131 < y

                  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. *-lft-identityN/A

                      \[\leadsto \left(\log t - \color{blue}{1 \cdot y}\right) - z \]
                    3. metadata-evalN/A

                      \[\leadsto \left(\log t - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot y\right) - z \]
                    4. fp-cancel-sign-sub-invN/A

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

                      \[\leadsto \color{blue}{\left(\log t + -1 \cdot y\right) - z} \]
                    6. fp-cancel-sign-sub-invN/A

                      \[\leadsto \color{blue}{\left(\log t - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} - z \]
                    7. metadata-evalN/A

                      \[\leadsto \left(\log t - \color{blue}{1} \cdot y\right) - z \]
                    8. *-lft-identityN/A

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 8.2 \cdot 10^{+67}:\\ \;\;\;\;\mathsf{fma}\left(\log y, x, \log t\right) - z\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+131}:\\ \;\;\;\;\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: 88.7% accurate, 1.0× speedup?

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

                  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}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
                  4. Applied rewrites99.8%

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

                    \[\leadsto \left(x \cdot \left(\left(\frac{\log t}{x \cdot z} + \frac{\log y}{z}\right) - \frac{y}{x \cdot z}\right) - 1\right) \cdot z \]
                  6. Step-by-step derivation
                    1. Applied rewrites99.8%

                      \[\leadsto \left(\left(\frac{\frac{\log t - y}{z}}{x} + \frac{\log y}{z}\right) \cdot x - 1\right) \cdot z \]
                    2. Taylor expanded in x around inf

                      \[\leadsto \left(\frac{x \cdot \log y}{z} - 1\right) \cdot z \]
                    3. Step-by-step derivation
                      1. Applied rewrites86.0%

                        \[\leadsto \left(\frac{\log y \cdot x}{z} - 1\right) \cdot z \]

                      if -7.40000000000000008e112 < z < 0.12

                      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} \]
                      5. Applied rewrites96.0%

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

                      if 0.12 < 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}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
                      4. Applied rewrites99.8%

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

                        \[\leadsto \left(x \cdot \left(\left(\frac{\log t}{x \cdot z} + \frac{\log y}{z}\right) - \frac{y}{x \cdot z}\right) - 1\right) \cdot z \]
                      6. Step-by-step derivation
                        1. Applied rewrites96.1%

                          \[\leadsto \left(\left(\frac{\frac{\log t - y}{z}}{x} + \frac{\log y}{z}\right) \cdot x - 1\right) \cdot z \]
                        2. Taylor expanded in x around inf

                          \[\leadsto \left(\frac{\log y}{z} \cdot x - 1\right) \cdot z \]
                        3. Step-by-step derivation
                          1. Applied rewrites84.6%

                            \[\leadsto \left(\frac{\log y}{z} \cdot x - 1\right) \cdot z \]
                        4. Recombined 3 regimes into one program.
                        5. Final simplification91.0%

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

                        Alternative 6: 59.6% accurate, 1.0× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot \log y - y \leq -200000:\\ \;\;\;\;\left(\frac{-y}{z} - 1\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;\log t - z\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (<= (- (* x (log y)) y) -200000.0)
                           (* (- (/ (- y) z) 1.0) z)
                           (- (log t) z)))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if (((x * log(y)) - y) <= -200000.0) {
                        		tmp = ((-y / z) - 1.0) * z;
                        	} else {
                        		tmp = log(t) - z;
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z, t)
                        use fmin_fmax_functions
                            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 * log(y)) - y) <= (-200000.0d0)) then
                                tmp = ((-y / z) - 1.0d0) * z
                            else
                                tmp = log(t) - z
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if (((x * Math.log(y)) - y) <= -200000.0) {
                        		tmp = ((-y / z) - 1.0) * z;
                        	} else {
                        		tmp = Math.log(t) - z;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if ((x * math.log(y)) - y) <= -200000.0:
                        		tmp = ((-y / z) - 1.0) * z
                        	else:
                        		tmp = math.log(t) - z
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if (Float64(Float64(x * log(y)) - y) <= -200000.0)
                        		tmp = Float64(Float64(Float64(Float64(-y) / z) - 1.0) * z);
                        	else
                        		tmp = Float64(log(t) - z);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if (((x * log(y)) - y) <= -200000.0)
                        		tmp = ((-y / z) - 1.0) * z;
                        	else
                        		tmp = log(t) - z;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], -200000.0], N[(N[(N[((-y) / z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \cdot \log y - y \leq -200000:\\
                        \;\;\;\;\left(\frac{-y}{z} - 1\right) \cdot z\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\log t - z\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (-.f64 (*.f64 x (log.f64 y)) y) < -2e5

                          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}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
                          4. Applied rewrites80.8%

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

                            \[\leadsto \left(x \cdot \left(\left(\frac{\log t}{x \cdot z} + \frac{\log y}{z}\right) - \frac{y}{x \cdot z}\right) - 1\right) \cdot z \]
                          6. Step-by-step derivation
                            1. Applied rewrites71.3%

                              \[\leadsto \left(\left(\frac{\frac{\log t - y}{z}}{x} + \frac{\log y}{z}\right) \cdot x - 1\right) \cdot z \]
                            2. Taylor expanded in y around inf

                              \[\leadsto \left(-1 \cdot \frac{y}{z} - 1\right) \cdot z \]
                            3. Step-by-step derivation
                              1. Applied rewrites56.1%

                                \[\leadsto \left(\frac{-y}{z} - 1\right) \cdot z \]

                              if -2e5 < (-.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} \]
                              5. Applied rewrites99.3%

                                \[\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 rewrites73.6%

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

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

                              Alternative 7: 84.2% accurate, 1.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \log y \cdot x\\ \mathbf{if}\;x \leq -5.2 \cdot 10^{+193}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{+38}:\\ \;\;\;\;\left(\frac{t\_1}{z} - 1\right) \cdot z\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+146}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                              (FPCore (x y z t)
                               :precision binary64
                               (let* ((t_1 (* (log y) x)))
                                 (if (<= x -5.2e+193)
                                   t_1
                                   (if (<= x -1.1e+38)
                                     (* (- (/ t_1 z) 1.0) z)
                                     (if (<= x 3.5e+146) (- (- (log t) y) z) t_1)))))
                              double code(double x, double y, double z, double t) {
                              	double t_1 = log(y) * x;
                              	double tmp;
                              	if (x <= -5.2e+193) {
                              		tmp = t_1;
                              	} else if (x <= -1.1e+38) {
                              		tmp = ((t_1 / z) - 1.0) * z;
                              	} else if (x <= 3.5e+146) {
                              		tmp = (log(t) - y) - z;
                              	} else {
                              		tmp = t_1;
                              	}
                              	return tmp;
                              }
                              
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(x, y, z, t)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8), intent (in) :: z
                                  real(8), intent (in) :: t
                                  real(8) :: t_1
                                  real(8) :: tmp
                                  t_1 = log(y) * x
                                  if (x <= (-5.2d+193)) then
                                      tmp = t_1
                                  else if (x <= (-1.1d+38)) then
                                      tmp = ((t_1 / z) - 1.0d0) * z
                                  else if (x <= 3.5d+146) then
                                      tmp = (log(t) - y) - z
                                  else
                                      tmp = t_1
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double y, double z, double t) {
                              	double t_1 = Math.log(y) * x;
                              	double tmp;
                              	if (x <= -5.2e+193) {
                              		tmp = t_1;
                              	} else if (x <= -1.1e+38) {
                              		tmp = ((t_1 / z) - 1.0) * z;
                              	} else if (x <= 3.5e+146) {
                              		tmp = (Math.log(t) - y) - z;
                              	} else {
                              		tmp = t_1;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t):
                              	t_1 = math.log(y) * x
                              	tmp = 0
                              	if x <= -5.2e+193:
                              		tmp = t_1
                              	elif x <= -1.1e+38:
                              		tmp = ((t_1 / z) - 1.0) * z
                              	elif x <= 3.5e+146:
                              		tmp = (math.log(t) - y) - z
                              	else:
                              		tmp = t_1
                              	return tmp
                              
                              function code(x, y, z, t)
                              	t_1 = Float64(log(y) * x)
                              	tmp = 0.0
                              	if (x <= -5.2e+193)
                              		tmp = t_1;
                              	elseif (x <= -1.1e+38)
                              		tmp = Float64(Float64(Float64(t_1 / z) - 1.0) * z);
                              	elseif (x <= 3.5e+146)
                              		tmp = Float64(Float64(log(t) - y) - z);
                              	else
                              		tmp = t_1;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z, t)
                              	t_1 = log(y) * x;
                              	tmp = 0.0;
                              	if (x <= -5.2e+193)
                              		tmp = t_1;
                              	elseif (x <= -1.1e+38)
                              		tmp = ((t_1 / z) - 1.0) * z;
                              	elseif (x <= 3.5e+146)
                              		tmp = (log(t) - y) - z;
                              	else
                              		tmp = t_1;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -5.2e+193], t$95$1, If[LessEqual[x, -1.1e+38], N[(N[(N[(t$95$1 / z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 3.5e+146], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := \log y \cdot x\\
                              \mathbf{if}\;x \leq -5.2 \cdot 10^{+193}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;x \leq -1.1 \cdot 10^{+38}:\\
                              \;\;\;\;\left(\frac{t\_1}{z} - 1\right) \cdot z\\
                              
                              \mathbf{elif}\;x \leq 3.5 \cdot 10^{+146}:\\
                              \;\;\;\;\left(\log t - y\right) - z\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_1\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if x < -5.20000000000000026e193 or 3.5000000000000001e146 < 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 \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
                                  2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if -5.20000000000000026e193 < x < -1.10000000000000003e38

                                1. Initial program 99.7%

                                  \[\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}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
                                4. Applied rewrites79.1%

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

                                  \[\leadsto \left(x \cdot \left(\left(\frac{\log t}{x \cdot z} + \frac{\log y}{z}\right) - \frac{y}{x \cdot z}\right) - 1\right) \cdot z \]
                                6. Step-by-step derivation
                                  1. Applied rewrites79.1%

                                    \[\leadsto \left(\left(\frac{\frac{\log t - y}{z}}{x} + \frac{\log y}{z}\right) \cdot x - 1\right) \cdot z \]
                                  2. Taylor expanded in x around inf

                                    \[\leadsto \left(\frac{x \cdot \log y}{z} - 1\right) \cdot z \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites73.1%

                                      \[\leadsto \left(\frac{\log y \cdot x}{z} - 1\right) \cdot z \]

                                    if -1.10000000000000003e38 < x < 3.5000000000000001e146

                                    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. *-lft-identityN/A

                                        \[\leadsto \left(\log t - \color{blue}{1 \cdot y}\right) - z \]
                                      3. metadata-evalN/A

                                        \[\leadsto \left(\log t - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot y\right) - z \]
                                      4. fp-cancel-sign-sub-invN/A

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

                                        \[\leadsto \color{blue}{\left(\log t + -1 \cdot y\right) - z} \]
                                      6. fp-cancel-sign-sub-invN/A

                                        \[\leadsto \color{blue}{\left(\log t - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} - z \]
                                      7. metadata-evalN/A

                                        \[\leadsto \left(\log t - \color{blue}{1} \cdot y\right) - z \]
                                      8. *-lft-identityN/A

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{+193}:\\ \;\;\;\;\log y \cdot x\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{+38}:\\ \;\;\;\;\left(\frac{\log y \cdot x}{z} - 1\right) \cdot z\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+146}:\\ \;\;\;\;\left(\log t - y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot x\\ \end{array} \]
                                  6. Add Preprocessing

                                  Alternative 8: 83.2% accurate, 1.8× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+38} \lor \neg \left(x \leq 3.5 \cdot 10^{+146}\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.6e+38) (not (<= x 3.5e+146)))
                                     (* (log y) x)
                                     (- (- (log t) y) z)))
                                  double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if ((x <= -1.6e+38) || !(x <= 3.5e+146)) {
                                  		tmp = log(y) * x;
                                  	} else {
                                  		tmp = (log(t) - y) - z;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y, z, t)
                                  use fmin_fmax_functions
                                      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.6d+38)) .or. (.not. (x <= 3.5d+146))) 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.6e+38) || !(x <= 3.5e+146)) {
                                  		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.6e+38) or not (x <= 3.5e+146):
                                  		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.6e+38) || !(x <= 3.5e+146))
                                  		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.6e+38) || ~((x <= 3.5e+146)))
                                  		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.6e+38], N[Not[LessEqual[x, 3.5e+146]], $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.6 \cdot 10^{+38} \lor \neg \left(x \leq 3.5 \cdot 10^{+146}\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.59999999999999993e38 or 3.5000000000000001e146 < 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 \color{blue}{\left(\left(x \cdot \log y - y\right) - z\right) + \log t} \]
                                      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if -1.59999999999999993e38 < x < 3.5000000000000001e146

                                    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. *-lft-identityN/A

                                        \[\leadsto \left(\log t - \color{blue}{1 \cdot y}\right) - z \]
                                      3. metadata-evalN/A

                                        \[\leadsto \left(\log t - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot y\right) - z \]
                                      4. fp-cancel-sign-sub-invN/A

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

                                        \[\leadsto \color{blue}{\left(\log t + -1 \cdot y\right) - z} \]
                                      6. fp-cancel-sign-sub-invN/A

                                        \[\leadsto \color{blue}{\left(\log t - \left(\mathsf{neg}\left(-1\right)\right) \cdot y\right)} - z \]
                                      7. metadata-evalN/A

                                        \[\leadsto \left(\log t - \color{blue}{1} \cdot y\right) - z \]
                                      8. *-lft-identityN/A

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

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

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

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

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

                                  Alternative 9: 38.7% accurate, 8.6× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.9 \cdot 10^{+68}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{z} \cdot z\\ \end{array} \end{array} \]
                                  (FPCore (x y z t)
                                   :precision binary64
                                   (if (<= y 1.9e+68) (- z) (* (/ (- y) z) z)))
                                  double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if (y <= 1.9e+68) {
                                  		tmp = -z;
                                  	} else {
                                  		tmp = (-y / z) * z;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y, z, t)
                                  use fmin_fmax_functions
                                      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 <= 1.9d+68) then
                                          tmp = -z
                                      else
                                          tmp = (-y / z) * z
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t) {
                                  	double tmp;
                                  	if (y <= 1.9e+68) {
                                  		tmp = -z;
                                  	} else {
                                  		tmp = (-y / z) * z;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t):
                                  	tmp = 0
                                  	if y <= 1.9e+68:
                                  		tmp = -z
                                  	else:
                                  		tmp = (-y / z) * z
                                  	return tmp
                                  
                                  function code(x, y, z, t)
                                  	tmp = 0.0
                                  	if (y <= 1.9e+68)
                                  		tmp = Float64(-z);
                                  	else
                                  		tmp = Float64(Float64(Float64(-y) / z) * z);
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t)
                                  	tmp = 0.0;
                                  	if (y <= 1.9e+68)
                                  		tmp = -z;
                                  	else
                                  		tmp = (-y / z) * z;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_] := If[LessEqual[y, 1.9e+68], (-z), N[(N[((-y) / z), $MachinePrecision] * z), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;y \leq 1.9 \cdot 10^{+68}:\\
                                  \;\;\;\;-z\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{-y}{z} \cdot z\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y < 1.9e68

                                    1. Initial program 99.8%

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

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

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

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

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

                                    if 1.9e68 < 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 z around inf

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

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

                                      \[\leadsto \left(-1 \cdot \frac{y}{z}\right) \cdot z \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites48.3%

                                        \[\leadsto \frac{-y}{z} \cdot z \]
                                    7. Recombined 2 regimes into one program.
                                    8. Final simplification41.5%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.9 \cdot 10^{+68}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\frac{-y}{z} \cdot z\\ \end{array} \]
                                    9. Add Preprocessing

                                    Alternative 10: 48.0% accurate, 9.8× speedup?

                                    \[\begin{array}{l} \\ \left(\frac{-y}{z} - 1\right) \cdot z \end{array} \]
                                    (FPCore (x y z t) :precision binary64 (* (- (/ (- y) z) 1.0) z))
                                    double code(double x, double y, double z, double t) {
                                    	return ((-y / z) - 1.0) * z;
                                    }
                                    
                                    module fmin_fmax_functions
                                        implicit none
                                        private
                                        public fmax
                                        public fmin
                                    
                                        interface fmax
                                            module procedure fmax88
                                            module procedure fmax44
                                            module procedure fmax84
                                            module procedure fmax48
                                        end interface
                                        interface fmin
                                            module procedure fmin88
                                            module procedure fmin44
                                            module procedure fmin84
                                            module procedure fmin48
                                        end interface
                                    contains
                                        real(8) function fmax88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmax44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmax84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmax48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmin44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmin48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                        end function
                                    end module
                                    
                                    real(8) function code(x, y, z, t)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        real(8), intent (in) :: z
                                        real(8), intent (in) :: t
                                        code = ((-y / z) - 1.0d0) * z
                                    end function
                                    
                                    public static double code(double x, double y, double z, double t) {
                                    	return ((-y / z) - 1.0) * z;
                                    }
                                    
                                    def code(x, y, z, t):
                                    	return ((-y / z) - 1.0) * z
                                    
                                    function code(x, y, z, t)
                                    	return Float64(Float64(Float64(Float64(-y) / z) - 1.0) * z)
                                    end
                                    
                                    function tmp = code(x, y, z, t)
                                    	tmp = ((-y / z) - 1.0) * z;
                                    end
                                    
                                    code[x_, y_, z_, t_] := N[(N[(N[((-y) / z), $MachinePrecision] - 1.0), $MachinePrecision] * z), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \left(\frac{-y}{z} - 1\right) \cdot 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}{z \cdot \left(\left(\frac{\log t}{z} + \frac{x \cdot \log y}{z}\right) - \left(1 + \frac{y}{z}\right)\right)} \]
                                    4. Applied rewrites84.9%

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

                                      \[\leadsto \left(x \cdot \left(\left(\frac{\log t}{x \cdot z} + \frac{\log y}{z}\right) - \frac{y}{x \cdot z}\right) - 1\right) \cdot z \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites72.2%

                                        \[\leadsto \left(\left(\frac{\frac{\log t - y}{z}}{x} + \frac{\log y}{z}\right) \cdot x - 1\right) \cdot z \]
                                      2. Taylor expanded in y around inf

                                        \[\leadsto \left(-1 \cdot \frac{y}{z} - 1\right) \cdot z \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites48.9%

                                          \[\leadsto \left(\frac{-y}{z} - 1\right) \cdot z \]
                                        2. Final simplification48.9%

                                          \[\leadsto \left(\frac{-y}{z} - 1\right) \cdot z \]
                                        3. Add Preprocessing

                                        Alternative 11: 29.8% 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;
                                        }
                                        
                                        module fmin_fmax_functions
                                            implicit none
                                            private
                                            public fmax
                                            public fmin
                                        
                                            interface fmax
                                                module procedure fmax88
                                                module procedure fmax44
                                                module procedure fmax84
                                                module procedure fmax48
                                            end interface
                                            interface fmin
                                                module procedure fmin88
                                                module procedure fmin44
                                                module procedure fmin84
                                                module procedure fmin48
                                            end interface
                                        contains
                                            real(8) function fmax88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmax44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmax84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmax48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmin44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmin48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                            end function
                                        end module
                                        
                                        real(8) function code(x, y, z, t)
                                        use fmin_fmax_functions
                                            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.f6430.7

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

                                          \[\leadsto \color{blue}{-z} \]
                                        6. Final simplification30.7%

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

                                        Reproduce

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