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

Percentage Accurate: 88.9% → 96.8%
Time: 11.9s
Alternatives: 12
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));
}
real(8) function code(x, y, z, t)
    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 12 alternatives:

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

Initial Program: 88.9% accurate, 1.0× speedup?

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

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

Alternative 1: 96.8% accurate, 0.7× speedup?

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

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


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

    1. Initial program 90.1%

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{y - z}}}{t - z} \]
      5. --lowering--.f6498.5

        \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{t - z}} \]
    4. Applied egg-rr98.5%

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

    if 1.00000000000000002e-251 < t

    1. Initial program 85.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/N/A

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

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

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

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

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

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

Alternative 2: 61.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{t \cdot y}\\ t_2 := \frac{-x}{y \cdot z}\\ \mathbf{if}\;y \leq -1.25 \cdot 10^{+254}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{+111}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{+61}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -85000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* t y))) (t_2 (/ (- x) (* y z))))
   (if (<= y -1.25e+254)
     t_1
     (if (<= y -1.4e+111)
       t_2
       (if (<= y -1.45e+61)
         t_1
         (if (<= y -85000.0)
           t_2
           (if (<= y 2.2e-9) (/ x (* z (- z t))) t_1)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (t * y);
	double t_2 = -x / (y * z);
	double tmp;
	if (y <= -1.25e+254) {
		tmp = t_1;
	} else if (y <= -1.4e+111) {
		tmp = t_2;
	} else if (y <= -1.45e+61) {
		tmp = t_1;
	} else if (y <= -85000.0) {
		tmp = t_2;
	} else if (y <= 2.2e-9) {
		tmp = x / (z * (z - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    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) :: t_2
    real(8) :: tmp
    t_1 = x / (t * y)
    t_2 = -x / (y * z)
    if (y <= (-1.25d+254)) then
        tmp = t_1
    else if (y <= (-1.4d+111)) then
        tmp = t_2
    else if (y <= (-1.45d+61)) then
        tmp = t_1
    else if (y <= (-85000.0d0)) then
        tmp = t_2
    else if (y <= 2.2d-9) then
        tmp = x / (z * (z - t))
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (t * y);
	double t_2 = -x / (y * z);
	double tmp;
	if (y <= -1.25e+254) {
		tmp = t_1;
	} else if (y <= -1.4e+111) {
		tmp = t_2;
	} else if (y <= -1.45e+61) {
		tmp = t_1;
	} else if (y <= -85000.0) {
		tmp = t_2;
	} else if (y <= 2.2e-9) {
		tmp = x / (z * (z - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / (t * y)
	t_2 = -x / (y * z)
	tmp = 0
	if y <= -1.25e+254:
		tmp = t_1
	elif y <= -1.4e+111:
		tmp = t_2
	elif y <= -1.45e+61:
		tmp = t_1
	elif y <= -85000.0:
		tmp = t_2
	elif y <= 2.2e-9:
		tmp = x / (z * (z - t))
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(t * y))
	t_2 = Float64(Float64(-x) / Float64(y * z))
	tmp = 0.0
	if (y <= -1.25e+254)
		tmp = t_1;
	elseif (y <= -1.4e+111)
		tmp = t_2;
	elseif (y <= -1.45e+61)
		tmp = t_1;
	elseif (y <= -85000.0)
		tmp = t_2;
	elseif (y <= 2.2e-9)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / (t * y);
	t_2 = -x / (y * z);
	tmp = 0.0;
	if (y <= -1.25e+254)
		tmp = t_1;
	elseif (y <= -1.4e+111)
		tmp = t_2;
	elseif (y <= -1.45e+61)
		tmp = t_1;
	elseif (y <= -85000.0)
		tmp = t_2;
	elseif (y <= 2.2e-9)
		tmp = x / (z * (z - t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+254], t$95$1, If[LessEqual[y, -1.4e+111], t$95$2, If[LessEqual[y, -1.45e+61], t$95$1, If[LessEqual[y, -85000.0], t$95$2, If[LessEqual[y, 2.2e-9], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{t \cdot y}\\
t_2 := \frac{-x}{y \cdot z}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1.45 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -85000:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.24999999999999999e254 or -1.4e111 < y < -1.45e61 or 2.1999999999999998e-9 < y

    1. Initial program 82.3%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
      2. *-lowering-*.f6465.3

        \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
    5. Simplified65.3%

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

    if -1.24999999999999999e254 < y < -1.4e111 or -1.45e61 < y < -85000

    1. Initial program 93.4%

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
      4. --lowering--.f6488.8

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right)} \cdot y} \]
    5. Simplified88.8%

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot y} \]
      2. neg-lowering-neg.f6464.7

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

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

    if -85000 < y < 2.1999999999999998e-9

    1. Initial program 88.9%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(z \cdot \left(t - z\right)\right)}} \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - z\right)\right)\right)}} \]
      7. mul-1-negN/A

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + t\right)}\right)\right)} \]
      12. distribute-neg-inN/A

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)}} \]
      13. remove-double-negN/A

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
      14. unsub-negN/A

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(z - t\right)}} \]
      15. --lowering--.f6471.2

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(z - t\right)}} \]
    5. Simplified71.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+254}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{+111}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{+61}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{elif}\;y \leq -85000:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5499999999999999e132 or 1.75e81 < z

    1. Initial program 75.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/N/A

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

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

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

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

        \[\leadsto \frac{\frac{x}{t - z}}{\color{blue}{y - z}} \]
    4. Applied egg-rr99.9%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{\mathsf{neg}\left(z\right)}}}{y - z} \]
      4. neg-lowering-neg.f6490.0

        \[\leadsto \frac{\frac{x}{\color{blue}{-z}}}{y - z} \]
    7. Simplified90.0%

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

    if -1.5499999999999999e132 < z < 1.75e81

    1. Initial program 94.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+132}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+81}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 52.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq 400:\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.89999999999999985e-43 or 400 < t

    1. Initial program 86.6%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
      2. *-lowering-*.f6452.2

        \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
    5. Simplified52.2%

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

    if -1.89999999999999985e-43 < t < 4.3999999999999999e-271

    1. Initial program 93.3%

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
      4. --lowering--.f6463.5

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right)} \cdot y} \]
      2. neg-lowering-neg.f6454.9

        \[\leadsto \frac{x}{\color{blue}{\left(-z\right)} \cdot y} \]
    8. Simplified54.9%

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

    if 4.3999999999999999e-271 < t < 400

    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 \color{blue}{\frac{x}{{z}^{2}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
      3. *-lowering-*.f6461.9

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    5. Simplified61.9%

      \[\leadsto \color{blue}{\frac{x}{z \cdot z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{-271}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;t \leq 400:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.1e185 or 5.7999999999999997e135 < z

    1. Initial program 73.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
      2. unpow2N/A

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
      3. *-lowering-*.f6473.1

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    5. Simplified73.1%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
      3. /-lowering-/.f6493.8

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    7. Applied egg-rr93.8%

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

    if -1.1e185 < z < 5.7999999999999997e135

    1. Initial program 93.2%

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

Alternative 6: 76.5% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.04999999999999992e-81

    1. Initial program 94.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. /-lowering-/.f64N/A

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
      4. --lowering--.f6481.3

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right)} \cdot y} \]
    5. Simplified81.3%

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

    if -2.04999999999999992e-81 < y < 3.79999999999999977e-83

    1. Initial program 88.7%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(z \cdot \left(t - z\right)\right)}} \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - z\right)\right)\right)}} \]
      7. mul-1-negN/A

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + t\right)}\right)\right)} \]
      12. distribute-neg-inN/A

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)}} \]
      13. remove-double-negN/A

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
      14. unsub-negN/A

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(z - t\right)}} \]
      15. --lowering--.f6478.1

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(z - t\right)}} \]
    5. Simplified78.1%

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

    if 3.79999999999999977e-83 < y

    1. Initial program 79.9%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-81}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-83}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 7: 75.3% accurate, 0.7× speedup?

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

      1. Initial program 87.4%

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

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

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

          \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
        4. --lowering--.f6474.0

          \[\leadsto \frac{x}{\color{blue}{\left(t - z\right)} \cdot y} \]
      5. Simplified74.0%

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

      if -8.9999999999999995e-86 < y < 1.6999999999999999e-83

      1. Initial program 88.6%

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

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

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

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

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

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

          \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(z \cdot \left(t - z\right)\right)}} \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto \frac{x}{\color{blue}{z \cdot \left(\mathsf{neg}\left(\left(t - z\right)\right)\right)}} \]
        7. mul-1-negN/A

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

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

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

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

          \[\leadsto \frac{x}{z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + t\right)}\right)\right)} \]
        12. distribute-neg-inN/A

          \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(t\right)\right)\right)}} \]
        13. remove-double-negN/A

          \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(\mathsf{neg}\left(t\right)\right)\right)} \]
        14. unsub-negN/A

          \[\leadsto \frac{x}{z \cdot \color{blue}{\left(z - t\right)}} \]
        15. --lowering--.f6477.8

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

        \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z - t\right)}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification75.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-86}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-83}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 61.6% accurate, 0.8× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z \cdot z}\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{+37}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (/ x (* z z))))
       (if (<= z -1.75e+37) t_1 (if (<= z 1.4e+14) (/ x (* t y)) t_1))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = x / (z * z);
    	double tmp;
    	if (z <= -1.75e+37) {
    		tmp = t_1;
    	} else if (z <= 1.4e+14) {
    		tmp = x / (t * y);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: tmp
        t_1 = x / (z * z)
        if (z <= (-1.75d+37)) then
            tmp = t_1
        else if (z <= 1.4d+14) then
            tmp = x / (t * y)
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = x / (z * z);
    	double tmp;
    	if (z <= -1.75e+37) {
    		tmp = t_1;
    	} else if (z <= 1.4e+14) {
    		tmp = x / (t * y);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = x / (z * z)
    	tmp = 0
    	if z <= -1.75e+37:
    		tmp = t_1
    	elif z <= 1.4e+14:
    		tmp = x / (t * y)
    	else:
    		tmp = t_1
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(x / Float64(z * z))
    	tmp = 0.0
    	if (z <= -1.75e+37)
    		tmp = t_1;
    	elseif (z <= 1.4e+14)
    		tmp = Float64(x / Float64(t * y));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = x / (z * z);
    	tmp = 0.0;
    	if (z <= -1.75e+37)
    		tmp = t_1;
    	elseif (z <= 1.4e+14)
    		tmp = x / (t * y);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+37], t$95$1, If[LessEqual[z, 1.4e+14], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \frac{x}{z \cdot z}\\
    \mathbf{if}\;z \leq -1.75 \cdot 10^{+37}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 1.4 \cdot 10^{+14}:\\
    \;\;\;\;\frac{x}{t \cdot y}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.75e37 or 1.4e14 < z

      1. Initial program 79.9%

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

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

          \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
        2. unpow2N/A

          \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
        3. *-lowering-*.f6467.0

          \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
      5. Simplified67.0%

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

      if -1.75e37 < z < 1.4e14

      1. Initial program 94.9%

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

        \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
        2. *-lowering-*.f6452.9

          \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
      5. Simplified52.9%

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

    Alternative 9: 97.0% 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.
    real(8) function code(x, y, z, t)
        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. Step-by-step derivation
      1. associate-/l/N/A

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

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

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

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

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

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

    Alternative 10: 59.0% accurate, 0.9× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 116000:\\ \;\;\;\;\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 (<= t 116000.0) (/ 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 (t <= 116000.0) {
    		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.
    real(8) function code(x, y, z, t)
        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 <= 116000.0d0) 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 (t <= 116000.0) {
    		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 t <= 116000.0:
    		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 (t <= 116000.0)
    		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 (t <= 116000.0)
    		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[LessEqual[t, 116000.0], 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}\;t \leq 116000:\\
    \;\;\;\;\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 t < 116000

      1. Initial program 88.8%

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

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

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

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

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

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

          \[\leadsto \frac{x}{\color{blue}{\mathsf{neg}\left(z \cdot \left(y - z\right)\right)}} \]
        6. distribute-rgt-neg-inN/A

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

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

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

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

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

          \[\leadsto \frac{x}{z \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)}\right)\right)} \]
        12. distribute-neg-inN/A

          \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(y\right)\right)\right)}} \]
        13. unsub-negN/A

          \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) - y\right)}} \]
        14. remove-double-negN/A

          \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} - y\right)} \]
        15. --lowering--.f6458.9

          \[\leadsto \frac{x}{z \cdot \color{blue}{\left(z - y\right)}} \]
      5. Simplified58.9%

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

      if 116000 < t

      1. Initial program 85.2%

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

        \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
        2. *-lowering-*.f6452.9

          \[\leadsto \frac{x}{\color{blue}{t \cdot y}} \]
      5. Simplified52.9%

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

    Alternative 11: 88.9% 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.
    real(8) function code(x, y, z, t)
        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 12: 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.
    real(8) function code(x, y, z, t)
        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 \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
      2. *-lowering-*.f6437.4

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

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

    Developer Target 1: 88.0% 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;
    }
    
    real(8) function code(x, y, z, t)
        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 2024198 
    (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))))