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

Percentage Accurate: 88.9% → 96.7%
Time: 7.4s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 88.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 96.7% accurate, 1.0× speedup?

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

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

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

Alternative 2: 91.0% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 8.20000000000000029e177

    1. Initial program 90.4%

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

    if 8.20000000000000029e177 < t

    1. Initial program 82.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--.f6495.4

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

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

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

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

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

Alternative 3: 81.6% accurate, 0.7× speedup?

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

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1.35d-6)) then
        tmp = (x / y) / (t - z)
    else if (t <= 2.3d-19) then
        tmp = (x / (y - z)) / -z
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.35e-6) {
		tmp = (x / y) / (t - z);
	} else if (t <= 2.3e-19) {
		tmp = (x / (y - z)) / -z;
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -1.35e-6:
		tmp = (x / y) / (t - z)
	elif t <= 2.3e-19:
		tmp = (x / (y - z)) / -z
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1.35e-6)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (t <= 2.3e-19)
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(-z));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -1.35e-6)
		tmp = (x / y) / (t - z);
	elseif (t <= 2.3e-19)
		tmp = (x / (y - z)) / -z;
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, -1.35e-6], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e-19], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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


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

    1. Initial program 79.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. associate-/r*N/A

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

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

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

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

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

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

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

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

      if -1.34999999999999999e-6 < t < 2.2999999999999998e-19

      1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.2999999999999998e-19 < t

      1. Initial program 87.3%

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

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

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

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

          \[\leadsto \frac{x}{\left(y - z\right) \cdot \color{blue}{\left(t - z\right)}} \]
        5. *-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.5

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

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

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

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

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

    Alternative 4: 78.6% accurate, 0.7× speedup?

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

      1. Initial program 80.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. associate-/r*N/A

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

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

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

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

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

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

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

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

        if -1.20000000000000002e-16 < t < 2.2999999999999998e-19

        1. Initial program 91.6%

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

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

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

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

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

        if 2.2999999999999998e-19 < t

        1. Initial program 87.3%

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

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

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

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

            \[\leadsto \frac{x}{\left(y - z\right) \cdot \color{blue}{\left(t - z\right)}} \]
          5. *-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.5

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

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

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

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

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

      Alternative 5: 78.5% accurate, 0.7× speedup?

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

        1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{x}{\color{blue}{t - z}}}{y - z} \]
          10. lift--.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 y around inf

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

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

          if -1.25e18 < y < 7.99999999999999968e-23

          1. Initial program 91.2%

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

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

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

          if 7.99999999999999968e-23 < y

          1. Initial program 83.3%

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

              \[\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--.f6492.0

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

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

          Alternative 6: 73.3% accurate, 0.7× speedup?

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

            1. Initial program 87.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. associate-/r*N/A

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

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

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

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

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

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

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

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

              if -3.79999999999999989e-164 < t < 1.10000000000000004e-61

              1. Initial program 90.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--.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{\color{blue}{\frac{x}{t}}}{y - z} \]
              5. Step-by-step derivation
                1. lower-/.f6426.5

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

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

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

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

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

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

                \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{-z} \]
              11. Step-by-step derivation
                1. associate-*r/N/A

                  \[\leadsto \frac{\frac{-1 \cdot x}{\color{blue}{z}}}{-z} \]
                2. lower-/.f64N/A

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

                  \[\leadsto \frac{\frac{\mathsf{neg}\left(x\right)}{z}}{-z} \]
                4. lower-neg.f6457.8

                  \[\leadsto \frac{\frac{-x}{z}}{-z} \]
              12. Applied rewrites57.8%

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

              if 1.10000000000000004e-61 < t

              1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 7: 72.8% accurate, 0.7× speedup?

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

              1. Initial program 87.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 rewrites78.2%

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

                if -6.09999999999999999e-170 < t < 1.10000000000000004e-61

                1. Initial program 90.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--.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{\color{blue}{\frac{x}{t}}}{y - z} \]
                5. Step-by-step derivation
                  1. lower-/.f6426.4

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{-z} \]
                11. Step-by-step derivation
                  1. associate-*r/N/A

                    \[\leadsto \frac{\frac{-1 \cdot x}{\color{blue}{z}}}{-z} \]
                  2. lower-/.f64N/A

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

                    \[\leadsto \frac{\frac{\mathsf{neg}\left(x\right)}{z}}{-z} \]
                  4. lower-neg.f6457.8

                    \[\leadsto \frac{\frac{-x}{z}}{-z} \]
                12. Applied rewrites57.8%

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

                if 1.10000000000000004e-61 < t

                1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 8: 72.5% accurate, 0.7× speedup?

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

                1. Initial program 82.3%

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

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

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

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

                    \[\leadsto \frac{x}{\left(y - z\right) \cdot \color{blue}{\left(t - z\right)}} \]
                  5. *-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 0

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

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{-z} \]
                11. Step-by-step derivation
                  1. associate-*r/N/A

                    \[\leadsto \frac{\frac{-1 \cdot x}{\color{blue}{z}}}{-z} \]
                  2. lower-/.f64N/A

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

                    \[\leadsto \frac{\frac{\mathsf{neg}\left(x\right)}{z}}{-z} \]
                  4. lower-neg.f6482.7

                    \[\leadsto \frac{\frac{-x}{z}}{-z} \]
                12. Applied rewrites82.7%

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

                if -9.00000000000000073e100 < z < 1.6500000000000001e35

                1. Initial program 93.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 rewrites66.7%

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

                Alternative 9: 69.7% accurate, 0.6× speedup?

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

                  1. Initial program 87.7%

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

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

                    if -6.5000000000000001e-14 < y < -3.99999999999999979e-283

                    1. Initial program 90.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--.f6497.2

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{-z} \]
                    11. Step-by-step derivation
                      1. associate-*r/N/A

                        \[\leadsto \frac{\frac{-1 \cdot x}{\color{blue}{z}}}{-z} \]
                      2. lower-/.f64N/A

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

                        \[\leadsto \frac{\frac{\mathsf{neg}\left(x\right)}{z}}{-z} \]
                      4. lower-neg.f6458.5

                        \[\leadsto \frac{\frac{-x}{z}}{-z} \]
                    12. Applied rewrites58.5%

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

                    if -3.99999999999999979e-283 < y < 9.7999999999999996e-33

                    1. Initial program 91.2%

                      \[\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 rewrites68.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--.f6468.8

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

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

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

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

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

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

                      if 9.7999999999999996e-33 < y

                      1. Initial program 83.4%

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

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

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

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

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

                        Alternative 10: 67.3% accurate, 0.7× speedup?

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

                          1. Initial program 83.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--.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 0

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

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

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

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

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

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

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

                            \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{-z} \]
                          11. Step-by-step derivation
                            1. associate-*r/N/A

                              \[\leadsto \frac{\frac{-1 \cdot x}{\color{blue}{z}}}{-z} \]
                            2. lower-/.f64N/A

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

                              \[\leadsto \frac{\frac{\mathsf{neg}\left(x\right)}{z}}{-z} \]
                            4. lower-neg.f6476.1

                              \[\leadsto \frac{\frac{-x}{z}}{-z} \]
                          12. Applied rewrites76.1%

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

                          if -1.1500000000000001e22 < z < 2.99999999999999995e24

                          1. Initial program 93.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--.f6494.0

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

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

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

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

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

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

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

                          Alternative 11: 64.0% accurate, 0.8× speedup?

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

                            1. Initial program 83.6%

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

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

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

                            if -1.1500000000000001e22 < z < 2.99999999999999995e24

                            1. Initial program 93.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--.f6494.0

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

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

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

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

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

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

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

                            Alternative 12: 62.4% accurate, 0.8× speedup?

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

                              1. Initial program 83.9%

                                \[\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-*.f6468.0

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

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

                              if -8e5 < z < 2.99999999999999995e24

                              1. Initial program 93.4%

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

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

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

                            Alternative 13: 39.6% accurate, 1.7× speedup?

                            \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{t \cdot y} \end{array} \]
                            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                            (FPCore (x y z t) :precision binary64 (/ x (* t y)))
                            assert(x < y && y < z && z < t);
                            double code(double x, double y, double z, double t) {
                            	return x / (t * y);
                            }
                            
                            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z, t)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                code = x / (t * y)
                            end function
                            
                            assert x < y && y < z && z < t;
                            public static double code(double x, double y, double z, double t) {
                            	return x / (t * y);
                            }
                            
                            [x, y, z, t] = sort([x, y, z, t])
                            def code(x, y, z, t):
                            	return x / (t * y)
                            
                            x, y, z, t = sort([x, y, z, t])
                            function code(x, y, z, t)
                            	return Float64(x / Float64(t * y))
                            end
                            
                            x, y, z, t = num2cell(sort([x, y, z, t])){:}
                            function tmp = code(x, y, z, t)
                            	tmp = x / (t * y);
                            end
                            
                            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                            code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
                            \\
                            \frac{x}{t \cdot y}
                            \end{array}
                            
                            Derivation
                            1. Initial program 88.9%

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

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

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

                            Reproduce

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