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

Percentage Accurate: 88.5% → 97.0%
Time: 6.3s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 88.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 97.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999982e-21 < t

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 96.8% 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.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.8% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+272}:\\
\;\;\;\;\frac{x}{t\_1}\\

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


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

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e291 < (*.f64 (-.f64 y z) (-.f64 t z)) < 2.0000000000000001e272

    1. Initial program 88.5%

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

    if 2.0000000000000001e272 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{t - z}}{-z} \]
    6. Applied rewrites60.3%

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

Alternative 4: 83.1% accurate, 0.6× speedup?

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

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

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

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

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

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


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

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.70000000000000016e180 < y < -8.50000000000000037e-11

    1. Initial program 88.5%

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

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

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

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

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

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

    if -8.50000000000000037e-11 < y < 1.95000000000000013e-76

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{t - z}}{-z} \]
    6. Applied rewrites60.3%

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

    if 1.95000000000000013e-76 < y

    1. Initial program 88.5%

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

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

    Alternative 5: 79.9% accurate, 0.7× speedup?

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

      1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.45000000000000016e-139 < t < 4.0999999999999999e-69

      1. Initial program 88.5%

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

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

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

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

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

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

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

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

      if 4.0999999999999999e-69 < t

      1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.8999999999999998e-238 < t < 2.15e-69

        1. Initial program 88.5%

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

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

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

        if 2.15e-69 < t

        1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.8999999999999998e-238 < t < 2.15e-69

          1. Initial program 88.5%

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

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

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

          if 2.15e-69 < t

          1. Initial program 88.5%

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

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

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

            1. Initial program 88.5%

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

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

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

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

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

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

            if 1.2e-237 < t < 2.15e-69

            1. Initial program 88.5%

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

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

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

            if 2.15e-69 < t

            1. Initial program 88.5%

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

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

            Alternative 9: 69.1% accurate, 0.7× speedup?

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

              1. Initial program 88.5%

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

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

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

              if -720 < z < 7.2e52

              1. Initial program 88.5%

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

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

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

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

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

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

            Alternative 10: 61.8% 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 -340:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 13500:\\ \;\;\;\;\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 -340.0) t_1 (if (<= z 13500.0) (/ 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 <= -340.0) {
            		tmp = t_1;
            	} else if (z <= 13500.0) {
            		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 <= (-340.0d0)) then
                    tmp = t_1
                else if (z <= 13500.0d0) 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 <= -340.0) {
            		tmp = t_1;
            	} else if (z <= 13500.0) {
            		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 <= -340.0:
            		tmp = t_1
            	elif z <= 13500.0:
            		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 <= -340.0)
            		tmp = t_1;
            	elseif (z <= 13500.0)
            		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 <= -340.0)
            		tmp = t_1;
            	elseif (z <= 13500.0)
            		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, -340.0], t$95$1, If[LessEqual[z, 13500.0], 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 -340:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;z \leq 13500:\\
            \;\;\;\;\frac{x}{t \cdot y}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -340 or 13500 < z

              1. Initial program 88.5%

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

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

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

              if -340 < z < 13500

              1. Initial program 88.5%

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

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

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

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

            Alternative 11: 39.7% 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.5%

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

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

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

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

            Reproduce

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