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

Percentage Accurate: 89.1% → 97.0%
Time: 5.1s
Alternatives: 14
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 14 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.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ x (* (- y z) (- t z))))
double code(double x, double y, double z, double t) {
	return x / ((y - z) * (t - z));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x / ((y - z) * (t - z))
end function
public static double code(double x, double y, double z, double t) {
	return x / ((y - z) * (t - z));
}
def code(x, y, z, t):
	return x / ((y - z) * (t - z))
function code(x, y, z, t)
	return Float64(x / Float64(Float64(y - z) * Float64(t - z)))
end
function tmp = code(x, y, z, t)
	tmp = x / ((y - z) * (t - z));
end
code[x_, y_, z_, t_] := N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 97.0% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{\frac{x}{z - y}}{z - t} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (/ (/ x (- z y)) (- z t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return (x / (z - y)) / (z - t);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x / (z - y)) / (z - t)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return (x / (z - y)) / (z - t);
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return (x / (z - y)) / (z - t)
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(Float64(x / Float64(z - y)) / Float64(z - t))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = (x / (z - y)) / (z - t);
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[(z - y), $MachinePrecision]), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{x}{z - y}}{z - t}
\end{array}
Derivation
  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. associate-/r*N/A

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

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

      \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
    6. sub-negate-revN/A

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

      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
    8. distribute-neg-frac2N/A

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

      \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
    10. sub-negate-revN/A

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

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

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

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

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

Alternative 2: 97.0% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{\frac{x}{z - t}}{z - y} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (/ (/ x (- z t)) (- z y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return (x / (z - t)) / (z - y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

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

      \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
    6. sub-negate-revN/A

      \[\leadsto \frac{\frac{x}{\color{blue}{\mathsf{neg}\left(\left(z - t\right)\right)}}}{y - z} \]
    7. distribute-frac-neg2N/A

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

      \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{z - t}\right)}{\color{blue}{y - z}} \]
    9. sub-negate-revN/A

      \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{z - t}\right)}{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
    10. frac-2neg-revN/A

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

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

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

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

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

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

Alternative 3: 91.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;t\_1 \leq 10^{+307}:\\ \;\;\;\;\frac{x}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (- t z))))
   (if (<= t_1 1e+307) (/ x t_1) (/ (/ x (- z t)) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if (t_1 <= 1e+307) {
		tmp = x / t_1;
	} else {
		tmp = (x / (z - t)) / z;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - z) * (t - z)
    if (t_1 <= 1d+307) then
        tmp = x / t_1
    else
        tmp = (x / (z - t)) / z
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if (t_1 <= 1e+307) {
		tmp = x / t_1;
	} else {
		tmp = (x / (z - t)) / z;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if t_1 <= 1e+307:
		tmp = x / t_1
	else:
		tmp = (x / (z - t)) / z
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (t_1 <= 1e+307)
		tmp = Float64(x / t_1);
	else
		tmp = Float64(Float64(x / Float64(z - t)) / 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 = (y - z) * (t - z);
	tmp = 0.0;
	if (t_1 <= 1e+307)
		tmp = x / t_1;
	else
		tmp = (x / (z - t)) / z;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+307], N[(x / t$95$1), $MachinePrecision], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;\frac{x}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 y z) (-.f64 t z)) < 9.99999999999999986e306

    1. Initial program 89.1%

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

    if 9.99999999999999986e306 < (*.f64 (-.f64 y z) (-.f64 t z))

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
      6. sub-negate-revN/A

        \[\leadsto \frac{\frac{x}{\color{blue}{\mathsf{neg}\left(\left(z - t\right)\right)}}}{y - z} \]
      7. distribute-frac-neg2N/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{z - t}\right)}{\color{blue}{y - z}} \]
      9. sub-negate-revN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{z - t}\right)}{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
      10. frac-2neg-revN/A

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

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

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

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

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

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

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

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

    Alternative 4: 80.1% accurate, 0.6× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{x}{z - y}}{z}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-266}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+23}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -1.45e-50)
       (/ (/ x (- z y)) z)
       (if (<= z -2.6e-266)
         (/ (/ x t) (- y z))
         (if (<= z 1.9e+23) (/ x (* y (- t z))) (/ (/ x (- z t)) z)))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -1.45e-50) {
    		tmp = (x / (z - y)) / z;
    	} else if (z <= -2.6e-266) {
    		tmp = (x / t) / (y - z);
    	} else if (z <= 1.9e+23) {
    		tmp = x / (y * (t - z));
    	} else {
    		tmp = (x / (z - t)) / z;
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: tmp
        if (z <= (-1.45d-50)) then
            tmp = (x / (z - y)) / z
        else if (z <= (-2.6d-266)) then
            tmp = (x / t) / (y - z)
        else if (z <= 1.9d+23) then
            tmp = x / (y * (t - z))
        else
            tmp = (x / (z - t)) / z
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -1.45e-50) {
    		tmp = (x / (z - y)) / z;
    	} else if (z <= -2.6e-266) {
    		tmp = (x / t) / (y - z);
    	} else if (z <= 1.9e+23) {
    		tmp = x / (y * (t - z));
    	} else {
    		tmp = (x / (z - t)) / z;
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	tmp = 0
    	if z <= -1.45e-50:
    		tmp = (x / (z - y)) / z
    	elif z <= -2.6e-266:
    		tmp = (x / t) / (y - z)
    	elif z <= 1.9e+23:
    		tmp = x / (y * (t - z))
    	else:
    		tmp = (x / (z - t)) / z
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -1.45e-50)
    		tmp = Float64(Float64(x / Float64(z - y)) / z);
    	elseif (z <= -2.6e-266)
    		tmp = Float64(Float64(x / t) / Float64(y - z));
    	elseif (z <= 1.9e+23)
    		tmp = Float64(x / Float64(y * Float64(t - z)));
    	else
    		tmp = Float64(Float64(x / Float64(z - t)) / z);
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (z <= -1.45e-50)
    		tmp = (x / (z - y)) / z;
    	elseif (z <= -2.6e-266)
    		tmp = (x / t) / (y - z);
    	elseif (z <= 1.9e+23)
    		tmp = x / (y * (t - z));
    	else
    		tmp = (x / (z - t)) / z;
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := If[LessEqual[z, -1.45e-50], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -2.6e-266], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+23], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -1.45 \cdot 10^{-50}:\\
    \;\;\;\;\frac{\frac{x}{z - y}}{z}\\
    
    \mathbf{elif}\;z \leq -2.6 \cdot 10^{-266}:\\
    \;\;\;\;\frac{\frac{x}{t}}{y - z}\\
    
    \mathbf{elif}\;z \leq 1.9 \cdot 10^{+23}:\\
    \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{x}{z - t}}{z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if z < -1.45000000000000004e-50

      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. associate-/r*N/A

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

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

          \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
        6. sub-negate-revN/A

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

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
        8. distribute-neg-frac2N/A

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

          \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
        10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{x}{z - y}}{z} \]
        8. lower-/.f6459.8

          \[\leadsto \frac{\frac{x}{z - y}}{z} \]
      8. Applied rewrites59.8%

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

      if -1.45000000000000004e-50 < z < -2.6e-266

      1. Initial program 89.1%

        \[\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 rewrites57.9%

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
          6. *-rgt-identityN/A

            \[\leadsto \frac{\frac{\color{blue}{x \cdot 1}}{t}}{y - z} \]
          7. metadata-evalN/A

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

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

            \[\leadsto \frac{\frac{x \cdot \color{blue}{1}}{t}}{y - z} \]
          10. *-rgt-identity59.3

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

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

        if -2.6e-266 < z < 1.89999999999999987e23

        1. Initial program 89.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. lower-*.f64N/A

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

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

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

        if 1.89999999999999987e23 < z

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

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

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

            \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
          6. sub-negate-revN/A

            \[\leadsto \frac{\frac{x}{\color{blue}{\mathsf{neg}\left(\left(z - t\right)\right)}}}{y - z} \]
          7. distribute-frac-neg2N/A

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

            \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{z - t}\right)}{\color{blue}{y - z}} \]
          9. sub-negate-revN/A

            \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{z - t}\right)}{\color{blue}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
          10. frac-2neg-revN/A

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

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

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

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

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

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

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

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

        Alternative 5: 79.1% accurate, 0.6× speedup?

        \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{x}{z - y}}{z}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-266}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \end{array} \end{array} \]
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        (FPCore (x y z t)
         :precision binary64
         (if (<= z -1.45e-50)
           (/ (/ x (- z y)) z)
           (if (<= z -2.6e-266)
             (/ (/ x t) (- y z))
             (if (<= z 1.02e+14) (/ x (* y (- t z))) (/ (/ x z) (- z y))))))
        assert(x < y && y < z && z < t);
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= -1.45e-50) {
        		tmp = (x / (z - y)) / z;
        	} else if (z <= -2.6e-266) {
        		tmp = (x / t) / (y - z);
        	} else if (z <= 1.02e+14) {
        		tmp = x / (y * (t - z));
        	} else {
        		tmp = (x / z) / (z - y);
        	}
        	return tmp;
        }
        
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: tmp
            if (z <= (-1.45d-50)) then
                tmp = (x / (z - y)) / z
            else if (z <= (-2.6d-266)) then
                tmp = (x / t) / (y - z)
            else if (z <= 1.02d+14) then
                tmp = x / (y * (t - z))
            else
                tmp = (x / z) / (z - y)
            end if
            code = tmp
        end function
        
        assert x < y && y < z && z < t;
        public static double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= -1.45e-50) {
        		tmp = (x / (z - y)) / z;
        	} else if (z <= -2.6e-266) {
        		tmp = (x / t) / (y - z);
        	} else if (z <= 1.02e+14) {
        		tmp = x / (y * (t - z));
        	} else {
        		tmp = (x / z) / (z - y);
        	}
        	return tmp;
        }
        
        [x, y, z, t] = sort([x, y, z, t])
        def code(x, y, z, t):
        	tmp = 0
        	if z <= -1.45e-50:
        		tmp = (x / (z - y)) / z
        	elif z <= -2.6e-266:
        		tmp = (x / t) / (y - z)
        	elif z <= 1.02e+14:
        		tmp = x / (y * (t - z))
        	else:
        		tmp = (x / z) / (z - y)
        	return tmp
        
        x, y, z, t = sort([x, y, z, t])
        function code(x, y, z, t)
        	tmp = 0.0
        	if (z <= -1.45e-50)
        		tmp = Float64(Float64(x / Float64(z - y)) / z);
        	elseif (z <= -2.6e-266)
        		tmp = Float64(Float64(x / t) / Float64(y - z));
        	elseif (z <= 1.02e+14)
        		tmp = Float64(x / Float64(y * Float64(t - z)));
        	else
        		tmp = Float64(Float64(x / z) / Float64(z - y));
        	end
        	return tmp
        end
        
        x, y, z, t = num2cell(sort([x, y, z, t])){:}
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if (z <= -1.45e-50)
        		tmp = (x / (z - y)) / z;
        	elseif (z <= -2.6e-266)
        		tmp = (x / t) / (y - z);
        	elseif (z <= 1.02e+14)
        		tmp = x / (y * (t - z));
        	else
        		tmp = (x / z) / (z - y);
        	end
        	tmp_2 = tmp;
        end
        
        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_] := If[LessEqual[z, -1.45e-50], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -2.6e-266], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+14], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -1.45 \cdot 10^{-50}:\\
        \;\;\;\;\frac{\frac{x}{z - y}}{z}\\
        
        \mathbf{elif}\;z \leq -2.6 \cdot 10^{-266}:\\
        \;\;\;\;\frac{\frac{x}{t}}{y - z}\\
        
        \mathbf{elif}\;z \leq 1.02 \cdot 10^{+14}:\\
        \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{x}{z}}{z - y}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if z < -1.45000000000000004e-50

          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. associate-/r*N/A

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

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

              \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
            6. sub-negate-revN/A

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

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
            8. distribute-neg-frac2N/A

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

              \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
            10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{x}{z - y}}{z} \]
            8. lower-/.f6459.8

              \[\leadsto \frac{\frac{x}{z - y}}{z} \]
          8. Applied rewrites59.8%

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

          if -1.45000000000000004e-50 < z < -2.6e-266

          1. Initial program 89.1%

            \[\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 rewrites57.9%

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
              6. *-rgt-identityN/A

                \[\leadsto \frac{\frac{\color{blue}{x \cdot 1}}{t}}{y - z} \]
              7. metadata-evalN/A

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

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

                \[\leadsto \frac{\frac{x \cdot \color{blue}{1}}{t}}{y - z} \]
              10. *-rgt-identity59.3

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

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

            if -2.6e-266 < z < 1.02e14

            1. Initial program 89.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. lower-*.f64N/A

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

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

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

            if 1.02e14 < z

            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. associate-/r*N/A

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

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

                \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
              6. sub-negate-revN/A

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

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
              8. distribute-neg-frac2N/A

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

                \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
              10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} - y} \]
              5. lower-/.f6457.4

                \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - y}} \]
            8. Applied rewrites57.4%

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

          Alternative 6: 78.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.2 \cdot 10^{-165}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 520000000000:\\ \;\;\;\;\frac{\frac{x}{z - y}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
          NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
          (FPCore (x y z t)
           :precision binary64
           (if (<= t -3.2e-165)
             (/ x (* y (- t z)))
             (if (<= t 520000000000.0) (/ (/ x (- z y)) z) (/ x (* (- y z) t)))))
          assert(x < y && y < z && z < t);
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (t <= -3.2e-165) {
          		tmp = x / (y * (t - z));
          	} else if (t <= 520000000000.0) {
          		tmp = (x / (z - y)) / z;
          	} else {
          		tmp = x / ((y - z) * t);
          	}
          	return tmp;
          }
          
          NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: tmp
              if (t <= (-3.2d-165)) then
                  tmp = x / (y * (t - z))
              else if (t <= 520000000000.0d0) then
                  tmp = (x / (z - y)) / z
              else
                  tmp = x / ((y - z) * t)
              end if
              code = tmp
          end function
          
          assert x < y && y < z && z < t;
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (t <= -3.2e-165) {
          		tmp = x / (y * (t - z));
          	} else if (t <= 520000000000.0) {
          		tmp = (x / (z - y)) / z;
          	} else {
          		tmp = x / ((y - z) * t);
          	}
          	return tmp;
          }
          
          [x, y, z, t] = sort([x, y, z, t])
          def code(x, y, z, t):
          	tmp = 0
          	if t <= -3.2e-165:
          		tmp = x / (y * (t - z))
          	elif t <= 520000000000.0:
          		tmp = (x / (z - y)) / z
          	else:
          		tmp = x / ((y - z) * t)
          	return tmp
          
          x, y, z, t = sort([x, y, z, t])
          function code(x, y, z, t)
          	tmp = 0.0
          	if (t <= -3.2e-165)
          		tmp = Float64(x / Float64(y * Float64(t - z)));
          	elseif (t <= 520000000000.0)
          		tmp = Float64(Float64(x / Float64(z - y)) / z);
          	else
          		tmp = Float64(x / Float64(Float64(y - z) * t));
          	end
          	return tmp
          end
          
          x, y, z, t = num2cell(sort([x, y, z, t])){:}
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (t <= -3.2e-165)
          		tmp = x / (y * (t - z));
          	elseif (t <= 520000000000.0)
          		tmp = (x / (z - y)) / z;
          	else
          		tmp = x / ((y - z) * t);
          	end
          	tmp_2 = tmp;
          end
          
          NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
          code[x_, y_, z_, t_] := If[LessEqual[t, -3.2e-165], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 520000000000.0], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq -3.2 \cdot 10^{-165}:\\
          \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
          
          \mathbf{elif}\;t \leq 520000000000:\\
          \;\;\;\;\frac{\frac{x}{z - y}}{z}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if t < -3.20000000000000013e-165

            1. Initial program 89.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. lower-*.f64N/A

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

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

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

            if -3.20000000000000013e-165 < t < 5.2e11

            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. associate-/r*N/A

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

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

                \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
              6. sub-negate-revN/A

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

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
              8. distribute-neg-frac2N/A

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

                \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
              10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{z - y}}{z} \]
              8. lower-/.f6459.8

                \[\leadsto \frac{\frac{x}{z - y}}{z} \]
            8. Applied rewrites59.8%

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

            if 5.2e11 < t

            1. Initial program 89.1%

              \[\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 rewrites57.9%

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

            Alternative 7: 78.8% accurate, 0.7× speedup?

            \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{z}}{z - y}\\ \mathbf{if}\;z \leq -2.4 \cdot 10^{-48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+14}:\\ \;\;\;\;\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 y))))
               (if (<= z -2.4e-48) t_1 (if (<= z 1.02e+14) (/ 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 - y);
            	double tmp;
            	if (z <= -2.4e-48) {
            		tmp = t_1;
            	} else if (z <= 1.02e+14) {
            		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 - y)
                if (z <= (-2.4d-48)) then
                    tmp = t_1
                else if (z <= 1.02d+14) 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 - y);
            	double tmp;
            	if (z <= -2.4e-48) {
            		tmp = t_1;
            	} else if (z <= 1.02e+14) {
            		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 - y)
            	tmp = 0
            	if z <= -2.4e-48:
            		tmp = t_1
            	elif z <= 1.02e+14:
            		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(Float64(x / z) / Float64(z - y))
            	tmp = 0.0
            	if (z <= -2.4e-48)
            		tmp = t_1;
            	elseif (z <= 1.02e+14)
            		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 - y);
            	tmp = 0.0;
            	if (z <= -2.4e-48)
            		tmp = t_1;
            	elseif (z <= 1.02e+14)
            		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[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e-48], t$95$1, If[LessEqual[z, 1.02e+14], 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{\frac{x}{z}}{z - y}\\
            \mathbf{if}\;z \leq -2.4 \cdot 10^{-48}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;z \leq 1.02 \cdot 10^{+14}:\\
            \;\;\;\;\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.4e-48 or 1.02e14 < z

              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. associate-/r*N/A

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

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

                  \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                6. sub-negate-revN/A

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

                  \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                8. distribute-neg-frac2N/A

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

                  \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} - y} \]
                5. lower-/.f6457.4

                  \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - y}} \]
              8. Applied rewrites57.4%

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

              if -2.4e-48 < z < 1.02e14

              1. Initial program 89.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. lower-*.f64N/A

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

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

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

            Alternative 8: 77.4% 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.2 \cdot 10^{-165}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-95}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            (FPCore (x y z t)
             :precision binary64
             (if (<= t -3.2e-165)
               (/ x (* y (- t z)))
               (if (<= t 3e-95) (/ x (* z (- z y))) (/ x (* (- y z) t)))))
            assert(x < y && y < z && z < t);
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if (t <= -3.2e-165) {
            		tmp = x / (y * (t - z));
            	} else if (t <= 3e-95) {
            		tmp = x / (z * (z - y));
            	} else {
            		tmp = x / ((y - z) * t);
            	}
            	return tmp;
            }
            
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z, t)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: tmp
                if (t <= (-3.2d-165)) then
                    tmp = x / (y * (t - z))
                else if (t <= 3d-95) then
                    tmp = x / (z * (z - y))
                else
                    tmp = x / ((y - z) * t)
                end if
                code = tmp
            end function
            
            assert x < y && y < z && z < t;
            public static double code(double x, double y, double z, double t) {
            	double tmp;
            	if (t <= -3.2e-165) {
            		tmp = x / (y * (t - z));
            	} else if (t <= 3e-95) {
            		tmp = x / (z * (z - y));
            	} else {
            		tmp = x / ((y - z) * t);
            	}
            	return tmp;
            }
            
            [x, y, z, t] = sort([x, y, z, t])
            def code(x, y, z, t):
            	tmp = 0
            	if t <= -3.2e-165:
            		tmp = x / (y * (t - z))
            	elif t <= 3e-95:
            		tmp = x / (z * (z - y))
            	else:
            		tmp = x / ((y - z) * t)
            	return tmp
            
            x, y, z, t = sort([x, y, z, t])
            function code(x, y, z, t)
            	tmp = 0.0
            	if (t <= -3.2e-165)
            		tmp = Float64(x / Float64(y * Float64(t - z)));
            	elseif (t <= 3e-95)
            		tmp = Float64(x / Float64(z * Float64(z - y)));
            	else
            		tmp = Float64(x / Float64(Float64(y - z) * t));
            	end
            	return tmp
            end
            
            x, y, z, t = num2cell(sort([x, y, z, t])){:}
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if (t <= -3.2e-165)
            		tmp = x / (y * (t - z));
            	elseif (t <= 3e-95)
            		tmp = x / (z * (z - y));
            	else
            		tmp = x / ((y - z) * t);
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_] := If[LessEqual[t, -3.2e-165], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-95], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;t \leq -3.2 \cdot 10^{-165}:\\
            \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\
            
            \mathbf{elif}\;t \leq 3 \cdot 10^{-95}:\\
            \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if t < -3.20000000000000013e-165

              1. Initial program 89.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. lower-*.f64N/A

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

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

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

              if -3.20000000000000013e-165 < t < 3e-95

              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. associate-/r*N/A

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

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

                  \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                6. sub-negate-revN/A

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

                  \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                8. distribute-neg-frac2N/A

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

                  \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

              if 3e-95 < t

              1. Initial program 89.1%

                \[\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 rewrites57.9%

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

              Alternative 9: 76.7% accurate, 0.7× speedup?

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

                1. Initial program 89.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. lower-*.f64N/A

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

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

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

                if -3.8000000000000002e-64 < y < 1.35000000000000013e-54

                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. associate-/r*N/A

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

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

                    \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                  6. sub-negate-revN/A

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

                    \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                  8. distribute-neg-frac2N/A

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

                    \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                  10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

                if 1.35000000000000013e-54 < y

                1. Initial program 89.1%

                  \[\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 rewrites57.9%

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

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

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

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

                      \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t} \]
                    5. sub-negate-revN/A

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

                      \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                    7. distribute-neg-frac2N/A

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

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

                      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{z - y}\right)}{t}} \]
                    10. *-rgt-identityN/A

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

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

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

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

                      \[\leadsto \frac{\frac{x \cdot \left(\mathsf{neg}\left(-1\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                    15. sub-negate-revN/A

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

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

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

                      \[\leadsto \frac{\frac{x \cdot \color{blue}{1}}{y - z}}{t} \]
                    19. *-rgt-identity63.3

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

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

                    \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
                  5. Step-by-step derivation
                    1. lower-/.f6443.2

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

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

                Alternative 10: 68.3% accurate, 0.7× speedup?

                \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.58 \cdot 10^{-103}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-88}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \end{array} \end{array} \]
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                (FPCore (x y z t)
                 :precision binary64
                 (if (<= z -1.58e-103)
                   (/ x (* z (- z t)))
                   (if (<= z 3.3e-88) (/ (/ x y) t) (/ x (* z (- z y))))))
                assert(x < y && y < z && z < t);
                double code(double x, double y, double z, double t) {
                	double tmp;
                	if (z <= -1.58e-103) {
                		tmp = x / (z * (z - t));
                	} else if (z <= 3.3e-88) {
                		tmp = (x / y) / t;
                	} else {
                		tmp = x / (z * (z - y));
                	}
                	return tmp;
                }
                
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z, t)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8) :: tmp
                    if (z <= (-1.58d-103)) then
                        tmp = x / (z * (z - t))
                    else if (z <= 3.3d-88) then
                        tmp = (x / y) / t
                    else
                        tmp = x / (z * (z - y))
                    end if
                    code = tmp
                end function
                
                assert x < y && y < z && z < t;
                public static double code(double x, double y, double z, double t) {
                	double tmp;
                	if (z <= -1.58e-103) {
                		tmp = x / (z * (z - t));
                	} else if (z <= 3.3e-88) {
                		tmp = (x / y) / t;
                	} else {
                		tmp = x / (z * (z - y));
                	}
                	return tmp;
                }
                
                [x, y, z, t] = sort([x, y, z, t])
                def code(x, y, z, t):
                	tmp = 0
                	if z <= -1.58e-103:
                		tmp = x / (z * (z - t))
                	elif z <= 3.3e-88:
                		tmp = (x / y) / t
                	else:
                		tmp = x / (z * (z - y))
                	return tmp
                
                x, y, z, t = sort([x, y, z, t])
                function code(x, y, z, t)
                	tmp = 0.0
                	if (z <= -1.58e-103)
                		tmp = Float64(x / Float64(z * Float64(z - t)));
                	elseif (z <= 3.3e-88)
                		tmp = Float64(Float64(x / y) / t);
                	else
                		tmp = Float64(x / Float64(z * Float64(z - y)));
                	end
                	return tmp
                end
                
                x, y, z, t = num2cell(sort([x, y, z, t])){:}
                function tmp_2 = code(x, y, z, t)
                	tmp = 0.0;
                	if (z <= -1.58e-103)
                		tmp = x / (z * (z - t));
                	elseif (z <= 3.3e-88)
                		tmp = (x / y) / t;
                	else
                		tmp = x / (z * (z - y));
                	end
                	tmp_2 = tmp;
                end
                
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_] := If[LessEqual[z, -1.58e-103], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e-88], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -1.58 \cdot 10^{-103}:\\
                \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\
                
                \mathbf{elif}\;z \leq 3.3 \cdot 10^{-88}:\\
                \;\;\;\;\frac{\frac{x}{y}}{t}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if z < -1.5800000000000001e-103

                  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. associate-/r*N/A

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

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

                      \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                    6. sub-negate-revN/A

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

                      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                    8. distribute-neg-frac2N/A

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

                      \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                    10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

                  if -1.5800000000000001e-103 < z < 3.29999999999999994e-88

                  1. Initial program 89.1%

                    \[\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 rewrites57.9%

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

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

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

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

                        \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t} \]
                      5. sub-negate-revN/A

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

                        \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                      7. distribute-neg-frac2N/A

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

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

                        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{z - y}\right)}{t}} \]
                      10. *-rgt-identityN/A

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

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

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

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

                        \[\leadsto \frac{\frac{x \cdot \left(\mathsf{neg}\left(-1\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                      15. sub-negate-revN/A

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

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

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

                        \[\leadsto \frac{\frac{x \cdot \color{blue}{1}}{y - z}}{t} \]
                      19. *-rgt-identity63.3

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

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

                      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
                    5. Step-by-step derivation
                      1. lower-/.f6443.2

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

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

                    if 3.29999999999999994e-88 < z

                    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. associate-/r*N/A

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

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

                        \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                      6. sub-negate-revN/A

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

                        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                      8. distribute-neg-frac2N/A

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

                        \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                      10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 67.5% 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 \left(z - t\right)}\\ \mathbf{if}\;z \leq -1.58 \cdot 10^{-103}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 140000000:\\ \;\;\;\;\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 t)))))
                     (if (<= z -1.58e-103) t_1 (if (<= z 140000000.0) (/ (/ 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 - t));
                  	double tmp;
                  	if (z <= -1.58e-103) {
                  		tmp = t_1;
                  	} else if (z <= 140000000.0) {
                  		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 - t))
                      if (z <= (-1.58d-103)) then
                          tmp = t_1
                      else if (z <= 140000000.0d0) 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 - t));
                  	double tmp;
                  	if (z <= -1.58e-103) {
                  		tmp = t_1;
                  	} else if (z <= 140000000.0) {
                  		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 - t))
                  	tmp = 0
                  	if z <= -1.58e-103:
                  		tmp = t_1
                  	elif z <= 140000000.0:
                  		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 * Float64(z - t)))
                  	tmp = 0.0
                  	if (z <= -1.58e-103)
                  		tmp = t_1;
                  	elseif (z <= 140000000.0)
                  		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 - t));
                  	tmp = 0.0;
                  	if (z <= -1.58e-103)
                  		tmp = t_1;
                  	elseif (z <= 140000000.0)
                  		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 * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.58e-103], t$95$1, If[LessEqual[z, 140000000.0], 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 \left(z - t\right)}\\
                  \mathbf{if}\;z \leq -1.58 \cdot 10^{-103}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;z \leq 140000000:\\
                  \;\;\;\;\frac{\frac{x}{y}}{t}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -1.5800000000000001e-103 or 1.4e8 < z

                    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. associate-/r*N/A

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

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

                        \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                      6. sub-negate-revN/A

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

                        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                      8. distribute-neg-frac2N/A

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

                        \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                      10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

                    if -1.5800000000000001e-103 < z < 1.4e8

                    1. Initial program 89.1%

                      \[\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 rewrites57.9%

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

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

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

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

                          \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t} \]
                        5. sub-negate-revN/A

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

                          \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                        7. distribute-neg-frac2N/A

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

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

                          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{z - y}\right)}{t}} \]
                        10. *-rgt-identityN/A

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

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

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

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

                          \[\leadsto \frac{\frac{x \cdot \left(\mathsf{neg}\left(-1\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                        15. sub-negate-revN/A

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

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

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

                          \[\leadsto \frac{\frac{x \cdot \color{blue}{1}}{y - z}}{t} \]
                        19. *-rgt-identity63.3

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

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

                        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
                      5. Step-by-step derivation
                        1. lower-/.f6443.2

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

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

                    Alternative 12: 62.9% 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 -8.6 \cdot 10^{-47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+15}:\\ \;\;\;\;\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 -8.6e-47) t_1 (if (<= z 2.05e+15) (/ (/ 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 <= -8.6e-47) {
                    		tmp = t_1;
                    	} else if (z <= 2.05e+15) {
                    		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 <= (-8.6d-47)) then
                            tmp = t_1
                        else if (z <= 2.05d+15) 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 <= -8.6e-47) {
                    		tmp = t_1;
                    	} else if (z <= 2.05e+15) {
                    		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 <= -8.6e-47:
                    		tmp = t_1
                    	elif z <= 2.05e+15:
                    		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 <= -8.6e-47)
                    		tmp = t_1;
                    	elseif (z <= 2.05e+15)
                    		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 <= -8.6e-47)
                    		tmp = t_1;
                    	elseif (z <= 2.05e+15)
                    		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, -8.6e-47], t$95$1, If[LessEqual[z, 2.05e+15], 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 -8.6 \cdot 10^{-47}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;z \leq 2.05 \cdot 10^{+15}:\\
                    \;\;\;\;\frac{\frac{x}{y}}{t}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if z < -8.5999999999999995e-47 or 2.05e15 < z

                      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. associate-/r*N/A

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

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

                          \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                        6. sub-negate-revN/A

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

                          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                        8. distribute-neg-frac2N/A

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

                          \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                        10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{x}{z \cdot z} \]
                      8. Step-by-step derivation
                        1. Applied rewrites39.4%

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

                        if -8.5999999999999995e-47 < z < 2.05e15

                        1. Initial program 89.1%

                          \[\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 rewrites57.9%

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

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

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

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

                              \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t} \]
                            5. sub-negate-revN/A

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

                              \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                            7. distribute-neg-frac2N/A

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

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

                              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{z - y}\right)}{t}} \]
                            10. *-rgt-identityN/A

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

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

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

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

                              \[\leadsto \frac{\frac{x \cdot \left(\mathsf{neg}\left(-1\right)\right)}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)}}{t} \]
                            15. sub-negate-revN/A

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

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

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

                              \[\leadsto \frac{\frac{x \cdot \color{blue}{1}}{y - z}}{t} \]
                            19. *-rgt-identity63.3

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

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

                            \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
                          5. Step-by-step derivation
                            1. lower-/.f6443.2

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

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

                        Alternative 13: 61.7% 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 -8.6 \cdot 10^{-47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+15}:\\ \;\;\;\;\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 -8.6e-47) t_1 (if (<= z 2.05e+15) (/ 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 <= -8.6e-47) {
                        		tmp = t_1;
                        	} else if (z <= 2.05e+15) {
                        		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 <= (-8.6d-47)) then
                                tmp = t_1
                            else if (z <= 2.05d+15) 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 <= -8.6e-47) {
                        		tmp = t_1;
                        	} else if (z <= 2.05e+15) {
                        		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 <= -8.6e-47:
                        		tmp = t_1
                        	elif z <= 2.05e+15:
                        		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 <= -8.6e-47)
                        		tmp = t_1;
                        	elseif (z <= 2.05e+15)
                        		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 <= -8.6e-47)
                        		tmp = t_1;
                        	elseif (z <= 2.05e+15)
                        		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, -8.6e-47], t$95$1, If[LessEqual[z, 2.05e+15], 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 -8.6 \cdot 10^{-47}:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;z \leq 2.05 \cdot 10^{+15}:\\
                        \;\;\;\;\frac{x}{t \cdot y}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if z < -8.5999999999999995e-47 or 2.05e15 < z

                          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. associate-/r*N/A

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

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

                              \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                            6. sub-negate-revN/A

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

                              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                            8. distribute-neg-frac2N/A

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

                              \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                            10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{x}{z \cdot z} \]
                          8. Step-by-step derivation
                            1. Applied rewrites39.4%

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

                            if -8.5999999999999995e-47 < z < 2.05e15

                            1. Initial program 89.1%

                              \[\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.9

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

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

                          Alternative 14: 39.4% accurate, 1.7× speedup?

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

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

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

                              \[\leadsto \frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \]
                            6. sub-negate-revN/A

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

                              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{x}{y - z}\right)}{z - t}} \]
                            8. distribute-neg-frac2N/A

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

                              \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}}{z - t} \]
                            10. sub-negate-revN/A

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{x}{z \cdot z} \]
                          8. Step-by-step derivation
                            1. Applied rewrites39.4%

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

                            Reproduce

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