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

Percentage Accurate: 89.1% → 96.6%
Time: 10.8s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 89.1% 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.6% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{\frac{x}{t - z}}{y - z} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (/ (/ x (- t z)) (- y z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return (x / (t - z)) / (y - z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 91.7%

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Step-by-step derivation
    1. associate-/l/96.8%

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

    \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
  4. Add Preprocessing
  5. Final simplification96.8%

    \[\leadsto \frac{\frac{x}{t - z}}{y - z} \]
  6. Add Preprocessing

Alternative 2: 77.7% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{z}}{z - t}\\ \mathbf{if}\;z \leq -1.25 \cdot 10^{-9}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-91}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+67}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - 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 z) (- z t))))
   (if (<= z -1.25e-9)
     t_1
     (if (<= z 1.05e-91)
       (/ (/ x t) (- y z))
       (if (<= z 1.5e+67) (/ (/ x y) (- 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 - t);
	double tmp;
	if (z <= -1.25e-9) {
		tmp = t_1;
	} else if (z <= 1.05e-91) {
		tmp = (x / t) / (y - z);
	} else if (z <= 1.5e+67) {
		tmp = (x / y) / (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 - t)
    if (z <= (-1.25d-9)) then
        tmp = t_1
    else if (z <= 1.05d-91) then
        tmp = (x / t) / (y - z)
    else if (z <= 1.5d+67) then
        tmp = (x / y) / (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 - t);
	double tmp;
	if (z <= -1.25e-9) {
		tmp = t_1;
	} else if (z <= 1.05e-91) {
		tmp = (x / t) / (y - z);
	} else if (z <= 1.5e+67) {
		tmp = (x / y) / (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 - t)
	tmp = 0
	if z <= -1.25e-9:
		tmp = t_1
	elif z <= 1.05e-91:
		tmp = (x / t) / (y - z)
	elif z <= 1.5e+67:
		tmp = (x / y) / (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 - t))
	tmp = 0.0
	if (z <= -1.25e-9)
		tmp = t_1;
	elseif (z <= 1.05e-91)
		tmp = Float64(Float64(x / t) / Float64(y - z));
	elseif (z <= 1.5e+67)
		tmp = Float64(Float64(x / y) / 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 - t);
	tmp = 0.0;
	if (z <= -1.25e-9)
		tmp = t_1;
	elseif (z <= 1.05e-91)
		tmp = (x / t) / (y - z);
	elseif (z <= 1.5e+67)
		tmp = (x / y) / (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 - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e-9], t$95$1, If[LessEqual[z, 1.05e-91], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+67], N[(N[(x / y), $MachinePrecision] / N[(t - 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{\frac{x}{z}}{z - t}\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+67}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.25e-9 or 1.50000000000000005e67 < z

    1. Initial program 89.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/85.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-185.1%

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

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-z \cdot \left(t - z\right)}} \]
      3. remove-double-neg85.1%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(t - z\right)} \]
      4. distribute-rgt-neg-in85.1%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot \left(-\left(t - z\right)\right)}} \]
    7. Applied egg-rr85.1%

      \[\leadsto \color{blue}{x \cdot \frac{1}{z \cdot \left(-\left(t - z\right)\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*85.1%

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

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z - t\right)}} \]
    11. Step-by-step derivation
      1. associate-/r*92.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    12. Simplified92.0%

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

    if -1.25e-9 < z < 1.05e-91

    1. Initial program 93.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/94.4%

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

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

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

    if 1.05e-91 < z < 1.50000000000000005e67

    1. Initial program 94.3%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-91}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+67}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.0% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-9} \lor \neg \left(z \leq 1.15 \cdot 10^{+22}\right):\\ \;\;\;\;\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 (or (<= z -1.05e-9) (not (<= z 1.15e+22)))
   (/ 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 ((z <= -1.05e-9) || !(z <= 1.15e+22)) {
		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 ((z <= (-1.05d-9)) .or. (.not. (z <= 1.15d+22))) 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 ((z <= -1.05e-9) || !(z <= 1.15e+22)) {
		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 (z <= -1.05e-9) or not (z <= 1.15e+22):
		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 ((z <= -1.05e-9) || !(z <= 1.15e+22))
		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 ((z <= -1.05e-9) || ~((z <= 1.15e+22)))
		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[Or[LessEqual[z, -1.05e-9], N[Not[LessEqual[z, 1.15e+22]], $MachinePrecision]], 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}\;z \leq -1.05 \cdot 10^{-9} \lor \neg \left(z \leq 1.15 \cdot 10^{+22}\right):\\
\;\;\;\;\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 2 regimes
  2. if z < -1.0500000000000001e-9 or 1.1500000000000001e22 < z

    1. Initial program 89.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/83.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-183.7%

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

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-z \cdot \left(t - z\right)}} \]
      3. remove-double-neg83.8%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(t - z\right)} \]
      4. distribute-rgt-neg-in83.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot \left(-\left(t - z\right)\right)}} \]
    7. Applied egg-rr83.8%

      \[\leadsto \color{blue}{x \cdot \frac{1}{z \cdot \left(-\left(t - z\right)\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*83.8%

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

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

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

    if -1.0500000000000001e-9 < z < 1.1500000000000001e22

    1. Initial program 94.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-9} \lor \neg \left(z \leq 1.15 \cdot 10^{+22}\right):\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.1% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3500:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-163}:\\ \;\;\;\;\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 -3500.0)
   (/ x (* (- t z) y))
   (if (<= y 1.3e-163) (/ 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 <= -3500.0) {
		tmp = x / ((t - z) * y);
	} else if (y <= 1.3e-163) {
		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 <= (-3500.0d0)) then
        tmp = x / ((t - z) * y)
    else if (y <= 1.3d-163) 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 <= -3500.0) {
		tmp = x / ((t - z) * y);
	} else if (y <= 1.3e-163) {
		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 <= -3500.0:
		tmp = x / ((t - z) * y)
	elif y <= 1.3e-163:
		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 <= -3500.0)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= 1.3e-163)
		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 <= -3500.0)
		tmp = x / ((t - z) * y);
	elseif (y <= 1.3e-163)
		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, -3500.0], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-163], 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 -3500:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-163}:\\
\;\;\;\;\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 < -3500

    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 81.0%

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

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

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

    if -3500 < y < 1.30000000000000001e-163

    1. Initial program 94.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/75.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-175.0%

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

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-z \cdot \left(t - z\right)}} \]
      3. remove-double-neg74.9%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(t - z\right)} \]
      4. distribute-rgt-neg-in74.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot \left(-\left(t - z\right)\right)}} \]
    7. Applied egg-rr74.9%

      \[\leadsto \color{blue}{x \cdot \frac{1}{z \cdot \left(-\left(t - z\right)\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*74.9%

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

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

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

    if 1.30000000000000001e-163 < y

    1. Initial program 91.3%

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

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

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

Alternative 5: 77.6% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3900:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{-164}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -3900.0)
   (/ x (* (- t z) y))
   (if (<= y 9.6e-164) (/ 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 <= -3900.0) {
		tmp = x / ((t - z) * y);
	} else if (y <= 9.6e-164) {
		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 <= (-3900.0d0)) then
        tmp = x / ((t - z) * y)
    else if (y <= 9.6d-164) 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 <= -3900.0) {
		tmp = x / ((t - z) * y);
	} else if (y <= 9.6e-164) {
		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 <= -3900.0:
		tmp = x / ((t - z) * y)
	elif y <= 9.6e-164:
		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 <= -3900.0)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= 9.6e-164)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -3900.0)
		tmp = x / ((t - z) * y);
	elseif (y <= 9.6e-164)
		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, -3900.0], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e-164], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3900:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\

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

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


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

    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 81.0%

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

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

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

    if -3900 < y < 9.59999999999999932e-164

    1. Initial program 94.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/75.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-175.0%

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

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-z \cdot \left(t - z\right)}} \]
      3. remove-double-neg74.9%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(t - z\right)} \]
      4. distribute-rgt-neg-in74.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot \left(-\left(t - z\right)\right)}} \]
    7. Applied egg-rr74.9%

      \[\leadsto \color{blue}{x \cdot \frac{1}{z \cdot \left(-\left(t - z\right)\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*74.9%

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

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

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

    if 9.59999999999999932e-164 < y

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/96.1%

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

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

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.3%

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

Alternative 6: 78.8% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3500:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-162}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -3500.0)
   (/ (/ x y) (- t z))
   (if (<= y 1.45e-162) (/ 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 <= -3500.0) {
		tmp = (x / y) / (t - z);
	} else if (y <= 1.45e-162) {
		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 <= (-3500.0d0)) then
        tmp = (x / y) / (t - z)
    else if (y <= 1.45d-162) 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 <= -3500.0) {
		tmp = (x / y) / (t - z);
	} else if (y <= 1.45e-162) {
		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 <= -3500.0:
		tmp = (x / y) / (t - z)
	elif y <= 1.45e-162:
		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 <= -3500.0)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= 1.45e-162)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -3500.0)
		tmp = (x / y) / (t - z);
	elseif (y <= 1.45e-162)
		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, -3500.0], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e-162], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3500:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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


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

    1. Initial program 87.4%

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

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

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

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

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

    if -3500 < y < 1.4500000000000001e-162

    1. Initial program 94.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/75.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-175.3%

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

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-z \cdot \left(t - z\right)}} \]
      3. remove-double-neg75.2%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(t - z\right)} \]
      4. distribute-rgt-neg-in75.2%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot \left(-\left(t - z\right)\right)}} \]
    7. Applied egg-rr75.2%

      \[\leadsto \color{blue}{x \cdot \frac{1}{z \cdot \left(-\left(t - z\right)\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*75.2%

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

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

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

    if 1.4500000000000001e-162 < y

    1. Initial program 91.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/96.1%

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

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

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.1%

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

Alternative 7: 78.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-45}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - 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 (<= z -9e-10)
   (/ (/ x z) (- z t))
   (if (<= z 3.6e-45) (/ (/ x t) (- y z)) (/ (/ x z) (- z y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -9e-10) {
		tmp = (x / z) / (z - t);
	} else if (z <= 3.6e-45) {
		tmp = (x / t) / (y - z);
	} else {
		tmp = (x / z) / (z - 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 (z <= (-9d-10)) then
        tmp = (x / z) / (z - t)
    else if (z <= 3.6d-45) then
        tmp = (x / t) / (y - z)
    else
        tmp = (x / z) / (z - 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 <= -9e-10) {
		tmp = (x / z) / (z - t);
	} else if (z <= 3.6e-45) {
		tmp = (x / t) / (y - z);
	} else {
		tmp = (x / z) / (z - y);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -9e-10:
		tmp = (x / z) / (z - t)
	elif z <= 3.6e-45:
		tmp = (x / t) / (y - z)
	else:
		tmp = (x / z) / (z - y)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -9e-10)
		tmp = Float64(Float64(x / z) / Float64(z - t));
	elseif (z <= 3.6e-45)
		tmp = Float64(Float64(x / t) / Float64(y - z));
	else
		tmp = Float64(Float64(x / z) / Float64(z - 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 <= -9e-10)
		tmp = (x / z) / (z - t);
	elseif (z <= 3.6e-45)
		tmp = (x / t) / (y - z);
	else
		tmp = (x / z) / (z - 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[z, -9e-10], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-45], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.9999999999999999e-10

    1. Initial program 88.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/83.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-183.9%

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

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

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

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-z \cdot \left(t - z\right)}} \]
      3. remove-double-neg83.9%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(t - z\right)} \]
      4. distribute-rgt-neg-in83.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot \left(-\left(t - z\right)\right)}} \]
    7. Applied egg-rr83.9%

      \[\leadsto \color{blue}{x \cdot \frac{1}{z \cdot \left(-\left(t - z\right)\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*83.9%

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

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z - t\right)}} \]
    11. Step-by-step derivation
      1. associate-/r*91.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    12. Simplified91.9%

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

    if -8.9999999999999999e-10 < z < 3.60000000000000001e-45

    1. Initial program 94.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/94.1%

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

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

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

    if 3.60000000000000001e-45 < z

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/98.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y - z} \]
      2. neg-mul-175.5%

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

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-10}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-45}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 51.1% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{-123}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-88}:\\ \;\;\;\;\frac{x}{t \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{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 (<= y -1.35e-123)
   (/ (/ x y) t)
   (if (<= y 2.5e-88) (/ x (* t (- z))) (/ (/ x t) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.35e-123) {
		tmp = (x / y) / t;
	} else if (y <= 2.5e-88) {
		tmp = x / (t * -z);
	} 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 (y <= (-1.35d-123)) then
        tmp = (x / y) / t
    else if (y <= 2.5d-88) then
        tmp = x / (t * -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 (y <= -1.35e-123) {
		tmp = (x / y) / t;
	} else if (y <= 2.5e-88) {
		tmp = x / (t * -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 y <= -1.35e-123:
		tmp = (x / y) / t
	elif y <= 2.5e-88:
		tmp = x / (t * -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 (y <= -1.35e-123)
		tmp = Float64(Float64(x / y) / t);
	elseif (y <= 2.5e-88)
		tmp = Float64(x / Float64(t * Float64(-z)));
	else
		tmp = Float64(Float64(x / 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 (y <= -1.35e-123)
		tmp = (x / y) / t;
	elseif (y <= 2.5e-88)
		tmp = x / (t * -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[LessEqual[y, -1.35e-123], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 2.5e-88], N[(x / N[(t * (-z)), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-123}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\

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

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


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

    1. Initial program 91.0%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity48.8%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot y} \]
      2. times-frac52.9%

        \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
    5. Applied egg-rr52.9%

      \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
    6. Step-by-step derivation
      1. associate-*l/52.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{t}} \]
      2. *-lft-identity52.9%

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

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

    if -1.35e-123 < y < 2.50000000000000004e-88

    1. Initial program 91.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/97.2%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/41.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. neg-mul-141.4%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    8. Simplified41.4%

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

    if 2.50000000000000004e-88 < y

    1. Initial program 92.4%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. associate-/r*43.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
      2. div-inv43.6%

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{1}{y}} \]
    5. Applied egg-rr43.6%

      \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{1}{y}} \]
    6. Step-by-step derivation
      1. un-div-inv43.6%

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification46.4%

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

Alternative 9: 45.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.92 \cdot 10^{-7} \lor \neg \left(z \leq 8.8 \cdot 10^{+61}\right):\\ \;\;\;\;\frac{x}{t \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 -1.92e-7) (not (<= z 8.8e+61))) (/ x (* t 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 <= -1.92e-7) || !(z <= 8.8e+61)) {
		tmp = x / (t * z);
	} 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 ((z <= (-1.92d-7)) .or. (.not. (z <= 8.8d+61))) then
        tmp = x / (t * 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 <= -1.92e-7) || !(z <= 8.8e+61)) {
		tmp = x / (t * 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 <= -1.92e-7) or not (z <= 8.8e+61):
		tmp = x / (t * 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 <= -1.92e-7) || !(z <= 8.8e+61))
		tmp = Float64(x / Float64(t * 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 <= -1.92e-7) || ~((z <= 8.8e+61)))
		tmp = x / (t * 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, -1.92e-7], N[Not[LessEqual[z, 8.8e+61]], $MachinePrecision]], N[(x / N[(t * 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 -1.92 \cdot 10^{-7} \lor \neg \left(z \leq 8.8 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.91999999999999999e-7 or 8.8000000000000001e61 < z

    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 83.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/83.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-183.6%

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt45.3%

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

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg62.1%

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

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt58.7%

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(t - z\right) \cdot z}} \]
      8. associate-/r*58.7%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{t - z}}{z}} \]
    7. Applied egg-rr58.7%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{t - z}}{z}} \]
    8. Step-by-step derivation
      1. associate-*r/58.3%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t - z}}{z}} \]
      2. associate-*l/58.3%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{t - z}} \]
      3. associate-*r/58.3%

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{t - z}} \]
      4. *-rgt-identity58.3%

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Step-by-step derivation
      1. *-commutative30.8%

        \[\leadsto \frac{x}{\color{blue}{z \cdot t}} \]
    12. Simplified30.8%

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

    if -1.91999999999999999e-7 < z < 8.8000000000000001e61

    1. Initial program 94.3%

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

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

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

Alternative 10: 46.9% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.92 \cdot 10^{-7} \lor \neg \left(z \leq 1.8 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{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 -1.92e-7) (not (<= z 1.8e+67))) (/ x (* t 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 <= -1.92e-7) || !(z <= 1.8e+67)) {
		tmp = x / (t * z);
	} 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 ((z <= (-1.92d-7)) .or. (.not. (z <= 1.8d+67))) then
        tmp = x / (t * 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 <= -1.92e-7) || !(z <= 1.8e+67)) {
		tmp = x / (t * 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 <= -1.92e-7) or not (z <= 1.8e+67):
		tmp = x / (t * 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 <= -1.92e-7) || !(z <= 1.8e+67))
		tmp = Float64(x / Float64(t * z));
	else
		tmp = Float64(Float64(x / 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 <= -1.92e-7) || ~((z <= 1.8e+67)))
		tmp = x / (t * 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, -1.92e-7], N[Not[LessEqual[z, 1.8e+67]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.92 \cdot 10^{-7} \lor \neg \left(z \leq 1.8 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.91999999999999999e-7 or 1.7999999999999999e67 < z

    1. Initial program 89.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/84.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-184.8%

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt46.9%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod64.2%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg64.2%

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

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt60.7%

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(t - z\right) \cdot z}} \]
      8. associate-/r*60.6%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{t - z}}{z}} \]
    7. Applied egg-rr60.6%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{t - z}}{z}} \]
    8. Step-by-step derivation
      1. associate-*r/60.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t - z}}{z}} \]
      2. associate-*l/60.2%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{t - z}} \]
      3. associate-*r/60.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{t - z}} \]
      4. *-rgt-identity60.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{t - z} \]
    9. Simplified60.2%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Step-by-step derivation
      1. *-commutative31.8%

        \[\leadsto \frac{x}{\color{blue}{z \cdot t}} \]
    12. Simplified31.8%

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

    if -1.91999999999999999e-7 < z < 1.7999999999999999e67

    1. Initial program 93.8%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. associate-/r*60.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
      2. div-inv60.1%

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{1}{y}} \]
    5. Applied egg-rr60.1%

      \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{1}{y}} \]
    6. Step-by-step derivation
      1. un-div-inv60.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    7. Applied egg-rr60.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.6%

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

Alternative 11: 47.4% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{-7} \lor \neg \left(z \leq 9.5 \cdot 10^{+67}\right):\\ \;\;\;\;\frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.85e-7) (not (<= z 9.5e+67))) (/ x (* t z)) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.85e-7) || !(z <= 9.5e+67)) {
		tmp = x / (t * z);
	} else {
		tmp = (x / y) / t;
	}
	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 ((z <= (-1.85d-7)) .or. (.not. (z <= 9.5d+67))) then
        tmp = x / (t * z)
    else
        tmp = (x / y) / t
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.85e-7) || !(z <= 9.5e+67)) {
		tmp = x / (t * z);
	} else {
		tmp = (x / y) / t;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.85e-7) or not (z <= 9.5e+67):
		tmp = x / (t * z)
	else:
		tmp = (x / y) / t
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.85e-7) || !(z <= 9.5e+67))
		tmp = Float64(x / Float64(t * z));
	else
		tmp = Float64(Float64(x / y) / t);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.85e-7) || ~((z <= 9.5e+67)))
		tmp = x / (t * z);
	else
		tmp = (x / y) / t;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.85e-7], N[Not[LessEqual[z, 9.5e+67]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-7} \lor \neg \left(z \leq 9.5 \cdot 10^{+67}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.85000000000000002e-7 or 9.5000000000000002e67 < z

    1. Initial program 89.0%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/84.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-184.8%

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

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

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt46.9%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod64.2%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg64.2%

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

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt60.7%

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(t - z\right) \cdot z}} \]
      8. associate-/r*60.6%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{t - z}}{z}} \]
    7. Applied egg-rr60.6%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{t - z}}{z}} \]
    8. Step-by-step derivation
      1. associate-*r/60.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t - z}}{z}} \]
      2. associate-*l/60.2%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{t - z}} \]
      3. associate-*r/60.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{t - z}} \]
      4. *-rgt-identity60.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{t - z} \]
    9. Simplified60.2%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Step-by-step derivation
      1. *-commutative31.8%

        \[\leadsto \frac{x}{\color{blue}{z \cdot t}} \]
    12. Simplified31.8%

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

    if -1.85000000000000002e-7 < z < 9.5000000000000002e67

    1. Initial program 93.8%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity56.1%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot y} \]
      2. times-frac58.8%

        \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
    5. Applied egg-rr58.8%

      \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
    6. Step-by-step derivation
      1. associate-*l/58.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{t}} \]
      2. *-lft-identity58.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
    7. Simplified58.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.9%

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

Alternative 12: 90.9% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+185}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \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.6e+185) (/ (/ x y) (- 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 (y <= -2.6e+185) {
		tmp = (x / y) / (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 (y <= (-2.6d+185)) then
        tmp = (x / y) / (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 (y <= -2.6e+185) {
		tmp = (x / y) / (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 y <= -2.6e+185:
		tmp = (x / y) / (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 (y <= -2.6e+185)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	else
		tmp = Float64(x / Float64(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 (y <= -2.6e+185)
		tmp = (x / y) / (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[y, -2.6e+185], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * 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.6 \cdot 10^{+185}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.60000000000000001e185

    1. Initial program 75.5%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    5. Simplified95.1%

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

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

    if -2.60000000000000001e185 < y

    1. Initial program 92.9%

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

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

Alternative 13: 59.1% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+153}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \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 -1.85e+153) (/ (/ x y) 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 <= -1.85e+153) {
		tmp = (x / y) / 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 <= (-1.85d+153)) then
        tmp = (x / y) / 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 <= -1.85e+153) {
		tmp = (x / y) / 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 <= -1.85e+153:
		tmp = (x / y) / 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 <= -1.85e+153)
		tmp = Float64(Float64(x / y) / 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 <= -1.85e+153)
		tmp = (x / y) / 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, -1.85e+153], N[(N[(x / y), $MachinePrecision] / t), $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 -1.85 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.8500000000000001e153

    1. Initial program 79.0%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity45.9%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot y} \]
      2. times-frac58.8%

        \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
    5. Applied egg-rr58.8%

      \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
    6. Step-by-step derivation
      1. associate-*l/58.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{t}} \]
      2. *-lft-identity58.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
    7. Simplified58.7%

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

    if -1.8500000000000001e153 < y

    1. Initial program 93.4%

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

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

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

Alternative 14: 38.5% accurate, 1.8× 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 91.7%

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

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

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

Developer target: 88.2% 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 2024074 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
  :precision binary64

  :alt
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))

  (/ x (* (- y z) (- t z))))