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

Percentage Accurate: 89.6% → 96.9%
Time: 4.2s
Alternatives: 11
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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 89.6% 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: 96.9% accurate, 1.0× 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 89.6%

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Step-by-step derivation
    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
    10. lift--.f6496.9

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

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

Alternative 2: 93.0% 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}\\ \mathbf{if}\;z \leq -3.9 \cdot 10^{+69}:\\ \;\;\;\;\frac{t\_1}{t - z}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+168}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1}{y - 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
 (let* ((t_1 (/ x (- z))))
   (if (<= z -3.9e+69)
     (/ t_1 (- t z))
     (if (<= z 5.6e+168) (/ x (* (- y z) (- t z))) (/ t_1 (- y z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / -z;
	double tmp;
	if (z <= -3.9e+69) {
		tmp = t_1 / (t - z);
	} else if (z <= 5.6e+168) {
		tmp = x / ((y - z) * (t - z));
	} else {
		tmp = t_1 / (y - 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) :: t_1
    real(8) :: tmp
    t_1 = x / -z
    if (z <= (-3.9d+69)) then
        tmp = t_1 / (t - z)
    else if (z <= 5.6d+168) then
        tmp = x / ((y - z) * (t - z))
    else
        tmp = t_1 / (y - 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 t_1 = x / -z;
	double tmp;
	if (z <= -3.9e+69) {
		tmp = t_1 / (t - z);
	} else if (z <= 5.6e+168) {
		tmp = x / ((y - z) * (t - z));
	} else {
		tmp = t_1 / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / -z
	tmp = 0
	if z <= -3.9e+69:
		tmp = t_1 / (t - z)
	elif z <= 5.6e+168:
		tmp = x / ((y - z) * (t - z))
	else:
		tmp = t_1 / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(-z))
	tmp = 0.0
	if (z <= -3.9e+69)
		tmp = Float64(t_1 / Float64(t - z));
	elseif (z <= 5.6e+168)
		tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z)));
	else
		tmp = Float64(t_1 / Float64(y - z));
	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;
	tmp = 0.0;
	if (z <= -3.9e+69)
		tmp = t_1 / (t - z);
	elseif (z <= 5.6e+168)
		tmp = x / ((y - z) * (t - z));
	else
		tmp = t_1 / (y - 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_] := Block[{t$95$1 = N[(x / (-z)), $MachinePrecision]}, If[LessEqual[z, -3.9e+69], N[(t$95$1 / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+168], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{-z}\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{+69}:\\
\;\;\;\;\frac{t\_1}{t - z}\\

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

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


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

    1. Initial program 82.0%

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

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

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(t - z\right)} \]
      2. lower-neg.f6477.8

        \[\leadsto \frac{x}{\left(-z\right) \cdot \left(t - z\right)} \]
    4. Applied rewrites77.8%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{-z}}}{t - z} \]
      7. lift--.f6490.7

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

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

    if -3.8999999999999999e69 < z < 5.5999999999999998e168

    1. Initial program 93.1%

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

    if 5.5999999999999998e168 < z

    1. Initial program 81.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
      10. lift--.f6499.9

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

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

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

        \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(z\right)}}{y - z} \]
      2. lift-neg.f6496.4

        \[\leadsto \frac{\frac{x}{-z}}{y - z} \]
    6. Applied rewrites96.4%

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

Alternative 3: 82.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 -5.2 \cdot 10^{-179}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 8.1 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{x}{-z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - 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 -5.2e-179)
   (/ (/ x y) (- t z))
   (if (<= t 8.1e-50) (/ (/ x (- z)) (- y z)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.2e-179) {
		tmp = (x / y) / (t - z);
	} else if (t <= 8.1e-50) {
		tmp = (x / -z) / (y - z);
	} else {
		tmp = (x / t) / (y - 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 <= (-5.2d-179)) then
        tmp = (x / y) / (t - z)
    else if (t <= 8.1d-50) then
        tmp = (x / -z) / (y - z)
    else
        tmp = (x / t) / (y - 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 <= -5.2e-179) {
		tmp = (x / y) / (t - z);
	} else if (t <= 8.1e-50) {
		tmp = (x / -z) / (y - z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -5.2e-179:
		tmp = (x / y) / (t - z)
	elif t <= 8.1e-50:
		tmp = (x / -z) / (y - z)
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.2e-179)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (t <= 8.1e-50)
		tmp = Float64(Float64(x / Float64(-z)) / Float64(y - z));
	else
		tmp = Float64(Float64(x / t) / Float64(y - 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 <= -5.2e-179)
		tmp = (x / y) / (t - z);
	elseif (t <= 8.1e-50)
		tmp = (x / -z) / (y - z);
	else
		tmp = (x / t) / (y - 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, -5.2e-179], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.1e-50], N[(N[(x / (-z)), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-179}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.20000000000000011e-179

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t - z} \]
        7. lift--.f6482.4

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

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

      if -5.20000000000000011e-179 < t < 8.0999999999999999e-50

      1. Initial program 91.0%

        \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
        10. lift--.f6496.7

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

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

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

          \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(z\right)}}{y - z} \]
        2. lift-neg.f6482.3

          \[\leadsto \frac{\frac{x}{-z}}{y - z} \]
      6. Applied rewrites82.3%

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

      if 8.0999999999999999e-50 < t

      1. Initial program 89.1%

        \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
        10. lift--.f6497.0

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{t}}}{y - z} \]
      5. Step-by-step derivation
        1. Applied rewrites82.3%

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

      Alternative 4: 78.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 -1.12 \cdot 10^{-42}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{\left(-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 (<= y -1.12e-42)
         (/ x (* y (- t z)))
         (if (<= y 1.35e-16) (/ 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-42) {
      		tmp = x / (y * (t - z));
      	} else if (y <= 1.35e-16) {
      		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-42)) then
              tmp = x / (y * (t - z))
          else if (y <= 1.35d-16) 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-42) {
      		tmp = x / (y * (t - z));
      	} else if (y <= 1.35e-16) {
      		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-42:
      		tmp = x / (y * (t - z))
      	elif y <= 1.35e-16:
      		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-42)
      		tmp = Float64(x / Float64(y * Float64(t - z)));
      	elseif (y <= 1.35e-16)
      		tmp = Float64(x / Float64(Float64(-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 (y <= -1.12e-42)
      		tmp = x / (y * (t - z));
      	elseif (y <= 1.35e-16)
      		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-42], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e-16], N[(x / N[((-z) * 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}\;y \leq -1.12 \cdot 10^{-42}:\\
      \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
      
      \mathbf{elif}\;y \leq 1.35 \cdot 10^{-16}:\\
      \;\;\;\;\frac{x}{\left(-z\right) \cdot \left(t - z\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{x}{y - z}}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -1.1199999999999999e-42

        1. Initial program 88.9%

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

          \[\leadsto \frac{x}{\color{blue}{y} \cdot \left(t - z\right)} \]
        3. Step-by-step derivation
          1. Applied rewrites80.7%

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

          if -1.1199999999999999e-42 < y < 1.35e-16

          1. Initial program 91.1%

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

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

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot \left(t - z\right)} \]
            2. lower-neg.f6474.3

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

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

          if 1.35e-16 < y

          1. Initial program 85.3%

            \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
          2. Step-by-step derivation
            1. lift-/.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t - z} \]
            9. lift--.f6499.8

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

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

            \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{t}} \]
          5. Step-by-step derivation
            1. Applied rewrites93.9%

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

          Alternative 5: 72.9% accurate, 0.7× speedup?

          \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 3.4 \cdot 10^{-183}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-57}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - 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 3.4e-183)
             (/ (/ x y) (- t z))
             (if (<= t 3.4e-57) (/ x (* z z)) (/ (/ x t) (- y z)))))
          assert(x < y && y < z && z < t);
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (t <= 3.4e-183) {
          		tmp = (x / y) / (t - z);
          	} else if (t <= 3.4e-57) {
          		tmp = x / (z * z);
          	} else {
          		tmp = (x / t) / (y - 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 <= 3.4d-183) then
                  tmp = (x / y) / (t - z)
              else if (t <= 3.4d-57) then
                  tmp = x / (z * z)
              else
                  tmp = (x / t) / (y - 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 <= 3.4e-183) {
          		tmp = (x / y) / (t - z);
          	} else if (t <= 3.4e-57) {
          		tmp = x / (z * z);
          	} else {
          		tmp = (x / t) / (y - z);
          	}
          	return tmp;
          }
          
          [x, y, z, t] = sort([x, y, z, t])
          def code(x, y, z, t):
          	tmp = 0
          	if t <= 3.4e-183:
          		tmp = (x / y) / (t - z)
          	elif t <= 3.4e-57:
          		tmp = x / (z * z)
          	else:
          		tmp = (x / t) / (y - z)
          	return tmp
          
          x, y, z, t = sort([x, y, z, t])
          function code(x, y, z, t)
          	tmp = 0.0
          	if (t <= 3.4e-183)
          		tmp = Float64(Float64(x / y) / Float64(t - z));
          	elseif (t <= 3.4e-57)
          		tmp = Float64(x / Float64(z * z));
          	else
          		tmp = Float64(Float64(x / t) / Float64(y - 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 <= 3.4e-183)
          		tmp = (x / y) / (t - z);
          	elseif (t <= 3.4e-57)
          		tmp = x / (z * z);
          	else
          		tmp = (x / t) / (y - 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, 3.4e-183], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-57], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq 3.4 \cdot 10^{-183}:\\
          \;\;\;\;\frac{\frac{x}{y}}{t - z}\\
          
          \mathbf{elif}\;t \leq 3.4 \cdot 10^{-57}:\\
          \;\;\;\;\frac{x}{z \cdot z}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{t}}{y - z}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if t < 3.40000000000000014e-183

            1. Initial program 89.5%

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t - z} \]
                7. lift--.f6468.1

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

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

              if 3.40000000000000014e-183 < t < 3.40000000000000016e-57

              1. Initial program 91.3%

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

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

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

                  \[\leadsto \frac{x}{z \cdot \color{blue}{z}} \]
              4. Applied rewrites52.2%

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

              if 3.40000000000000016e-57 < t

              1. Initial program 89.2%

                \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
              2. Step-by-step derivation
                1. lift-/.f64N/A

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
                10. lift--.f6497.0

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

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

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

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

              Alternative 6: 72.5% accurate, 0.7× speedup?

              \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 3.4 \cdot 10^{-183}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-57}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - 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 3.4e-183)
                 (/ x (* y (- t z)))
                 (if (<= t 3.4e-57) (/ x (* z z)) (/ (/ x t) (- y z)))))
              assert(x < y && y < z && z < t);
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if (t <= 3.4e-183) {
              		tmp = x / (y * (t - z));
              	} else if (t <= 3.4e-57) {
              		tmp = x / (z * z);
              	} else {
              		tmp = (x / t) / (y - 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 <= 3.4d-183) then
                      tmp = x / (y * (t - z))
                  else if (t <= 3.4d-57) then
                      tmp = x / (z * z)
                  else
                      tmp = (x / t) / (y - 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 <= 3.4e-183) {
              		tmp = x / (y * (t - z));
              	} else if (t <= 3.4e-57) {
              		tmp = x / (z * z);
              	} else {
              		tmp = (x / t) / (y - z);
              	}
              	return tmp;
              }
              
              [x, y, z, t] = sort([x, y, z, t])
              def code(x, y, z, t):
              	tmp = 0
              	if t <= 3.4e-183:
              		tmp = x / (y * (t - z))
              	elif t <= 3.4e-57:
              		tmp = x / (z * z)
              	else:
              		tmp = (x / t) / (y - z)
              	return tmp
              
              x, y, z, t = sort([x, y, z, t])
              function code(x, y, z, t)
              	tmp = 0.0
              	if (t <= 3.4e-183)
              		tmp = Float64(x / Float64(y * Float64(t - z)));
              	elseif (t <= 3.4e-57)
              		tmp = Float64(x / Float64(z * z));
              	else
              		tmp = Float64(Float64(x / t) / Float64(y - 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 <= 3.4e-183)
              		tmp = x / (y * (t - z));
              	elseif (t <= 3.4e-57)
              		tmp = x / (z * z);
              	else
              		tmp = (x / t) / (y - 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, 3.4e-183], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-57], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
              \\
              \begin{array}{l}
              \mathbf{if}\;t \leq 3.4 \cdot 10^{-183}:\\
              \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
              
              \mathbf{elif}\;t \leq 3.4 \cdot 10^{-57}:\\
              \;\;\;\;\frac{x}{z \cdot z}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\frac{x}{t}}{y - z}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if t < 3.40000000000000014e-183

                1. Initial program 89.5%

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

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

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

                  if 3.40000000000000014e-183 < t < 3.40000000000000016e-57

                  1. Initial program 91.3%

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

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

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

                      \[\leadsto \frac{x}{z \cdot \color{blue}{z}} \]
                  4. Applied rewrites52.2%

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

                  if 3.40000000000000016e-57 < t

                  1. Initial program 89.2%

                    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
                  2. Step-by-step derivation
                    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
                    10. lift--.f6497.0

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

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

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

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

                  Alternative 7: 72.1% 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.05 \cdot 10^{-66}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-256}:\\ \;\;\;\;\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 (<= y -1.05e-66)
                     (/ x (* y (- t z)))
                     (if (<= y 4e-256) (/ 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 (y <= -1.05e-66) {
                  		tmp = x / (y * (t - z));
                  	} else if (y <= 4e-256) {
                  		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 (y <= (-1.05d-66)) then
                          tmp = x / (y * (t - z))
                      else if (y <= 4d-256) 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 (y <= -1.05e-66) {
                  		tmp = x / (y * (t - z));
                  	} else if (y <= 4e-256) {
                  		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 y <= -1.05e-66:
                  		tmp = x / (y * (t - z))
                  	elif y <= 4e-256:
                  		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 (y <= -1.05e-66)
                  		tmp = Float64(x / Float64(y * Float64(t - z)));
                  	elseif (y <= 4e-256)
                  		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 (y <= -1.05e-66)
                  		tmp = x / (y * (t - z));
                  	elseif (y <= 4e-256)
                  		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[y, -1.05e-66], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-256], 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}\;y \leq -1.05 \cdot 10^{-66}:\\
                  \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
                  
                  \mathbf{elif}\;y \leq 4 \cdot 10^{-256}:\\
                  \;\;\;\;\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 y < -1.05e-66

                    1. Initial program 89.2%

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

                      \[\leadsto \frac{x}{\color{blue}{y} \cdot \left(t - z\right)} \]
                    3. Step-by-step derivation
                      1. Applied rewrites79.2%

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

                      if -1.05e-66 < y < 3.99999999999999991e-256

                      1. Initial program 90.2%

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

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

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

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

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

                      if 3.99999999999999991e-256 < y

                      1. Initial program 89.8%

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

                        \[\leadsto \frac{x}{\left(y - z\right) \cdot \color{blue}{t}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites76.7%

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

                      Alternative 8: 70.7% accurate, 0.7× 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 -2.5 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{+19}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \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 -2.5e+56) t_1 (if (<= z 5.4e+19) (/ x (* y (- t z))) 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 <= -2.5e+56) {
                      		tmp = t_1;
                      	} else if (z <= 5.4e+19) {
                      		tmp = x / (y * (t - z));
                      	} 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 <= (-2.5d+56)) then
                              tmp = t_1
                          else if (z <= 5.4d+19) then
                              tmp = x / (y * (t - z))
                          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 <= -2.5e+56) {
                      		tmp = t_1;
                      	} else if (z <= 5.4e+19) {
                      		tmp = x / (y * (t - z));
                      	} 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 <= -2.5e+56:
                      		tmp = t_1
                      	elif z <= 5.4e+19:
                      		tmp = x / (y * (t - z))
                      	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 <= -2.5e+56)
                      		tmp = t_1;
                      	elseif (z <= 5.4e+19)
                      		tmp = Float64(x / Float64(y * Float64(t - z)));
                      	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 <= -2.5e+56)
                      		tmp = t_1;
                      	elseif (z <= 5.4e+19)
                      		tmp = x / (y * (t - z));
                      	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, -2.5e+56], t$95$1, If[LessEqual[z, 5.4e+19], N[(x / N[(y * N[(t - z), $MachinePrecision]), $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 -2.5 \cdot 10^{+56}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;z \leq 5.4 \cdot 10^{+19}:\\
                      \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -2.50000000000000012e56 or 5.4e19 < z

                        1. Initial program 83.4%

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

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

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

                            \[\leadsto \frac{x}{z \cdot \color{blue}{z}} \]
                        4. Applied rewrites71.4%

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

                        if -2.50000000000000012e56 < z < 5.4e19

                        1. Initial program 94.5%

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

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

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

                        Alternative 9: 63.6% accurate, 0.8× 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 -3.7 \cdot 10^{+42}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+19}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \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 -3.7e+42) t_1 (if (<= z 2.15e+19) (/ (/ x y) t) 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 <= -3.7e+42) {
                        		tmp = t_1;
                        	} else if (z <= 2.15e+19) {
                        		tmp = (x / y) / t;
                        	} 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 <= (-3.7d+42)) then
                                tmp = t_1
                            else if (z <= 2.15d+19) then
                                tmp = (x / y) / t
                            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 <= -3.7e+42) {
                        		tmp = t_1;
                        	} else if (z <= 2.15e+19) {
                        		tmp = (x / y) / t;
                        	} 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 <= -3.7e+42:
                        		tmp = t_1
                        	elif z <= 2.15e+19:
                        		tmp = (x / y) / t
                        	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 <= -3.7e+42)
                        		tmp = t_1;
                        	elseif (z <= 2.15e+19)
                        		tmp = Float64(Float64(x / y) / t);
                        	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 <= -3.7e+42)
                        		tmp = t_1;
                        	elseif (z <= 2.15e+19)
                        		tmp = (x / y) / t;
                        	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, -3.7e+42], t$95$1, If[LessEqual[z, 2.15e+19], N[(N[(x / y), $MachinePrecision] / t), $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 -3.7 \cdot 10^{+42}:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;z \leq 2.15 \cdot 10^{+19}:\\
                        \;\;\;\;\frac{\frac{x}{y}}{t}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if z < -3.69999999999999996e42 or 2.15e19 < z

                          1. Initial program 83.7%

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

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

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

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

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

                          if -3.69999999999999996e42 < z < 2.15e19

                          1. Initial program 94.5%

                            \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
                          2. Step-by-step derivation
                            1. lift-/.f64N/A

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

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

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

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

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

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

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

                              \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t - z} \]
                            9. lift--.f6493.8

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

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

                            \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{t}} \]
                          5. Step-by-step derivation
                            1. Applied rewrites71.4%

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

                              \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
                            3. Step-by-step derivation
                              1. lower-/.f6457.6

                                \[\leadsto \frac{\frac{x}{\color{blue}{y}}}{t} \]
                            4. Applied rewrites57.6%

                              \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
                          6. Recombined 2 regimes into one program.
                          7. Add Preprocessing

                          Alternative 10: 62.3% accurate, 0.8× 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 -3.1 \cdot 10^{+42}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{t \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 -3.1e+42) t_1 (if (<= z 2.2e+18) (/ x (* t 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 <= -3.1e+42) {
                          		tmp = t_1;
                          	} else if (z <= 2.2e+18) {
                          		tmp = x / (t * 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 <= (-3.1d+42)) then
                                  tmp = t_1
                              else if (z <= 2.2d+18) then
                                  tmp = x / (t * 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 <= -3.1e+42) {
                          		tmp = t_1;
                          	} else if (z <= 2.2e+18) {
                          		tmp = x / (t * 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 <= -3.1e+42:
                          		tmp = t_1
                          	elif z <= 2.2e+18:
                          		tmp = x / (t * 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 <= -3.1e+42)
                          		tmp = t_1;
                          	elseif (z <= 2.2e+18)
                          		tmp = Float64(x / Float64(t * 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 <= -3.1e+42)
                          		tmp = t_1;
                          	elseif (z <= 2.2e+18)
                          		tmp = x / (t * 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, -3.1e+42], t$95$1, If[LessEqual[z, 2.2e+18], N[(x / N[(t * 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 -3.1 \cdot 10^{+42}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;z \leq 2.2 \cdot 10^{+18}:\\
                          \;\;\;\;\frac{x}{t \cdot y}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if z < -3.1000000000000002e42 or 2.2e18 < z

                            1. Initial program 83.7%

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

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

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

                                \[\leadsto \frac{x}{z \cdot \color{blue}{z}} \]
                            4. Applied rewrites70.8%

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

                            if -3.1000000000000002e42 < z < 2.2e18

                            1. Initial program 94.5%

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

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

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

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

                          Alternative 11: 39.8% accurate, 1.7× speedup?

                          \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{t \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 (* t y)))
                          assert(x < y && y < z && z < t);
                          double code(double x, double y, double z, double t) {
                          	return x / (t * 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 / (t * y)
                          end function
                          
                          assert x < y && y < z && z < t;
                          public static double code(double x, double y, double z, double t) {
                          	return x / (t * y);
                          }
                          
                          [x, y, z, t] = sort([x, y, z, t])
                          def code(x, y, z, t):
                          	return x / (t * y)
                          
                          x, y, z, t = sort([x, y, z, t])
                          function code(x, y, z, t)
                          	return Float64(x / Float64(t * y))
                          end
                          
                          x, y, z, t = num2cell(sort([x, y, z, t])){:}
                          function tmp = code(x, y, z, t)
                          	tmp = x / (t * 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[(t * y), $MachinePrecision]), $MachinePrecision]
                          
                          \begin{array}{l}
                          [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
                          \\
                          \frac{x}{t \cdot y}
                          \end{array}
                          
                          Derivation
                          1. Initial program 89.6%

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

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

                              \[\leadsto \frac{x}{t \cdot \color{blue}{y}} \]
                          4. Applied rewrites39.8%

                            \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
                          5. Add Preprocessing

                          Reproduce

                          ?
                          herbie shell --seed 2025115 
                          (FPCore (x y z t)
                            :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
                            :precision binary64
                            (/ x (* (- y z) (- t z))))