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

Percentage Accurate: 88.6% → 97.1%
Time: 5.2s
Alternatives: 10
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}

Sampling outcomes in binary64 precision:

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 10 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.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 97.1% accurate, 0.8× 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 87.9%

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Add Preprocessing
  3. Applied rewrites97.7%

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

Alternative 2: 75.9% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1000000 \lor \neg \left(y \leq 3.2 \cdot 10^{-87}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(z - t\right) \cdot 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 (or (<= y -1000000.0) (not (<= y 3.2e-87)))
   (/ x (* y (- t z)))
   (/ x (* (- z t) z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1000000.0) || !(y <= 3.2e-87)) {
		tmp = x / (y * (t - z));
	} else {
		tmp = x / ((z - t) * z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e6 or 3.19999999999999979e-87 < y

    1. Initial program 86.6%

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

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

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

      if -1e6 < y < 3.19999999999999979e-87

      1. Initial program 89.4%

        \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. Add Preprocessing
      3. Applied rewrites88.4%

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

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

          \[\leadsto \frac{x}{\color{blue}{\left(z - t\right) \cdot z}} \]
      6. Recombined 2 regimes into one program.
      7. Final simplification79.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1000000 \lor \neg \left(y \leq 3.2 \cdot 10^{-87}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(z - t\right) \cdot z}\\ \end{array} \]
      8. Add Preprocessing

      Alternative 3: 68.2% accurate, 0.7× speedup?

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

        1. Initial program 85.6%

          \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
        2. Add Preprocessing
        3. Applied rewrites85.6%

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

          \[\leadsto \frac{x}{\color{blue}{-1 \cdot \left(y \cdot z\right) + {z}^{2}}} \]
        5. Step-by-step derivation
          1. Applied rewrites71.9%

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

          if -7.1999999999999999e-73 < z < 9.0000000000000002e-97

          1. Initial program 91.8%

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

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

              \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
          5. Recombined 2 regimes into one program.
          6. Final simplification70.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-73} \lor \neg \left(z \leq 9 \cdot 10^{-97}\right):\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]
          7. Add Preprocessing

          Alternative 4: 76.8% accurate, 0.7× speedup?

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

            1. Initial program 83.1%

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

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

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

              if -1e6 < y < 6.3999999999999999e-230

              1. Initial program 91.0%

                \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
              2. Add Preprocessing
              3. Applied rewrites89.9%

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

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

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

                if 6.3999999999999999e-230 < y

                1. Initial program 87.4%

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

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

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

                Alternative 5: 68.8% accurate, 0.7× speedup?

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

                  1. Initial program 83.2%

                    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
                  2. Add Preprocessing
                  3. Applied rewrites83.2%

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

                    \[\leadsto \frac{x}{\color{blue}{-1 \cdot \left(y \cdot z\right) + {z}^{2}}} \]
                  5. Step-by-step derivation
                    1. Applied rewrites65.2%

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

                    if -7.1999999999999999e-73 < z < 1.59999999999999991e-105

                    1. Initial program 91.6%

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

                      \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
                    4. Step-by-step derivation
                      1. Applied rewrites69.9%

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

                      if 1.59999999999999991e-105 < z

                      1. Initial program 87.5%

                        \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
                      2. Add Preprocessing
                      3. Applied rewrites87.5%

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

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

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

                      Alternative 6: 90.5% accurate, 0.7× speedup?

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

                        1. Initial program 89.5%

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

                        if 2.30000000000000002e142 < t

                        1. Initial program 76.7%

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

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

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

                        Alternative 7: 90.8% accurate, 0.7× speedup?

                        \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+167}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array} \end{array} \]
                        NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                        (FPCore (x y z t)
                         :precision binary64
                         (if (<= y -9.5e+167) (/ (/ x (- t z)) y) (/ 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 (y <= -9.5e+167) {
                        		tmp = (x / (t - z)) / y;
                        	} 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 (y <= (-9.5d+167)) then
                                tmp = (x / (t - z)) / y
                            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 (y <= -9.5e+167) {
                        		tmp = (x / (t - z)) / y;
                        	} 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 y <= -9.5e+167:
                        		tmp = (x / (t - z)) / y
                        	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 (y <= -9.5e+167)
                        		tmp = Float64(Float64(x / Float64(t - z)) / y);
                        	else
                        		tmp = Float64(x / Float64(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 (y <= -9.5e+167)
                        		tmp = (x / (t - z)) / y;
                        	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[y, -9.5e+167], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;y \leq -9.5 \cdot 10^{+167}:\\
                        \;\;\;\;\frac{\frac{x}{t - z}}{y}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if y < -9.5000000000000006e167

                          1. Initial program 81.2%

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

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

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

                            if -9.5000000000000006e167 < y

                            1. Initial program 88.7%

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

                          Alternative 8: 60.6% accurate, 0.8× speedup?

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

                            1. Initial program 85.7%

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

                              \[\leadsto \frac{x}{\color{blue}{{z}^{2}}} \]
                            4. Step-by-step derivation
                              1. Applied rewrites70.8%

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

                              if -4.9000000000000003e60 < z < 1.2600000000000001e-51

                              1. Initial program 90.1%

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

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

                                  \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
                              5. Recombined 2 regimes into one program.
                              6. Final simplification65.1%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.9 \cdot 10^{+60} \lor \neg \left(z \leq 1.26 \cdot 10^{-51}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 9: 88.6% accurate, 1.0× speedup?

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

                                \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
                              2. Add Preprocessing
                              3. Add Preprocessing

                              Alternative 10: 39.4% accurate, 1.4× 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 87.9%

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

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

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

                                Developer Target 1: 87.6% accurate, 0.4× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;\frac{x}{t\_1} < 0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{t\_1}\\ \end{array} \end{array} \]
                                (FPCore (x y z t)
                                 :precision binary64
                                 (let* ((t_1 (* (- y z) (- t z))))
                                   (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
                                double code(double x, double y, double z, double t) {
                                	double t_1 = (y - z) * (t - z);
                                	double tmp;
                                	if ((x / t_1) < 0.0) {
                                		tmp = (x / (y - z)) / (t - z);
                                	} else {
                                		tmp = x * (1.0 / t_1);
                                	}
                                	return tmp;
                                }
                                
                                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 ((x / t_1) < 0.0d0) then
                                        tmp = (x / (y - z)) / (t - z)
                                    else
                                        tmp = x * (1.0d0 / t_1)
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double y, double z, double t) {
                                	double t_1 = (y - z) * (t - z);
                                	double tmp;
                                	if ((x / t_1) < 0.0) {
                                		tmp = (x / (y - z)) / (t - z);
                                	} else {
                                		tmp = x * (1.0 / t_1);
                                	}
                                	return tmp;
                                }
                                
                                def code(x, y, z, t):
                                	t_1 = (y - z) * (t - z)
                                	tmp = 0
                                	if (x / t_1) < 0.0:
                                		tmp = (x / (y - z)) / (t - z)
                                	else:
                                		tmp = x * (1.0 / t_1)
                                	return tmp
                                
                                function code(x, y, z, t)
                                	t_1 = Float64(Float64(y - z) * Float64(t - z))
                                	tmp = 0.0
                                	if (Float64(x / t_1) < 0.0)
                                		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
                                	else
                                		tmp = Float64(x * Float64(1.0 / t_1));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, y, z, t)
                                	t_1 = (y - z) * (t - z);
                                	tmp = 0.0;
                                	if ((x / t_1) < 0.0)
                                		tmp = (x / (y - z)) / (t - z);
                                	else
                                		tmp = x * (1.0 / t_1);
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
                                \mathbf{if}\;\frac{x}{t\_1} < 0:\\
                                \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;x \cdot \frac{1}{t\_1}\\
                                
                                
                                \end{array}
                                \end{array}
                                

                                Reproduce

                                ?
                                herbie shell --seed 2025018 
                                (FPCore (x y z t)
                                  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
                                  :precision binary64
                                
                                  :alt
                                  (! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))
                                
                                  (/ x (* (- y z) (- t z))))