Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B

Percentage Accurate: 88.7% → 97.0%
Time: 10.8s
Alternatives: 16
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
	return x / ((y - z) * (t - 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 = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
	return x / ((y - z) * (t - z));
}
def code(x, y, z, t):
	return x / ((y - z) * (t - z))
function code(x, y, z, t)
	return Float64(x / Float64(Float64(y - z) * Float64(t - z)))
end
function tmp = code(x, y, z, t)
	tmp = x / ((y - z) * (t - z));
end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\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 16 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: 88.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 10^{-5}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t 1e-5) (/ (/ x (- t z)) (- y z)) (/ (/ x (- y z)) (- t z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1e-5) {
		tmp = (x / (t - z)) / (y - z);
	} else {
		tmp = (x / (y - z)) / (t - z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 (t <= 1d-5) then
        tmp = (x / (t - z)) / (y - z)
    else
        tmp = (x / (y - z)) / (t - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1e-5) {
		tmp = (x / (t - z)) / (y - z);
	} else {
		tmp = (x / (y - z)) / (t - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= 1e-5:
		tmp = (x / (t - z)) / (y - z)
	else:
		tmp = (x / (y - z)) / (t - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 1e-5)
		tmp = Float64(Float64(x / Float64(t - z)) / Float64(y - z));
	else
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= 1e-5)
		tmp = (x / (t - z)) / (y - z);
	else
		tmp = (x / (y - z)) / (t - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, 1e-5], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-5}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.00000000000000008e-5

    1. Initial program 88.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Applied rewrites96.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]

    if 1.00000000000000008e-5 < t

    1. Initial program 86.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Applied rewrites98.2%

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

Alternative 2: 93.2% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+157} \lor \neg \left(z \leq 3 \cdot 10^{+104}\right):\\ \;\;\;\;\frac{\frac{x}{z}}{\left(-t\right) + z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -2.25e+157) (not (<= z 3e+104)))
   (/ (/ x z) (+ (- t) z))
   (/ x (* (- y z) (- t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.25e+157) || !(z <= 3e+104)) {
		tmp = (x / z) / (-t + z);
	} else {
		tmp = x / ((y - z) * (t - z));
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 ((z <= (-2.25d+157)) .or. (.not. (z <= 3d+104))) then
        tmp = (x / z) / (-t + z)
    else
        tmp = x / ((y - z) * (t - z))
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.25e+157) || !(z <= 3e+104)) {
		tmp = (x / z) / (-t + z);
	} else {
		tmp = x / ((y - z) * (t - z));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -2.25e+157) or not (z <= 3e+104):
		tmp = (x / z) / (-t + z)
	else:
		tmp = x / ((y - z) * (t - z))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -2.25e+157) || !(z <= 3e+104))
		tmp = Float64(Float64(x / z) / Float64(Float64(-t) + z));
	else
		tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z)));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -2.25e+157) || ~((z <= 3e+104)))
		tmp = (x / z) / (-t + z);
	else
		tmp = x / ((y - z) * (t - z));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.25e+157], N[Not[LessEqual[z, 3e+104]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / N[((-t) + z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+157} \lor \neg \left(z \leq 3 \cdot 10^{+104}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\left(-t\right) + z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.24999999999999992e157 or 2.99999999999999969e104 < z

    1. Initial program 73.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x}{z \cdot \left(t - z\right)}\right)} \]
      2. distribute-neg-fracN/A

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(x\right)}{z}}}{t - z} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{t - z} \]
      7. lower--.f6492.4

        \[\leadsto \frac{\frac{-x}{z}}{\color{blue}{t - z}} \]
    5. Applied rewrites92.4%

      \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{t - z}} \]

    if -2.24999999999999992e157 < z < 2.99999999999999969e104

    1. Initial program 93.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification93.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+157} \lor \neg \left(z \leq 3 \cdot 10^{+104}\right):\\ \;\;\;\;\frac{\frac{x}{z}}{\left(-t\right) + z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.2% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+157}:\\ \;\;\;\;\frac{\frac{x}{z}}{\left(-t\right) + z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+104}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{-z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= z -2.25e+157)
   (/ (/ x z) (+ (- t) z))
   (if (<= z 3e+104) (/ x (* (- y z) (- t z))) (/ (/ x (- t z)) (- z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.25e+157) {
		tmp = (x / z) / (-t + z);
	} else if (z <= 3e+104) {
		tmp = x / ((y - z) * (t - z));
	} else {
		tmp = (x / (t - z)) / -z;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 (z <= (-2.25d+157)) then
        tmp = (x / z) / (-t + z)
    else if (z <= 3d+104) then
        tmp = x / ((y - z) * (t - z))
    else
        tmp = (x / (t - z)) / -z
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.25e+157) {
		tmp = (x / z) / (-t + z);
	} else if (z <= 3e+104) {
		tmp = x / ((y - z) * (t - z));
	} else {
		tmp = (x / (t - z)) / -z;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -2.25e+157:
		tmp = (x / z) / (-t + z)
	elif z <= 3e+104:
		tmp = x / ((y - z) * (t - z))
	else:
		tmp = (x / (t - z)) / -z
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -2.25e+157)
		tmp = Float64(Float64(x / z) / Float64(Float64(-t) + z));
	elseif (z <= 3e+104)
		tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z)));
	else
		tmp = Float64(Float64(x / Float64(t - z)) / Float64(-z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -2.25e+157)
		tmp = (x / z) / (-t + z);
	elseif (z <= 3e+104)
		tmp = x / ((y - z) * (t - z));
	else
		tmp = (x / (t - z)) / -z;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[z, -2.25e+157], N[(N[(x / z), $MachinePrecision] / N[((-t) + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+104], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{x}{z}}{\left(-t\right) + z}\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+104}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{-z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.24999999999999992e157

    1. Initial program 74.1%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x}{z \cdot \left(t - z\right)}\right)} \]
      2. distribute-neg-fracN/A

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(x\right)}{z}}}{t - z} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{t - z} \]
      7. lower--.f6497.1

        \[\leadsto \frac{\frac{-x}{z}}{\color{blue}{t - z}} \]
    5. Applied rewrites97.1%

      \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{t - z}} \]

    if -2.24999999999999992e157 < z < 2.99999999999999969e104

    1. Initial program 93.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing

    if 2.99999999999999969e104 < z

    1. Initial program 73.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Applied rewrites99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Taylor expanded in y around 0

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

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

        \[\leadsto \frac{\frac{x}{t - z}}{\color{blue}{-z}} \]
    6. Applied rewrites88.9%

      \[\leadsto \frac{\frac{x}{t - z}}{\color{blue}{-z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.3%

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

Alternative 4: 61.8% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z \cdot z}\\ \mathbf{if}\;z \leq -1.45 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-52}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+19}:\\ \;\;\;\;\frac{-x}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* z z))))
   (if (<= z -1.45e-5)
     t_1
     (if (<= z 2.6e-52)
       (/ x (* t y))
       (if (<= z 1.75e+19) (/ (- x) (* z y)) t_1)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * z);
	double tmp;
	if (z <= -1.45e-5) {
		tmp = t_1;
	} else if (z <= 2.6e-52) {
		tmp = x / (t * y);
	} else if (z <= 1.75e+19) {
		tmp = -x / (z * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 / (z * z)
    if (z <= (-1.45d-5)) then
        tmp = t_1
    else if (z <= 2.6d-52) then
        tmp = x / (t * y)
    else if (z <= 1.75d+19) then
        tmp = -x / (z * y)
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z * z);
	double tmp;
	if (z <= -1.45e-5) {
		tmp = t_1;
	} else if (z <= 2.6e-52) {
		tmp = x / (t * y);
	} else if (z <= 1.75e+19) {
		tmp = -x / (z * y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / (z * z)
	tmp = 0
	if z <= -1.45e-5:
		tmp = t_1
	elif z <= 2.6e-52:
		tmp = x / (t * y)
	elif z <= 1.75e+19:
		tmp = -x / (z * y)
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * z))
	tmp = 0.0
	if (z <= -1.45e-5)
		tmp = t_1;
	elseif (z <= 2.6e-52)
		tmp = Float64(x / Float64(t * y));
	elseif (z <= 1.75e+19)
		tmp = Float64(Float64(-x) / Float64(z * y));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z * z);
	tmp = 0.0;
	if (z <= -1.45e-5)
		tmp = t_1;
	elseif (z <= 2.6e-52)
		tmp = x / (t * y);
	elseif (z <= 1.75e+19)
		tmp = -x / (z * y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e-5], t$95$1, If[LessEqual[z, 2.6e-52], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+19], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-52}:\\
\;\;\;\;\frac{x}{t \cdot y}\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{+19}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.45e-5 or 1.75e19 < z

    1. Initial program 82.1%

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

      \[\leadsto \frac{x}{\color{blue}{{z}^{2}}} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
      2. lower-*.f6463.7

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    5. Applied rewrites63.7%

      \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]

    if -1.45e-5 < z < 2.5999999999999999e-52

    1. Initial program 94.8%

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

      \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
    4. Step-by-step derivation
      1. lower-*.f6462.1

        \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
    5. Applied rewrites62.1%

      \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]

    if 2.5999999999999999e-52 < z < 1.75e19

    1. Initial program 88.0%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y} \]
      5. lower--.f6463.9

        \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y} \]
    5. Applied rewrites63.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
    6. Taylor expanded in z around inf

      \[\leadsto -1 \cdot \color{blue}{\frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. Applied rewrites33.7%

        \[\leadsto \frac{\frac{-x}{y}}{\color{blue}{z}} \]
      2. Step-by-step derivation
        1. Applied rewrites37.6%

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

      Alternative 5: 77.2% accurate, 0.7× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-118}:\\ \;\;\;\;\frac{x}{\left(-z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (<= y -1.12e-20)
         (/ x (* (- t z) y))
         (if (<= y 1.35e-118) (/ x (* (- z) (- t z))) (/ x (* (- y z) t)))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= -1.12e-20) {
      		tmp = x / ((t - z) * y);
      	} else if (y <= 1.35e-118) {
      		tmp = x / (-z * (t - z));
      	} else {
      		tmp = x / ((y - z) * t);
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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.12d-20)) then
              tmp = x / ((t - z) * y)
          else if (y <= 1.35d-118) then
              tmp = x / (-z * (t - z))
          else
              tmp = x / ((y - z) * t)
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= -1.12e-20) {
      		tmp = x / ((t - z) * y);
      	} else if (y <= 1.35e-118) {
      		tmp = x / (-z * (t - z));
      	} else {
      		tmp = x / ((y - z) * t);
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if y <= -1.12e-20:
      		tmp = x / ((t - z) * y)
      	elif y <= 1.35e-118:
      		tmp = x / (-z * (t - z))
      	else:
      		tmp = x / ((y - z) * t)
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if (y <= -1.12e-20)
      		tmp = Float64(x / Float64(Float64(t - z) * y));
      	elseif (y <= 1.35e-118)
      		tmp = Float64(x / Float64(Float64(-z) * Float64(t - z)));
      	else
      		tmp = Float64(x / Float64(Float64(y - z) * t));
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (y <= -1.12e-20)
      		tmp = x / ((t - z) * y);
      	elseif (y <= 1.35e-118)
      		tmp = x / (-z * (t - z));
      	else
      		tmp = x / ((y - z) * t);
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[LessEqual[y, -1.12e-20], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-118], N[(x / N[((-z) * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -1.12 \cdot 10^{-20}:\\
      \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
      
      \mathbf{elif}\;y \leq 1.35 \cdot 10^{-118}:\\
      \;\;\;\;\frac{x}{\left(-z\right) \cdot \left(t - z\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -1.12000000000000002e-20

        1. Initial program 88.0%

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
          3. lower--.f6483.1

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

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

        if -1.12000000000000002e-20 < y < 1.34999999999999997e-118

        1. Initial program 91.5%

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

          \[\leadsto \frac{x}{\color{blue}{\left(-1 \cdot z\right)} \cdot \left(t - z\right)} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot \left(t - z\right)} \]
          2. lower-neg.f6476.4

            \[\leadsto \frac{x}{\color{blue}{\left(-z\right)} \cdot \left(t - z\right)} \]
        5. Applied rewrites76.4%

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

        if 1.34999999999999997e-118 < y

        1. Initial program 84.3%

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(y - z\right) \cdot t}} \]
          3. lower--.f6453.1

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

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

      Alternative 6: 77.3% accurate, 0.7× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{-101}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;t \leq 0.0215:\\ \;\;\;\;\frac{x}{\left(-z\right) \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (<= t -2.1e-101)
         (/ x (* (- t z) y))
         (if (<= t 0.0215) (/ x (* (- z) (- y z))) (/ x (* (- y z) t)))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= -2.1e-101) {
      		tmp = x / ((t - z) * y);
      	} else if (t <= 0.0215) {
      		tmp = x / (-z * (y - z));
      	} else {
      		tmp = x / ((y - z) * t);
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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 (t <= (-2.1d-101)) then
              tmp = x / ((t - z) * y)
          else if (t <= 0.0215d0) then
              tmp = x / (-z * (y - z))
          else
              tmp = x / ((y - z) * t)
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= -2.1e-101) {
      		tmp = x / ((t - z) * y);
      	} else if (t <= 0.0215) {
      		tmp = x / (-z * (y - z));
      	} else {
      		tmp = x / ((y - z) * t);
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if t <= -2.1e-101:
      		tmp = x / ((t - z) * y)
      	elif t <= 0.0215:
      		tmp = x / (-z * (y - z))
      	else:
      		tmp = x / ((y - z) * t)
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= -2.1e-101)
      		tmp = Float64(x / Float64(Float64(t - z) * y));
      	elseif (t <= 0.0215)
      		tmp = Float64(x / Float64(Float64(-z) * Float64(y - z)));
      	else
      		tmp = Float64(x / Float64(Float64(y - z) * t));
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (t <= -2.1e-101)
      		tmp = x / ((t - z) * y);
      	elseif (t <= 0.0215)
      		tmp = x / (-z * (y - z));
      	else
      		tmp = x / ((y - z) * t);
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[LessEqual[t, -2.1e-101], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0215], N[(x / N[((-z) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -2.1 \cdot 10^{-101}:\\
      \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
      
      \mathbf{elif}\;t \leq 0.0215:\\
      \;\;\;\;\frac{x}{\left(-z\right) \cdot \left(y - z\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < -2.10000000000000016e-101

        1. Initial program 85.3%

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
          3. lower--.f6452.7

            \[\leadsto \frac{x}{\color{blue}{\left(t - z\right)} \cdot y} \]
        5. Applied rewrites52.7%

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

        if -2.10000000000000016e-101 < t < 0.021499999999999998

        1. Initial program 91.3%

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

          \[\leadsto \frac{x}{\color{blue}{-1 \cdot \left(z \cdot \left(y - z\right)\right)}} \]
        4. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \frac{x}{\color{blue}{\left(-1 \cdot z\right) \cdot \left(y - z\right)}} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{x}{\color{blue}{\left(-1 \cdot z\right) \cdot \left(y - z\right)}} \]
          3. mul-1-negN/A

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

            \[\leadsto \frac{x}{\color{blue}{\left(-z\right)} \cdot \left(y - z\right)} \]
          5. lower--.f6476.2

            \[\leadsto \frac{x}{\left(-z\right) \cdot \color{blue}{\left(y - z\right)}} \]
        5. Applied rewrites76.2%

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

        if 0.021499999999999998 < t

        1. Initial program 86.2%

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(y - z\right) \cdot t}} \]
          3. lower--.f6481.2

            \[\leadsto \frac{x}{\color{blue}{\left(y - z\right)} \cdot t} \]
        5. Applied rewrites81.2%

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

      Alternative 7: 68.8% accurate, 0.7× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+107} \lor \neg \left(z \leq 5.2 \cdot 10^{+20}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= z -2.05e+107) (not (<= z 5.2e+20)))
         (/ x (* z z))
         (/ x (* (- t z) y))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -2.05e+107) || !(z <= 5.2e+20)) {
      		tmp = x / (z * z);
      	} else {
      		tmp = x / ((t - z) * y);
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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 ((z <= (-2.05d+107)) .or. (.not. (z <= 5.2d+20))) then
              tmp = x / (z * z)
          else
              tmp = x / ((t - z) * y)
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -2.05e+107) || !(z <= 5.2e+20)) {
      		tmp = x / (z * z);
      	} else {
      		tmp = x / ((t - z) * y);
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if (z <= -2.05e+107) or not (z <= 5.2e+20):
      		tmp = x / (z * z)
      	else:
      		tmp = x / ((t - z) * y)
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if ((z <= -2.05e+107) || !(z <= 5.2e+20))
      		tmp = Float64(x / Float64(z * z));
      	else
      		tmp = Float64(x / Float64(Float64(t - z) * y));
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if ((z <= -2.05e+107) || ~((z <= 5.2e+20)))
      		tmp = x / (z * z);
      	else
      		tmp = x / ((t - z) * y);
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.05e+107], N[Not[LessEqual[z, 5.2e+20]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -2.05 \cdot 10^{+107} \lor \neg \left(z \leq 5.2 \cdot 10^{+20}\right):\\
      \;\;\;\;\frac{x}{z \cdot z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -2.05e107 or 5.2e20 < z

        1. Initial program 79.7%

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

          \[\leadsto \frac{x}{\color{blue}{{z}^{2}}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
          2. lower-*.f6469.9

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
        5. Applied rewrites69.9%

          \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]

        if -2.05e107 < z < 5.2e20

        1. Initial program 93.7%

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
          3. lower--.f6464.7

            \[\leadsto \frac{x}{\color{blue}{\left(t - z\right)} \cdot y} \]
        5. Applied rewrites64.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+107} \lor \neg \left(z \leq 5.2 \cdot 10^{+20}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 70.3% accurate, 0.7× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 2.65 \cdot 10^{-114}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;t \leq 0.000175:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (<= t 2.65e-114)
         (/ x (* (- t z) y))
         (if (<= t 0.000175) (/ x (* z z)) (/ x (* (- y z) t)))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 2.65e-114) {
      		tmp = x / ((t - z) * y);
      	} else if (t <= 0.000175) {
      		tmp = x / (z * z);
      	} else {
      		tmp = x / ((y - z) * t);
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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 (t <= 2.65d-114) then
              tmp = x / ((t - z) * y)
          else if (t <= 0.000175d0) then
              tmp = x / (z * z)
          else
              tmp = x / ((y - z) * t)
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 2.65e-114) {
      		tmp = x / ((t - z) * y);
      	} else if (t <= 0.000175) {
      		tmp = x / (z * z);
      	} else {
      		tmp = x / ((y - z) * t);
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if t <= 2.65e-114:
      		tmp = x / ((t - z) * y)
      	elif t <= 0.000175:
      		tmp = x / (z * z)
      	else:
      		tmp = x / ((y - z) * t)
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= 2.65e-114)
      		tmp = Float64(x / Float64(Float64(t - z) * y));
      	elseif (t <= 0.000175)
      		tmp = Float64(x / Float64(z * z));
      	else
      		tmp = Float64(x / Float64(Float64(y - z) * t));
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (t <= 2.65e-114)
      		tmp = x / ((t - z) * y);
      	elseif (t <= 0.000175)
      		tmp = x / (z * z);
      	else
      		tmp = x / ((y - z) * t);
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[LessEqual[t, 2.65e-114], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.000175], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 2.65 \cdot 10^{-114}:\\
      \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\
      
      \mathbf{elif}\;t \leq 0.000175:\\
      \;\;\;\;\frac{x}{z \cdot z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < 2.64999999999999986e-114

        1. Initial program 87.1%

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
          3. lower--.f6457.7

            \[\leadsto \frac{x}{\color{blue}{\left(t - z\right)} \cdot y} \]
        5. Applied rewrites57.7%

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

        if 2.64999999999999986e-114 < t < 1.74999999999999998e-4

        1. Initial program 96.2%

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

          \[\leadsto \frac{x}{\color{blue}{{z}^{2}}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
          2. lower-*.f6454.1

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
        5. Applied rewrites54.1%

          \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]

        if 1.74999999999999998e-4 < t

        1. Initial program 86.4%

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

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(y - z\right) \cdot t}} \]
          3. lower--.f6481.5

            \[\leadsto \frac{x}{\color{blue}{\left(y - z\right)} \cdot t} \]
        5. Applied rewrites81.5%

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

      Alternative 9: 90.6% accurate, 0.7× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 8 \cdot 10^{+145}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (<= t 8e+145) (/ x (* (- y z) (- t z))) (/ (/ x (- y z)) t)))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 8e+145) {
      		tmp = x / ((y - z) * (t - z));
      	} else {
      		tmp = (x / (y - z)) / t;
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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 (t <= 8d+145) then
              tmp = x / ((y - z) * (t - z))
          else
              tmp = (x / (y - z)) / t
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (t <= 8e+145) {
      		tmp = x / ((y - z) * (t - z));
      	} else {
      		tmp = (x / (y - z)) / t;
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if t <= 8e+145:
      		tmp = x / ((y - z) * (t - z))
      	else:
      		tmp = (x / (y - z)) / t
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if (t <= 8e+145)
      		tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z)));
      	else
      		tmp = Float64(Float64(x / Float64(y - z)) / t);
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (t <= 8e+145)
      		tmp = x / ((y - z) * (t - z));
      	else
      		tmp = (x / (y - z)) / t;
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[LessEqual[t, 8e+145], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 8 \cdot 10^{+145}:\\
      \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{x}{y - z}}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < 7.9999999999999999e145

        1. Initial program 87.8%

          \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
        2. Add Preprocessing

        if 7.9999999999999999e145 < t

        1. Initial program 88.6%

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t}} \]
          3. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t}} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t} \]
          5. lower--.f6494.2

            \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t} \]
        5. Applied rewrites94.2%

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

      Alternative 10: 90.8% accurate, 0.7× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -5.1 \cdot 10^{+188}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (<= y -5.1e+188) (/ (/ x (- t z)) y) (/ x (* (- y z) (- t z)))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= -5.1e+188) {
      		tmp = (x / (t - z)) / y;
      	} else {
      		tmp = x / ((y - z) * (t - z));
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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 <= (-5.1d+188)) then
              tmp = (x / (t - z)) / y
          else
              tmp = x / ((y - z) * (t - z))
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (y <= -5.1e+188) {
      		tmp = (x / (t - z)) / y;
      	} else {
      		tmp = x / ((y - z) * (t - z));
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if y <= -5.1e+188:
      		tmp = (x / (t - z)) / y
      	else:
      		tmp = x / ((y - z) * (t - z))
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if (y <= -5.1e+188)
      		tmp = Float64(Float64(x / Float64(t - z)) / y);
      	else
      		tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z)));
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (y <= -5.1e+188)
      		tmp = (x / (t - z)) / y;
      	else
      		tmp = x / ((y - z) * (t - z));
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[LessEqual[y, -5.1e+188], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -5.1 \cdot 10^{+188}:\\
      \;\;\;\;\frac{\frac{x}{t - z}}{y}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -5.1000000000000002e188

        1. Initial program 85.3%

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
          3. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y} \]
          5. lower--.f6492.5

            \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y} \]
        5. Applied rewrites92.5%

          \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]

        if -5.1000000000000002e188 < y

        1. Initial program 88.3%

          \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
        2. Add Preprocessing
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 11: 61.5% accurate, 0.8× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-5} \lor \neg \left(z \leq 1.8 \cdot 10^{-16}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= z -1.45e-5) (not (<= z 1.8e-16))) (/ x (* z z)) (/ x (* t y))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -1.45e-5) || !(z <= 1.8e-16)) {
      		tmp = x / (z * z);
      	} else {
      		tmp = x / (t * y);
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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 ((z <= (-1.45d-5)) .or. (.not. (z <= 1.8d-16))) then
              tmp = x / (z * z)
          else
              tmp = x / (t * y)
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -1.45e-5) || !(z <= 1.8e-16)) {
      		tmp = x / (z * z);
      	} else {
      		tmp = x / (t * y);
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if (z <= -1.45e-5) or not (z <= 1.8e-16):
      		tmp = x / (z * z)
      	else:
      		tmp = x / (t * y)
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if ((z <= -1.45e-5) || !(z <= 1.8e-16))
      		tmp = Float64(x / Float64(z * z));
      	else
      		tmp = Float64(x / Float64(t * y));
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if ((z <= -1.45e-5) || ~((z <= 1.8e-16)))
      		tmp = x / (z * z);
      	else
      		tmp = x / (t * y);
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.45e-5], N[Not[LessEqual[z, 1.8e-16]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -1.45 \cdot 10^{-5} \lor \neg \left(z \leq 1.8 \cdot 10^{-16}\right):\\
      \;\;\;\;\frac{x}{z \cdot z}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{t \cdot y}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.45e-5 or 1.79999999999999991e-16 < z

        1. Initial program 82.5%

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

          \[\leadsto \frac{x}{\color{blue}{{z}^{2}}} \]
        4. Step-by-step derivation
          1. unpow2N/A

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
          2. lower-*.f6461.3

            \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
        5. Applied rewrites61.3%

          \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]

        if -1.45e-5 < z < 1.79999999999999991e-16

        1. Initial program 94.3%

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

          \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
        4. Step-by-step derivation
          1. lower-*.f6459.5

            \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
        5. Applied rewrites59.5%

          \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification60.5%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-5} \lor \neg \left(z \leq 1.8 \cdot 10^{-16}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 12: 45.1% accurate, 0.8× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+102} \lor \neg \left(z \leq 1.35 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= z -5e+102) (not (<= z 1.35e-41))) (/ x (* z y)) (/ x (* t y))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -5e+102) || !(z <= 1.35e-41)) {
      		tmp = x / (z * y);
      	} else {
      		tmp = x / (t * y);
      	}
      	return tmp;
      }
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      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 ((z <= (-5d+102)) .or. (.not. (z <= 1.35d-41))) then
              tmp = x / (z * y)
          else
              tmp = x / (t * y)
          end if
          code = tmp
      end function
      
      assert x < y && y < z && z < t;
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -5e+102) || !(z <= 1.35e-41)) {
      		tmp = x / (z * y);
      	} else {
      		tmp = x / (t * y);
      	}
      	return tmp;
      }
      
      [x, y, z, t] = sort([x, y, z, t])
      def code(x, y, z, t):
      	tmp = 0
      	if (z <= -5e+102) or not (z <= 1.35e-41):
      		tmp = x / (z * y)
      	else:
      		tmp = x / (t * y)
      	return tmp
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	tmp = 0.0
      	if ((z <= -5e+102) || !(z <= 1.35e-41))
      		tmp = Float64(x / Float64(z * y));
      	else
      		tmp = Float64(x / Float64(t * y));
      	end
      	return tmp
      end
      
      x, y, z, t = num2cell(sort([x, y, z, t])){:}
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if ((z <= -5e+102) || ~((z <= 1.35e-41)))
      		tmp = x / (z * y);
      	else
      		tmp = x / (t * y);
      	end
      	tmp_2 = tmp;
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5e+102], N[Not[LessEqual[z, 1.35e-41]], $MachinePrecision]], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -5 \cdot 10^{+102} \lor \neg \left(z \leq 1.35 \cdot 10^{-41}\right):\\
      \;\;\;\;\frac{x}{z \cdot y}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{t \cdot y}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -5e102 or 1.35e-41 < z

        1. Initial program 80.9%

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
          3. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y} \]
          5. lower--.f6458.0

            \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y} \]
        5. Applied rewrites58.0%

          \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
        6. Applied rewrites47.7%

          \[\leadsto \frac{\frac{x}{z + t}}{y} \]
        7. Taylor expanded in z around inf

          \[\leadsto \frac{x}{\color{blue}{y \cdot z}} \]
        8. Step-by-step derivation
          1. Applied rewrites37.5%

            \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]

          if -5e102 < z < 1.35e-41

          1. Initial program 94.3%

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

            \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
          4. Step-by-step derivation
            1. lower-*.f6454.5

              \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
          5. Applied rewrites54.5%

            \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
        9. Recombined 2 regimes into one program.
        10. Final simplification46.3%

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

        Alternative 13: 97.2% accurate, 0.8× speedup?

        \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{\frac{x}{t - z}}{y - z} \end{array} \]
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        (FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
        assert(x < y && y < z && z < t);
        double code(double x, double y, double z, double t) {
        	return (x / (t - z)) / (y - z);
        }
        
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        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 / (t - z)) / (y - z)
        end function
        
        assert x < y && y < z && z < t;
        public static double code(double x, double y, double z, double t) {
        	return (x / (t - z)) / (y - z);
        }
        
        [x, y, z, t] = sort([x, y, z, t])
        def code(x, y, z, t):
        	return (x / (t - z)) / (y - z)
        
        x, y, z, t = sort([x, y, z, t])
        function code(x, y, z, t)
        	return Float64(Float64(x / Float64(t - z)) / Float64(y - z))
        end
        
        x, y, z, t = num2cell(sort([x, y, z, t])){:}
        function tmp = code(x, y, z, t)
        	tmp = (x / (t - z)) / (y - z);
        end
        
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_] := N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
        \\
        \frac{\frac{x}{t - z}}{y - z}
        \end{array}
        
        Derivation
        1. Initial program 87.9%

          \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
        2. Add Preprocessing
        3. Applied rewrites96.7%

          \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
        4. Add Preprocessing

        Alternative 14: 29.1% accurate, 1.0× speedup?

        \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 2.15 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot z}\\ \end{array} \end{array} \]
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        (FPCore (x y z t)
         :precision binary64
         (if (<= t 2.15e-56) (/ x (* z y)) (/ x (* t z))))
        assert(x < y && y < z && z < t);
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (t <= 2.15e-56) {
        		tmp = x / (z * y);
        	} else {
        		tmp = x / (t * z);
        	}
        	return tmp;
        }
        
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        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 (t <= 2.15d-56) then
                tmp = x / (z * y)
            else
                tmp = x / (t * z)
            end if
            code = tmp
        end function
        
        assert x < y && y < z && z < t;
        public static double code(double x, double y, double z, double t) {
        	double tmp;
        	if (t <= 2.15e-56) {
        		tmp = x / (z * y);
        	} else {
        		tmp = x / (t * z);
        	}
        	return tmp;
        }
        
        [x, y, z, t] = sort([x, y, z, t])
        def code(x, y, z, t):
        	tmp = 0
        	if t <= 2.15e-56:
        		tmp = x / (z * y)
        	else:
        		tmp = x / (t * z)
        	return tmp
        
        x, y, z, t = sort([x, y, z, t])
        function code(x, y, z, t)
        	tmp = 0.0
        	if (t <= 2.15e-56)
        		tmp = Float64(x / Float64(z * y));
        	else
        		tmp = Float64(x / Float64(t * z));
        	end
        	return tmp
        end
        
        x, y, z, t = num2cell(sort([x, y, z, t])){:}
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if (t <= 2.15e-56)
        		tmp = x / (z * y);
        	else
        		tmp = x / (t * z);
        	end
        	tmp_2 = tmp;
        end
        
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_] := If[LessEqual[t, 2.15e-56], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;t \leq 2.15 \cdot 10^{-56}:\\
        \;\;\;\;\frac{x}{z \cdot y}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x}{t \cdot z}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < 2.1500000000000001e-56

          1. Initial program 87.7%

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

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

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

              \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
            3. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y} \]
            5. lower--.f6462.7

              \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y} \]
          5. Applied rewrites62.7%

            \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
          6. Applied rewrites49.3%

            \[\leadsto \frac{\frac{x}{z + t}}{y} \]
          7. Taylor expanded in z around inf

            \[\leadsto \frac{x}{\color{blue}{y \cdot z}} \]
          8. Step-by-step derivation
            1. Applied rewrites24.6%

              \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]

            if 2.1500000000000001e-56 < t

            1. Initial program 88.5%

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

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

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

                \[\leadsto \frac{x}{\color{blue}{\left(y - z\right) \cdot t}} \]
              3. lower--.f6474.4

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

              \[\leadsto \frac{x}{\color{blue}{\left(y - z\right) \cdot t}} \]
            6. Applied rewrites43.5%

              \[\leadsto \frac{x}{\left(-\left(y - z\right)\right) \cdot t} \]
            7. Taylor expanded in y around 0

              \[\leadsto \frac{x}{t \cdot \color{blue}{z}} \]
            8. Step-by-step derivation
              1. Applied rewrites31.9%

                \[\leadsto \frac{x}{t \cdot \color{blue}{z}} \]
            9. Recombined 2 regimes into one program.
            10. Add Preprocessing

            Alternative 15: 88.7% accurate, 1.0× speedup?

            \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \end{array} \]
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            (FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
            assert(x < y && y < z && z < t);
            double code(double x, double y, double z, double t) {
            	return x / ((y - z) * (t - z));
            }
            
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            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 / ((y - z) * (t - z))
            end function
            
            assert x < y && y < z && z < t;
            public static double code(double x, double y, double z, double t) {
            	return x / ((y - z) * (t - z));
            }
            
            [x, y, z, t] = sort([x, y, z, t])
            def code(x, y, z, t):
            	return x / ((y - z) * (t - z))
            
            x, y, z, t = sort([x, y, z, t])
            function code(x, y, z, t)
            	return Float64(x / Float64(Float64(y - z) * Float64(t - z)))
            end
            
            x, y, z, t = num2cell(sort([x, y, z, t])){:}
            function tmp = code(x, y, z, t)
            	tmp = x / ((y - z) * (t - z));
            end
            
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
            \\
            \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
            \end{array}
            
            Derivation
            1. Initial program 87.9%

              \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
            2. Add Preprocessing
            3. Add Preprocessing

            Alternative 16: 22.4% accurate, 1.4× speedup?

            \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{z \cdot y} \end{array} \]
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            (FPCore (x y z t) :precision binary64 (/ x (* z y)))
            assert(x < y && y < z && z < t);
            double code(double x, double y, double z, double t) {
            	return x / (z * y);
            }
            
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            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 / (z * y)
            end function
            
            assert x < y && y < z && z < t;
            public static double code(double x, double y, double z, double t) {
            	return x / (z * y);
            }
            
            [x, y, z, t] = sort([x, y, z, t])
            def code(x, y, z, t):
            	return x / (z * y)
            
            x, y, z, t = sort([x, y, z, t])
            function code(x, y, z, t)
            	return Float64(x / Float64(z * y))
            end
            
            x, y, z, t = num2cell(sort([x, y, z, t])){:}
            function tmp = code(x, y, z, t)
            	tmp = x / (z * y);
            end
            
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_] := N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
            \\
            \frac{x}{z \cdot y}
            \end{array}
            
            Derivation
            1. Initial program 87.9%

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

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

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

                \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
              3. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y} \]
              5. lower--.f6462.7

                \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y} \]
            5. Applied rewrites62.7%

              \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
            6. Applied rewrites51.7%

              \[\leadsto \frac{\frac{x}{z + t}}{y} \]
            7. Taylor expanded in z around inf

              \[\leadsto \frac{x}{\color{blue}{y \cdot z}} \]
            8. Step-by-step derivation
              1. Applied rewrites24.3%

                \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]
              2. Add Preprocessing

              Developer Target 1: 87.6% accurate, 0.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;\frac{x}{t\_1} < 0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{t\_1}\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (* (- y z) (- t z))))
                 (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
              double code(double x, double y, double z, double t) {
              	double t_1 = (y - z) * (t - z);
              	double tmp;
              	if ((x / t_1) < 0.0) {
              		tmp = (x / (y - z)) / (t - z);
              	} else {
              		tmp = x * (1.0 / 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 = (y - z) * (t - z)
                  if ((x / t_1) < 0.0d0) then
                      tmp = (x / (y - z)) / (t - z)
                  else
                      tmp = x * (1.0d0 / t_1)
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double t_1 = (y - z) * (t - z);
              	double tmp;
              	if ((x / t_1) < 0.0) {
              		tmp = (x / (y - z)) / (t - z);
              	} else {
              		tmp = x * (1.0 / t_1);
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = (y - z) * (t - z)
              	tmp = 0
              	if (x / t_1) < 0.0:
              		tmp = (x / (y - z)) / (t - z)
              	else:
              		tmp = x * (1.0 / t_1)
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(Float64(y - z) * Float64(t - z))
              	tmp = 0.0
              	if (Float64(x / t_1) < 0.0)
              		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
              	else
              		tmp = Float64(x * Float64(1.0 / t_1));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = (y - z) * (t - z);
              	tmp = 0.0;
              	if ((x / t_1) < 0.0)
              		tmp = (x / (y - z)) / (t - z);
              	else
              		tmp = x * (1.0 / t_1);
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
              \mathbf{if}\;\frac{x}{t\_1} < 0:\\
              \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
              
              \mathbf{else}:\\
              \;\;\;\;x \cdot \frac{1}{t\_1}\\
              
              
              \end{array}
              \end{array}
              

              Reproduce

              ?
              herbie shell --seed 2025016 
              (FPCore (x y z t)
                :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
                :precision binary64
              
                :alt
                (! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
              
                (/ x (* (- y z) (- t z))))