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

Percentage Accurate: 88.8% → 96.9%
Time: 16.7s
Alternatives: 22
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 22 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.8% 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.9% 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 90.8%

    \[\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. Add Preprocessing

Alternative 2: 78.6% accurate, 0.1× 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_2 := \frac{x}{z \cdot \left(z - t\right)}\\ t_3 := \frac{\frac{x}{t}}{y - z}\\ \mathbf{if}\;y \leq -1.52 \cdot 10^{+190}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-9}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{-110}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-140}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-174}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -9.8 \cdot 10^{-206} \lor \neg \left(y \leq -6.2 \cdot 10^{-234}\right) \land y \leq 7.8 \cdot 10^{-120}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \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_2 (/ x (* z (- z t))))
        (t_3 (/ (/ x t) (- y z))))
   (if (<= y -1.52e+190)
     (/ (/ x y) (- t z))
     (if (<= y -3e+17)
       (/ x (* (- t z) y))
       (if (<= y -7.2e-9)
         t_2
         (if (<= y -2.05e-50)
           (/ (/ x (- t z)) y)
           (if (<= y -5.4e-62)
             t_1
             (if (<= y -4.3e-110)
               t_3
               (if (<= y -5.6e-140)
                 t_2
                 (if (<= y -1.7e-174)
                   t_1
                   (if (or (<= y -9.8e-206)
                           (and (not (<= y -6.2e-234)) (<= y 7.8e-120)))
                     t_2
                     t_3)))))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double t_2 = x / (z * (z - t));
	double t_3 = (x / t) / (y - z);
	double tmp;
	if (y <= -1.52e+190) {
		tmp = (x / y) / (t - z);
	} else if (y <= -3e+17) {
		tmp = x / ((t - z) * y);
	} else if (y <= -7.2e-9) {
		tmp = t_2;
	} else if (y <= -2.05e-50) {
		tmp = (x / (t - z)) / y;
	} else if (y <= -5.4e-62) {
		tmp = t_1;
	} else if (y <= -4.3e-110) {
		tmp = t_3;
	} else if (y <= -5.6e-140) {
		tmp = t_2;
	} else if (y <= -1.7e-174) {
		tmp = t_1;
	} else if ((y <= -9.8e-206) || (!(y <= -6.2e-234) && (y <= 7.8e-120))) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = (x / z) / z
    t_2 = x / (z * (z - t))
    t_3 = (x / t) / (y - z)
    if (y <= (-1.52d+190)) then
        tmp = (x / y) / (t - z)
    else if (y <= (-3d+17)) then
        tmp = x / ((t - z) * y)
    else if (y <= (-7.2d-9)) then
        tmp = t_2
    else if (y <= (-2.05d-50)) then
        tmp = (x / (t - z)) / y
    else if (y <= (-5.4d-62)) then
        tmp = t_1
    else if (y <= (-4.3d-110)) then
        tmp = t_3
    else if (y <= (-5.6d-140)) then
        tmp = t_2
    else if (y <= (-1.7d-174)) then
        tmp = t_1
    else if ((y <= (-9.8d-206)) .or. (.not. (y <= (-6.2d-234))) .and. (y <= 7.8d-120)) then
        tmp = t_2
    else
        tmp = t_3
    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 t_2 = x / (z * (z - t));
	double t_3 = (x / t) / (y - z);
	double tmp;
	if (y <= -1.52e+190) {
		tmp = (x / y) / (t - z);
	} else if (y <= -3e+17) {
		tmp = x / ((t - z) * y);
	} else if (y <= -7.2e-9) {
		tmp = t_2;
	} else if (y <= -2.05e-50) {
		tmp = (x / (t - z)) / y;
	} else if (y <= -5.4e-62) {
		tmp = t_1;
	} else if (y <= -4.3e-110) {
		tmp = t_3;
	} else if (y <= -5.6e-140) {
		tmp = t_2;
	} else if (y <= -1.7e-174) {
		tmp = t_1;
	} else if ((y <= -9.8e-206) || (!(y <= -6.2e-234) && (y <= 7.8e-120))) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / z) / z
	t_2 = x / (z * (z - t))
	t_3 = (x / t) / (y - z)
	tmp = 0
	if y <= -1.52e+190:
		tmp = (x / y) / (t - z)
	elif y <= -3e+17:
		tmp = x / ((t - z) * y)
	elif y <= -7.2e-9:
		tmp = t_2
	elif y <= -2.05e-50:
		tmp = (x / (t - z)) / y
	elif y <= -5.4e-62:
		tmp = t_1
	elif y <= -4.3e-110:
		tmp = t_3
	elif y <= -5.6e-140:
		tmp = t_2
	elif y <= -1.7e-174:
		tmp = t_1
	elif (y <= -9.8e-206) or (not (y <= -6.2e-234) and (y <= 7.8e-120)):
		tmp = t_2
	else:
		tmp = t_3
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) / z)
	t_2 = Float64(x / Float64(z * Float64(z - t)))
	t_3 = Float64(Float64(x / t) / Float64(y - z))
	tmp = 0.0
	if (y <= -1.52e+190)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= -3e+17)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= -7.2e-9)
		tmp = t_2;
	elseif (y <= -2.05e-50)
		tmp = Float64(Float64(x / Float64(t - z)) / y);
	elseif (y <= -5.4e-62)
		tmp = t_1;
	elseif (y <= -4.3e-110)
		tmp = t_3;
	elseif (y <= -5.6e-140)
		tmp = t_2;
	elseif (y <= -1.7e-174)
		tmp = t_1;
	elseif ((y <= -9.8e-206) || (!(y <= -6.2e-234) && (y <= 7.8e-120)))
		tmp = t_2;
	else
		tmp = t_3;
	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_2 = x / (z * (z - t));
	t_3 = (x / t) / (y - z);
	tmp = 0.0;
	if (y <= -1.52e+190)
		tmp = (x / y) / (t - z);
	elseif (y <= -3e+17)
		tmp = x / ((t - z) * y);
	elseif (y <= -7.2e-9)
		tmp = t_2;
	elseif (y <= -2.05e-50)
		tmp = (x / (t - z)) / y;
	elseif (y <= -5.4e-62)
		tmp = t_1;
	elseif (y <= -4.3e-110)
		tmp = t_3;
	elseif (y <= -5.6e-140)
		tmp = t_2;
	elseif (y <= -1.7e-174)
		tmp = t_1;
	elseif ((y <= -9.8e-206) || (~((y <= -6.2e-234)) && (y <= 7.8e-120)))
		tmp = t_2;
	else
		tmp = t_3;
	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]}, Block[{t$95$2 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.52e+190], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3e+17], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.2e-9], t$95$2, If[LessEqual[y, -2.05e-50], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, -5.4e-62], t$95$1, If[LessEqual[y, -4.3e-110], t$95$3, If[LessEqual[y, -5.6e-140], t$95$2, If[LessEqual[y, -1.7e-174], t$95$1, If[Or[LessEqual[y, -9.8e-206], And[N[Not[LessEqual[y, -6.2e-234]], $MachinePrecision], LessEqual[y, 7.8e-120]]], t$95$2, t$95$3]]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{z \cdot \left(z - t\right)}\\
t_3 := \frac{\frac{x}{t}}{y - z}\\
\mathbf{if}\;y \leq -1.52 \cdot 10^{+190}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

\mathbf{elif}\;y \leq -7.2 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq -5.4 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -4.3 \cdot 10^{-110}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-140}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -9.8 \cdot 10^{-206} \lor \neg \left(y \leq -6.2 \cdot 10^{-234}\right) \land y \leq 7.8 \cdot 10^{-120}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.5199999999999999e190

    1. Initial program 83.3%

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

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

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

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

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

    if -1.5199999999999999e190 < y < -3e17

    1. Initial program 82.1%

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

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

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

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

    if -3e17 < y < -7.2e-9 or -4.30000000000000025e-110 < y < -5.6000000000000005e-140 or -1.7000000000000001e-174 < y < -9.7999999999999999e-206 or -6.2000000000000003e-234 < y < 7.8000000000000003e-120

    1. Initial program 95.7%

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

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

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

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

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

    if -7.2e-9 < y < -2.04999999999999993e-50

    1. Initial program 98.8%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv99.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
    9. Simplified68.6%

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

    if -2.04999999999999993e-50 < y < -5.40000000000000039e-62 or -5.6000000000000005e-140 < y < -1.7000000000000001e-174

    1. Initial program 75.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.8%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg87.3%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac299.8%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg99.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv99.8%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr83.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv99.8%

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

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

    if -5.40000000000000039e-62 < y < -4.30000000000000025e-110 or -9.7999999999999999e-206 < y < -6.2000000000000003e-234 or 7.8000000000000003e-120 < y

    1. Initial program 92.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.52 \cdot 10^{+190}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{-110}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-140}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-174}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;y \leq -9.8 \cdot 10^{-206} \lor \neg \left(y \leq -6.2 \cdot 10^{-234}\right) \land y \leq 7.8 \cdot 10^{-120}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 70.0% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{-z}}{t}\\ t_2 := \frac{\frac{1}{z}}{\frac{z}{x}}\\ t_3 := \frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+83}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{+41}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-221}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-59}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+18}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+47}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x (- z)) t))
        (t_2 (/ (/ 1.0 z) (/ z x)))
        (t_3 (/ x (* (- t z) y))))
   (if (<= z -2.85e+144)
     t_2
     (if (<= z -1.1e+83)
       t_1
       (if (<= z -2.2e+41)
         t_2
         (if (<= z -4.2e-221)
           t_3
           (if (<= z 2e-59)
             (/ x (* t (- y z)))
             (if (<= z 3.1e+18)
               t_3
               (if (<= z 4.8e+45)
                 (/ (/ x z) z)
                 (if (<= z 1.75e+47) t_1 (* x (/ (/ 1.0 z) z))))))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / -z) / t;
	double t_2 = (1.0 / z) / (z / x);
	double t_3 = x / ((t - z) * y);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = t_2;
	} else if (z <= -1.1e+83) {
		tmp = t_1;
	} else if (z <= -2.2e+41) {
		tmp = t_2;
	} else if (z <= -4.2e-221) {
		tmp = t_3;
	} else if (z <= 2e-59) {
		tmp = x / (t * (y - z));
	} else if (z <= 3.1e+18) {
		tmp = t_3;
	} else if (z <= 4.8e+45) {
		tmp = (x / z) / z;
	} else if (z <= 1.75e+47) {
		tmp = t_1;
	} else {
		tmp = x * ((1.0 / z) / 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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (x / -z) / t
    t_2 = (1.0d0 / z) / (z / x)
    t_3 = x / ((t - z) * y)
    if (z <= (-2.85d+144)) then
        tmp = t_2
    else if (z <= (-1.1d+83)) then
        tmp = t_1
    else if (z <= (-2.2d+41)) then
        tmp = t_2
    else if (z <= (-4.2d-221)) then
        tmp = t_3
    else if (z <= 2d-59) then
        tmp = x / (t * (y - z))
    else if (z <= 3.1d+18) then
        tmp = t_3
    else if (z <= 4.8d+45) then
        tmp = (x / z) / z
    else if (z <= 1.75d+47) then
        tmp = t_1
    else
        tmp = x * ((1.0d0 / z) / z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / -z) / t;
	double t_2 = (1.0 / z) / (z / x);
	double t_3 = x / ((t - z) * y);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = t_2;
	} else if (z <= -1.1e+83) {
		tmp = t_1;
	} else if (z <= -2.2e+41) {
		tmp = t_2;
	} else if (z <= -4.2e-221) {
		tmp = t_3;
	} else if (z <= 2e-59) {
		tmp = x / (t * (y - z));
	} else if (z <= 3.1e+18) {
		tmp = t_3;
	} else if (z <= 4.8e+45) {
		tmp = (x / z) / z;
	} else if (z <= 1.75e+47) {
		tmp = t_1;
	} else {
		tmp = x * ((1.0 / z) / z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / -z) / t
	t_2 = (1.0 / z) / (z / x)
	t_3 = x / ((t - z) * y)
	tmp = 0
	if z <= -2.85e+144:
		tmp = t_2
	elif z <= -1.1e+83:
		tmp = t_1
	elif z <= -2.2e+41:
		tmp = t_2
	elif z <= -4.2e-221:
		tmp = t_3
	elif z <= 2e-59:
		tmp = x / (t * (y - z))
	elif z <= 3.1e+18:
		tmp = t_3
	elif z <= 4.8e+45:
		tmp = (x / z) / z
	elif z <= 1.75e+47:
		tmp = t_1
	else:
		tmp = x * ((1.0 / z) / z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / Float64(-z)) / t)
	t_2 = Float64(Float64(1.0 / z) / Float64(z / x))
	t_3 = Float64(x / Float64(Float64(t - z) * y))
	tmp = 0.0
	if (z <= -2.85e+144)
		tmp = t_2;
	elseif (z <= -1.1e+83)
		tmp = t_1;
	elseif (z <= -2.2e+41)
		tmp = t_2;
	elseif (z <= -4.2e-221)
		tmp = t_3;
	elseif (z <= 2e-59)
		tmp = Float64(x / Float64(t * Float64(y - z)));
	elseif (z <= 3.1e+18)
		tmp = t_3;
	elseif (z <= 4.8e+45)
		tmp = Float64(Float64(x / z) / z);
	elseif (z <= 1.75e+47)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(Float64(1.0 / z) / z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / -z) / t;
	t_2 = (1.0 / z) / (z / x);
	t_3 = x / ((t - z) * y);
	tmp = 0.0;
	if (z <= -2.85e+144)
		tmp = t_2;
	elseif (z <= -1.1e+83)
		tmp = t_1;
	elseif (z <= -2.2e+41)
		tmp = t_2;
	elseif (z <= -4.2e-221)
		tmp = t_3;
	elseif (z <= 2e-59)
		tmp = x / (t * (y - z));
	elseif (z <= 3.1e+18)
		tmp = t_3;
	elseif (z <= 4.8e+45)
		tmp = (x / z) / z;
	elseif (z <= 1.75e+47)
		tmp = t_1;
	else
		tmp = x * ((1.0 / z) / z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+144], t$95$2, If[LessEqual[z, -1.1e+83], t$95$1, If[LessEqual[z, -2.2e+41], t$95$2, If[LessEqual[z, -4.2e-221], t$95$3, If[LessEqual[z, 2e-59], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+18], t$95$3, If[LessEqual[z, 4.8e+45], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.75e+47], t$95$1, N[(x * N[(N[(1.0 / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{-z}}{t}\\
t_2 := \frac{\frac{1}{z}}{\frac{z}{x}}\\
t_3 := \frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1.1 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.2 \cdot 10^{+41}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-221}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;z \leq 3.1 \cdot 10^{+18}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{+45}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.85000000000000002e144 or -1.09999999999999999e83 < z < -2.1999999999999999e41

    1. Initial program 87.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg96.3%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified88.2%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac288.2%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg88.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv88.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr82.1%

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
      3. clear-num88.3%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{z}}{\frac{z}{x}}} \]
      5. *-un-lft-identity88.3%

        \[\leadsto \frac{\color{blue}{\frac{1}{z}}}{\frac{z}{x}} \]
    16. Applied egg-rr88.3%

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

    if -2.85000000000000002e144 < z < -1.09999999999999999e83 or 4.79999999999999979e45 < z < 1.75000000000000008e47

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. times-frac45.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{z}}{t}} \]
      4. mul-1-neg45.7%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{t} \]
      5. distribute-frac-neg45.7%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{t}} \]
    11. Simplified45.7%

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

    if -2.1999999999999999e41 < z < -4.2e-221 or 2.0000000000000001e-59 < z < 3.1e18

    1. Initial program 93.9%

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

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

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

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

    if -4.2e-221 < z < 2.0000000000000001e-59

    1. Initial program 93.8%

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

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

    if 3.1e18 < z < 4.79999999999999979e45

    1. Initial program 88.0%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.4%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.6%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg63.5%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified63.2%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac263.2%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg63.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv63.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr63.2%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv63.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    16. Applied egg-rr63.2%

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

    if 1.75000000000000008e47 < z

    1. Initial program 89.3%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg95.4%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified80.8%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac280.8%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg80.8%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr82.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{1}{z}}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{+41}:\\ \;\;\;\;\frac{\frac{1}{z}}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-221}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-59}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 70.0% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{-z}}{t}\\ t_2 := \frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-221}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-59}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+16}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+46}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+47}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x (- z)) t)) (t_2 (/ x (* (- t z) y))))
   (if (<= z -2.85e+144)
     (* (/ x z) (/ 1.0 z))
     (if (<= z -3.2e+83)
       t_1
       (if (<= z -1.65e+41)
         (/ x (* z z))
         (if (<= z -2.8e-221)
           t_2
           (if (<= z 3.6e-59)
             (/ x (* t (- y z)))
             (if (<= z 2.7e+16)
               t_2
               (if (<= z 1.02e+46)
                 (/ (/ x z) z)
                 (if (<= z 4.5e+47) t_1 (* x (/ (/ 1.0 z) z))))))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / -z) / t;
	double t_2 = x / ((t - z) * y);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = (x / z) * (1.0 / z);
	} else if (z <= -3.2e+83) {
		tmp = t_1;
	} else if (z <= -1.65e+41) {
		tmp = x / (z * z);
	} else if (z <= -2.8e-221) {
		tmp = t_2;
	} else if (z <= 3.6e-59) {
		tmp = x / (t * (y - z));
	} else if (z <= 2.7e+16) {
		tmp = t_2;
	} else if (z <= 1.02e+46) {
		tmp = (x / z) / z;
	} else if (z <= 4.5e+47) {
		tmp = t_1;
	} else {
		tmp = x * ((1.0 / z) / 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x / -z) / t
    t_2 = x / ((t - z) * y)
    if (z <= (-2.85d+144)) then
        tmp = (x / z) * (1.0d0 / z)
    else if (z <= (-3.2d+83)) then
        tmp = t_1
    else if (z <= (-1.65d+41)) then
        tmp = x / (z * z)
    else if (z <= (-2.8d-221)) then
        tmp = t_2
    else if (z <= 3.6d-59) then
        tmp = x / (t * (y - z))
    else if (z <= 2.7d+16) then
        tmp = t_2
    else if (z <= 1.02d+46) then
        tmp = (x / z) / z
    else if (z <= 4.5d+47) then
        tmp = t_1
    else
        tmp = x * ((1.0d0 / z) / z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / -z) / t;
	double t_2 = x / ((t - z) * y);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = (x / z) * (1.0 / z);
	} else if (z <= -3.2e+83) {
		tmp = t_1;
	} else if (z <= -1.65e+41) {
		tmp = x / (z * z);
	} else if (z <= -2.8e-221) {
		tmp = t_2;
	} else if (z <= 3.6e-59) {
		tmp = x / (t * (y - z));
	} else if (z <= 2.7e+16) {
		tmp = t_2;
	} else if (z <= 1.02e+46) {
		tmp = (x / z) / z;
	} else if (z <= 4.5e+47) {
		tmp = t_1;
	} else {
		tmp = x * ((1.0 / z) / z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / -z) / t
	t_2 = x / ((t - z) * y)
	tmp = 0
	if z <= -2.85e+144:
		tmp = (x / z) * (1.0 / z)
	elif z <= -3.2e+83:
		tmp = t_1
	elif z <= -1.65e+41:
		tmp = x / (z * z)
	elif z <= -2.8e-221:
		tmp = t_2
	elif z <= 3.6e-59:
		tmp = x / (t * (y - z))
	elif z <= 2.7e+16:
		tmp = t_2
	elif z <= 1.02e+46:
		tmp = (x / z) / z
	elif z <= 4.5e+47:
		tmp = t_1
	else:
		tmp = x * ((1.0 / z) / z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / Float64(-z)) / t)
	t_2 = Float64(x / Float64(Float64(t - z) * y))
	tmp = 0.0
	if (z <= -2.85e+144)
		tmp = Float64(Float64(x / z) * Float64(1.0 / z));
	elseif (z <= -3.2e+83)
		tmp = t_1;
	elseif (z <= -1.65e+41)
		tmp = Float64(x / Float64(z * z));
	elseif (z <= -2.8e-221)
		tmp = t_2;
	elseif (z <= 3.6e-59)
		tmp = Float64(x / Float64(t * Float64(y - z)));
	elseif (z <= 2.7e+16)
		tmp = t_2;
	elseif (z <= 1.02e+46)
		tmp = Float64(Float64(x / z) / z);
	elseif (z <= 4.5e+47)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(Float64(1.0 / z) / z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / -z) / t;
	t_2 = x / ((t - z) * y);
	tmp = 0.0;
	if (z <= -2.85e+144)
		tmp = (x / z) * (1.0 / z);
	elseif (z <= -3.2e+83)
		tmp = t_1;
	elseif (z <= -1.65e+41)
		tmp = x / (z * z);
	elseif (z <= -2.8e-221)
		tmp = t_2;
	elseif (z <= 3.6e-59)
		tmp = x / (t * (y - z));
	elseif (z <= 2.7e+16)
		tmp = t_2;
	elseif (z <= 1.02e+46)
		tmp = (x / z) / z;
	elseif (z <= 4.5e+47)
		tmp = t_1;
	else
		tmp = x * ((1.0 / z) / z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+144], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e+83], t$95$1, If[LessEqual[z, -1.65e+41], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e-221], t$95$2, If[LessEqual[z, 3.6e-59], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+16], t$95$2, If[LessEqual[z, 1.02e+46], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 4.5e+47], t$95$1, N[(x * N[(N[(1.0 / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{-z}}{t}\\
t_2 := \frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.65 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{z \cdot z}\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-221}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.02 \cdot 10^{+46}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if z < -2.85000000000000002e144

    1. Initial program 83.7%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr100.0%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.9%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg98.4%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv95.0%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right) \cdot \frac{1}{z}} \]
      2. distribute-neg-frac295.0%

        \[\leadsto \color{blue}{\frac{-x}{-z}} \cdot \frac{1}{z} \]
      3. frac-2neg95.0%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr95.0%

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

    if -2.85000000000000002e144 < z < -3.1999999999999999e83 or 1.0199999999999999e46 < z < 4.49999999999999979e47

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. times-frac45.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{z}}{t}} \]
      4. mul-1-neg45.7%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{t} \]
      5. distribute-frac-neg45.7%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{t}} \]
    11. Simplified45.7%

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

    if -3.1999999999999999e83 < z < -1.65e41

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.3%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg89.5%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified66.4%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac266.4%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg66.4%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv66.8%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr66.6%

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
      3. *-commutative66.6%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{z}} \]
      4. frac-2neg66.6%

        \[\leadsto \color{blue}{\frac{-1}{-z}} \cdot \frac{x}{z} \]
      5. metadata-eval66.6%

        \[\leadsto \frac{\color{blue}{-1}}{-z} \cdot \frac{x}{z} \]
      6. frac-2neg66.6%

        \[\leadsto \frac{-1}{-z} \cdot \color{blue}{\frac{-x}{-z}} \]
      7. frac-times66.8%

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

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

        \[\leadsto \frac{\color{blue}{x}}{\left(-z\right) \cdot \left(-z\right)} \]
    16. Applied egg-rr66.8%

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

    if -1.65e41 < z < -2.80000000000000019e-221 or 3.6e-59 < z < 2.7e16

    1. Initial program 93.9%

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

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

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

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

    if -2.80000000000000019e-221 < z < 3.6e-59

    1. Initial program 93.8%

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

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

    if 2.7e16 < z < 1.0199999999999999e46

    1. Initial program 88.0%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.4%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.6%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg63.5%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified63.2%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac263.2%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg63.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv63.2%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr63.2%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv63.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    16. Applied egg-rr63.2%

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

    if 4.49999999999999979e47 < z

    1. Initial program 89.3%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg95.4%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified80.8%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac280.8%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg80.8%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr82.8%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification73.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-221}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-59}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+16}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{+46}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 82.1% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{z - t}}{z}\\ \mathbf{if}\;y \leq -2 \cdot 10^{+190}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-9}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-51}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-106} \lor \neg \left(y \leq 2.75 \cdot 10^{-157}\right):\\ \;\;\;\;\frac{\frac{x}{t}}{y - 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 t)) z)))
   (if (<= y -2e+190)
     (/ (/ x y) (- t z))
     (if (<= y -5.5e+21)
       (/ x (* (- t z) y))
       (if (<= y -5.2e-9)
         t_1
         (if (<= y -2.7e-51)
           (/ (/ x (- t z)) y)
           (if (<= y -1.7e-65)
             (/ (/ x z) z)
             (if (or (<= y -1e-106) (not (<= y 2.75e-157)))
               (/ (/ x t) (- y 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 - t)) / z;
	double tmp;
	if (y <= -2e+190) {
		tmp = (x / y) / (t - z);
	} else if (y <= -5.5e+21) {
		tmp = x / ((t - z) * y);
	} else if (y <= -5.2e-9) {
		tmp = t_1;
	} else if (y <= -2.7e-51) {
		tmp = (x / (t - z)) / y;
	} else if (y <= -1.7e-65) {
		tmp = (x / z) / z;
	} else if ((y <= -1e-106) || !(y <= 2.75e-157)) {
		tmp = (x / t) / (y - 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 - t)) / z
    if (y <= (-2d+190)) then
        tmp = (x / y) / (t - z)
    else if (y <= (-5.5d+21)) then
        tmp = x / ((t - z) * y)
    else if (y <= (-5.2d-9)) then
        tmp = t_1
    else if (y <= (-2.7d-51)) then
        tmp = (x / (t - z)) / y
    else if (y <= (-1.7d-65)) then
        tmp = (x / z) / z
    else if ((y <= (-1d-106)) .or. (.not. (y <= 2.75d-157))) then
        tmp = (x / t) / (y - 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 - t)) / z;
	double tmp;
	if (y <= -2e+190) {
		tmp = (x / y) / (t - z);
	} else if (y <= -5.5e+21) {
		tmp = x / ((t - z) * y);
	} else if (y <= -5.2e-9) {
		tmp = t_1;
	} else if (y <= -2.7e-51) {
		tmp = (x / (t - z)) / y;
	} else if (y <= -1.7e-65) {
		tmp = (x / z) / z;
	} else if ((y <= -1e-106) || !(y <= 2.75e-157)) {
		tmp = (x / t) / (y - 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 - t)) / z
	tmp = 0
	if y <= -2e+190:
		tmp = (x / y) / (t - z)
	elif y <= -5.5e+21:
		tmp = x / ((t - z) * y)
	elif y <= -5.2e-9:
		tmp = t_1
	elif y <= -2.7e-51:
		tmp = (x / (t - z)) / y
	elif y <= -1.7e-65:
		tmp = (x / z) / z
	elif (y <= -1e-106) or not (y <= 2.75e-157):
		tmp = (x / t) / (y - 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 / Float64(z - t)) / z)
	tmp = 0.0
	if (y <= -2e+190)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= -5.5e+21)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= -5.2e-9)
		tmp = t_1;
	elseif (y <= -2.7e-51)
		tmp = Float64(Float64(x / Float64(t - z)) / y);
	elseif (y <= -1.7e-65)
		tmp = Float64(Float64(x / z) / z);
	elseif ((y <= -1e-106) || !(y <= 2.75e-157))
		tmp = Float64(Float64(x / t) / Float64(y - 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 - t)) / z;
	tmp = 0.0;
	if (y <= -2e+190)
		tmp = (x / y) / (t - z);
	elseif (y <= -5.5e+21)
		tmp = x / ((t - z) * y);
	elseif (y <= -5.2e-9)
		tmp = t_1;
	elseif (y <= -2.7e-51)
		tmp = (x / (t - z)) / y;
	elseif (y <= -1.7e-65)
		tmp = (x / z) / z;
	elseif ((y <= -1e-106) || ~((y <= 2.75e-157)))
		tmp = (x / t) / (y - 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 / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -2e+190], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.5e+21], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-9], t$95$1, If[LessEqual[y, -2.7e-51], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, -1.7e-65], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[Or[LessEqual[y, -1e-106], N[Not[LessEqual[y, 2.75e-157]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] / N[(y - 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 - t}}{z}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+190}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

\mathbf{elif}\;y \leq -5.2 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-65}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;y \leq -1 \cdot 10^{-106} \lor \neg \left(y \leq 2.75 \cdot 10^{-157}\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -2.0000000000000001e190

    1. Initial program 83.3%

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

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

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

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

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

    if -2.0000000000000001e190 < y < -5.5e21

    1. Initial program 81.7%

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

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

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

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

    if -5.5e21 < y < -5.2000000000000002e-9 or -9.99999999999999941e-107 < y < 2.7499999999999999e-157

    1. Initial program 91.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv95.6%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num95.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity95.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg80.9%

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

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

    if -5.2000000000000002e-9 < y < -2.6999999999999997e-51

    1. Initial program 98.8%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv99.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
    9. Simplified68.6%

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

    if -2.6999999999999997e-51 < y < -1.69999999999999993e-65

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.5%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num100.0%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg99.5%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac299.5%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg99.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv99.5%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr99.5%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv99.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    16. Applied egg-rr99.5%

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

    if -1.69999999999999993e-65 < y < -9.99999999999999941e-107 or 2.7499999999999999e-157 < y

    1. Initial program 94.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+190}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-51}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-106} \lor \neg \left(y \leq 2.75 \cdot 10^{-157}\right):\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 62.4% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{+78}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-48}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 7.2 \cdot 10^{+213}\right) \land z \leq 3.6 \cdot 10^{+217}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= z -2.85e+144)
   (* (/ x z) (/ 1.0 z))
   (if (<= z -1.12e+78)
     (/ (/ x (- z)) t)
     (if (<= z -4.7e-42)
       (/ -1.0 (* y (/ z x)))
       (if (<= z 2.9e-48)
         (/ (/ x t) y)
         (if (or (<= z 3.6e+171) (and (not (<= z 7.2e+213)) (<= z 3.6e+217)))
           (/ (/ x z) z)
           (* x (/ (/ 1.0 z) z))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.85e+144) {
		tmp = (x / z) * (1.0 / z);
	} else if (z <= -1.12e+78) {
		tmp = (x / -z) / t;
	} else if (z <= -4.7e-42) {
		tmp = -1.0 / (y * (z / x));
	} else if (z <= 2.9e-48) {
		tmp = (x / t) / y;
	} else if ((z <= 3.6e+171) || (!(z <= 7.2e+213) && (z <= 3.6e+217))) {
		tmp = (x / z) / z;
	} else {
		tmp = x * ((1.0 / z) / 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 <= (-2.85d+144)) then
        tmp = (x / z) * (1.0d0 / z)
    else if (z <= (-1.12d+78)) then
        tmp = (x / -z) / t
    else if (z <= (-4.7d-42)) then
        tmp = (-1.0d0) / (y * (z / x))
    else if (z <= 2.9d-48) then
        tmp = (x / t) / y
    else if ((z <= 3.6d+171) .or. (.not. (z <= 7.2d+213)) .and. (z <= 3.6d+217)) then
        tmp = (x / z) / z
    else
        tmp = x * ((1.0d0 / z) / z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.85e+144) {
		tmp = (x / z) * (1.0 / z);
	} else if (z <= -1.12e+78) {
		tmp = (x / -z) / t;
	} else if (z <= -4.7e-42) {
		tmp = -1.0 / (y * (z / x));
	} else if (z <= 2.9e-48) {
		tmp = (x / t) / y;
	} else if ((z <= 3.6e+171) || (!(z <= 7.2e+213) && (z <= 3.6e+217))) {
		tmp = (x / z) / z;
	} else {
		tmp = x * ((1.0 / z) / z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -2.85e+144:
		tmp = (x / z) * (1.0 / z)
	elif z <= -1.12e+78:
		tmp = (x / -z) / t
	elif z <= -4.7e-42:
		tmp = -1.0 / (y * (z / x))
	elif z <= 2.9e-48:
		tmp = (x / t) / y
	elif (z <= 3.6e+171) or (not (z <= 7.2e+213) and (z <= 3.6e+217)):
		tmp = (x / z) / z
	else:
		tmp = x * ((1.0 / z) / z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -2.85e+144)
		tmp = Float64(Float64(x / z) * Float64(1.0 / z));
	elseif (z <= -1.12e+78)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	elseif (z <= -4.7e-42)
		tmp = Float64(-1.0 / Float64(y * Float64(z / x)));
	elseif (z <= 2.9e-48)
		tmp = Float64(Float64(x / t) / y);
	elseif ((z <= 3.6e+171) || (!(z <= 7.2e+213) && (z <= 3.6e+217)))
		tmp = Float64(Float64(x / z) / z);
	else
		tmp = Float64(x * Float64(Float64(1.0 / z) / 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 <= -2.85e+144)
		tmp = (x / z) * (1.0 / z);
	elseif (z <= -1.12e+78)
		tmp = (x / -z) / t;
	elseif (z <= -4.7e-42)
		tmp = -1.0 / (y * (z / x));
	elseif (z <= 2.9e-48)
		tmp = (x / t) / y;
	elseif ((z <= 3.6e+171) || (~((z <= 7.2e+213)) && (z <= 3.6e+217)))
		tmp = (x / z) / z;
	else
		tmp = x * ((1.0 / z) / z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[z, -2.85e+144], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.12e+78], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -4.7e-42], N[(-1.0 / N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-48], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[Or[LessEqual[z, 3.6e+171], And[N[Not[LessEqual[z, 7.2e+213]], $MachinePrecision], LessEqual[z, 3.6e+217]]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(1.0 / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\

\mathbf{elif}\;z \leq -1.12 \cdot 10^{+78}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\

\mathbf{elif}\;z \leq -4.7 \cdot 10^{-42}:\\
\;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 7.2 \cdot 10^{+213}\right) \land z \leq 3.6 \cdot 10^{+217}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.85000000000000002e144

    1. Initial program 83.7%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr100.0%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.9%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg98.4%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv95.0%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right) \cdot \frac{1}{z}} \]
      2. distribute-neg-frac295.0%

        \[\leadsto \color{blue}{\frac{-x}{-z}} \cdot \frac{1}{z} \]
      3. frac-2neg95.0%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr95.0%

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

    if -2.85000000000000002e144 < z < -1.12e78

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. times-frac44.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{z}}{t}} \]
      4. mul-1-neg44.7%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{t} \]
      5. distribute-frac-neg44.7%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{t}} \]
    11. Simplified44.7%

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

    if -1.12e78 < z < -4.7000000000000001e-42

    1. Initial program 96.1%

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Taylor expanded in y around inf 50.4%

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    8. Simplified35.2%

      \[\leadsto \color{blue}{\frac{-x}{z}} \cdot \frac{1}{y} \]
    9. Step-by-step derivation
      1. clear-num38.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{-x}}} \cdot \frac{1}{y} \]
      2. frac-2neg38.7%

        \[\leadsto \frac{1}{\frac{z}{-x}} \cdot \color{blue}{\frac{-1}{-y}} \]
      3. metadata-eval38.7%

        \[\leadsto \frac{1}{\frac{z}{-x}} \cdot \frac{\color{blue}{-1}}{-y} \]
      4. frac-times41.9%

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

        \[\leadsto \frac{\color{blue}{-1}}{\frac{z}{-x} \cdot \left(-y\right)} \]
      6. add-sqr-sqrt22.4%

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

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

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

        \[\leadsto \frac{-1}{\frac{z}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \cdot \left(-y\right)} \]
      10. add-sqr-sqrt13.8%

        \[\leadsto \frac{-1}{\frac{z}{\color{blue}{x}} \cdot \left(-y\right)} \]
      11. add-sqr-sqrt9.2%

        \[\leadsto \frac{-1}{\frac{z}{x} \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}} \]
      12. sqrt-unprod21.2%

        \[\leadsto \frac{-1}{\frac{z}{x} \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \]
      13. sqr-neg21.2%

        \[\leadsto \frac{-1}{\frac{z}{x} \cdot \sqrt{\color{blue}{y \cdot y}}} \]
      14. sqrt-unprod15.6%

        \[\leadsto \frac{-1}{\frac{z}{x} \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      15. add-sqr-sqrt41.9%

        \[\leadsto \frac{-1}{\frac{z}{x} \cdot \color{blue}{y}} \]
    10. Applied egg-rr41.9%

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

    if -4.7000000000000001e-42 < z < 2.9000000000000003e-48

    1. Initial program 93.6%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv92.4%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr92.4%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num91.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity92.5%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified66.0%

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

    if 2.9000000000000003e-48 < z < 3.60000000000000018e171 or 7.2000000000000002e213 < z < 3.6000000000000002e217

    1. Initial program 86.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv98.0%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num97.8%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity98.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg80.7%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac259.7%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg59.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv59.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr57.1%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv59.7%

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

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

    if 3.60000000000000018e171 < z < 7.2000000000000002e213 or 3.6000000000000002e217 < z

    1. Initial program 96.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv100.0%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg97.1%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified88.3%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac288.3%

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

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv88.3%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr96.8%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification68.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{+78}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-42}:\\ \;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-48}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 7.2 \cdot 10^{+213}\right) \land z \leq 3.6 \cdot 10^{+217}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 62.0% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-72}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-41}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 2.4 \cdot 10^{+214}\right) \land z \leq 3.6 \cdot 10^{+217}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ x z) (/ 1.0 z))))
   (if (<= z -2.85e+144)
     t_1
     (if (<= z -2.15e+84)
       (/ (/ x (- z)) t)
       (if (<= z -7.5e-72)
         t_1
         (if (<= z 5.5e-41)
           (/ (/ x t) y)
           (if (or (<= z 3.6e+171) (and (not (<= z 2.4e+214)) (<= z 3.6e+217)))
             (/ (/ x z) z)
             (* x (/ (/ 1.0 z) z)))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) * (1.0 / z);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = t_1;
	} else if (z <= -2.15e+84) {
		tmp = (x / -z) / t;
	} else if (z <= -7.5e-72) {
		tmp = t_1;
	} else if (z <= 5.5e-41) {
		tmp = (x / t) / y;
	} else if ((z <= 3.6e+171) || (!(z <= 2.4e+214) && (z <= 3.6e+217))) {
		tmp = (x / z) / z;
	} else {
		tmp = x * ((1.0 / z) / 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) :: t_1
    real(8) :: tmp
    t_1 = (x / z) * (1.0d0 / z)
    if (z <= (-2.85d+144)) then
        tmp = t_1
    else if (z <= (-2.15d+84)) then
        tmp = (x / -z) / t
    else if (z <= (-7.5d-72)) then
        tmp = t_1
    else if (z <= 5.5d-41) then
        tmp = (x / t) / y
    else if ((z <= 3.6d+171) .or. (.not. (z <= 2.4d+214)) .and. (z <= 3.6d+217)) then
        tmp = (x / z) / z
    else
        tmp = x * ((1.0d0 / z) / z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / z) * (1.0 / z);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = t_1;
	} else if (z <= -2.15e+84) {
		tmp = (x / -z) / t;
	} else if (z <= -7.5e-72) {
		tmp = t_1;
	} else if (z <= 5.5e-41) {
		tmp = (x / t) / y;
	} else if ((z <= 3.6e+171) || (!(z <= 2.4e+214) && (z <= 3.6e+217))) {
		tmp = (x / z) / z;
	} else {
		tmp = x * ((1.0 / z) / z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / z) * (1.0 / z)
	tmp = 0
	if z <= -2.85e+144:
		tmp = t_1
	elif z <= -2.15e+84:
		tmp = (x / -z) / t
	elif z <= -7.5e-72:
		tmp = t_1
	elif z <= 5.5e-41:
		tmp = (x / t) / y
	elif (z <= 3.6e+171) or (not (z <= 2.4e+214) and (z <= 3.6e+217)):
		tmp = (x / z) / z
	else:
		tmp = x * ((1.0 / z) / z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) * Float64(1.0 / z))
	tmp = 0.0
	if (z <= -2.85e+144)
		tmp = t_1;
	elseif (z <= -2.15e+84)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	elseif (z <= -7.5e-72)
		tmp = t_1;
	elseif (z <= 5.5e-41)
		tmp = Float64(Float64(x / t) / y);
	elseif ((z <= 3.6e+171) || (!(z <= 2.4e+214) && (z <= 3.6e+217)))
		tmp = Float64(Float64(x / z) / z);
	else
		tmp = Float64(x * Float64(Float64(1.0 / z) / z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / z) * (1.0 / z);
	tmp = 0.0;
	if (z <= -2.85e+144)
		tmp = t_1;
	elseif (z <= -2.15e+84)
		tmp = (x / -z) / t;
	elseif (z <= -7.5e-72)
		tmp = t_1;
	elseif (z <= 5.5e-41)
		tmp = (x / t) / y;
	elseif ((z <= 3.6e+171) || (~((z <= 2.4e+214)) && (z <= 3.6e+217)))
		tmp = (x / z) / z;
	else
		tmp = x * ((1.0 / z) / z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+144], t$95$1, If[LessEqual[z, -2.15e+84], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -7.5e-72], t$95$1, If[LessEqual[z, 5.5e-41], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[Or[LessEqual[z, 3.6e+171], And[N[Not[LessEqual[z, 2.4e+214]], $MachinePrecision], LessEqual[z, 3.6e+217]]], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], N[(x * N[(N[(1.0 / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.15 \cdot 10^{+84}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 2.4 \cdot 10^{+214}\right) \land z \leq 3.6 \cdot 10^{+217}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.85000000000000002e144 or -2.1499999999999998e84 < z < -7.5000000000000004e-72

    1. Initial program 90.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv99.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg77.9%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified69.2%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv69.3%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right) \cdot \frac{1}{z}} \]
      2. distribute-neg-frac269.3%

        \[\leadsto \color{blue}{\frac{-x}{-z}} \cdot \frac{1}{z} \]
      3. frac-2neg69.3%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr69.3%

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

    if -2.85000000000000002e144 < z < -2.1499999999999998e84

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. times-frac44.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{z}}{t}} \]
      4. mul-1-neg44.7%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{t} \]
      5. distribute-frac-neg44.7%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{t}} \]
    11. Simplified44.7%

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

    if -7.5000000000000004e-72 < z < 5.50000000000000022e-41

    1. Initial program 93.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr92.1%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv91.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv91.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num91.6%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity92.2%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified67.4%

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

    if 5.50000000000000022e-41 < z < 3.60000000000000018e171 or 2.4000000000000001e214 < z < 3.6000000000000002e217

    1. Initial program 86.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv98.0%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num97.8%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity98.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg80.7%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac259.7%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg59.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv59.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr57.1%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv59.7%

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

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

    if 3.60000000000000018e171 < z < 2.4000000000000001e214 or 3.6000000000000002e217 < z

    1. Initial program 96.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv100.0%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg97.1%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified88.3%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac288.3%

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

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv88.3%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr96.8%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification68.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-72}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-41}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 2.4 \cdot 10^{+214}\right) \land z \leq 3.6 \cdot 10^{+217}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.0% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := x \cdot \frac{\frac{1}{z}}{z}\\ t_2 := \frac{\frac{x}{z}}{z}\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-43}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 7.2 \cdot 10^{+213}\right) \land z \leq 3.6 \cdot 10^{+217}:\\ \;\;\;\;t\_2\\ \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 (/ (/ 1.0 z) z))) (t_2 (/ (/ x z) z)))
   (if (<= z -2.85e+144)
     t_2
     (if (<= z -3.2e+83)
       (/ (/ x (- z)) t)
       (if (<= z -7.6e-74)
         t_1
         (if (<= z 1.35e-43)
           (/ (/ x t) y)
           (if (or (<= z 3.6e+171) (and (not (<= z 7.2e+213)) (<= z 3.6e+217)))
             t_2
             t_1)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x * ((1.0 / z) / z);
	double t_2 = (x / z) / z;
	double tmp;
	if (z <= -2.85e+144) {
		tmp = t_2;
	} else if (z <= -3.2e+83) {
		tmp = (x / -z) / t;
	} else if (z <= -7.6e-74) {
		tmp = t_1;
	} else if (z <= 1.35e-43) {
		tmp = (x / t) / y;
	} else if ((z <= 3.6e+171) || (!(z <= 7.2e+213) && (z <= 3.6e+217))) {
		tmp = t_2;
	} 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 * ((1.0d0 / z) / z)
    t_2 = (x / z) / z
    if (z <= (-2.85d+144)) then
        tmp = t_2
    else if (z <= (-3.2d+83)) then
        tmp = (x / -z) / t
    else if (z <= (-7.6d-74)) then
        tmp = t_1
    else if (z <= 1.35d-43) then
        tmp = (x / t) / y
    else if ((z <= 3.6d+171) .or. (.not. (z <= 7.2d+213)) .and. (z <= 3.6d+217)) then
        tmp = t_2
    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 * ((1.0 / z) / z);
	double t_2 = (x / z) / z;
	double tmp;
	if (z <= -2.85e+144) {
		tmp = t_2;
	} else if (z <= -3.2e+83) {
		tmp = (x / -z) / t;
	} else if (z <= -7.6e-74) {
		tmp = t_1;
	} else if (z <= 1.35e-43) {
		tmp = (x / t) / y;
	} else if ((z <= 3.6e+171) || (!(z <= 7.2e+213) && (z <= 3.6e+217))) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x * ((1.0 / z) / z)
	t_2 = (x / z) / z
	tmp = 0
	if z <= -2.85e+144:
		tmp = t_2
	elif z <= -3.2e+83:
		tmp = (x / -z) / t
	elif z <= -7.6e-74:
		tmp = t_1
	elif z <= 1.35e-43:
		tmp = (x / t) / y
	elif (z <= 3.6e+171) or (not (z <= 7.2e+213) and (z <= 3.6e+217)):
		tmp = t_2
	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(Float64(1.0 / z) / z))
	t_2 = Float64(Float64(x / z) / z)
	tmp = 0.0
	if (z <= -2.85e+144)
		tmp = t_2;
	elseif (z <= -3.2e+83)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	elseif (z <= -7.6e-74)
		tmp = t_1;
	elseif (z <= 1.35e-43)
		tmp = Float64(Float64(x / t) / y);
	elseif ((z <= 3.6e+171) || (!(z <= 7.2e+213) && (z <= 3.6e+217)))
		tmp = t_2;
	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 * ((1.0 / z) / z);
	t_2 = (x / z) / z;
	tmp = 0.0;
	if (z <= -2.85e+144)
		tmp = t_2;
	elseif (z <= -3.2e+83)
		tmp = (x / -z) / t;
	elseif (z <= -7.6e-74)
		tmp = t_1;
	elseif (z <= 1.35e-43)
		tmp = (x / t) / y;
	elseif ((z <= 3.6e+171) || (~((z <= 7.2e+213)) && (z <= 3.6e+217)))
		tmp = t_2;
	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[(N[(1.0 / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2.85e+144], t$95$2, If[LessEqual[z, -3.2e+83], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -7.6e-74], t$95$1, If[LessEqual[z, 1.35e-43], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[Or[LessEqual[z, 3.6e+171], And[N[Not[LessEqual[z, 7.2e+213]], $MachinePrecision], LessEqual[z, 3.6e+217]]], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{1}{z}}{z}\\
t_2 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\

\mathbf{elif}\;z \leq -7.6 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 7.2 \cdot 10^{+213}\right) \land z \leq 3.6 \cdot 10^{+217}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.85000000000000002e144 or 1.34999999999999996e-43 < z < 3.60000000000000018e171 or 7.2000000000000002e213 < z < 3.6000000000000002e217

    1. Initial program 85.6%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv98.7%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num98.6%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity98.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified71.8%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac271.8%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg71.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv71.8%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr67.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv71.8%

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

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

    if -2.85000000000000002e144 < z < -3.1999999999999999e83

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. times-frac44.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{z}}{t}} \]
      4. mul-1-neg44.7%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{t} \]
      5. distribute-frac-neg44.7%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{t}} \]
    11. Simplified44.7%

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

    if -3.1999999999999999e83 < z < -7.5999999999999993e-74 or 3.60000000000000018e171 < z < 7.2000000000000002e213 or 3.6000000000000002e217 < z

    1. Initial program 96.7%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv96.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv99.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg77.9%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac266.7%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg66.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv66.8%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr71.0%

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

    if -7.5999999999999993e-74 < z < 1.34999999999999996e-43

    1. Initial program 93.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr92.1%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv91.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv91.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num91.6%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity92.2%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified67.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-74}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-43}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+171} \lor \neg \left(z \leq 7.2 \cdot 10^{+213}\right) \land z \leq 3.6 \cdot 10^{+217}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 72.6% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{y}}{t - z}\\ \mathbf{if}\;t \leq -1.55 \cdot 10^{-193}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-236}:\\ \;\;\;\;\frac{\frac{1}{z}}{\frac{z}{x}}\\ \mathbf{elif}\;t \leq 1.26 \cdot 10^{-188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-158}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-78}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{+86}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x y) (- t z))))
   (if (<= t -1.55e-193)
     t_1
     (if (<= t 2.4e-236)
       (/ (/ 1.0 z) (/ z x))
       (if (<= t 1.26e-188)
         t_1
         (if (<= t 4.8e-158)
           (/ (/ x z) z)
           (if (<= t 7.8e-78)
             t_1
             (if (<= t 1.25e-16)
               (/ x (* z z))
               (if (<= t 2.15e+86)
                 (/ x (* t (- y z)))
                 (/ (/ x t) (- y z)))))))))))
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 (t <= -1.55e-193) {
		tmp = t_1;
	} else if (t <= 2.4e-236) {
		tmp = (1.0 / z) / (z / x);
	} else if (t <= 1.26e-188) {
		tmp = t_1;
	} else if (t <= 4.8e-158) {
		tmp = (x / z) / z;
	} else if (t <= 7.8e-78) {
		tmp = t_1;
	} else if (t <= 1.25e-16) {
		tmp = x / (z * z);
	} else if (t <= 2.15e+86) {
		tmp = x / (t * (y - z));
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 (t <= (-1.55d-193)) then
        tmp = t_1
    else if (t <= 2.4d-236) then
        tmp = (1.0d0 / z) / (z / x)
    else if (t <= 1.26d-188) then
        tmp = t_1
    else if (t <= 4.8d-158) then
        tmp = (x / z) / z
    else if (t <= 7.8d-78) then
        tmp = t_1
    else if (t <= 1.25d-16) then
        tmp = x / (z * z)
    else if (t <= 2.15d+86) then
        tmp = x / (t * (y - z))
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / y) / (t - z);
	double tmp;
	if (t <= -1.55e-193) {
		tmp = t_1;
	} else if (t <= 2.4e-236) {
		tmp = (1.0 / z) / (z / x);
	} else if (t <= 1.26e-188) {
		tmp = t_1;
	} else if (t <= 4.8e-158) {
		tmp = (x / z) / z;
	} else if (t <= 7.8e-78) {
		tmp = t_1;
	} else if (t <= 1.25e-16) {
		tmp = x / (z * z);
	} else if (t <= 2.15e+86) {
		tmp = x / (t * (y - z));
	} else {
		tmp = (x / t) / (y - z);
	}
	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 t <= -1.55e-193:
		tmp = t_1
	elif t <= 2.4e-236:
		tmp = (1.0 / z) / (z / x)
	elif t <= 1.26e-188:
		tmp = t_1
	elif t <= 4.8e-158:
		tmp = (x / z) / z
	elif t <= 7.8e-78:
		tmp = t_1
	elif t <= 1.25e-16:
		tmp = x / (z * z)
	elif t <= 2.15e+86:
		tmp = x / (t * (y - z))
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) / Float64(t - z))
	tmp = 0.0
	if (t <= -1.55e-193)
		tmp = t_1;
	elseif (t <= 2.4e-236)
		tmp = Float64(Float64(1.0 / z) / Float64(z / x));
	elseif (t <= 1.26e-188)
		tmp = t_1;
	elseif (t <= 4.8e-158)
		tmp = Float64(Float64(x / z) / z);
	elseif (t <= 7.8e-78)
		tmp = t_1;
	elseif (t <= 1.25e-16)
		tmp = Float64(x / Float64(z * z));
	elseif (t <= 2.15e+86)
		tmp = Float64(x / Float64(t * Float64(y - z)));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / y) / (t - z);
	tmp = 0.0;
	if (t <= -1.55e-193)
		tmp = t_1;
	elseif (t <= 2.4e-236)
		tmp = (1.0 / z) / (z / x);
	elseif (t <= 1.26e-188)
		tmp = t_1;
	elseif (t <= 4.8e-158)
		tmp = (x / z) / z;
	elseif (t <= 7.8e-78)
		tmp = t_1;
	elseif (t <= 1.25e-16)
		tmp = x / (z * z);
	elseif (t <= 2.15e+86)
		tmp = x / (t * (y - z));
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.55e-193], t$95$1, If[LessEqual[t, 2.4e-236], N[(N[(1.0 / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.26e-188], t$95$1, If[LessEqual[t, 4.8e-158], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 7.8e-78], t$95$1, If[LessEqual[t, 1.25e-16], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.15e+86], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{y}}{t - z}\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{-193}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-236}:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{z}{x}}\\

\mathbf{elif}\;t \leq 1.26 \cdot 10^{-188}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.8 \cdot 10^{-158}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;t \leq 7.8 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.25 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{z \cdot z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if t < -1.5500000000000001e-193 or 2.4000000000000002e-236 < t < 1.26e-188 or 4.80000000000000015e-158 < t < 7.8000000000000004e-78

    1. Initial program 93.1%

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

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

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

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

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

    if -1.5500000000000001e-193 < t < 2.4000000000000002e-236

    1. Initial program 92.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv97.0%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num97.0%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity97.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac253.0%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg53.0%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr47.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
      3. clear-num53.0%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{z}}{\frac{z}{x}}} \]
      5. *-un-lft-identity53.0%

        \[\leadsto \frac{\color{blue}{\frac{1}{z}}}{\frac{z}{x}} \]
    16. Applied egg-rr53.0%

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

    if 1.26e-188 < t < 4.80000000000000015e-158

    1. Initial program 81.3%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr100.0%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv100.0%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg52.1%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified52.1%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac252.1%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg52.1%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv52.1%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr42.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv52.1%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    16. Applied egg-rr52.1%

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

    if 7.8000000000000004e-78 < t < 1.2500000000000001e-16

    1. Initial program 99.8%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num97.1%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity97.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac271.0%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg71.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv71.1%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr71.0%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{z}} \]
      4. frac-2neg71.1%

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

        \[\leadsto \frac{\color{blue}{-1}}{-z} \cdot \frac{x}{z} \]
      6. frac-2neg71.1%

        \[\leadsto \frac{-1}{-z} \cdot \color{blue}{\frac{-x}{-z}} \]
      7. frac-times71.1%

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

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

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

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

    if 1.2500000000000001e-16 < t < 2.1500000000000001e86

    1. Initial program 89.6%

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

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

    if 2.1500000000000001e86 < t

    1. Initial program 82.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.55 \cdot 10^{-193}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-236}:\\ \;\;\;\;\frac{\frac{1}{z}}{\frac{z}{x}}\\ \mathbf{elif}\;t \leq 1.26 \cdot 10^{-188}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-158}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-78}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{+86}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 69.8% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{t}}{y - z}\\ t_2 := \frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{1}{z}}{\frac{z}{x}}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-269}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-118}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-94}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5000000000:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x t) (- y z))) (t_2 (/ x (* (- t z) y))))
   (if (<= z -2.85e+144)
     (/ (/ 1.0 z) (/ z x))
     (if (<= z -9.2e+60)
       t_1
       (if (<= z 5.8e-269)
         t_2
         (if (<= z 4.8e-118)
           t_1
           (if (<= z 1.85e-94)
             t_2
             (if (<= z 7.8e-22)
               t_1
               (if (<= z 5000000000.0) t_2 (* x (/ (/ 1.0 z) z)))))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / t) / (y - z);
	double t_2 = x / ((t - z) * y);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = (1.0 / z) / (z / x);
	} else if (z <= -9.2e+60) {
		tmp = t_1;
	} else if (z <= 5.8e-269) {
		tmp = t_2;
	} else if (z <= 4.8e-118) {
		tmp = t_1;
	} else if (z <= 1.85e-94) {
		tmp = t_2;
	} else if (z <= 7.8e-22) {
		tmp = t_1;
	} else if (z <= 5000000000.0) {
		tmp = t_2;
	} else {
		tmp = x * ((1.0 / z) / 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x / t) / (y - z)
    t_2 = x / ((t - z) * y)
    if (z <= (-2.85d+144)) then
        tmp = (1.0d0 / z) / (z / x)
    else if (z <= (-9.2d+60)) then
        tmp = t_1
    else if (z <= 5.8d-269) then
        tmp = t_2
    else if (z <= 4.8d-118) then
        tmp = t_1
    else if (z <= 1.85d-94) then
        tmp = t_2
    else if (z <= 7.8d-22) then
        tmp = t_1
    else if (z <= 5000000000.0d0) then
        tmp = t_2
    else
        tmp = x * ((1.0d0 / z) / z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / t) / (y - z);
	double t_2 = x / ((t - z) * y);
	double tmp;
	if (z <= -2.85e+144) {
		tmp = (1.0 / z) / (z / x);
	} else if (z <= -9.2e+60) {
		tmp = t_1;
	} else if (z <= 5.8e-269) {
		tmp = t_2;
	} else if (z <= 4.8e-118) {
		tmp = t_1;
	} else if (z <= 1.85e-94) {
		tmp = t_2;
	} else if (z <= 7.8e-22) {
		tmp = t_1;
	} else if (z <= 5000000000.0) {
		tmp = t_2;
	} else {
		tmp = x * ((1.0 / z) / z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / t) / (y - z)
	t_2 = x / ((t - z) * y)
	tmp = 0
	if z <= -2.85e+144:
		tmp = (1.0 / z) / (z / x)
	elif z <= -9.2e+60:
		tmp = t_1
	elif z <= 5.8e-269:
		tmp = t_2
	elif z <= 4.8e-118:
		tmp = t_1
	elif z <= 1.85e-94:
		tmp = t_2
	elif z <= 7.8e-22:
		tmp = t_1
	elif z <= 5000000000.0:
		tmp = t_2
	else:
		tmp = x * ((1.0 / z) / z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / t) / Float64(y - z))
	t_2 = Float64(x / Float64(Float64(t - z) * y))
	tmp = 0.0
	if (z <= -2.85e+144)
		tmp = Float64(Float64(1.0 / z) / Float64(z / x));
	elseif (z <= -9.2e+60)
		tmp = t_1;
	elseif (z <= 5.8e-269)
		tmp = t_2;
	elseif (z <= 4.8e-118)
		tmp = t_1;
	elseif (z <= 1.85e-94)
		tmp = t_2;
	elseif (z <= 7.8e-22)
		tmp = t_1;
	elseif (z <= 5000000000.0)
		tmp = t_2;
	else
		tmp = Float64(x * Float64(Float64(1.0 / z) / z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / t) / (y - z);
	t_2 = x / ((t - z) * y);
	tmp = 0.0;
	if (z <= -2.85e+144)
		tmp = (1.0 / z) / (z / x);
	elseif (z <= -9.2e+60)
		tmp = t_1;
	elseif (z <= 5.8e-269)
		tmp = t_2;
	elseif (z <= 4.8e-118)
		tmp = t_1;
	elseif (z <= 1.85e-94)
		tmp = t_2;
	elseif (z <= 7.8e-22)
		tmp = t_1;
	elseif (z <= 5000000000.0)
		tmp = t_2;
	else
		tmp = x * ((1.0 / z) / z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.85e+144], N[(N[(1.0 / z), $MachinePrecision] / N[(z / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.2e+60], t$95$1, If[LessEqual[z, 5.8e-269], t$95$2, If[LessEqual[z, 4.8e-118], t$95$1, If[LessEqual[z, 1.85e-94], t$95$2, If[LessEqual[z, 7.8e-22], t$95$1, If[LessEqual[z, 5000000000.0], t$95$2, N[(x * N[(N[(1.0 / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y - z}\\
t_2 := \frac{x}{\left(t - z\right) \cdot y}\\
\mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\
\;\;\;\;\frac{\frac{1}{z}}{\frac{z}{x}}\\

\mathbf{elif}\;z \leq -9.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-269}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{-94}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 5000000000:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.85000000000000002e144

    1. Initial program 83.7%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr100.0%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.9%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg98.4%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac294.9%

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr86.9%

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
      3. clear-num95.0%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{z}}{\frac{z}{x}}} \]
      5. *-un-lft-identity95.0%

        \[\leadsto \frac{\color{blue}{\frac{1}{z}}}{\frac{z}{x}} \]
    16. Applied egg-rr95.0%

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

    if -2.85000000000000002e144 < z < -9.20000000000000068e60 or 5.8000000000000002e-269 < z < 4.8000000000000003e-118 or 1.8499999999999999e-94 < z < 7.79999999999999996e-22

    1. Initial program 87.1%

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

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

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

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

    if -9.20000000000000068e60 < z < 5.8000000000000002e-269 or 4.8000000000000003e-118 < z < 1.8499999999999999e-94 or 7.79999999999999996e-22 < z < 5e9

    1. Initial program 95.0%

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

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

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

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

    if 5e9 < z

    1. Initial program 89.9%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv99.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified74.1%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac274.1%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg74.1%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv74.1%

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

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

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

Alternative 11: 72.7% accurate, 0.2× 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_2 := \frac{\frac{x}{t - z}}{y}\\ \mathbf{if}\;t \leq -4.3 \cdot 10^{-198}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-257}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-263}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-150}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 1.82 \cdot 10^{-25}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x z) z)) (t_2 (/ (/ x (- t z)) y)))
   (if (<= t -4.3e-198)
     t_2
     (if (<= t -2.2e-257)
       t_1
       (if (<= t 9.5e-263)
         t_2
         (if (<= t 1.65e-150)
           t_1
           (if (<= t 5e-87)
             (/ (/ x y) (- t z))
             (if (<= t 1.82e-25) (/ x (* z z)) (/ (/ x t) (- y z))))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double t_2 = (x / (t - z)) / y;
	double tmp;
	if (t <= -4.3e-198) {
		tmp = t_2;
	} else if (t <= -2.2e-257) {
		tmp = t_1;
	} else if (t <= 9.5e-263) {
		tmp = t_2;
	} else if (t <= 1.65e-150) {
		tmp = t_1;
	} else if (t <= 5e-87) {
		tmp = (x / y) / (t - z);
	} else if (t <= 1.82e-25) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 / z) / z
    t_2 = (x / (t - z)) / y
    if (t <= (-4.3d-198)) then
        tmp = t_2
    else if (t <= (-2.2d-257)) then
        tmp = t_1
    else if (t <= 9.5d-263) then
        tmp = t_2
    else if (t <= 1.65d-150) then
        tmp = t_1
    else if (t <= 5d-87) then
        tmp = (x / y) / (t - z)
    else if (t <= 1.82d-25) then
        tmp = x / (z * z)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double t_2 = (x / (t - z)) / y;
	double tmp;
	if (t <= -4.3e-198) {
		tmp = t_2;
	} else if (t <= -2.2e-257) {
		tmp = t_1;
	} else if (t <= 9.5e-263) {
		tmp = t_2;
	} else if (t <= 1.65e-150) {
		tmp = t_1;
	} else if (t <= 5e-87) {
		tmp = (x / y) / (t - z);
	} else if (t <= 1.82e-25) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / z) / z
	t_2 = (x / (t - z)) / y
	tmp = 0
	if t <= -4.3e-198:
		tmp = t_2
	elif t <= -2.2e-257:
		tmp = t_1
	elif t <= 9.5e-263:
		tmp = t_2
	elif t <= 1.65e-150:
		tmp = t_1
	elif t <= 5e-87:
		tmp = (x / y) / (t - z)
	elif t <= 1.82e-25:
		tmp = x / (z * z)
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) / z)
	t_2 = Float64(Float64(x / Float64(t - z)) / y)
	tmp = 0.0
	if (t <= -4.3e-198)
		tmp = t_2;
	elseif (t <= -2.2e-257)
		tmp = t_1;
	elseif (t <= 9.5e-263)
		tmp = t_2;
	elseif (t <= 1.65e-150)
		tmp = t_1;
	elseif (t <= 5e-87)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (t <= 1.82e-25)
		tmp = Float64(x / Float64(z * z));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / z) / z;
	t_2 = (x / (t - z)) / y;
	tmp = 0.0;
	if (t <= -4.3e-198)
		tmp = t_2;
	elseif (t <= -2.2e-257)
		tmp = t_1;
	elseif (t <= 9.5e-263)
		tmp = t_2;
	elseif (t <= 1.65e-150)
		tmp = t_1;
	elseif (t <= 5e-87)
		tmp = (x / y) / (t - z);
	elseif (t <= 1.82e-25)
		tmp = x / (z * z);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -4.3e-198], t$95$2, If[LessEqual[t, -2.2e-257], t$95$1, If[LessEqual[t, 9.5e-263], t$95$2, If[LessEqual[t, 1.65e-150], t$95$1, If[LessEqual[t, 5e-87], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.82e-25], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{\frac{x}{t - z}}{y}\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-198}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -2.2 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-263}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{-150}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.82 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -4.3000000000000003e-198 or -2.19999999999999988e-257 < t < 9.5000000000000005e-263

    1. Initial program 92.8%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv96.7%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num96.6%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity96.6%

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

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

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

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

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

    if -4.3000000000000003e-198 < t < -2.19999999999999988e-257 or 9.5000000000000005e-263 < t < 1.6500000000000001e-150

    1. Initial program 92.2%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv91.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr91.0%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.9%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg65.0%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified65.2%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac265.2%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg65.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv65.1%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr57.6%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv65.2%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    16. Applied egg-rr65.2%

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

    if 1.6500000000000001e-150 < t < 5.00000000000000042e-87

    1. Initial program 92.2%

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

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

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

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

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

    if 5.00000000000000042e-87 < t < 1.8199999999999999e-25

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.8%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv96.9%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num97.0%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity97.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg81.7%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac275.4%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg75.4%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv75.5%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr75.4%

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
      3. *-commutative75.5%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{z}} \]
      4. frac-2neg75.5%

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

        \[\leadsto \frac{\color{blue}{-1}}{-z} \cdot \frac{x}{z} \]
      6. frac-2neg75.5%

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

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

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

        \[\leadsto \frac{\color{blue}{x}}{\left(-z\right) \cdot \left(-z\right)} \]
    16. Applied egg-rr75.5%

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

    if 1.8199999999999999e-25 < t

    1. Initial program 84.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-198}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;t \leq -2.2 \cdot 10^{-257}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-263}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{-150}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 1.82 \cdot 10^{-25}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 67.8% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq -8.6 \cdot 10^{+80}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\

\mathbf{elif}\;z \leq -2.6 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.85000000000000002e144 or -8.60000000000000008e80 < z < -2.6000000000000001e41

    1. Initial program 87.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv99.8%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv88.0%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right) \cdot \frac{1}{z}} \]
      2. distribute-neg-frac288.0%

        \[\leadsto \color{blue}{\frac{-x}{-z}} \cdot \frac{1}{z} \]
      3. frac-2neg88.0%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr88.0%

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

    if -2.85000000000000002e144 < z < -8.60000000000000008e80

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. times-frac44.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{z}}{t}} \]
      4. mul-1-neg44.7%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{t} \]
      5. distribute-frac-neg44.7%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{t}} \]
    11. Simplified44.7%

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

    if -2.6000000000000001e41 < z < 3.60000000000000012e-66

    1. Initial program 94.4%

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

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

    if 3.60000000000000012e-66 < z

    1. Initial program 89.5%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv98.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv98.7%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num98.6%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity98.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac267.7%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg67.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv67.7%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr69.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{+80}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-66}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.9% 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}\\ \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-72} \lor \neg \left(z \leq 1.8 \cdot 10^{-110}\right):\\ \;\;\;\;t\_1\\ \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
 (let* ((t_1 (/ (/ x z) z)))
   (if (<= z -2.85e+144)
     t_1
     (if (<= z -3.2e+83)
       (/ (/ x (- z)) t)
       (if (or (<= z -2.4e-72) (not (<= z 1.8e-110))) t_1 (/ (/ x t) y))))))
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 <= -2.85e+144) {
		tmp = t_1;
	} else if (z <= -3.2e+83) {
		tmp = (x / -z) / t;
	} else if ((z <= -2.4e-72) || !(z <= 1.8e-110)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (x / z) / z
    if (z <= (-2.85d+144)) then
        tmp = t_1
    else if (z <= (-3.2d+83)) then
        tmp = (x / -z) / t
    else if ((z <= (-2.4d-72)) .or. (.not. (z <= 1.8d-110))) then
        tmp = t_1
    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 t_1 = (x / z) / z;
	double tmp;
	if (z <= -2.85e+144) {
		tmp = t_1;
	} else if (z <= -3.2e+83) {
		tmp = (x / -z) / t;
	} else if ((z <= -2.4e-72) || !(z <= 1.8e-110)) {
		tmp = t_1;
	} else {
		tmp = (x / t) / y;
	}
	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 <= -2.85e+144:
		tmp = t_1
	elif z <= -3.2e+83:
		tmp = (x / -z) / t
	elif (z <= -2.4e-72) or not (z <= 1.8e-110):
		tmp = t_1
	else:
		tmp = (x / t) / y
	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 <= -2.85e+144)
		tmp = t_1;
	elseif (z <= -3.2e+83)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	elseif ((z <= -2.4e-72) || !(z <= 1.8e-110))
		tmp = t_1;
	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)
	t_1 = (x / z) / z;
	tmp = 0.0;
	if (z <= -2.85e+144)
		tmp = t_1;
	elseif (z <= -3.2e+83)
		tmp = (x / -z) / t;
	elseif ((z <= -2.4e-72) || ~((z <= 1.8e-110)))
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2.85e+144], t$95$1, If[LessEqual[z, -3.2e+83], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, -2.4e-72], N[Not[LessEqual[z, 1.8e-110]], $MachinePrecision]], t$95$1, N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]]]
\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 -2.85 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-72} \lor \neg \left(z \leq 1.8 \cdot 10^{-110}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.85000000000000002e144 or -3.1999999999999999e83 < z < -2.4e-72 or 1.79999999999999997e-110 < z

    1. Initial program 90.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.1%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified66.6%

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac266.6%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg66.6%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv66.6%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr65.9%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv66.6%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    16. Applied egg-rr66.6%

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

    if -2.85000000000000002e144 < z < -3.1999999999999999e83

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. times-frac44.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{z}}{t}} \]
      4. mul-1-neg44.7%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{t} \]
      5. distribute-frac-neg44.7%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{t}} \]
    11. Simplified44.7%

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

    if -2.4e-72 < z < 1.79999999999999997e-110

    1. Initial program 93.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv90.8%

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num90.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity91.4%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified70.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-72} \lor \neg \left(z \leq 1.8 \cdot 10^{-110}\right):\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 80.8% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.49999999999999999e53

    1. Initial program 92.1%

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

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

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

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

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

    if -1.49999999999999999e53 < t < 5.8000000000000004e43

    1. Initial program 93.1%

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

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

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

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

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

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

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

    if 5.8000000000000004e43 < t < 2.0000000000000001e142

    1. Initial program 94.4%

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

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

    if 2.0000000000000001e142 < t

    1. Initial program 78.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+53}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+43}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+142}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.1% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.99999999999999998e-73 or 1.79999999999999997e-110 < z

    1. Initial program 89.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.1%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity99.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{x}{t - z}}{z}} \]
      4. mul-1-neg77.9%

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

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

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

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

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

      \[\leadsto \frac{-\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. distribute-neg-frac263.5%

        \[\leadsto \frac{\color{blue}{\frac{-x}{-z}}}{z} \]
      2. frac-2neg63.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
      3. div-inv63.6%

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{z}} \]
    14. Applied egg-rr62.9%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{z}} \]
      2. div-inv63.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{z} \]
    16. Applied egg-rr63.5%

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

    if -7.99999999999999998e-73 < z < 1.79999999999999997e-110

    1. Initial program 93.7%

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

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

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr92.3%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. associate-*l/90.6%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv90.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv90.8%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num90.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/91.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity91.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{t - z}}}{\frac{y - z}{x}} \]
    6. Applied egg-rr91.4%

      \[\leadsto \color{blue}{\frac{\frac{1}{t - z}}{\frac{y - z}{x}}} \]
    7. Taylor expanded in z around 0 67.2%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/r*70.3%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified70.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-73} \lor \neg \left(z \leq 1.8 \cdot 10^{-110}\right):\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 45.3% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+174} \lor \neg \left(z \leq 7.8 \cdot 10^{-7}\right):\\ \;\;\;\;\frac{x}{z \cdot y}\\ \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 -8e+174) (not (<= z 7.8e-7))) (/ x (* z y)) (/ x (* t y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -8e+174) || !(z <= 7.8e-7)) {
		tmp = x / (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 ((z <= (-8d+174)) .or. (.not. (z <= 7.8d-7))) then
        tmp = x / (z * y)
    else
        tmp = x / (t * y)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -8e+174) || !(z <= 7.8e-7)) {
		tmp = x / (z * y);
	} else {
		tmp = x / (t * y);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -8e+174) or not (z <= 7.8e-7):
		tmp = x / (z * y)
	else:
		tmp = x / (t * y)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -8e+174) || !(z <= 7.8e-7))
		tmp = Float64(x / Float64(z * y));
	else
		tmp = Float64(x / Float64(t * y));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -8e+174) || ~((z <= 7.8e-7)))
		tmp = x / (z * y);
	else
		tmp = x / (t * y);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8e+174], N[Not[LessEqual[z, 7.8e-7]], $MachinePrecision]], N[(x / N[(z * y), $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 -8 \cdot 10^{+174} \lor \neg \left(z \leq 7.8 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x}{z \cdot y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.00000000000000055e174 or 7.80000000000000049e-7 < z

    1. Initial program 89.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.8%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
      3. div-inv99.7%

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*90.6%

        \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    4. Applied egg-rr90.6%

      \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    5. Taylor expanded in t around 0 82.2%

      \[\leadsto x \cdot \color{blue}{\frac{-1}{z \cdot \left(y - z\right)}} \]
    6. Taylor expanded in z around 0 39.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg39.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac239.6%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. *-commutative39.6%

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out39.6%

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(-y\right)}} \]
    8. Simplified39.6%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(-y\right)}} \]
    9. Step-by-step derivation
      1. frac-2neg39.6%

        \[\leadsto \color{blue}{\frac{-x}{-z \cdot \left(-y\right)}} \]
      2. div-inv39.6%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{-z \cdot \left(-y\right)}} \]
      3. add-sqr-sqrt17.6%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      4. sqrt-unprod43.4%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      5. sqr-neg43.4%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      6. sqrt-unprod17.2%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      7. add-sqr-sqrt32.9%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      8. distribute-rgt-neg-out32.9%

        \[\leadsto x \cdot \frac{1}{-\color{blue}{\left(-z \cdot y\right)}} \]
      9. remove-double-neg32.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt12.3%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      11. sqrt-unprod35.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg35.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}}} \]
      13. sqrt-unprod24.6%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}} \]
      14. add-sqr-sqrt39.6%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(-y\right)}} \]
      15. *-commutative39.6%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(-y\right) \cdot z}} \]
      16. add-sqr-sqrt24.6%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot z} \]
      17. sqrt-unprod35.7%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot z} \]
      18. sqr-neg35.7%

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod12.3%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot z} \]
      20. add-sqr-sqrt32.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{y} \cdot z} \]
    10. Applied egg-rr32.9%

      \[\leadsto \color{blue}{x \cdot \frac{1}{y \cdot z}} \]
    11. Step-by-step derivation
      1. associate-*r/32.9%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity32.9%

        \[\leadsto \frac{\color{blue}{x}}{y \cdot z} \]
    12. Simplified32.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]

    if -8.00000000000000055e174 < z < 7.80000000000000049e-7

    1. Initial program 91.9%

      \[\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}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+174} \lor \neg \left(z \leq 7.8 \cdot 10^{-7}\right):\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 48.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.55 \cdot 10^{+178}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 0.16:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{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 -1.55e+178)
   (/ x (* z y))
   (if (<= z 0.16) (/ (/ x t) y) (/ (/ x z) y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.55e+178) {
		tmp = x / (z * y);
	} else if (z <= 0.16) {
		tmp = (x / t) / y;
	} else {
		tmp = (x / 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 <= (-1.55d+178)) then
        tmp = x / (z * y)
    else if (z <= 0.16d0) then
        tmp = (x / t) / y
    else
        tmp = (x / 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 <= -1.55e+178) {
		tmp = x / (z * y);
	} else if (z <= 0.16) {
		tmp = (x / t) / y;
	} else {
		tmp = (x / z) / y;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -1.55e+178:
		tmp = x / (z * y)
	elif z <= 0.16:
		tmp = (x / t) / y
	else:
		tmp = (x / z) / y
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.55e+178)
		tmp = Float64(x / Float64(z * y));
	elseif (z <= 0.16)
		tmp = Float64(Float64(x / t) / y);
	else
		tmp = Float64(Float64(x / 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 <= -1.55e+178)
		tmp = x / (z * y);
	elseif (z <= 0.16)
		tmp = (x / t) / y;
	else
		tmp = (x / 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, -1.55e+178], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.16], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+178}:\\
\;\;\;\;\frac{x}{z \cdot y}\\

\mathbf{elif}\;z \leq 0.16:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.54999999999999996e178

    1. Initial program 90.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
      3. div-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*90.2%

        \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    4. Applied egg-rr90.2%

      \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    5. Taylor expanded in t around 0 90.2%

      \[\leadsto x \cdot \color{blue}{\frac{-1}{z \cdot \left(y - z\right)}} \]
    6. Taylor expanded in z around 0 59.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg59.9%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac259.9%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. *-commutative59.9%

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out59.9%

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(-y\right)}} \]
    8. Simplified59.9%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(-y\right)}} \]
    9. Step-by-step derivation
      1. frac-2neg59.9%

        \[\leadsto \color{blue}{\frac{-x}{-z \cdot \left(-y\right)}} \]
      2. div-inv59.9%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{-z \cdot \left(-y\right)}} \]
      3. add-sqr-sqrt22.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      4. sqrt-unprod59.4%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      5. sqr-neg59.4%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      6. sqrt-unprod37.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      7. add-sqr-sqrt59.8%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      8. distribute-rgt-neg-out59.8%

        \[\leadsto x \cdot \frac{1}{-\color{blue}{\left(-z \cdot y\right)}} \]
      9. remove-double-neg59.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt17.0%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      11. sqrt-unprod59.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg59.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}}} \]
      13. sqrt-unprod42.8%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}} \]
      14. add-sqr-sqrt59.9%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(-y\right)}} \]
      15. *-commutative59.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(-y\right) \cdot z}} \]
      16. add-sqr-sqrt42.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot z} \]
      17. sqrt-unprod59.7%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot z} \]
      18. sqr-neg59.7%

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod17.0%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot z} \]
      20. add-sqr-sqrt59.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{y} \cdot z} \]
    10. Applied egg-rr59.8%

      \[\leadsto \color{blue}{x \cdot \frac{1}{y \cdot z}} \]
    11. Step-by-step derivation
      1. associate-*r/59.8%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity59.8%

        \[\leadsto \frac{\color{blue}{x}}{y \cdot z} \]
    12. Simplified59.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]

    if -1.54999999999999996e178 < z < 0.160000000000000003

    1. Initial program 91.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/93.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv93.7%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr93.7%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. associate-*l/93.9%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv94.1%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv94.1%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num94.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/94.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity94.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{t - z}}}{\frac{y - z}{x}} \]
    6. Applied egg-rr94.4%

      \[\leadsto \color{blue}{\frac{\frac{1}{t - z}}{\frac{y - z}{x}}} \]
    7. Taylor expanded in z around 0 48.3%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/r*52.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified52.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]

    if 0.160000000000000003 < z

    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-/l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Taylor expanded in y around inf 46.8%

      \[\leadsto \frac{x}{t - z} \cdot \color{blue}{\frac{1}{y}} \]
    6. Taylor expanded in t around 0 44.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{z}\right)} \cdot \frac{1}{y} \]
    7. Step-by-step derivation
      1. associate-*r/83.6%

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y - z} \]
      2. neg-mul-183.6%

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    8. Simplified44.5%

      \[\leadsto \color{blue}{\frac{-x}{z}} \cdot \frac{1}{y} \]
    9. Step-by-step derivation
      1. un-div-inv44.5%

        \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{y}} \]
      2. distribute-frac-neg44.5%

        \[\leadsto \frac{\color{blue}{-\frac{x}{z}}}{y} \]
      3. distribute-frac-neg44.5%

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{y}} \]
      4. distribute-frac-neg244.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-y}} \]
      5. add-sqr-sqrt25.3%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \]
      6. sqrt-unprod29.0%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \]
      7. sqr-neg29.0%

        \[\leadsto \frac{\frac{x}{z}}{\sqrt{\color{blue}{y \cdot y}}} \]
      8. sqrt-unprod15.7%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      9. add-sqr-sqrt34.6%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{y}} \]
    10. Applied egg-rr34.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+178}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 0.16:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 48.2% 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 \cdot 10^{+180}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-39}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{t}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1e+180)
   (/ x (* z y))
   (if (<= z 5.6e-39) (/ (/ x t) y) (/ (/ x z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1e+180) {
		tmp = x / (z * y);
	} else if (z <= 5.6e-39) {
		tmp = (x / t) / y;
	} else {
		tmp = (x / z) / 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 <= (-1d+180)) then
        tmp = x / (z * y)
    else if (z <= 5.6d-39) then
        tmp = (x / t) / y
    else
        tmp = (x / z) / t
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1e+180) {
		tmp = x / (z * y);
	} else if (z <= 5.6e-39) {
		tmp = (x / t) / y;
	} else {
		tmp = (x / z) / t;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -1e+180:
		tmp = x / (z * y)
	elif z <= 5.6e-39:
		tmp = (x / t) / y
	else:
		tmp = (x / z) / t
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1e+180)
		tmp = Float64(x / Float64(z * y));
	elseif (z <= 5.6e-39)
		tmp = Float64(Float64(x / t) / y);
	else
		tmp = Float64(Float64(x / z) / t);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1e+180)
		tmp = x / (z * y);
	elseif (z <= 5.6e-39)
		tmp = (x / t) / y;
	else
		tmp = (x / z) / t;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[z, -1e+180], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-39], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+180}:\\
\;\;\;\;\frac{x}{z \cdot y}\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1e180

    1. Initial program 90.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
      3. div-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*90.2%

        \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    4. Applied egg-rr90.2%

      \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    5. Taylor expanded in t around 0 90.2%

      \[\leadsto x \cdot \color{blue}{\frac{-1}{z \cdot \left(y - z\right)}} \]
    6. Taylor expanded in z around 0 59.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg59.9%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac259.9%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. *-commutative59.9%

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out59.9%

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(-y\right)}} \]
    8. Simplified59.9%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(-y\right)}} \]
    9. Step-by-step derivation
      1. frac-2neg59.9%

        \[\leadsto \color{blue}{\frac{-x}{-z \cdot \left(-y\right)}} \]
      2. div-inv59.9%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{-z \cdot \left(-y\right)}} \]
      3. add-sqr-sqrt22.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      4. sqrt-unprod59.4%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      5. sqr-neg59.4%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      6. sqrt-unprod37.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      7. add-sqr-sqrt59.8%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      8. distribute-rgt-neg-out59.8%

        \[\leadsto x \cdot \frac{1}{-\color{blue}{\left(-z \cdot y\right)}} \]
      9. remove-double-neg59.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt17.0%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      11. sqrt-unprod59.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg59.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}}} \]
      13. sqrt-unprod42.8%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}} \]
      14. add-sqr-sqrt59.9%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(-y\right)}} \]
      15. *-commutative59.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(-y\right) \cdot z}} \]
      16. add-sqr-sqrt42.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot z} \]
      17. sqrt-unprod59.7%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot z} \]
      18. sqr-neg59.7%

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod17.0%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot z} \]
      20. add-sqr-sqrt59.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{y} \cdot z} \]
    10. Applied egg-rr59.8%

      \[\leadsto \color{blue}{x \cdot \frac{1}{y \cdot z}} \]
    11. Step-by-step derivation
      1. associate-*r/59.8%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity59.8%

        \[\leadsto \frac{\color{blue}{x}}{y \cdot z} \]
    12. Simplified59.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]

    if -1e180 < z < 5.6000000000000003e-39

    1. Initial program 91.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/93.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv93.5%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr93.5%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. associate-*l/94.3%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv94.4%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv94.4%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/94.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity94.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{t - z}}}{\frac{y - z}{x}} \]
    6. Applied egg-rr94.8%

      \[\leadsto \color{blue}{\frac{\frac{1}{t - z}}{\frac{y - z}{x}}} \]
    7. Taylor expanded in z around 0 50.0%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/r*54.4%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified54.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]

    if 5.6000000000000003e-39 < z

    1. Initial program 90.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 40.0%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
    6. Taylor expanded in y around 0 35.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/35.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. neg-mul-135.5%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    8. Simplified35.5%

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt16.5%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      2. sqrt-unprod34.6%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      3. sqr-neg34.6%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot x}}}{t \cdot z} \]
      4. sqrt-unprod14.2%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      5. add-sqr-sqrt26.1%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot z} \]
      6. *-un-lft-identity26.1%

        \[\leadsto \color{blue}{1 \cdot \frac{x}{t \cdot z}} \]
      7. associate-/r*24.9%

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
    10. Applied egg-rr24.9%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{t}}{z}} \]
    11. Step-by-step derivation
      1. *-lft-identity24.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. associate-/r*26.1%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
      3. *-lft-identity26.1%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot z} \]
      4. times-frac32.5%

        \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{z}} \]
      5. associate-*l/32.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{z}}{t}} \]
      6. *-lft-identity32.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{t} \]
    12. Simplified32.5%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+180}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-39}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 48.6% 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.55 \cdot 10^{+178}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+44}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.55e+178)
   (/ x (* z y))
   (if (<= z 7.2e+44) (/ (/ x t) y) (/ x (* t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.55e+178) {
		tmp = x / (z * y);
	} else if (z <= 7.2e+44) {
		tmp = (x / t) / y;
	} else {
		tmp = x / (t * 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.55d+178)) then
        tmp = x / (z * y)
    else if (z <= 7.2d+44) then
        tmp = (x / t) / y
    else
        tmp = x / (t * z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.55e+178) {
		tmp = x / (z * y);
	} else if (z <= 7.2e+44) {
		tmp = (x / t) / y;
	} else {
		tmp = x / (t * z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -1.55e+178:
		tmp = x / (z * y)
	elif z <= 7.2e+44:
		tmp = (x / t) / y
	else:
		tmp = x / (t * z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.55e+178)
		tmp = Float64(x / Float64(z * y));
	elseif (z <= 7.2e+44)
		tmp = Float64(Float64(x / t) / y);
	else
		tmp = Float64(x / Float64(t * z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.55e+178)
		tmp = x / (z * y);
	elseif (z <= 7.2e+44)
		tmp = (x / t) / y;
	else
		tmp = x / (t * z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+178], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+44], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+178}:\\
\;\;\;\;\frac{x}{z \cdot y}\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.54999999999999996e178

    1. Initial program 90.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
      3. div-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*90.2%

        \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    4. Applied egg-rr90.2%

      \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    5. Taylor expanded in t around 0 90.2%

      \[\leadsto x \cdot \color{blue}{\frac{-1}{z \cdot \left(y - z\right)}} \]
    6. Taylor expanded in z around 0 59.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg59.9%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac259.9%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. *-commutative59.9%

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out59.9%

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(-y\right)}} \]
    8. Simplified59.9%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(-y\right)}} \]
    9. Step-by-step derivation
      1. frac-2neg59.9%

        \[\leadsto \color{blue}{\frac{-x}{-z \cdot \left(-y\right)}} \]
      2. div-inv59.9%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{-z \cdot \left(-y\right)}} \]
      3. add-sqr-sqrt22.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      4. sqrt-unprod59.4%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      5. sqr-neg59.4%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      6. sqrt-unprod37.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      7. add-sqr-sqrt59.8%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      8. distribute-rgt-neg-out59.8%

        \[\leadsto x \cdot \frac{1}{-\color{blue}{\left(-z \cdot y\right)}} \]
      9. remove-double-neg59.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt17.0%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      11. sqrt-unprod59.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg59.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}}} \]
      13. sqrt-unprod42.8%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}} \]
      14. add-sqr-sqrt59.9%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(-y\right)}} \]
      15. *-commutative59.9%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(-y\right) \cdot z}} \]
      16. add-sqr-sqrt42.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot z} \]
      17. sqrt-unprod59.7%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot z} \]
      18. sqr-neg59.7%

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod17.0%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot z} \]
      20. add-sqr-sqrt59.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{y} \cdot z} \]
    10. Applied egg-rr59.8%

      \[\leadsto \color{blue}{x \cdot \frac{1}{y \cdot z}} \]
    11. Step-by-step derivation
      1. associate-*r/59.8%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity59.8%

        \[\leadsto \frac{\color{blue}{x}}{y \cdot z} \]
    12. Simplified59.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]

    if -1.54999999999999996e178 < z < 7.2e44

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/94.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv94.2%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr94.2%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. associate-*l/94.3%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y - z}}{t - z}} \]
      2. div-inv94.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{t - z} \]
      3. div-inv94.4%

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/94.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      6. *-un-lft-identity94.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{t - z}}}{\frac{y - z}{x}} \]
    6. Applied egg-rr94.8%

      \[\leadsto \color{blue}{\frac{\frac{1}{t - z}}{\frac{y - z}{x}}} \]
    7. Taylor expanded in z around 0 45.2%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/r*49.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified49.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]

    if 7.2e44 < z

    1. Initial program 89.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 41.7%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
    6. Taylor expanded in y around 0 38.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/38.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. neg-mul-138.8%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    8. Simplified38.8%

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt17.9%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      2. sqrt-unprod42.0%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      3. sqr-neg42.0%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot x}}}{t \cdot z} \]
      4. sqrt-unprod17.7%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      5. add-sqr-sqrt32.6%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot z} \]
      6. *-un-lft-identity32.6%

        \[\leadsto \color{blue}{1 \cdot \frac{x}{t \cdot z}} \]
      7. associate-/r*31.1%

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
    10. Applied egg-rr31.1%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{t}}{z}} \]
    11. Step-by-step derivation
      1. *-lft-identity31.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. associate-/l/32.6%

        \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]
    12. Simplified32.6%

      \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification46.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+178}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+44}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 42.3% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -6.9 \cdot 10^{+174}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{-152}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= z -6.9e+174)
   (/ x (* z y))
   (if (<= z 1.66e-152) (/ x (* t y)) (/ x (* t z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -6.9e+174) {
		tmp = x / (z * y);
	} else if (z <= 1.66e-152) {
		tmp = x / (t * y);
	} else {
		tmp = x / (t * 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 <= (-6.9d+174)) then
        tmp = x / (z * y)
    else if (z <= 1.66d-152) then
        tmp = x / (t * y)
    else
        tmp = x / (t * z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -6.9e+174) {
		tmp = x / (z * y);
	} else if (z <= 1.66e-152) {
		tmp = x / (t * y);
	} else {
		tmp = x / (t * z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -6.9e+174:
		tmp = x / (z * y)
	elif z <= 1.66e-152:
		tmp = x / (t * y)
	else:
		tmp = x / (t * z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -6.9e+174)
		tmp = Float64(x / Float64(z * y));
	elseif (z <= 1.66e-152)
		tmp = Float64(x / Float64(t * y));
	else
		tmp = Float64(x / Float64(t * z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -6.9e+174)
		tmp = x / (z * y);
	elseif (z <= 1.66e-152)
		tmp = x / (t * y);
	else
		tmp = x / (t * z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[z, -6.9e+174], N[(x / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.66e-152], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.9 \cdot 10^{+174}:\\
\;\;\;\;\frac{x}{z \cdot y}\\

\mathbf{elif}\;z \leq 1.66 \cdot 10^{-152}:\\
\;\;\;\;\frac{x}{t \cdot y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.9000000000000002e174

    1. Initial program 87.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
      3. div-inv100.0%

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*87.3%

        \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    4. Applied egg-rr87.3%

      \[\leadsto \color{blue}{x \cdot \left(\frac{1}{t - z} \cdot \frac{1}{y - z}\right)} \]
    5. Taylor expanded in t around 0 87.3%

      \[\leadsto x \cdot \color{blue}{\frac{-1}{z \cdot \left(y - z\right)}} \]
    6. Taylor expanded in z around 0 56.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg56.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac256.6%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. *-commutative56.6%

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out56.6%

        \[\leadsto \frac{x}{\color{blue}{z \cdot \left(-y\right)}} \]
    8. Simplified56.6%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(-y\right)}} \]
    9. Step-by-step derivation
      1. frac-2neg56.6%

        \[\leadsto \color{blue}{\frac{-x}{-z \cdot \left(-y\right)}} \]
      2. div-inv56.6%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{-z \cdot \left(-y\right)}} \]
      3. add-sqr-sqrt19.5%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      4. sqrt-unprod60.5%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      5. sqr-neg60.5%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      6. sqrt-unprod37.0%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      7. add-sqr-sqrt56.5%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{-z \cdot \left(-y\right)} \]
      8. distribute-rgt-neg-out56.5%

        \[\leadsto x \cdot \frac{1}{-\color{blue}{\left(-z \cdot y\right)}} \]
      9. remove-double-neg56.5%

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt14.7%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}} \]
      11. sqrt-unprod56.2%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg56.2%

        \[\leadsto x \cdot \frac{1}{z \cdot \sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}}} \]
      13. sqrt-unprod41.8%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}} \]
      14. add-sqr-sqrt56.6%

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\left(-y\right)}} \]
      15. *-commutative56.6%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(-y\right) \cdot z}} \]
      16. add-sqr-sqrt41.8%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot z} \]
      17. sqrt-unprod56.2%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot z} \]
      18. sqr-neg56.2%

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod14.7%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot z} \]
      20. add-sqr-sqrt56.5%

        \[\leadsto x \cdot \frac{1}{\color{blue}{y} \cdot z} \]
    10. Applied egg-rr56.5%

      \[\leadsto \color{blue}{x \cdot \frac{1}{y \cdot z}} \]
    11. Step-by-step derivation
      1. associate-*r/56.5%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity56.5%

        \[\leadsto \frac{\color{blue}{x}}{y \cdot z} \]
    12. Simplified56.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]

    if -6.9000000000000002e174 < z < 1.6599999999999999e-152

    1. Initial program 92.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 52.4%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]

    if 1.6599999999999999e-152 < z

    1. Initial program 89.9%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/98.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 43.7%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
    6. Taylor expanded in y around 0 35.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/35.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. neg-mul-135.1%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    8. Simplified35.1%

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt17.0%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      2. sqrt-unprod32.5%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{t \cdot z} \]
      3. sqr-neg32.5%

        \[\leadsto \frac{\sqrt{\color{blue}{x \cdot x}}}{t \cdot z} \]
      4. sqrt-unprod13.1%

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      5. add-sqr-sqrt24.4%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot z} \]
      6. *-un-lft-identity24.4%

        \[\leadsto \color{blue}{1 \cdot \frac{x}{t \cdot z}} \]
      7. associate-/r*23.4%

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{x}{t}}{z}} \]
    10. Applied egg-rr23.4%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{t}}{z}} \]
    11. Step-by-step derivation
      1. *-lft-identity23.4%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. associate-/l/24.4%

        \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]
    12. Simplified24.4%

      \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification41.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.9 \cdot 10^{+174}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{-152}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 90.7% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+190}:\\ \;\;\;\;\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 -1.65e+190) (/ (/ 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 <= -1.65e+190) {
		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 <= (-1.65d+190)) 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 <= -1.65e+190) {
		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 <= -1.65e+190:
		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 <= -1.65e+190)
		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 <= -1.65e+190)
		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, -1.65e+190], 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 -1.65 \cdot 10^{+190}:\\
\;\;\;\;\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 < -1.65e190

    1. Initial program 83.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 83.3%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}} \]
    4. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    6. Taylor expanded in y around inf 100.0%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t - z} \]

    if -1.65e190 < y

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification91.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+190}:\\ \;\;\;\;\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 22: 39.4% 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 90.8%

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 36.6%

    \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
  4. Add Preprocessing

Developer target: 87.7% 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 2024107 
(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))))