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

Percentage Accurate: 88.7% → 97.0%
Time: 12.6s
Alternatives: 13
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 13 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.7% 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: 97.0% 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 88.0%

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

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

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

Alternative 2: 75.8% accurate, 0.3× 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 -4.4 \cdot 10^{+164}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-49}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-86}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+238}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x z) z)))
   (if (<= z -4.4e+164)
     t_1
     (if (<= z -2.3e-49)
       (/ x (* z (- z t)))
       (if (<= z 5.8e-86)
         (/ x (* (- t z) y))
         (if (<= z 2.9e+238) (/ x (* z (- z y))) t_1))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double tmp;
	if (z <= -4.4e+164) {
		tmp = t_1;
	} else if (z <= -2.3e-49) {
		tmp = x / (z * (z - t));
	} else if (z <= 5.8e-86) {
		tmp = x / ((t - z) * y);
	} else if (z <= 2.9e+238) {
		tmp = x / (z * (z - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x / z) / z
    if (z <= (-4.4d+164)) then
        tmp = t_1
    else if (z <= (-2.3d-49)) then
        tmp = x / (z * (z - t))
    else if (z <= 5.8d-86) then
        tmp = x / ((t - z) * y)
    else if (z <= 2.9d+238) then
        tmp = x / (z * (z - y))
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double tmp;
	if (z <= -4.4e+164) {
		tmp = t_1;
	} else if (z <= -2.3e-49) {
		tmp = x / (z * (z - t));
	} else if (z <= 5.8e-86) {
		tmp = x / ((t - z) * y);
	} else if (z <= 2.9e+238) {
		tmp = x / (z * (z - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / z) / z
	tmp = 0
	if z <= -4.4e+164:
		tmp = t_1
	elif z <= -2.3e-49:
		tmp = x / (z * (z - t))
	elif z <= 5.8e-86:
		tmp = x / ((t - z) * y)
	elif z <= 2.9e+238:
		tmp = x / (z * (z - y))
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) / z)
	tmp = 0.0
	if (z <= -4.4e+164)
		tmp = t_1;
	elseif (z <= -2.3e-49)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	elseif (z <= 5.8e-86)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (z <= 2.9e+238)
		tmp = Float64(x / Float64(z * Float64(z - y)));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / z) / z;
	tmp = 0.0;
	if (z <= -4.4e+164)
		tmp = t_1;
	elseif (z <= -2.3e-49)
		tmp = x / (z * (z - t));
	elseif (z <= 5.8e-86)
		tmp = x / ((t - z) * y);
	elseif (z <= 2.9e+238)
		tmp = x / (z * (z - y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -4.4e+164], t$95$1, If[LessEqual[z, -2.3e-49], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-86], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+238], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.40000000000000011e164 or 2.9000000000000002e238 < z

    1. Initial program 72.8%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac296.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg96.2%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in96.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg96.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg96.2%

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

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

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

    if -4.40000000000000011e164 < z < -2.2999999999999999e-49

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

    if -2.2999999999999999e-49 < z < 5.7999999999999998e-86

    1. Initial program 92.9%

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

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

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

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

    if 5.7999999999999998e-86 < z < 2.9000000000000002e238

    1. Initial program 91.9%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(y - z\right)}} \]
      2. distribute-rgt-neg-in76.2%

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(0 - \left(y - z\right)\right)}} \]
      4. sub-neg76.2%

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

        \[\leadsto \frac{x}{z \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right)} \]
      6. associate--r+76.2%

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(0 - \left(-z\right)\right) - y\right)}} \]
      7. neg-sub076.2%

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

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

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

Alternative 3: 71.6% accurate, 0.3× 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 -4.6 \cdot 10^{+164}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-45}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{+238}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x z) z)))
   (if (<= z -4.6e+164)
     t_1
     (if (<= z -9.2e-45)
       (/ x (* z (- z t)))
       (if (<= z 1.75e-87)
         (/ (/ x t) y)
         (if (<= z 4.9e+238) (/ x (* z (- z y))) t_1))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double tmp;
	if (z <= -4.6e+164) {
		tmp = t_1;
	} else if (z <= -9.2e-45) {
		tmp = x / (z * (z - t));
	} else if (z <= 1.75e-87) {
		tmp = (x / t) / y;
	} else if (z <= 4.9e+238) {
		tmp = x / (z * (z - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x / z) / z
    if (z <= (-4.6d+164)) then
        tmp = t_1
    else if (z <= (-9.2d-45)) then
        tmp = x / (z * (z - t))
    else if (z <= 1.75d-87) then
        tmp = (x / t) / y
    else if (z <= 4.9d+238) then
        tmp = x / (z * (z - y))
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double tmp;
	if (z <= -4.6e+164) {
		tmp = t_1;
	} else if (z <= -9.2e-45) {
		tmp = x / (z * (z - t));
	} else if (z <= 1.75e-87) {
		tmp = (x / t) / y;
	} else if (z <= 4.9e+238) {
		tmp = x / (z * (z - y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / z) / z
	tmp = 0
	if z <= -4.6e+164:
		tmp = t_1
	elif z <= -9.2e-45:
		tmp = x / (z * (z - t))
	elif z <= 1.75e-87:
		tmp = (x / t) / y
	elif z <= 4.9e+238:
		tmp = x / (z * (z - y))
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) / z)
	tmp = 0.0
	if (z <= -4.6e+164)
		tmp = t_1;
	elseif (z <= -9.2e-45)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	elseif (z <= 1.75e-87)
		tmp = Float64(Float64(x / t) / y);
	elseif (z <= 4.9e+238)
		tmp = Float64(x / Float64(z * Float64(z - y)));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / z) / z;
	tmp = 0.0;
	if (z <= -4.6e+164)
		tmp = t_1;
	elseif (z <= -9.2e-45)
		tmp = x / (z * (z - t));
	elseif (z <= 1.75e-87)
		tmp = (x / t) / y;
	elseif (z <= 4.9e+238)
		tmp = x / (z * (z - y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -4.6e+164], t$95$1, If[LessEqual[z, -9.2e-45], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-87], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.9e+238], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5999999999999999e164 or 4.90000000000000027e238 < z

    1. Initial program 72.8%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac296.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg96.2%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in96.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg96.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg96.2%

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

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

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

    if -4.5999999999999999e164 < z < -9.19999999999999967e-45

    1. Initial program 90.1%

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(-\color{blue}{\left(\left(-z\right) + t\right)}\right)} \]
      5. distribute-neg-in56.4%

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg56.4%

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(-t\right)\right)} \]
      7. unsub-neg56.4%

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

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

    if -9.19999999999999967e-45 < z < 1.75000000000000006e-87

    1. Initial program 92.1%

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num93.9%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{t - z}{x}}}}{y - z} \]
      2. associate-/r/93.9%

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

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

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

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

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

    if 1.75000000000000006e-87 < z < 4.90000000000000027e238

    1. Initial program 91.9%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(y - z\right)}} \]
      2. distribute-rgt-neg-in76.2%

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(0 - \left(y - z\right)\right)}} \]
      4. sub-neg76.2%

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

        \[\leadsto \frac{x}{z \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right)} \]
      6. associate--r+76.2%

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(0 - \left(-z\right)\right) - y\right)}} \]
      7. neg-sub076.2%

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

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

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

Alternative 4: 71.8% accurate, 0.3× 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)}\\ \mathbf{if}\;z \leq -4.4 \cdot 10^{+164}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-44}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-88}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+238}:\\ \;\;\;\;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 z) z)) (t_2 (/ x (* z (- z t)))))
   (if (<= z -4.4e+164)
     t_1
     (if (<= z -1.15e-44)
       t_2
       (if (<= z 9.8e-88) (/ (/ x t) y) (if (<= z 2.9e+238) 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 / z) / z;
	double t_2 = x / (z * (z - t));
	double tmp;
	if (z <= -4.4e+164) {
		tmp = t_1;
	} else if (z <= -1.15e-44) {
		tmp = t_2;
	} else if (z <= 9.8e-88) {
		tmp = (x / t) / y;
	} else if (z <= 2.9e+238) {
		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 / z) / z
    t_2 = x / (z * (z - t))
    if (z <= (-4.4d+164)) then
        tmp = t_1
    else if (z <= (-1.15d-44)) then
        tmp = t_2
    else if (z <= 9.8d-88) then
        tmp = (x / t) / y
    else if (z <= 2.9d+238) 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 / z) / z;
	double t_2 = x / (z * (z - t));
	double tmp;
	if (z <= -4.4e+164) {
		tmp = t_1;
	} else if (z <= -1.15e-44) {
		tmp = t_2;
	} else if (z <= 9.8e-88) {
		tmp = (x / t) / y;
	} else if (z <= 2.9e+238) {
		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 / z) / z
	t_2 = x / (z * (z - t))
	tmp = 0
	if z <= -4.4e+164:
		tmp = t_1
	elif z <= -1.15e-44:
		tmp = t_2
	elif z <= 9.8e-88:
		tmp = (x / t) / y
	elif z <= 2.9e+238:
		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(Float64(x / z) / z)
	t_2 = Float64(x / Float64(z * Float64(z - t)))
	tmp = 0.0
	if (z <= -4.4e+164)
		tmp = t_1;
	elseif (z <= -1.15e-44)
		tmp = t_2;
	elseif (z <= 9.8e-88)
		tmp = Float64(Float64(x / t) / y);
	elseif (z <= 2.9e+238)
		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 / z) / z;
	t_2 = x / (z * (z - t));
	tmp = 0.0;
	if (z <= -4.4e+164)
		tmp = t_1;
	elseif (z <= -1.15e-44)
		tmp = t_2;
	elseif (z <= 9.8e-88)
		tmp = (x / t) / y;
	elseif (z <= 2.9e+238)
		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[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+164], t$95$1, If[LessEqual[z, -1.15e-44], t$95$2, If[LessEqual[z, 9.8e-88], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.9e+238], t$95$2, t$95$1]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
t_2 := \frac{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+164}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-44}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+238}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.40000000000000011e164 or 2.9000000000000002e238 < z

    1. Initial program 72.8%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac296.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg96.2%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in96.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg96.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg96.2%

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

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

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

    if -4.40000000000000011e164 < z < -1.14999999999999999e-44 or 9.80000000000000055e-88 < z < 2.9000000000000002e238

    1. Initial program 91.3%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-t\right)\right)}} \]
      6. remove-double-neg65.9%

        \[\leadsto \frac{x}{z \cdot \left(\color{blue}{z} + \left(-t\right)\right)} \]
      7. unsub-neg65.9%

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

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

    if -1.14999999999999999e-44 < z < 9.80000000000000055e-88

    1. Initial program 92.1%

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num93.9%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{t - z}{x}}}}{y - z} \]
      2. associate-/r/93.9%

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

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

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

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

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

Alternative 5: 93.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.2e110

    1. Initial program 70.9%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac292.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg92.6%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in92.6%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg92.6%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg92.6%

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

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

    if -5.2e110 < z < 5.4000000000000002e129

    1. Initial program 92.6%

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

    if 5.4000000000000002e129 < z

    1. Initial program 85.0%

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{t - z}{x}}}}{y - z} \]
      2. associate-/r/99.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{z} \cdot \frac{x}{y - z}} \]
      2. *-commutative95.9%

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

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

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

Alternative 6: 79.0% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.5e7 or 6.7999999999999997e-87 < z

    1. Initial program 85.0%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac279.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg79.2%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in79.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg79.2%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg79.2%

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

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

    if -3.5e7 < z < 6.7999999999999997e-87

    1. Initial program 92.0%

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

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

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

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

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

Alternative 7: 79.8% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.5e5

    1. Initial program 79.3%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac280.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg80.7%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in80.7%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right) + \left(-t\right)}} \]
      7. remove-double-neg80.7%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg80.7%

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

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

    if -1.5e5 < z < 1.2500000000000001e-19

    1. Initial program 92.8%

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

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

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

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

    if 1.2500000000000001e-19 < z

    1. Initial program 86.9%

      \[\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. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{t - z}{x}}}}{y - z} \]
      2. associate-/r/99.8%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{z} \cdot \frac{x}{y - z}} \]
      2. *-commutative88.5%

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

      \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{-1}{z}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity88.5%

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

        \[\leadsto \color{blue}{\left(\frac{1}{y - z} \cdot x\right)} \cdot \frac{-1}{z} \]
      3. frac-2neg88.4%

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

        \[\leadsto \left(\frac{1}{y - z} \cdot x\right) \cdot \frac{\color{blue}{1}}{-z} \]
      5. un-div-inv88.5%

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

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

        \[\leadsto \frac{\frac{\color{blue}{x}}{y - z}}{-z} \]
    11. Applied egg-rr88.5%

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

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

Alternative 8: 78.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.5e-177

    1. Initial program 91.2%

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

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

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

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

    if -7.5e-177 < t < 4.9e-105

    1. Initial program 87.0%

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(0 - \left(y - z\right)\right)}} \]
      4. sub-neg76.1%

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

        \[\leadsto \frac{x}{z \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right)} \]
      6. associate--r+76.1%

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

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

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

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

    if 4.9e-105 < t

    1. Initial program 85.5%

      \[\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 78.4%

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

Alternative 9: 67.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 -5.8 \cdot 10^{+43} \lor \neg \left(z \leq 4.2 \cdot 10^{+33}\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 -5.8e+43) (not (<= z 4.2e+33))) (/ (/ 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 <= -5.8e+43) || !(z <= 4.2e+33)) {
		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 <= (-5.8d+43)) .or. (.not. (z <= 4.2d+33))) 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 <= -5.8e+43) || !(z <= 4.2e+33)) {
		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 <= -5.8e+43) or not (z <= 4.2e+33):
		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 <= -5.8e+43) || !(z <= 4.2e+33))
		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 <= -5.8e+43) || ~((z <= 4.2e+33)))
		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, -5.8e+43], N[Not[LessEqual[z, 4.2e+33]], $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 -5.8 \cdot 10^{+43} \lor \neg \left(z \leq 4.2 \cdot 10^{+33}\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 < -5.8000000000000004e43 or 4.2000000000000001e33 < z

    1. Initial program 82.2%

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      3. distribute-neg-frac285.3%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-\left(t - z\right)}} \]
      4. sub-neg85.3%

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

        \[\leadsto \frac{\frac{x}{z}}{-\color{blue}{\left(\left(-z\right) + t\right)}} \]
      6. distribute-neg-in85.3%

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z} + \left(-t\right)} \]
      8. unsub-neg85.3%

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

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

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

    if -5.8000000000000004e43 < z < 4.2000000000000001e33

    1. Initial program 92.9%

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num94.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{t - z}{x}}}}{y - z} \]
      2. associate-/r/94.9%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified60.8%

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

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

Alternative 10: 63.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 -5.2 \cdot 10^{+43} \lor \neg \left(z \leq 2.5 \cdot 10^{+34}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -5.2e+43) (not (<= z 2.5e+34))) (/ 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 <= -5.2e+43) || !(z <= 2.5e+34)) {
		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 <= (-5.2d+43)) .or. (.not. (z <= 2.5d+34))) 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 <= -5.2e+43) || !(z <= 2.5e+34)) {
		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 <= -5.2e+43) or not (z <= 2.5e+34):
		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 <= -5.2e+43) || !(z <= 2.5e+34))
		tmp = Float64(x / Float64(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 <= -5.2e+43) || ~((z <= 2.5e+34)))
		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, -5.2e+43], N[Not[LessEqual[z, 2.5e+34]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+43} \lor \neg \left(z \leq 2.5 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.20000000000000042e43 or 2.4999999999999999e34 < z

    1. Initial program 82.2%

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(0 - \left(y - z\right)\right)}} \]
      4. sub-neg77.1%

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

        \[\leadsto \frac{x}{z \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right)} \]
      6. associate--r+77.1%

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

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

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

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

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

    if -5.20000000000000042e43 < z < 2.4999999999999999e34

    1. Initial program 92.9%

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num94.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{t - z}{x}}}}{y - z} \]
      2. associate-/r/94.9%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified60.8%

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

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

Alternative 11: 61.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 -5.5 \cdot 10^{+43} \lor \neg \left(z \leq 5.2 \cdot 10^{-86}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -5.5e+43) (not (<= z 5.2e-86))) (/ 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 <= -5.5e+43) || !(z <= 5.2e-86)) {
		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 <= (-5.5d+43)) .or. (.not. (z <= 5.2d-86))) 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 <= -5.5e+43) || !(z <= 5.2e-86)) {
		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 <= -5.5e+43) or not (z <= 5.2e-86):
		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 <= -5.5e+43) || !(z <= 5.2e-86))
		tmp = Float64(x / Float64(z * z));
	else
		tmp = Float64(x / Float64(t * y));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -5.5e+43) || ~((z <= 5.2e-86)))
		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, -5.5e+43], N[Not[LessEqual[z, 5.2e-86]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+43} \lor \neg \left(z \leq 5.2 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.49999999999999989e43 or 5.2000000000000002e-86 < z

    1. Initial program 84.4%

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

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

        \[\leadsto \frac{x}{\color{blue}{-z \cdot \left(y - z\right)}} \]
      2. distribute-rgt-neg-in73.5%

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right)} \]
      6. associate--r+73.5%

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

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

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

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

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

    if -5.49999999999999989e43 < z < 5.2000000000000002e-86

    1. Initial program 92.4%

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

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

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

Alternative 12: 46.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 -3.6 \cdot 10^{+104} \lor \neg \left(z \leq 2.8 \cdot 10^{+129}\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 -3.6e+104) (not (<= z 2.8e+129))) (/ 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 <= -3.6e+104) || !(z <= 2.8e+129)) {
		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 <= (-3.6d+104)) .or. (.not. (z <= 2.8d+129))) 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 <= -3.6e+104) || !(z <= 2.8e+129)) {
		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 <= -3.6e+104) or not (z <= 2.8e+129):
		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 <= -3.6e+104) || !(z <= 2.8e+129))
		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 <= -3.6e+104) || ~((z <= 2.8e+129)))
		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, -3.6e+104], N[Not[LessEqual[z, 2.8e+129]], $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 -3.6 \cdot 10^{+104} \lor \neg \left(z \leq 2.8 \cdot 10^{+129}\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 < -3.60000000000000001e104 or 2.79999999999999975e129 < z

    1. Initial program 78.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y} \]
    9. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

        \[\leadsto 1 \cdot \color{blue}{\frac{-x}{y \cdot z}} \]
      3. add-sqr-sqrt27.5%

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

        \[\leadsto 1 \cdot \frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{y \cdot z} \]
      5. sqr-neg37.6%

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

        \[\leadsto 1 \cdot \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{y \cdot z} \]
      7. add-sqr-sqrt42.2%

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

      \[\leadsto \color{blue}{1 \cdot \frac{x}{y \cdot z}} \]
    11. Step-by-step derivation
      1. *-lft-identity42.2%

        \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]
      2. *-commutative42.2%

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

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

    if -3.60000000000000001e104 < z < 2.79999999999999975e129

    1. Initial program 92.6%

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

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

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

Alternative 13: 40.2% 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 88.0%

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

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

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

  :alt
  (! :herbie-platform default (if (< (/ x (* (- y z) (- t z))) 0) (/ (/ x (- y z)) (- t z)) (* x (/ 1 (* (- y z) (- t z))))))

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