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

Percentage Accurate: 89.2% → 98.1%
Time: 4.0s
Alternatives: 14
Speedup: 0.6×

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.2% 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: 98.1% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-319}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (* (- y z) (- t z)))))
   (* x_s (if (<= t_1 -1e-319) t_1 (/ (/ x_m (- t z)) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -1e-319) {
		tmp = t_1;
	} else {
		tmp = (x_m / (t - z)) / (y - z);
	}
	return x_s * tmp;
}
x\_m =     private
x\_s =     private
NOTE: x_m, 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_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / ((y - z) * (t - z))
    if (t_1 <= (-1d-319)) then
        tmp = t_1
    else
        tmp = (x_m / (t - z)) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -1e-319) {
		tmp = t_1;
	} else {
		tmp = (x_m / (t - z)) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = x_m / ((y - z) * (t - z))
	tmp = 0
	if t_1 <= -1e-319:
		tmp = t_1
	else:
		tmp = (x_m / (t - z)) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z)))
	tmp = 0.0
	if (t_1 <= -1e-319)
		tmp = t_1;
	else
		tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m / ((y - z) * (t - z));
	tmp = 0.0;
	if (t_1 <= -1e-319)
		tmp = t_1;
	else
		tmp = (x_m / (t - z)) / (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -1e-319], t$95$1, N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-319}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -9.99989e-320

    1. Initial program 98.2%

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

    if -9.99989e-320 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.6% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{-z}}{y - z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+135}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+84}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x_m (- z)) (- y z))))
   (*
    x_s
    (if (<= z -1.75e+135)
      t_1
      (if (<= z 5e+84) (/ x_m (* (- y z) (- t z))) t_1)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / -z) / (y - z);
	double tmp;
	if (z <= -1.75e+135) {
		tmp = t_1;
	} else if (z <= 5e+84) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m =     private
x\_s =     private
NOTE: x_m, 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_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / -z) / (y - z)
    if (z <= (-1.75d+135)) then
        tmp = t_1
    else if (z <= 5d+84) then
        tmp = x_m / ((y - z) * (t - z))
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / -z) / (y - z);
	double tmp;
	if (z <= -1.75e+135) {
		tmp = t_1;
	} else if (z <= 5e+84) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = (x_m / -z) / (y - z)
	tmp = 0
	if z <= -1.75e+135:
		tmp = t_1
	elif z <= 5e+84:
		tmp = x_m / ((y - z) * (t - z))
	else:
		tmp = t_1
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(x_m / Float64(-z)) / Float64(y - z))
	tmp = 0.0
	if (z <= -1.75e+135)
		tmp = t_1;
	elseif (z <= 5e+84)
		tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z)));
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (x_m / -z) / (y - z);
	tmp = 0.0;
	if (z <= -1.75e+135)
		tmp = t_1;
	elseif (z <= 5e+84)
		tmp = x_m / ((y - z) * (t - z));
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / (-z)), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.75e+135], t$95$1, If[LessEqual[z, 5e+84], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{-z}}{y - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7500000000000001e135 or 5.0000000000000001e84 < z

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{-z}}{y - z} \]
    6. Applied rewrites94.1%

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

    if -1.7500000000000001e135 < z < 5.0000000000000001e84

    1. Initial program 93.4%

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

Alternative 3: 82.7% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{t - z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.96 \cdot 10^{+186}:\\ \;\;\;\;\frac{t\_1}{y}\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-106}:\\ \;\;\;\;\frac{t\_1}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (- t z))))
   (*
    x_s
    (if (<= y -1.96e+186)
      (/ t_1 y)
      (if (<= y -7.2e+14)
        (/ x_m (* y (- t z)))
        (if (<= y 1.85e-106) (/ t_1 (- z)) (/ (/ x_m (- y z)) t)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (t - z);
	double tmp;
	if (y <= -1.96e+186) {
		tmp = t_1 / y;
	} else if (y <= -7.2e+14) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 1.85e-106) {
		tmp = t_1 / -z;
	} else {
		tmp = (x_m / (y - z)) / t;
	}
	return x_s * tmp;
}
x\_m =     private
x\_s =     private
NOTE: x_m, 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_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / (t - z)
    if (y <= (-1.96d+186)) then
        tmp = t_1 / y
    else if (y <= (-7.2d+14)) then
        tmp = x_m / (y * (t - z))
    else if (y <= 1.85d-106) then
        tmp = t_1 / -z
    else
        tmp = (x_m / (y - z)) / t
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (t - z);
	double tmp;
	if (y <= -1.96e+186) {
		tmp = t_1 / y;
	} else if (y <= -7.2e+14) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 1.85e-106) {
		tmp = t_1 / -z;
	} else {
		tmp = (x_m / (y - z)) / t;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = x_m / (t - z)
	tmp = 0
	if y <= -1.96e+186:
		tmp = t_1 / y
	elif y <= -7.2e+14:
		tmp = x_m / (y * (t - z))
	elif y <= 1.85e-106:
		tmp = t_1 / -z
	else:
		tmp = (x_m / (y - z)) / t
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m / Float64(t - z))
	tmp = 0.0
	if (y <= -1.96e+186)
		tmp = Float64(t_1 / y);
	elseif (y <= -7.2e+14)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= 1.85e-106)
		tmp = Float64(t_1 / Float64(-z));
	else
		tmp = Float64(Float64(x_m / Float64(y - z)) / t);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m / (t - z);
	tmp = 0.0;
	if (y <= -1.96e+186)
		tmp = t_1 / y;
	elseif (y <= -7.2e+14)
		tmp = x_m / (y * (t - z));
	elseif (y <= 1.85e-106)
		tmp = t_1 / -z;
	else
		tmp = (x_m / (y - z)) / t;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -1.96e+186], N[(t$95$1 / y), $MachinePrecision], If[LessEqual[y, -7.2e+14], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-106], N[(t$95$1 / (-z)), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.96 \cdot 10^{+186}:\\
\;\;\;\;\frac{t\_1}{y}\\

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

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-106}:\\
\;\;\;\;\frac{t\_1}{-z}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.95999999999999994e186

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
      4. lower-/.f6476.2

        \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
    6. Applied rewrites76.2%

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

      \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
    8. Step-by-step derivation
      1. lift-/.f6474.6

        \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
    9. Applied rewrites74.6%

      \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
    10. Taylor expanded in y around inf

      \[\leadsto \frac{\frac{x}{t - z}}{y} \]
    11. Step-by-step derivation
      1. Applied rewrites93.2%

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

      if -1.95999999999999994e186 < y < -7.2e14

      1. Initial program 89.4%

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

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

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

        if -7.2e14 < y < 1.8499999999999999e-106

        1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
          4. lower-/.f6496.9

            \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
        6. Applied rewrites96.9%

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

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

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

            \[\leadsto \frac{\frac{x}{t - z}}{-z} \]
        9. Applied rewrites77.9%

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

        if 1.8499999999999999e-106 < y

        1. Initial program 88.0%

          \[\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 rewrites80.4%

            \[\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. lift--.f64N/A

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

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

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

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

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

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

        Alternative 4: 82.3% accurate, 0.6× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.96 \cdot 10^{+186}:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\ \mathbf{elif}\;y \leq -5400000000000:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-107}:\\ \;\;\;\;\frac{\frac{x\_m}{-z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\ \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
        (FPCore (x_s x_m y z t)
         :precision binary64
         (*
          x_s
          (if (<= y -1.96e+186)
            (/ (/ x_m (- t z)) y)
            (if (<= y -5400000000000.0)
              (/ x_m (* y (- t z)))
              (if (<= y 8e-107) (/ (/ x_m (- z)) (- t z)) (/ (/ x_m (- y z)) t))))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        assert(x_m < y && y < z && z < t);
        double code(double x_s, double x_m, double y, double z, double t) {
        	double tmp;
        	if (y <= -1.96e+186) {
        		tmp = (x_m / (t - z)) / y;
        	} else if (y <= -5400000000000.0) {
        		tmp = x_m / (y * (t - z));
        	} else if (y <= 8e-107) {
        		tmp = (x_m / -z) / (t - z);
        	} else {
        		tmp = (x_m / (y - z)) / t;
        	}
        	return x_s * tmp;
        }
        
        x\_m =     private
        x\_s =     private
        NOTE: x_m, 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_s, x_m, y, z, t)
        use fmin_fmax_functions
            real(8), intent (in) :: x_s
            real(8), intent (in) :: x_m
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: tmp
            if (y <= (-1.96d+186)) then
                tmp = (x_m / (t - z)) / y
            else if (y <= (-5400000000000.0d0)) then
                tmp = x_m / (y * (t - z))
            else if (y <= 8d-107) then
                tmp = (x_m / -z) / (t - z)
            else
                tmp = (x_m / (y - z)) / t
            end if
            code = x_s * tmp
        end function
        
        x\_m = Math.abs(x);
        x\_s = Math.copySign(1.0, x);
        assert x_m < y && y < z && z < t;
        public static double code(double x_s, double x_m, double y, double z, double t) {
        	double tmp;
        	if (y <= -1.96e+186) {
        		tmp = (x_m / (t - z)) / y;
        	} else if (y <= -5400000000000.0) {
        		tmp = x_m / (y * (t - z));
        	} else if (y <= 8e-107) {
        		tmp = (x_m / -z) / (t - z);
        	} else {
        		tmp = (x_m / (y - z)) / t;
        	}
        	return x_s * tmp;
        }
        
        x\_m = math.fabs(x)
        x\_s = math.copysign(1.0, x)
        [x_m, y, z, t] = sort([x_m, y, z, t])
        def code(x_s, x_m, y, z, t):
        	tmp = 0
        	if y <= -1.96e+186:
        		tmp = (x_m / (t - z)) / y
        	elif y <= -5400000000000.0:
        		tmp = x_m / (y * (t - z))
        	elif y <= 8e-107:
        		tmp = (x_m / -z) / (t - z)
        	else:
        		tmp = (x_m / (y - z)) / t
        	return x_s * tmp
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        x_m, y, z, t = sort([x_m, y, z, t])
        function code(x_s, x_m, y, z, t)
        	tmp = 0.0
        	if (y <= -1.96e+186)
        		tmp = Float64(Float64(x_m / Float64(t - z)) / y);
        	elseif (y <= -5400000000000.0)
        		tmp = Float64(x_m / Float64(y * Float64(t - z)));
        	elseif (y <= 8e-107)
        		tmp = Float64(Float64(x_m / Float64(-z)) / Float64(t - z));
        	else
        		tmp = Float64(Float64(x_m / Float64(y - z)) / t);
        	end
        	return Float64(x_s * tmp)
        end
        
        x\_m = abs(x);
        x\_s = sign(x) * abs(1.0);
        x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
        function tmp_2 = code(x_s, x_m, y, z, t)
        	tmp = 0.0;
        	if (y <= -1.96e+186)
        		tmp = (x_m / (t - z)) / y;
        	elseif (y <= -5400000000000.0)
        		tmp = x_m / (y * (t - z));
        	elseif (y <= 8e-107)
        		tmp = (x_m / -z) / (t - z);
        	else
        		tmp = (x_m / (y - z)) / t;
        	end
        	tmp_2 = x_s * tmp;
        end
        
        x\_m = N[Abs[x], $MachinePrecision]
        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
        code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -1.96e+186], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, -5400000000000.0], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-107], N[(N[(x$95$m / (-z)), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        \\
        [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
        \\
        x\_s \cdot \begin{array}{l}
        \mathbf{if}\;y \leq -1.96 \cdot 10^{+186}:\\
        \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
        
        \mathbf{elif}\;y \leq -5400000000000:\\
        \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
        
        \mathbf{elif}\;y \leq 8 \cdot 10^{-107}:\\
        \;\;\;\;\frac{\frac{x\_m}{-z}}{t - z}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if y < -1.95999999999999994e186

          1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
            4. lower-/.f6476.2

              \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
          6. Applied rewrites76.2%

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

            \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
          8. Step-by-step derivation
            1. lift-/.f6474.6

              \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
          9. Applied rewrites74.6%

            \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
          10. Taylor expanded in y around inf

            \[\leadsto \frac{\frac{x}{t - z}}{y} \]
          11. Step-by-step derivation
            1. Applied rewrites93.2%

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

            if -1.95999999999999994e186 < y < -5.4e12

            1. Initial program 89.4%

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

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

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

              if -5.4e12 < y < 8e-107

              1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 8e-107 < y

              1. Initial program 88.0%

                \[\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 rewrites80.5%

                  \[\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. lift--.f64N/A

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

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

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

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

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

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

              Alternative 5: 82.0% accurate, 0.6× speedup?

              \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.96 \cdot 10^{+186}:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\ \mathbf{elif}\;y \leq -5400000000000:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-106}:\\ \;\;\;\;\frac{x\_m}{\left(-z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\ \end{array} \end{array} \]
              x\_m = (fabs.f64 x)
              x\_s = (copysign.f64 #s(literal 1 binary64) x)
              NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
              (FPCore (x_s x_m y z t)
               :precision binary64
               (*
                x_s
                (if (<= y -1.96e+186)
                  (/ (/ x_m (- t z)) y)
                  (if (<= y -5400000000000.0)
                    (/ x_m (* y (- t z)))
                    (if (<= y 1.25e-106) (/ x_m (* (- z) (- t z))) (/ (/ x_m (- y z)) t))))))
              x\_m = fabs(x);
              x\_s = copysign(1.0, x);
              assert(x_m < y && y < z && z < t);
              double code(double x_s, double x_m, double y, double z, double t) {
              	double tmp;
              	if (y <= -1.96e+186) {
              		tmp = (x_m / (t - z)) / y;
              	} else if (y <= -5400000000000.0) {
              		tmp = x_m / (y * (t - z));
              	} else if (y <= 1.25e-106) {
              		tmp = x_m / (-z * (t - z));
              	} else {
              		tmp = (x_m / (y - z)) / t;
              	}
              	return x_s * tmp;
              }
              
              x\_m =     private
              x\_s =     private
              NOTE: x_m, 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_s, x_m, y, z, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: x_s
                  real(8), intent (in) :: x_m
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: tmp
                  if (y <= (-1.96d+186)) then
                      tmp = (x_m / (t - z)) / y
                  else if (y <= (-5400000000000.0d0)) then
                      tmp = x_m / (y * (t - z))
                  else if (y <= 1.25d-106) then
                      tmp = x_m / (-z * (t - z))
                  else
                      tmp = (x_m / (y - z)) / t
                  end if
                  code = x_s * tmp
              end function
              
              x\_m = Math.abs(x);
              x\_s = Math.copySign(1.0, x);
              assert x_m < y && y < z && z < t;
              public static double code(double x_s, double x_m, double y, double z, double t) {
              	double tmp;
              	if (y <= -1.96e+186) {
              		tmp = (x_m / (t - z)) / y;
              	} else if (y <= -5400000000000.0) {
              		tmp = x_m / (y * (t - z));
              	} else if (y <= 1.25e-106) {
              		tmp = x_m / (-z * (t - z));
              	} else {
              		tmp = (x_m / (y - z)) / t;
              	}
              	return x_s * tmp;
              }
              
              x\_m = math.fabs(x)
              x\_s = math.copysign(1.0, x)
              [x_m, y, z, t] = sort([x_m, y, z, t])
              def code(x_s, x_m, y, z, t):
              	tmp = 0
              	if y <= -1.96e+186:
              		tmp = (x_m / (t - z)) / y
              	elif y <= -5400000000000.0:
              		tmp = x_m / (y * (t - z))
              	elif y <= 1.25e-106:
              		tmp = x_m / (-z * (t - z))
              	else:
              		tmp = (x_m / (y - z)) / t
              	return x_s * tmp
              
              x\_m = abs(x)
              x\_s = copysign(1.0, x)
              x_m, y, z, t = sort([x_m, y, z, t])
              function code(x_s, x_m, y, z, t)
              	tmp = 0.0
              	if (y <= -1.96e+186)
              		tmp = Float64(Float64(x_m / Float64(t - z)) / y);
              	elseif (y <= -5400000000000.0)
              		tmp = Float64(x_m / Float64(y * Float64(t - z)));
              	elseif (y <= 1.25e-106)
              		tmp = Float64(x_m / Float64(Float64(-z) * Float64(t - z)));
              	else
              		tmp = Float64(Float64(x_m / Float64(y - z)) / t);
              	end
              	return Float64(x_s * tmp)
              end
              
              x\_m = abs(x);
              x\_s = sign(x) * abs(1.0);
              x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
              function tmp_2 = code(x_s, x_m, y, z, t)
              	tmp = 0.0;
              	if (y <= -1.96e+186)
              		tmp = (x_m / (t - z)) / y;
              	elseif (y <= -5400000000000.0)
              		tmp = x_m / (y * (t - z));
              	elseif (y <= 1.25e-106)
              		tmp = x_m / (-z * (t - z));
              	else
              		tmp = (x_m / (y - z)) / t;
              	end
              	tmp_2 = x_s * tmp;
              end
              
              x\_m = N[Abs[x], $MachinePrecision]
              x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
              code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -1.96e+186], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, -5400000000000.0], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-106], N[(x$95$m / N[((-z) * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]), $MachinePrecision]
              
              \begin{array}{l}
              x\_m = \left|x\right|
              \\
              x\_s = \mathsf{copysign}\left(1, x\right)
              \\
              [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
              \\
              x\_s \cdot \begin{array}{l}
              \mathbf{if}\;y \leq -1.96 \cdot 10^{+186}:\\
              \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
              
              \mathbf{elif}\;y \leq -5400000000000:\\
              \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
              
              \mathbf{elif}\;y \leq 1.25 \cdot 10^{-106}:\\
              \;\;\;\;\frac{x\_m}{\left(-z\right) \cdot \left(t - z\right)}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\frac{x\_m}{y - z}}{t}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if y < -1.95999999999999994e186

                1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
                  4. lower-/.f6476.2

                    \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
                6. Applied rewrites76.2%

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

                  \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
                8. Step-by-step derivation
                  1. lift-/.f6474.6

                    \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
                9. Applied rewrites74.6%

                  \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
                10. Taylor expanded in y around inf

                  \[\leadsto \frac{\frac{x}{t - z}}{y} \]
                11. Step-by-step derivation
                  1. Applied rewrites93.2%

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

                  if -1.95999999999999994e186 < y < -5.4e12

                  1. Initial program 89.4%

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

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

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

                    if -5.4e12 < y < 1.24999999999999996e-106

                    1. Initial program 91.6%

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

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

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

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

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

                    if 1.24999999999999996e-106 < y

                    1. Initial program 88.0%

                      \[\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 rewrites80.5%

                        \[\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. lift--.f64N/A

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

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

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

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

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

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

                    Alternative 6: 79.8% accurate, 0.7× speedup?

                    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-113}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;t \leq 6.3 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{x\_m}{-z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
                    x\_m = (fabs.f64 x)
                    x\_s = (copysign.f64 #s(literal 1 binary64) x)
                    NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                    (FPCore (x_s x_m y z t)
                     :precision binary64
                     (*
                      x_s
                      (if (<= t -1.6e-113)
                        (/ (/ x_m y) (- t z))
                        (if (<= t 6.3e-52) (/ (/ x_m (- z)) (- y z)) (/ (/ x_m t) (- y z))))))
                    x\_m = fabs(x);
                    x\_s = copysign(1.0, x);
                    assert(x_m < y && y < z && z < t);
                    double code(double x_s, double x_m, double y, double z, double t) {
                    	double tmp;
                    	if (t <= -1.6e-113) {
                    		tmp = (x_m / y) / (t - z);
                    	} else if (t <= 6.3e-52) {
                    		tmp = (x_m / -z) / (y - z);
                    	} else {
                    		tmp = (x_m / t) / (y - z);
                    	}
                    	return x_s * tmp;
                    }
                    
                    x\_m =     private
                    x\_s =     private
                    NOTE: x_m, 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_s, x_m, y, z, t)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x_s
                        real(8), intent (in) :: x_m
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8) :: tmp
                        if (t <= (-1.6d-113)) then
                            tmp = (x_m / y) / (t - z)
                        else if (t <= 6.3d-52) then
                            tmp = (x_m / -z) / (y - z)
                        else
                            tmp = (x_m / t) / (y - z)
                        end if
                        code = x_s * tmp
                    end function
                    
                    x\_m = Math.abs(x);
                    x\_s = Math.copySign(1.0, x);
                    assert x_m < y && y < z && z < t;
                    public static double code(double x_s, double x_m, double y, double z, double t) {
                    	double tmp;
                    	if (t <= -1.6e-113) {
                    		tmp = (x_m / y) / (t - z);
                    	} else if (t <= 6.3e-52) {
                    		tmp = (x_m / -z) / (y - z);
                    	} else {
                    		tmp = (x_m / t) / (y - z);
                    	}
                    	return x_s * tmp;
                    }
                    
                    x\_m = math.fabs(x)
                    x\_s = math.copysign(1.0, x)
                    [x_m, y, z, t] = sort([x_m, y, z, t])
                    def code(x_s, x_m, y, z, t):
                    	tmp = 0
                    	if t <= -1.6e-113:
                    		tmp = (x_m / y) / (t - z)
                    	elif t <= 6.3e-52:
                    		tmp = (x_m / -z) / (y - z)
                    	else:
                    		tmp = (x_m / t) / (y - z)
                    	return x_s * tmp
                    
                    x\_m = abs(x)
                    x\_s = copysign(1.0, x)
                    x_m, y, z, t = sort([x_m, y, z, t])
                    function code(x_s, x_m, y, z, t)
                    	tmp = 0.0
                    	if (t <= -1.6e-113)
                    		tmp = Float64(Float64(x_m / y) / Float64(t - z));
                    	elseif (t <= 6.3e-52)
                    		tmp = Float64(Float64(x_m / Float64(-z)) / Float64(y - z));
                    	else
                    		tmp = Float64(Float64(x_m / t) / Float64(y - z));
                    	end
                    	return Float64(x_s * tmp)
                    end
                    
                    x\_m = abs(x);
                    x\_s = sign(x) * abs(1.0);
                    x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                    function tmp_2 = code(x_s, x_m, y, z, t)
                    	tmp = 0.0;
                    	if (t <= -1.6e-113)
                    		tmp = (x_m / y) / (t - z);
                    	elseif (t <= 6.3e-52)
                    		tmp = (x_m / -z) / (y - z);
                    	else
                    		tmp = (x_m / t) / (y - z);
                    	end
                    	tmp_2 = x_s * tmp;
                    end
                    
                    x\_m = N[Abs[x], $MachinePrecision]
                    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                    NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                    code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -1.6e-113], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.3e-52], N[(N[(x$95$m / (-z)), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                    
                    \begin{array}{l}
                    x\_m = \left|x\right|
                    \\
                    x\_s = \mathsf{copysign}\left(1, x\right)
                    \\
                    [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                    \\
                    x\_s \cdot \begin{array}{l}
                    \mathbf{if}\;t \leq -1.6 \cdot 10^{-113}:\\
                    \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\
                    
                    \mathbf{elif}\;t \leq 6.3 \cdot 10^{-52}:\\
                    \;\;\;\;\frac{\frac{x\_m}{-z}}{y - z}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if t < -1.6000000000000001e-113

                      1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

                        if -1.6000000000000001e-113 < t < 6.3000000000000003e-52

                        1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 6.3000000000000003e-52 < t

                        1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 7: 73.8% accurate, 0.7× speedup?

                        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq 1.15 \cdot 10^{-234}:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-53}:\\ \;\;\;\;\frac{\frac{x\_m}{-z}}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
                        x\_m = (fabs.f64 x)
                        x\_s = (copysign.f64 #s(literal 1 binary64) x)
                        NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                        (FPCore (x_s x_m y z t)
                         :precision binary64
                         (*
                          x_s
                          (if (<= t 1.15e-234)
                            (/ (/ x_m (- t z)) y)
                            (if (<= t 3.2e-53) (/ (/ x_m (- z)) (- z)) (/ (/ x_m t) (- y z))))))
                        x\_m = fabs(x);
                        x\_s = copysign(1.0, x);
                        assert(x_m < y && y < z && z < t);
                        double code(double x_s, double x_m, double y, double z, double t) {
                        	double tmp;
                        	if (t <= 1.15e-234) {
                        		tmp = (x_m / (t - z)) / y;
                        	} else if (t <= 3.2e-53) {
                        		tmp = (x_m / -z) / -z;
                        	} else {
                        		tmp = (x_m / t) / (y - z);
                        	}
                        	return x_s * tmp;
                        }
                        
                        x\_m =     private
                        x\_s =     private
                        NOTE: x_m, 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_s, x_m, y, z, t)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x_s
                            real(8), intent (in) :: x_m
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            real(8) :: tmp
                            if (t <= 1.15d-234) then
                                tmp = (x_m / (t - z)) / y
                            else if (t <= 3.2d-53) then
                                tmp = (x_m / -z) / -z
                            else
                                tmp = (x_m / t) / (y - z)
                            end if
                            code = x_s * tmp
                        end function
                        
                        x\_m = Math.abs(x);
                        x\_s = Math.copySign(1.0, x);
                        assert x_m < y && y < z && z < t;
                        public static double code(double x_s, double x_m, double y, double z, double t) {
                        	double tmp;
                        	if (t <= 1.15e-234) {
                        		tmp = (x_m / (t - z)) / y;
                        	} else if (t <= 3.2e-53) {
                        		tmp = (x_m / -z) / -z;
                        	} else {
                        		tmp = (x_m / t) / (y - z);
                        	}
                        	return x_s * tmp;
                        }
                        
                        x\_m = math.fabs(x)
                        x\_s = math.copysign(1.0, x)
                        [x_m, y, z, t] = sort([x_m, y, z, t])
                        def code(x_s, x_m, y, z, t):
                        	tmp = 0
                        	if t <= 1.15e-234:
                        		tmp = (x_m / (t - z)) / y
                        	elif t <= 3.2e-53:
                        		tmp = (x_m / -z) / -z
                        	else:
                        		tmp = (x_m / t) / (y - z)
                        	return x_s * tmp
                        
                        x\_m = abs(x)
                        x\_s = copysign(1.0, x)
                        x_m, y, z, t = sort([x_m, y, z, t])
                        function code(x_s, x_m, y, z, t)
                        	tmp = 0.0
                        	if (t <= 1.15e-234)
                        		tmp = Float64(Float64(x_m / Float64(t - z)) / y);
                        	elseif (t <= 3.2e-53)
                        		tmp = Float64(Float64(x_m / Float64(-z)) / Float64(-z));
                        	else
                        		tmp = Float64(Float64(x_m / t) / Float64(y - z));
                        	end
                        	return Float64(x_s * tmp)
                        end
                        
                        x\_m = abs(x);
                        x\_s = sign(x) * abs(1.0);
                        x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                        function tmp_2 = code(x_s, x_m, y, z, t)
                        	tmp = 0.0;
                        	if (t <= 1.15e-234)
                        		tmp = (x_m / (t - z)) / y;
                        	elseif (t <= 3.2e-53)
                        		tmp = (x_m / -z) / -z;
                        	else
                        		tmp = (x_m / t) / (y - z);
                        	end
                        	tmp_2 = x_s * tmp;
                        end
                        
                        x\_m = N[Abs[x], $MachinePrecision]
                        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                        NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                        code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 1.15e-234], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 3.2e-53], N[(N[(x$95$m / (-z)), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                        
                        \begin{array}{l}
                        x\_m = \left|x\right|
                        \\
                        x\_s = \mathsf{copysign}\left(1, x\right)
                        \\
                        [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                        \\
                        x\_s \cdot \begin{array}{l}
                        \mathbf{if}\;t \leq 1.15 \cdot 10^{-234}:\\
                        \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\
                        
                        \mathbf{elif}\;t \leq 3.2 \cdot 10^{-53}:\\
                        \;\;\;\;\frac{\frac{x\_m}{-z}}{-z}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if t < 1.14999999999999995e-234

                          1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
                            4. lower-/.f6485.8

                              \[\leadsto \frac{\frac{x}{t - z}}{\left(\frac{y}{z} - 1\right) \cdot z} \]
                          6. Applied rewrites85.8%

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

                            \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
                          8. Step-by-step derivation
                            1. lift-/.f6458.8

                              \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
                          9. Applied rewrites58.8%

                            \[\leadsto \frac{\frac{x}{t - z}}{\frac{y}{z} \cdot z} \]
                          10. Taylor expanded in y around inf

                            \[\leadsto \frac{\frac{x}{t - z}}{y} \]
                          11. Step-by-step derivation
                            1. Applied rewrites71.0%

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

                            if 1.14999999999999995e-234 < t < 3.2000000000000001e-53

                            1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{x}{-z}}{y - z} \]
                            6. Applied rewrites76.2%

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

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

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

                                \[\leadsto \frac{\frac{x}{-z}}{-z} \]
                            9. Applied rewrites57.3%

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

                            if 3.2000000000000001e-53 < t

                            1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 8: 73.2% accurate, 0.7× speedup?

                            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq 5.5 \cdot 10^{-234}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-53}:\\ \;\;\;\;\frac{\frac{x\_m}{-z}}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
                            x\_m = (fabs.f64 x)
                            x\_s = (copysign.f64 #s(literal 1 binary64) x)
                            NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                            (FPCore (x_s x_m y z t)
                             :precision binary64
                             (*
                              x_s
                              (if (<= t 5.5e-234)
                                (/ x_m (* y (- t z)))
                                (if (<= t 3.2e-53) (/ (/ x_m (- z)) (- z)) (/ (/ x_m t) (- y z))))))
                            x\_m = fabs(x);
                            x\_s = copysign(1.0, x);
                            assert(x_m < y && y < z && z < t);
                            double code(double x_s, double x_m, double y, double z, double t) {
                            	double tmp;
                            	if (t <= 5.5e-234) {
                            		tmp = x_m / (y * (t - z));
                            	} else if (t <= 3.2e-53) {
                            		tmp = (x_m / -z) / -z;
                            	} else {
                            		tmp = (x_m / t) / (y - z);
                            	}
                            	return x_s * tmp;
                            }
                            
                            x\_m =     private
                            x\_s =     private
                            NOTE: x_m, 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_s, x_m, y, z, t)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x_s
                                real(8), intent (in) :: x_m
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8) :: tmp
                                if (t <= 5.5d-234) then
                                    tmp = x_m / (y * (t - z))
                                else if (t <= 3.2d-53) then
                                    tmp = (x_m / -z) / -z
                                else
                                    tmp = (x_m / t) / (y - z)
                                end if
                                code = x_s * tmp
                            end function
                            
                            x\_m = Math.abs(x);
                            x\_s = Math.copySign(1.0, x);
                            assert x_m < y && y < z && z < t;
                            public static double code(double x_s, double x_m, double y, double z, double t) {
                            	double tmp;
                            	if (t <= 5.5e-234) {
                            		tmp = x_m / (y * (t - z));
                            	} else if (t <= 3.2e-53) {
                            		tmp = (x_m / -z) / -z;
                            	} else {
                            		tmp = (x_m / t) / (y - z);
                            	}
                            	return x_s * tmp;
                            }
                            
                            x\_m = math.fabs(x)
                            x\_s = math.copysign(1.0, x)
                            [x_m, y, z, t] = sort([x_m, y, z, t])
                            def code(x_s, x_m, y, z, t):
                            	tmp = 0
                            	if t <= 5.5e-234:
                            		tmp = x_m / (y * (t - z))
                            	elif t <= 3.2e-53:
                            		tmp = (x_m / -z) / -z
                            	else:
                            		tmp = (x_m / t) / (y - z)
                            	return x_s * tmp
                            
                            x\_m = abs(x)
                            x\_s = copysign(1.0, x)
                            x_m, y, z, t = sort([x_m, y, z, t])
                            function code(x_s, x_m, y, z, t)
                            	tmp = 0.0
                            	if (t <= 5.5e-234)
                            		tmp = Float64(x_m / Float64(y * Float64(t - z)));
                            	elseif (t <= 3.2e-53)
                            		tmp = Float64(Float64(x_m / Float64(-z)) / Float64(-z));
                            	else
                            		tmp = Float64(Float64(x_m / t) / Float64(y - z));
                            	end
                            	return Float64(x_s * tmp)
                            end
                            
                            x\_m = abs(x);
                            x\_s = sign(x) * abs(1.0);
                            x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                            function tmp_2 = code(x_s, x_m, y, z, t)
                            	tmp = 0.0;
                            	if (t <= 5.5e-234)
                            		tmp = x_m / (y * (t - z));
                            	elseif (t <= 3.2e-53)
                            		tmp = (x_m / -z) / -z;
                            	else
                            		tmp = (x_m / t) / (y - z);
                            	end
                            	tmp_2 = x_s * tmp;
                            end
                            
                            x\_m = N[Abs[x], $MachinePrecision]
                            x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                            NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                            code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 5.5e-234], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-53], N[(N[(x$95$m / (-z)), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                            
                            \begin{array}{l}
                            x\_m = \left|x\right|
                            \\
                            x\_s = \mathsf{copysign}\left(1, x\right)
                            \\
                            [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                            \\
                            x\_s \cdot \begin{array}{l}
                            \mathbf{if}\;t \leq 5.5 \cdot 10^{-234}:\\
                            \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
                            
                            \mathbf{elif}\;t \leq 3.2 \cdot 10^{-53}:\\
                            \;\;\;\;\frac{\frac{x\_m}{-z}}{-z}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if t < 5.5e-234

                              1. Initial program 89.2%

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

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

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

                                if 5.5e-234 < t < 3.2000000000000001e-53

                                1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{x}{-z}}{y - z} \]
                                6. Applied rewrites76.2%

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

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

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

                                    \[\leadsto \frac{\frac{x}{-z}}{-z} \]
                                9. Applied rewrites57.3%

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

                                if 3.2000000000000001e-53 < t

                                1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 9: 73.2% accurate, 0.7× speedup?

                                \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq 5.5 \cdot 10^{-234}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 2.45 \cdot 10^{-54}:\\ \;\;\;\;\frac{\frac{x\_m}{-z}}{-z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
                                x\_m = (fabs.f64 x)
                                x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                (FPCore (x_s x_m y z t)
                                 :precision binary64
                                 (*
                                  x_s
                                  (if (<= t 5.5e-234)
                                    (/ x_m (* y (- t z)))
                                    (if (<= t 2.45e-54) (/ (/ x_m (- z)) (- z)) (/ x_m (* (- y z) t))))))
                                x\_m = fabs(x);
                                x\_s = copysign(1.0, x);
                                assert(x_m < y && y < z && z < t);
                                double code(double x_s, double x_m, double y, double z, double t) {
                                	double tmp;
                                	if (t <= 5.5e-234) {
                                		tmp = x_m / (y * (t - z));
                                	} else if (t <= 2.45e-54) {
                                		tmp = (x_m / -z) / -z;
                                	} else {
                                		tmp = x_m / ((y - z) * t);
                                	}
                                	return x_s * tmp;
                                }
                                
                                x\_m =     private
                                x\_s =     private
                                NOTE: x_m, 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_s, x_m, y, z, t)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x_s
                                    real(8), intent (in) :: x_m
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    real(8) :: tmp
                                    if (t <= 5.5d-234) then
                                        tmp = x_m / (y * (t - z))
                                    else if (t <= 2.45d-54) then
                                        tmp = (x_m / -z) / -z
                                    else
                                        tmp = x_m / ((y - z) * t)
                                    end if
                                    code = x_s * tmp
                                end function
                                
                                x\_m = Math.abs(x);
                                x\_s = Math.copySign(1.0, x);
                                assert x_m < y && y < z && z < t;
                                public static double code(double x_s, double x_m, double y, double z, double t) {
                                	double tmp;
                                	if (t <= 5.5e-234) {
                                		tmp = x_m / (y * (t - z));
                                	} else if (t <= 2.45e-54) {
                                		tmp = (x_m / -z) / -z;
                                	} else {
                                		tmp = x_m / ((y - z) * t);
                                	}
                                	return x_s * tmp;
                                }
                                
                                x\_m = math.fabs(x)
                                x\_s = math.copysign(1.0, x)
                                [x_m, y, z, t] = sort([x_m, y, z, t])
                                def code(x_s, x_m, y, z, t):
                                	tmp = 0
                                	if t <= 5.5e-234:
                                		tmp = x_m / (y * (t - z))
                                	elif t <= 2.45e-54:
                                		tmp = (x_m / -z) / -z
                                	else:
                                		tmp = x_m / ((y - z) * t)
                                	return x_s * tmp
                                
                                x\_m = abs(x)
                                x\_s = copysign(1.0, x)
                                x_m, y, z, t = sort([x_m, y, z, t])
                                function code(x_s, x_m, y, z, t)
                                	tmp = 0.0
                                	if (t <= 5.5e-234)
                                		tmp = Float64(x_m / Float64(y * Float64(t - z)));
                                	elseif (t <= 2.45e-54)
                                		tmp = Float64(Float64(x_m / Float64(-z)) / Float64(-z));
                                	else
                                		tmp = Float64(x_m / Float64(Float64(y - z) * t));
                                	end
                                	return Float64(x_s * tmp)
                                end
                                
                                x\_m = abs(x);
                                x\_s = sign(x) * abs(1.0);
                                x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                                function tmp_2 = code(x_s, x_m, y, z, t)
                                	tmp = 0.0;
                                	if (t <= 5.5e-234)
                                		tmp = x_m / (y * (t - z));
                                	elseif (t <= 2.45e-54)
                                		tmp = (x_m / -z) / -z;
                                	else
                                		tmp = x_m / ((y - z) * t);
                                	end
                                	tmp_2 = x_s * tmp;
                                end
                                
                                x\_m = N[Abs[x], $MachinePrecision]
                                x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 5.5e-234], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.45e-54], N[(N[(x$95$m / (-z)), $MachinePrecision] / (-z)), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                                
                                \begin{array}{l}
                                x\_m = \left|x\right|
                                \\
                                x\_s = \mathsf{copysign}\left(1, x\right)
                                \\
                                [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                                \\
                                x\_s \cdot \begin{array}{l}
                                \mathbf{if}\;t \leq 5.5 \cdot 10^{-234}:\\
                                \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
                                
                                \mathbf{elif}\;t \leq 2.45 \cdot 10^{-54}:\\
                                \;\;\;\;\frac{\frac{x\_m}{-z}}{-z}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot t}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if t < 5.5e-234

                                  1. Initial program 89.2%

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

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

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

                                    if 5.5e-234 < t < 2.4500000000000001e-54

                                    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{\frac{x}{-z}}{y - z} \]
                                    6. Applied rewrites76.2%

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

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

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

                                        \[\leadsto \frac{\frac{x}{-z}}{-z} \]
                                    9. Applied rewrites57.2%

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

                                    if 2.4500000000000001e-54 < t

                                    1. Initial program 88.6%

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

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

                                    Alternative 10: 72.2% accurate, 0.7× speedup?

                                    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{-z}}{-z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+20}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
                                    x\_m = (fabs.f64 x)
                                    x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                    NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                    (FPCore (x_s x_m y z t)
                                     :precision binary64
                                     (let* ((t_1 (/ (/ x_m (- z)) (- z))))
                                       (*
                                        x_s
                                        (if (<= z -5000000000.0)
                                          t_1
                                          (if (<= z 2.7e+20) (/ x_m (* y (- t z))) t_1)))))
                                    x\_m = fabs(x);
                                    x\_s = copysign(1.0, x);
                                    assert(x_m < y && y < z && z < t);
                                    double code(double x_s, double x_m, double y, double z, double t) {
                                    	double t_1 = (x_m / -z) / -z;
                                    	double tmp;
                                    	if (z <= -5000000000.0) {
                                    		tmp = t_1;
                                    	} else if (z <= 2.7e+20) {
                                    		tmp = x_m / (y * (t - z));
                                    	} else {
                                    		tmp = t_1;
                                    	}
                                    	return x_s * tmp;
                                    }
                                    
                                    x\_m =     private
                                    x\_s =     private
                                    NOTE: x_m, 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_s, x_m, y, z, t)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: x_s
                                        real(8), intent (in) :: x_m
                                        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_m / -z) / -z
                                        if (z <= (-5000000000.0d0)) then
                                            tmp = t_1
                                        else if (z <= 2.7d+20) then
                                            tmp = x_m / (y * (t - z))
                                        else
                                            tmp = t_1
                                        end if
                                        code = x_s * tmp
                                    end function
                                    
                                    x\_m = Math.abs(x);
                                    x\_s = Math.copySign(1.0, x);
                                    assert x_m < y && y < z && z < t;
                                    public static double code(double x_s, double x_m, double y, double z, double t) {
                                    	double t_1 = (x_m / -z) / -z;
                                    	double tmp;
                                    	if (z <= -5000000000.0) {
                                    		tmp = t_1;
                                    	} else if (z <= 2.7e+20) {
                                    		tmp = x_m / (y * (t - z));
                                    	} else {
                                    		tmp = t_1;
                                    	}
                                    	return x_s * tmp;
                                    }
                                    
                                    x\_m = math.fabs(x)
                                    x\_s = math.copysign(1.0, x)
                                    [x_m, y, z, t] = sort([x_m, y, z, t])
                                    def code(x_s, x_m, y, z, t):
                                    	t_1 = (x_m / -z) / -z
                                    	tmp = 0
                                    	if z <= -5000000000.0:
                                    		tmp = t_1
                                    	elif z <= 2.7e+20:
                                    		tmp = x_m / (y * (t - z))
                                    	else:
                                    		tmp = t_1
                                    	return x_s * tmp
                                    
                                    x\_m = abs(x)
                                    x\_s = copysign(1.0, x)
                                    x_m, y, z, t = sort([x_m, y, z, t])
                                    function code(x_s, x_m, y, z, t)
                                    	t_1 = Float64(Float64(x_m / Float64(-z)) / Float64(-z))
                                    	tmp = 0.0
                                    	if (z <= -5000000000.0)
                                    		tmp = t_1;
                                    	elseif (z <= 2.7e+20)
                                    		tmp = Float64(x_m / Float64(y * Float64(t - z)));
                                    	else
                                    		tmp = t_1;
                                    	end
                                    	return Float64(x_s * tmp)
                                    end
                                    
                                    x\_m = abs(x);
                                    x\_s = sign(x) * abs(1.0);
                                    x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                                    function tmp_2 = code(x_s, x_m, y, z, t)
                                    	t_1 = (x_m / -z) / -z;
                                    	tmp = 0.0;
                                    	if (z <= -5000000000.0)
                                    		tmp = t_1;
                                    	elseif (z <= 2.7e+20)
                                    		tmp = x_m / (y * (t - z));
                                    	else
                                    		tmp = t_1;
                                    	end
                                    	tmp_2 = x_s * tmp;
                                    end
                                    
                                    x\_m = N[Abs[x], $MachinePrecision]
                                    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                    NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                    code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / (-z)), $MachinePrecision] / (-z)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -5000000000.0], t$95$1, If[LessEqual[z, 2.7e+20], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    x\_m = \left|x\right|
                                    \\
                                    x\_s = \mathsf{copysign}\left(1, x\right)
                                    \\
                                    [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                                    \\
                                    \begin{array}{l}
                                    t_1 := \frac{\frac{x\_m}{-z}}{-z}\\
                                    x\_s \cdot \begin{array}{l}
                                    \mathbf{if}\;z \leq -5000000000:\\
                                    \;\;\;\;t\_1\\
                                    
                                    \mathbf{elif}\;z \leq 2.7 \cdot 10^{+20}:\\
                                    \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_1\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if z < -5e9 or 2.7e20 < z

                                      1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\frac{x}{-z}}{y - z} \]
                                      6. Applied rewrites86.9%

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

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

                                          \[\leadsto \frac{\frac{x}{-z}}{\mathsf{neg}\left(z\right)} \]
                                        2. lift-neg.f6475.9

                                          \[\leadsto \frac{\frac{x}{-z}}{-z} \]
                                      9. Applied rewrites75.9%

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

                                      if -5e9 < z < 2.7e20

                                      1. Initial program 94.1%

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

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

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

                                      Alternative 11: 67.1% accurate, 0.7× speedup?

                                      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{-z}}{-z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2300000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
                                      x\_m = (fabs.f64 x)
                                      x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                      NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                      (FPCore (x_s x_m y z t)
                                       :precision binary64
                                       (let* ((t_1 (/ (/ x_m (- z)) (- z))))
                                         (*
                                          x_s
                                          (if (<= z -2300000.0) t_1 (if (<= z 1.75e+20) (/ (/ x_m y) t) t_1)))))
                                      x\_m = fabs(x);
                                      x\_s = copysign(1.0, x);
                                      assert(x_m < y && y < z && z < t);
                                      double code(double x_s, double x_m, double y, double z, double t) {
                                      	double t_1 = (x_m / -z) / -z;
                                      	double tmp;
                                      	if (z <= -2300000.0) {
                                      		tmp = t_1;
                                      	} else if (z <= 1.75e+20) {
                                      		tmp = (x_m / y) / t;
                                      	} else {
                                      		tmp = t_1;
                                      	}
                                      	return x_s * tmp;
                                      }
                                      
                                      x\_m =     private
                                      x\_s =     private
                                      NOTE: x_m, 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_s, x_m, y, z, t)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: x_s
                                          real(8), intent (in) :: x_m
                                          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_m / -z) / -z
                                          if (z <= (-2300000.0d0)) then
                                              tmp = t_1
                                          else if (z <= 1.75d+20) then
                                              tmp = (x_m / y) / t
                                          else
                                              tmp = t_1
                                          end if
                                          code = x_s * tmp
                                      end function
                                      
                                      x\_m = Math.abs(x);
                                      x\_s = Math.copySign(1.0, x);
                                      assert x_m < y && y < z && z < t;
                                      public static double code(double x_s, double x_m, double y, double z, double t) {
                                      	double t_1 = (x_m / -z) / -z;
                                      	double tmp;
                                      	if (z <= -2300000.0) {
                                      		tmp = t_1;
                                      	} else if (z <= 1.75e+20) {
                                      		tmp = (x_m / y) / t;
                                      	} else {
                                      		tmp = t_1;
                                      	}
                                      	return x_s * tmp;
                                      }
                                      
                                      x\_m = math.fabs(x)
                                      x\_s = math.copysign(1.0, x)
                                      [x_m, y, z, t] = sort([x_m, y, z, t])
                                      def code(x_s, x_m, y, z, t):
                                      	t_1 = (x_m / -z) / -z
                                      	tmp = 0
                                      	if z <= -2300000.0:
                                      		tmp = t_1
                                      	elif z <= 1.75e+20:
                                      		tmp = (x_m / y) / t
                                      	else:
                                      		tmp = t_1
                                      	return x_s * tmp
                                      
                                      x\_m = abs(x)
                                      x\_s = copysign(1.0, x)
                                      x_m, y, z, t = sort([x_m, y, z, t])
                                      function code(x_s, x_m, y, z, t)
                                      	t_1 = Float64(Float64(x_m / Float64(-z)) / Float64(-z))
                                      	tmp = 0.0
                                      	if (z <= -2300000.0)
                                      		tmp = t_1;
                                      	elseif (z <= 1.75e+20)
                                      		tmp = Float64(Float64(x_m / y) / t);
                                      	else
                                      		tmp = t_1;
                                      	end
                                      	return Float64(x_s * tmp)
                                      end
                                      
                                      x\_m = abs(x);
                                      x\_s = sign(x) * abs(1.0);
                                      x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                                      function tmp_2 = code(x_s, x_m, y, z, t)
                                      	t_1 = (x_m / -z) / -z;
                                      	tmp = 0.0;
                                      	if (z <= -2300000.0)
                                      		tmp = t_1;
                                      	elseif (z <= 1.75e+20)
                                      		tmp = (x_m / y) / t;
                                      	else
                                      		tmp = t_1;
                                      	end
                                      	tmp_2 = x_s * tmp;
                                      end
                                      
                                      x\_m = N[Abs[x], $MachinePrecision]
                                      x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                      NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                      code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / (-z)), $MachinePrecision] / (-z)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -2300000.0], t$95$1, If[LessEqual[z, 1.75e+20], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], t$95$1]]), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      x\_m = \left|x\right|
                                      \\
                                      x\_s = \mathsf{copysign}\left(1, x\right)
                                      \\
                                      [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                                      \\
                                      \begin{array}{l}
                                      t_1 := \frac{\frac{x\_m}{-z}}{-z}\\
                                      x\_s \cdot \begin{array}{l}
                                      \mathbf{if}\;z \leq -2300000:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{elif}\;z \leq 1.75 \cdot 10^{+20}:\\
                                      \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if z < -2.3e6 or 1.75e20 < z

                                        1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\frac{x}{-z}}{\mathsf{neg}\left(z\right)} \]
                                          2. lift-neg.f6475.6

                                            \[\leadsto \frac{\frac{x}{-z}}{-z} \]
                                        9. Applied rewrites75.6%

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

                                        if -2.3e6 < z < 1.75e20

                                        1. Initial program 94.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 rewrites71.3%

                                            \[\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. lift--.f64N/A

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

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

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

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

                                              \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t} \]
                                          3. Applied rewrites73.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-/.f6459.3

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

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

                                        Alternative 12: 63.3% accurate, 0.8× speedup?

                                        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{z \cdot z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
                                        x\_m = (fabs.f64 x)
                                        x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                        NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                        (FPCore (x_s x_m y z t)
                                         :precision binary64
                                         (let* ((t_1 (/ x_m (* z z))))
                                           (* x_s (if (<= z -5e-20) t_1 (if (<= z 1.75e+20) (/ (/ x_m y) t) t_1)))))
                                        x\_m = fabs(x);
                                        x\_s = copysign(1.0, x);
                                        assert(x_m < y && y < z && z < t);
                                        double code(double x_s, double x_m, double y, double z, double t) {
                                        	double t_1 = x_m / (z * z);
                                        	double tmp;
                                        	if (z <= -5e-20) {
                                        		tmp = t_1;
                                        	} else if (z <= 1.75e+20) {
                                        		tmp = (x_m / y) / t;
                                        	} else {
                                        		tmp = t_1;
                                        	}
                                        	return x_s * tmp;
                                        }
                                        
                                        x\_m =     private
                                        x\_s =     private
                                        NOTE: x_m, 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_s, x_m, y, z, t)
                                        use fmin_fmax_functions
                                            real(8), intent (in) :: x_s
                                            real(8), intent (in) :: x_m
                                            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_m / (z * z)
                                            if (z <= (-5d-20)) then
                                                tmp = t_1
                                            else if (z <= 1.75d+20) then
                                                tmp = (x_m / y) / t
                                            else
                                                tmp = t_1
                                            end if
                                            code = x_s * tmp
                                        end function
                                        
                                        x\_m = Math.abs(x);
                                        x\_s = Math.copySign(1.0, x);
                                        assert x_m < y && y < z && z < t;
                                        public static double code(double x_s, double x_m, double y, double z, double t) {
                                        	double t_1 = x_m / (z * z);
                                        	double tmp;
                                        	if (z <= -5e-20) {
                                        		tmp = t_1;
                                        	} else if (z <= 1.75e+20) {
                                        		tmp = (x_m / y) / t;
                                        	} else {
                                        		tmp = t_1;
                                        	}
                                        	return x_s * tmp;
                                        }
                                        
                                        x\_m = math.fabs(x)
                                        x\_s = math.copysign(1.0, x)
                                        [x_m, y, z, t] = sort([x_m, y, z, t])
                                        def code(x_s, x_m, y, z, t):
                                        	t_1 = x_m / (z * z)
                                        	tmp = 0
                                        	if z <= -5e-20:
                                        		tmp = t_1
                                        	elif z <= 1.75e+20:
                                        		tmp = (x_m / y) / t
                                        	else:
                                        		tmp = t_1
                                        	return x_s * tmp
                                        
                                        x\_m = abs(x)
                                        x\_s = copysign(1.0, x)
                                        x_m, y, z, t = sort([x_m, y, z, t])
                                        function code(x_s, x_m, y, z, t)
                                        	t_1 = Float64(x_m / Float64(z * z))
                                        	tmp = 0.0
                                        	if (z <= -5e-20)
                                        		tmp = t_1;
                                        	elseif (z <= 1.75e+20)
                                        		tmp = Float64(Float64(x_m / y) / t);
                                        	else
                                        		tmp = t_1;
                                        	end
                                        	return Float64(x_s * tmp)
                                        end
                                        
                                        x\_m = abs(x);
                                        x\_s = sign(x) * abs(1.0);
                                        x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                                        function tmp_2 = code(x_s, x_m, y, z, t)
                                        	t_1 = x_m / (z * z);
                                        	tmp = 0.0;
                                        	if (z <= -5e-20)
                                        		tmp = t_1;
                                        	elseif (z <= 1.75e+20)
                                        		tmp = (x_m / y) / t;
                                        	else
                                        		tmp = t_1;
                                        	end
                                        	tmp_2 = x_s * tmp;
                                        end
                                        
                                        x\_m = N[Abs[x], $MachinePrecision]
                                        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                        NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                        code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -5e-20], t$95$1, If[LessEqual[z, 1.75e+20], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], t$95$1]]), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        x\_m = \left|x\right|
                                        \\
                                        x\_s = \mathsf{copysign}\left(1, x\right)
                                        \\
                                        [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                                        \\
                                        \begin{array}{l}
                                        t_1 := \frac{x\_m}{z \cdot z}\\
                                        x\_s \cdot \begin{array}{l}
                                        \mathbf{if}\;z \leq -5 \cdot 10^{-20}:\\
                                        \;\;\;\;t\_1\\
                                        
                                        \mathbf{elif}\;z \leq 1.75 \cdot 10^{+20}:\\
                                        \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;t\_1\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if z < -4.9999999999999999e-20 or 1.75e20 < z

                                          1. Initial program 84.2%

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

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

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

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

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

                                          if -4.9999999999999999e-20 < z < 1.75e20

                                          1. Initial program 94.0%

                                            \[\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 rewrites72.3%

                                              \[\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. lift--.f64N/A

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

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

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

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

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

                                              \[\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-/.f6460.2

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

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

                                          Alternative 13: 61.8% accurate, 0.8× speedup?

                                          \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{z \cdot z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{-20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{+19}:\\ \;\;\;\;\frac{x\_m}{t \cdot y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
                                          x\_m = (fabs.f64 x)
                                          x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                          NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                          (FPCore (x_s x_m y z t)
                                           :precision binary64
                                           (let* ((t_1 (/ x_m (* z z))))
                                             (* x_s (if (<= z -4.8e-20) t_1 (if (<= z 5.4e+19) (/ x_m (* t y)) t_1)))))
                                          x\_m = fabs(x);
                                          x\_s = copysign(1.0, x);
                                          assert(x_m < y && y < z && z < t);
                                          double code(double x_s, double x_m, double y, double z, double t) {
                                          	double t_1 = x_m / (z * z);
                                          	double tmp;
                                          	if (z <= -4.8e-20) {
                                          		tmp = t_1;
                                          	} else if (z <= 5.4e+19) {
                                          		tmp = x_m / (t * y);
                                          	} else {
                                          		tmp = t_1;
                                          	}
                                          	return x_s * tmp;
                                          }
                                          
                                          x\_m =     private
                                          x\_s =     private
                                          NOTE: x_m, 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_s, x_m, y, z, t)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: x_s
                                              real(8), intent (in) :: x_m
                                              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_m / (z * z)
                                              if (z <= (-4.8d-20)) then
                                                  tmp = t_1
                                              else if (z <= 5.4d+19) then
                                                  tmp = x_m / (t * y)
                                              else
                                                  tmp = t_1
                                              end if
                                              code = x_s * tmp
                                          end function
                                          
                                          x\_m = Math.abs(x);
                                          x\_s = Math.copySign(1.0, x);
                                          assert x_m < y && y < z && z < t;
                                          public static double code(double x_s, double x_m, double y, double z, double t) {
                                          	double t_1 = x_m / (z * z);
                                          	double tmp;
                                          	if (z <= -4.8e-20) {
                                          		tmp = t_1;
                                          	} else if (z <= 5.4e+19) {
                                          		tmp = x_m / (t * y);
                                          	} else {
                                          		tmp = t_1;
                                          	}
                                          	return x_s * tmp;
                                          }
                                          
                                          x\_m = math.fabs(x)
                                          x\_s = math.copysign(1.0, x)
                                          [x_m, y, z, t] = sort([x_m, y, z, t])
                                          def code(x_s, x_m, y, z, t):
                                          	t_1 = x_m / (z * z)
                                          	tmp = 0
                                          	if z <= -4.8e-20:
                                          		tmp = t_1
                                          	elif z <= 5.4e+19:
                                          		tmp = x_m / (t * y)
                                          	else:
                                          		tmp = t_1
                                          	return x_s * tmp
                                          
                                          x\_m = abs(x)
                                          x\_s = copysign(1.0, x)
                                          x_m, y, z, t = sort([x_m, y, z, t])
                                          function code(x_s, x_m, y, z, t)
                                          	t_1 = Float64(x_m / Float64(z * z))
                                          	tmp = 0.0
                                          	if (z <= -4.8e-20)
                                          		tmp = t_1;
                                          	elseif (z <= 5.4e+19)
                                          		tmp = Float64(x_m / Float64(t * y));
                                          	else
                                          		tmp = t_1;
                                          	end
                                          	return Float64(x_s * tmp)
                                          end
                                          
                                          x\_m = abs(x);
                                          x\_s = sign(x) * abs(1.0);
                                          x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                                          function tmp_2 = code(x_s, x_m, y, z, t)
                                          	t_1 = x_m / (z * z);
                                          	tmp = 0.0;
                                          	if (z <= -4.8e-20)
                                          		tmp = t_1;
                                          	elseif (z <= 5.4e+19)
                                          		tmp = x_m / (t * y);
                                          	else
                                          		tmp = t_1;
                                          	end
                                          	tmp_2 = x_s * tmp;
                                          end
                                          
                                          x\_m = N[Abs[x], $MachinePrecision]
                                          x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                          NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                          code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -4.8e-20], t$95$1, If[LessEqual[z, 5.4e+19], N[(x$95$m / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          x\_m = \left|x\right|
                                          \\
                                          x\_s = \mathsf{copysign}\left(1, x\right)
                                          \\
                                          [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                                          \\
                                          \begin{array}{l}
                                          t_1 := \frac{x\_m}{z \cdot z}\\
                                          x\_s \cdot \begin{array}{l}
                                          \mathbf{if}\;z \leq -4.8 \cdot 10^{-20}:\\
                                          \;\;\;\;t\_1\\
                                          
                                          \mathbf{elif}\;z \leq 5.4 \cdot 10^{+19}:\\
                                          \;\;\;\;\frac{x\_m}{t \cdot y}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;t\_1\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if z < -4.79999999999999986e-20 or 5.4e19 < z

                                            1. Initial program 84.2%

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

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

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

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

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

                                            if -4.79999999999999986e-20 < z < 5.4e19

                                            1. Initial program 94.0%

                                              \[\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-*.f6457.2

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

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

                                          Alternative 14: 39.4% accurate, 1.7× speedup?

                                          \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \frac{x\_m}{t \cdot y} \end{array} \]
                                          x\_m = (fabs.f64 x)
                                          x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                          NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                          (FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* t y))))
                                          x\_m = fabs(x);
                                          x\_s = copysign(1.0, x);
                                          assert(x_m < y && y < z && z < t);
                                          double code(double x_s, double x_m, double y, double z, double t) {
                                          	return x_s * (x_m / (t * y));
                                          }
                                          
                                          x\_m =     private
                                          x\_s =     private
                                          NOTE: x_m, 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_s, x_m, y, z, t)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: x_s
                                              real(8), intent (in) :: x_m
                                              real(8), intent (in) :: y
                                              real(8), intent (in) :: z
                                              real(8), intent (in) :: t
                                              code = x_s * (x_m / (t * y))
                                          end function
                                          
                                          x\_m = Math.abs(x);
                                          x\_s = Math.copySign(1.0, x);
                                          assert x_m < y && y < z && z < t;
                                          public static double code(double x_s, double x_m, double y, double z, double t) {
                                          	return x_s * (x_m / (t * y));
                                          }
                                          
                                          x\_m = math.fabs(x)
                                          x\_s = math.copysign(1.0, x)
                                          [x_m, y, z, t] = sort([x_m, y, z, t])
                                          def code(x_s, x_m, y, z, t):
                                          	return x_s * (x_m / (t * y))
                                          
                                          x\_m = abs(x)
                                          x\_s = copysign(1.0, x)
                                          x_m, y, z, t = sort([x_m, y, z, t])
                                          function code(x_s, x_m, y, z, t)
                                          	return Float64(x_s * Float64(x_m / Float64(t * y)))
                                          end
                                          
                                          x\_m = abs(x);
                                          x\_s = sign(x) * abs(1.0);
                                          x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
                                          function tmp = code(x_s, x_m, y, z, t)
                                          	tmp = x_s * (x_m / (t * y));
                                          end
                                          
                                          x\_m = N[Abs[x], $MachinePrecision]
                                          x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                          NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
                                          code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                          
                                          \begin{array}{l}
                                          x\_m = \left|x\right|
                                          \\
                                          x\_s = \mathsf{copysign}\left(1, x\right)
                                          \\
                                          [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
                                          \\
                                          x\_s \cdot \frac{x\_m}{t \cdot y}
                                          \end{array}
                                          
                                          Derivation
                                          1. Initial program 89.2%

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

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

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

                                          Reproduce

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