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

Percentage Accurate: 88.7% → 96.9%
Time: 16.3s
Alternatives: 18
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 18 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: 96.9% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 49.9% 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}\\ t_2 := \frac{x}{z \cdot \left(-t\right)}\\ t_3 := \frac{x}{z \cdot \left(-y\right)}\\ \mathbf{if}\;y \leq -5.6 \cdot 10^{+192}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+34}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -18:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-63}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -9.8 \cdot 10^{-85}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+20}:\\ \;\;\;\;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 y) t)) (t_2 (/ x (* z (- t)))) (t_3 (/ x (* z (- y)))))
   (if (<= y -5.6e+192)
     t_1
     (if (<= y -2e+34)
       t_3
       (if (<= y -18.0)
         t_1
         (if (<= y -1.9e-63)
           t_2
           (if (<= y -9.8e-85) t_3 (if (<= y 7e+20) 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 / y) / t;
	double t_2 = x / (z * -t);
	double t_3 = x / (z * -y);
	double tmp;
	if (y <= -5.6e+192) {
		tmp = t_1;
	} else if (y <= -2e+34) {
		tmp = t_3;
	} else if (y <= -18.0) {
		tmp = t_1;
	} else if (y <= -1.9e-63) {
		tmp = t_2;
	} else if (y <= -9.8e-85) {
		tmp = t_3;
	} else if (y <= 7e+20) {
		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) :: t_3
    real(8) :: tmp
    t_1 = (x / y) / t
    t_2 = x / (z * -t)
    t_3 = x / (z * -y)
    if (y <= (-5.6d+192)) then
        tmp = t_1
    else if (y <= (-2d+34)) then
        tmp = t_3
    else if (y <= (-18.0d0)) then
        tmp = t_1
    else if (y <= (-1.9d-63)) then
        tmp = t_2
    else if (y <= (-9.8d-85)) then
        tmp = t_3
    else if (y <= 7d+20) 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 / y) / t;
	double t_2 = x / (z * -t);
	double t_3 = x / (z * -y);
	double tmp;
	if (y <= -5.6e+192) {
		tmp = t_1;
	} else if (y <= -2e+34) {
		tmp = t_3;
	} else if (y <= -18.0) {
		tmp = t_1;
	} else if (y <= -1.9e-63) {
		tmp = t_2;
	} else if (y <= -9.8e-85) {
		tmp = t_3;
	} else if (y <= 7e+20) {
		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 / y) / t
	t_2 = x / (z * -t)
	t_3 = x / (z * -y)
	tmp = 0
	if y <= -5.6e+192:
		tmp = t_1
	elif y <= -2e+34:
		tmp = t_3
	elif y <= -18.0:
		tmp = t_1
	elif y <= -1.9e-63:
		tmp = t_2
	elif y <= -9.8e-85:
		tmp = t_3
	elif y <= 7e+20:
		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 / y) / t)
	t_2 = Float64(x / Float64(z * Float64(-t)))
	t_3 = Float64(x / Float64(z * Float64(-y)))
	tmp = 0.0
	if (y <= -5.6e+192)
		tmp = t_1;
	elseif (y <= -2e+34)
		tmp = t_3;
	elseif (y <= -18.0)
		tmp = t_1;
	elseif (y <= -1.9e-63)
		tmp = t_2;
	elseif (y <= -9.8e-85)
		tmp = t_3;
	elseif (y <= 7e+20)
		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 / y) / t;
	t_2 = x / (z * -t);
	t_3 = x / (z * -y);
	tmp = 0.0;
	if (y <= -5.6e+192)
		tmp = t_1;
	elseif (y <= -2e+34)
		tmp = t_3;
	elseif (y <= -18.0)
		tmp = t_1;
	elseif (y <= -1.9e-63)
		tmp = t_2;
	elseif (y <= -9.8e-85)
		tmp = t_3;
	elseif (y <= 7e+20)
		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 / y), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(z * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.6e+192], t$95$1, If[LessEqual[y, -2e+34], t$95$3, If[LessEqual[y, -18.0], t$95$1, If[LessEqual[y, -1.9e-63], t$95$2, If[LessEqual[y, -9.8e-85], t$95$3, If[LessEqual[y, 7e+20], 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}{y}}{t}\\
t_2 := \frac{x}{z \cdot \left(-t\right)}\\
t_3 := \frac{x}{z \cdot \left(-y\right)}\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2 \cdot 10^{+34}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -18:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-63}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -9.8 \cdot 10^{-85}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 7 \cdot 10^{+20}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.59999999999999952e192 or -1.99999999999999989e34 < y < -18 or 7e20 < y

    1. Initial program 89.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    7. Step-by-step derivation
      1. *-commutative59.1%

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} \]
      2. associate-/r*64.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    8. Simplified64.5%

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

    if -5.59999999999999952e192 < y < -1.99999999999999989e34 or -1.90000000000000009e-63 < y < -9.80000000000000029e-85

    1. Initial program 91.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/97.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 0 73.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    9. Step-by-step derivation
      1. mul-1-neg60.4%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac260.4%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. *-commutative60.4%

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out60.4%

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

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

    if -18 < y < -1.90000000000000009e-63 or -9.80000000000000029e-85 < y < 7e20

    1. Initial program 91.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg43.9%

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. distribute-neg-frac243.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{+192}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -18:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq -9.8 \cdot 10^{-85}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.9% 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}\\ t_2 := \frac{x}{z \cdot \left(-t\right)}\\ t_3 := \frac{x}{z \cdot \left(-y\right)}\\ \mathbf{if}\;y \leq -1.2 \cdot 10^{+192}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{+34}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -780:\\ \;\;\;\;x \cdot \frac{\frac{1}{t}}{y}\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-63}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-83}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+20}:\\ \;\;\;\;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 y) t)) (t_2 (/ x (* z (- t)))) (t_3 (/ x (* z (- y)))))
   (if (<= y -1.2e+192)
     t_1
     (if (<= y -3.2e+34)
       t_3
       (if (<= y -780.0)
         (* x (/ (/ 1.0 t) y))
         (if (<= y -5e-63)
           t_2
           (if (<= y -2.3e-83) t_3 (if (<= y 8.2e+20) 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 / y) / t;
	double t_2 = x / (z * -t);
	double t_3 = x / (z * -y);
	double tmp;
	if (y <= -1.2e+192) {
		tmp = t_1;
	} else if (y <= -3.2e+34) {
		tmp = t_3;
	} else if (y <= -780.0) {
		tmp = x * ((1.0 / t) / y);
	} else if (y <= -5e-63) {
		tmp = t_2;
	} else if (y <= -2.3e-83) {
		tmp = t_3;
	} else if (y <= 8.2e+20) {
		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) :: t_3
    real(8) :: tmp
    t_1 = (x / y) / t
    t_2 = x / (z * -t)
    t_3 = x / (z * -y)
    if (y <= (-1.2d+192)) then
        tmp = t_1
    else if (y <= (-3.2d+34)) then
        tmp = t_3
    else if (y <= (-780.0d0)) then
        tmp = x * ((1.0d0 / t) / y)
    else if (y <= (-5d-63)) then
        tmp = t_2
    else if (y <= (-2.3d-83)) then
        tmp = t_3
    else if (y <= 8.2d+20) 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 / y) / t;
	double t_2 = x / (z * -t);
	double t_3 = x / (z * -y);
	double tmp;
	if (y <= -1.2e+192) {
		tmp = t_1;
	} else if (y <= -3.2e+34) {
		tmp = t_3;
	} else if (y <= -780.0) {
		tmp = x * ((1.0 / t) / y);
	} else if (y <= -5e-63) {
		tmp = t_2;
	} else if (y <= -2.3e-83) {
		tmp = t_3;
	} else if (y <= 8.2e+20) {
		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 / y) / t
	t_2 = x / (z * -t)
	t_3 = x / (z * -y)
	tmp = 0
	if y <= -1.2e+192:
		tmp = t_1
	elif y <= -3.2e+34:
		tmp = t_3
	elif y <= -780.0:
		tmp = x * ((1.0 / t) / y)
	elif y <= -5e-63:
		tmp = t_2
	elif y <= -2.3e-83:
		tmp = t_3
	elif y <= 8.2e+20:
		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 / y) / t)
	t_2 = Float64(x / Float64(z * Float64(-t)))
	t_3 = Float64(x / Float64(z * Float64(-y)))
	tmp = 0.0
	if (y <= -1.2e+192)
		tmp = t_1;
	elseif (y <= -3.2e+34)
		tmp = t_3;
	elseif (y <= -780.0)
		tmp = Float64(x * Float64(Float64(1.0 / t) / y));
	elseif (y <= -5e-63)
		tmp = t_2;
	elseif (y <= -2.3e-83)
		tmp = t_3;
	elseif (y <= 8.2e+20)
		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 / y) / t;
	t_2 = x / (z * -t);
	t_3 = x / (z * -y);
	tmp = 0.0;
	if (y <= -1.2e+192)
		tmp = t_1;
	elseif (y <= -3.2e+34)
		tmp = t_3;
	elseif (y <= -780.0)
		tmp = x * ((1.0 / t) / y);
	elseif (y <= -5e-63)
		tmp = t_2;
	elseif (y <= -2.3e-83)
		tmp = t_3;
	elseif (y <= 8.2e+20)
		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 / y), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(z * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e+192], t$95$1, If[LessEqual[y, -3.2e+34], t$95$3, If[LessEqual[y, -780.0], N[(x * N[(N[(1.0 / t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5e-63], t$95$2, If[LessEqual[y, -2.3e-83], t$95$3, If[LessEqual[y, 8.2e+20], 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}{y}}{t}\\
t_2 := \frac{x}{z \cdot \left(-t\right)}\\
t_3 := \frac{x}{z \cdot \left(-y\right)}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.2 \cdot 10^{+34}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -780:\\
\;\;\;\;x \cdot \frac{\frac{1}{t}}{y}\\

\mathbf{elif}\;y \leq -5 \cdot 10^{-63}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -2.3 \cdot 10^{-83}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{+20}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.1999999999999999e192 or 8.2e20 < y

    1. Initial program 89.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    7. Step-by-step derivation
      1. *-commutative59.7%

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} \]
      2. associate-/r*65.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    8. Simplified65.6%

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

    if -1.1999999999999999e192 < y < -3.1999999999999998e34 or -5.0000000000000002e-63 < y < -2.2999999999999999e-83

    1. Initial program 91.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/97.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 0 73.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    9. Step-by-step derivation
      1. mul-1-neg60.4%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac260.4%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. *-commutative60.4%

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out60.4%

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

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

    if -3.1999999999999998e34 < y < -780

    1. Initial program 100.0%

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

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

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

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

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

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

    if -780 < y < -5.0000000000000002e-63 or -2.2999999999999999e-83 < y < 8.2e20

    1. Initial program 91.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg43.6%

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. distribute-neg-frac243.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+192}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -780:\\ \;\;\;\;x \cdot \frac{\frac{1}{t}}{y}\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-83}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 51.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq 1.4 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.0500000000000001e-71

    1. Initial program 91.2%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. clear-num53.0%

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

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

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

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

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

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

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

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

    if -1.0500000000000001e-71 < t < 1.4599999999999999e-158

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out40.1%

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

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

    if 1.4599999999999999e-158 < t < 1.4e18

    1. Initial program 91.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    7. Step-by-step derivation
      1. *-commutative37.7%

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} \]
      2. associate-/r*42.9%

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

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

    if 1.4e18 < t < 7.79999999999999962e174

    1. Initial program 92.6%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg61.1%

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

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

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

    if 7.79999999999999962e174 < t

    1. Initial program 89.5%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. clear-num59.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{t} \cdot x}{y}} \]
      2. clear-num66.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;t \leq 1.46 \cdot 10^{-158}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+174}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y}{\frac{x}{t}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 80.0% 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}{y}}{t - z}\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+32}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{elif}\;y \leq -14:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\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
 (let* ((t_1 (/ (/ x y) (- t z))))
   (if (<= y -1.4e+93)
     t_1
     (if (<= y -4.6e+32)
       (/ x (* z (- z y)))
       (if (<= y -14.0)
         t_1
         (if (<= y 7e-8) (/ (/ 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 t_1 = (x / y) / (t - z);
	double tmp;
	if (y <= -1.4e+93) {
		tmp = t_1;
	} else if (y <= -4.6e+32) {
		tmp = x / (z * (z - y));
	} else if (y <= -14.0) {
		tmp = t_1;
	} else if (y <= 7e-8) {
		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) :: t_1
    real(8) :: tmp
    t_1 = (x / y) / (t - z)
    if (y <= (-1.4d+93)) then
        tmp = t_1
    else if (y <= (-4.6d+32)) then
        tmp = x / (z * (z - y))
    else if (y <= (-14.0d0)) then
        tmp = t_1
    else if (y <= 7d-8) 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 t_1 = (x / y) / (t - z);
	double tmp;
	if (y <= -1.4e+93) {
		tmp = t_1;
	} else if (y <= -4.6e+32) {
		tmp = x / (z * (z - y));
	} else if (y <= -14.0) {
		tmp = t_1;
	} else if (y <= 7e-8) {
		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):
	t_1 = (x / y) / (t - z)
	tmp = 0
	if y <= -1.4e+93:
		tmp = t_1
	elif y <= -4.6e+32:
		tmp = x / (z * (z - y))
	elif y <= -14.0:
		tmp = t_1
	elif y <= 7e-8:
		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)
	t_1 = Float64(Float64(x / y) / Float64(t - z))
	tmp = 0.0
	if (y <= -1.4e+93)
		tmp = t_1;
	elseif (y <= -4.6e+32)
		tmp = Float64(x / Float64(z * Float64(z - y)));
	elseif (y <= -14.0)
		tmp = t_1;
	elseif (y <= 7e-8)
		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)
	t_1 = (x / y) / (t - z);
	tmp = 0.0;
	if (y <= -1.4e+93)
		tmp = t_1;
	elseif (y <= -4.6e+32)
		tmp = x / (z * (z - y));
	elseif (y <= -14.0)
		tmp = t_1;
	elseif (y <= 7e-8)
		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_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e+93], t$95$1, If[LessEqual[y, -4.6e+32], N[(x / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -14.0], t$95$1, If[LessEqual[y, 7e-8], 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}
t_1 := \frac{\frac{x}{y}}{t - z}\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -14:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.39999999999999994e93 or -4.5999999999999999e32 < y < -14

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

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

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

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

    if -1.39999999999999994e93 < y < -4.5999999999999999e32

    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.5%

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*88.5%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{y - z}\right) \cdot \frac{1}{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. frac-times99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{y - z}{x} \cdot \left(t - z\right)}} \]
      6. metadata-eval99.8%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{-\frac{z \cdot \left(y - z\right)}{x}}} \]
      2. associate-/l*89.0%

        \[\leadsto \frac{1}{-\color{blue}{z \cdot \frac{y - z}{x}}} \]
      3. distribute-lft-neg-out89.0%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{y - z}{x}}}{-z}} \]
      2. add-sqr-sqrt44.1%

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

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{\sqrt{-z} \cdot \sqrt{-z}} \]
      4. sqrt-unprod56.0%

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

        \[\leadsto \frac{\frac{x}{y - z}}{\sqrt{\color{blue}{z \cdot z}}} \]
      6. sqrt-unprod11.5%

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

        \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{z}} \]
      8. associate-/r*12.6%

        \[\leadsto \color{blue}{\frac{x}{\left(y - z\right) \cdot z}} \]
      9. associate-/l/12.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - z}} \]
      10. frac-2neg12.6%

        \[\leadsto \color{blue}{\frac{-\frac{x}{z}}{-\left(y - z\right)}} \]
      11. div-inv12.6%

        \[\leadsto \color{blue}{\left(-\frac{x}{z}\right) \cdot \frac{1}{-\left(y - z\right)}} \]
      12. distribute-neg-frac212.6%

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{z}} \cdot \frac{1}{-\left(y - z\right)} \]
      18. sub-neg88.6%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{-\color{blue}{\left(y + \left(-z\right)\right)}} \]
      19. distribute-neg-in88.6%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\left(-y\right) + \left(-\left(-z\right)\right)}} \]
      20. add-sqr-sqrt44.1%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      21. sqrt-unprod66.6%

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
    11. Applied egg-rr88.6%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity89.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. associate-/r*89.2%

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

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

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

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

    if -14 < y < 7.00000000000000048e-8

    1. Initial program 92.0%

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{t - z} \]
    7. Step-by-step derivation
      1. mul-1-neg79.6%

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

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

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

    if 7.00000000000000048e-8 < y

    1. Initial program 87.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+93}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+32}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - y\right)}\\ \mathbf{elif}\;y \leq -14:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 97.6% accurate, 0.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -4.99999999999999981e-261

    1. Initial program 97.8%

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

    if -4.99999999999999981e-261 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 88.8%

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

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

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

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

Alternative 7: 64.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

    if -8.80000000000000036e-52 < t < 1.6500000000000001e-158

    1. Initial program 91.8%

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{y - z} \]
    6. 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} \]
    7. Simplified87.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    9. Step-by-step derivation
      1. mul-1-neg40.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac240.6%

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

        \[\leadsto \frac{x}{-\color{blue}{z \cdot y}} \]
      4. distribute-rgt-neg-out40.6%

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

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

    if 1.6500000000000001e-158 < t

    1. Initial program 91.3%

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

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

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

Alternative 8: 75.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

    if -1.38e-45 < t < 5.1e17

    1. Initial program 91.8%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*91.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{-\frac{z \cdot \left(y - z\right)}{x}}} \]
      2. associate-/l*84.4%

        \[\leadsto \frac{1}{-\color{blue}{z \cdot \frac{y - z}{x}}} \]
      3. distribute-lft-neg-out84.4%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{y - z}{x}}}{-z}} \]
      2. add-sqr-sqrt50.8%

        \[\leadsto \frac{\frac{1}{\frac{y - z}{x}}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      3. clear-num50.8%

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

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

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

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

        \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{z}} \]
      8. associate-/r*36.7%

        \[\leadsto \color{blue}{\frac{x}{\left(y - z\right) \cdot z}} \]
      9. associate-/l/36.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - z}} \]
      10. frac-2neg36.6%

        \[\leadsto \color{blue}{\frac{-\frac{x}{z}}{-\left(y - z\right)}} \]
      11. div-inv36.6%

        \[\leadsto \color{blue}{\left(-\frac{x}{z}\right) \cdot \frac{1}{-\left(y - z\right)}} \]
      12. distribute-neg-frac236.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\left(-y\right) + \left(-\left(-z\right)\right)}} \]
      20. add-sqr-sqrt50.1%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      21. sqrt-unprod67.6%

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\sqrt{\color{blue}{z \cdot z}}\right)} \]
      23. sqrt-unprod25.4%

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
    11. Applied egg-rr84.3%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity84.3%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. associate-/r*77.8%

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

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

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

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

    if 5.1e17 < t

    1. Initial program 91.0%

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

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

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

Alternative 9: 76.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 91.5%

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

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

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

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

    if -5.20000000000000022e-141 < t < 4.6e17

    1. Initial program 91.0%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*91.1%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{y - z}\right) \cdot \frac{1}{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. frac-times97.2%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{y - z}{x} \cdot \left(t - z\right)}} \]
      6. metadata-eval97.2%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{-\frac{z \cdot \left(y - z\right)}{x}}} \]
      2. associate-/l*86.7%

        \[\leadsto \frac{1}{-\color{blue}{z \cdot \frac{y - z}{x}}} \]
      3. distribute-lft-neg-out86.7%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{y - z}{x}}}{-z}} \]
      2. add-sqr-sqrt53.5%

        \[\leadsto \frac{\frac{1}{\frac{y - z}{x}}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      3. clear-num53.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{\sqrt{-z} \cdot \sqrt{-z}} \]
      4. sqrt-unprod59.0%

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

        \[\leadsto \frac{\frac{x}{y - z}}{\sqrt{\color{blue}{z \cdot z}}} \]
      6. sqrt-unprod17.8%

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

        \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{z}} \]
      8. associate-/r*34.0%

        \[\leadsto \color{blue}{\frac{x}{\left(y - z\right) \cdot z}} \]
      9. associate-/l/33.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - z}} \]
      10. frac-2neg33.9%

        \[\leadsto \color{blue}{\frac{-\frac{x}{z}}{-\left(y - z\right)}} \]
      11. div-inv33.9%

        \[\leadsto \color{blue}{\left(-\frac{x}{z}\right) \cdot \frac{1}{-\left(y - z\right)}} \]
      12. distribute-neg-frac233.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      22. sqr-neg70.1%

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
    11. Applied egg-rr86.5%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity86.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. associate-/r*79.6%

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

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

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

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

    if 4.6e17 < t

    1. Initial program 91.0%

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

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

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

Alternative 10: 78.4% accurate, 0.5× 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^{-140}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{+17}:\\ \;\;\;\;\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 -1.5e-140)
   (/ x (* y (- t z)))
   (if (<= t 4.6e+17) (/ 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 <= -1.5e-140) {
		tmp = x / (y * (t - z));
	} else if (t <= 4.6e+17) {
		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 <= (-1.5d-140)) then
        tmp = x / (y * (t - z))
    else if (t <= 4.6d+17) 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 <= -1.5e-140) {
		tmp = x / (y * (t - z));
	} else if (t <= 4.6e+17) {
		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 <= -1.5e-140:
		tmp = x / (y * (t - z))
	elif t <= 4.6e+17:
		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 <= -1.5e-140)
		tmp = Float64(x / Float64(y * Float64(t - z)));
	elseif (t <= 4.6e+17)
		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 <= -1.5e-140)
		tmp = x / (y * (t - z));
	elseif (t <= 4.6e+17)
		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, -1.5e-140], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+17], 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 -1.5 \cdot 10^{-140}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\

\mathbf{elif}\;t \leq 4.6 \cdot 10^{+17}:\\
\;\;\;\;\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 < -1.50000000000000009e-140

    1. Initial program 91.5%

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

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

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

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

    if -1.50000000000000009e-140 < t < 4.6e17

    1. Initial program 91.1%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*91.2%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{y - z}\right) \cdot \frac{1}{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. frac-times97.2%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{y - z}{x} \cdot \left(t - z\right)}} \]
      6. metadata-eval97.2%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{-\frac{z \cdot \left(y - z\right)}{x}}} \]
      2. associate-/l*86.8%

        \[\leadsto \frac{1}{-\color{blue}{z \cdot \frac{y - z}{x}}} \]
      3. distribute-lft-neg-out86.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{y - z}{x}}}{-z}} \]
      2. add-sqr-sqrt52.9%

        \[\leadsto \frac{\frac{1}{\frac{y - z}{x}}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      3. clear-num53.0%

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

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

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

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

        \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{z}} \]
      8. associate-/r*34.6%

        \[\leadsto \color{blue}{\frac{x}{\left(y - z\right) \cdot z}} \]
      9. associate-/l/34.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{z}} \cdot \frac{1}{-\left(y - z\right)} \]
      18. sub-neg86.6%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{-\color{blue}{\left(y + \left(-z\right)\right)}} \]
      19. distribute-neg-in86.6%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\left(-y\right) + \left(-\left(-z\right)\right)}} \]
      20. add-sqr-sqrt52.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      21. sqrt-unprod70.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      22. sqr-neg70.4%

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{z} \cdot \sqrt{z}}\right)} \]
      24. add-sqr-sqrt58.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
    11. Applied egg-rr86.6%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity86.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. associate-/r*79.8%

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

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

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

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

    if 4.6e17 < t

    1. Initial program 91.0%

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

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

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

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

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

Alternative 11: 79.0% accurate, 0.5× speedup?

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

\mathbf{elif}\;t \leq 4.6 \cdot 10^{+17}:\\
\;\;\;\;\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 < -4.5e-141

    1. Initial program 91.5%

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

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

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

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

    if -4.5e-141 < t < 4.6e17

    1. Initial program 91.0%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{t - z}\right)} \cdot \frac{1}{y - z} \]
      4. associate-*l*91.1%

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{y - z}\right) \cdot \frac{1}{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. frac-times97.2%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{y - z}{x} \cdot \left(t - z\right)}} \]
      6. metadata-eval97.2%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{-\frac{z \cdot \left(y - z\right)}{x}}} \]
      2. associate-/l*86.7%

        \[\leadsto \frac{1}{-\color{blue}{z \cdot \frac{y - z}{x}}} \]
      3. distribute-lft-neg-out86.7%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{y - z}{x}}}{-z}} \]
      2. add-sqr-sqrt53.5%

        \[\leadsto \frac{\frac{1}{\frac{y - z}{x}}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      3. clear-num53.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{y - z}}}{\sqrt{-z} \cdot \sqrt{-z}} \]
      4. sqrt-unprod59.0%

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

        \[\leadsto \frac{\frac{x}{y - z}}{\sqrt{\color{blue}{z \cdot z}}} \]
      6. sqrt-unprod17.8%

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

        \[\leadsto \frac{\frac{x}{y - z}}{\color{blue}{z}} \]
      8. associate-/r*34.0%

        \[\leadsto \color{blue}{\frac{x}{\left(y - z\right) \cdot z}} \]
      9. associate-/l/33.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y - z}} \]
      10. frac-2neg33.9%

        \[\leadsto \color{blue}{\frac{-\frac{x}{z}}{-\left(y - z\right)}} \]
      11. div-inv33.9%

        \[\leadsto \color{blue}{\left(-\frac{x}{z}\right) \cdot \frac{1}{-\left(y - z\right)}} \]
      12. distribute-neg-frac233.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      22. sqr-neg70.1%

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

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

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
    11. Applied egg-rr86.5%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity86.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. associate-/r*79.6%

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

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

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

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

    if 4.6e17 < t

    1. Initial program 91.0%

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

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

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

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

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

Alternative 12: 82.1% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \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.6e-140)
   (/ (/ x y) (- t z))
   (if (<= t 3.7e+18) (/ (/ 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 <= -1.6e-140) {
		tmp = (x / y) / (t - z);
	} else if (t <= 3.7e+18) {
		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 <= (-1.6d-140)) then
        tmp = (x / y) / (t - z)
    else if (t <= 3.7d+18) 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 <= -1.6e-140) {
		tmp = (x / y) / (t - z);
	} else if (t <= 3.7e+18) {
		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 <= -1.6e-140:
		tmp = (x / y) / (t - z)
	elif t <= 3.7e+18:
		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 <= -1.6e-140)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (t <= 3.7e+18)
		tmp = Float64(Float64(x / 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 <= -1.6e-140)
		tmp = (x / y) / (t - z);
	elseif (t <= 3.7e+18)
		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, -1.6e-140], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.7e+18], N[(N[(x / z), $MachinePrecision] / N[(z - y), $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.6 \cdot 10^{-140}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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


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

    1. Initial program 91.5%

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

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

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

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

    if -1.6000000000000001e-140 < t < 3.7e18

    1. Initial program 91.1%

      \[\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 0 86.7%

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

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

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

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

    if 3.7e18 < t

    1. Initial program 91.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 49.8% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -12.5 or 6.8e20 < y

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} \]
      2. associate-/r*59.8%

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

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

    if -12.5 < y < 6.8e20

    1. Initial program 92.0%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg43.2%

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

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

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

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

Alternative 14: 91.0% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.5000000000000001e151

    1. Initial program 67.6%

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

      \[\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 0 95.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{t - z} \]
    7. Step-by-step derivation
      1. mul-1-neg95.8%

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

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

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

    if -2.5000000000000001e151 < z

    1. Initial program 94.6%

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

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

Alternative 15: 43.0% accurate, 0.9× 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^{+113}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \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 5.2e+113) (/ x (* y t)) (/ x (* y z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 5.2e+113) {
		tmp = x / (y * t);
	} else {
		tmp = x / (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 <= 5.2d+113) then
        tmp = x / (y * t)
    else
        tmp = x / (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 <= 5.2e+113) {
		tmp = x / (y * t);
	} else {
		tmp = x / (y * z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= 5.2e+113:
		tmp = x / (y * t)
	else:
		tmp = x / (y * 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+113)
		tmp = Float64(x / Float64(y * t));
	else
		tmp = Float64(x / 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 <= 5.2e+113)
		tmp = x / (y * t);
	else
		tmp = x / (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, 5.2e+113], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x / 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 5.2 \cdot 10^{+113}:\\
\;\;\;\;\frac{x}{y \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 5.1999999999999998e113

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

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

    if 5.1999999999999998e113 < z

    1. Initial program 87.3%

      \[\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 t around 0 94.4%

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y - z} \]
    8. Step-by-step derivation
      1. div-inv94.4%

        \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot \frac{1}{z}}}{y - z} \]
      2. associate-/l*88.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{z \cdot \left(y - z\right)}} \]
      3. *-rgt-identity82.8%

        \[\leadsto \frac{\color{blue}{x}}{z \cdot \left(y - z\right)} \]
      4. associate-/r*82.3%

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

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

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]
    13. Step-by-step derivation
      1. *-commutative31.7%

        \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]
    14. Simplified31.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.2 \cdot 10^{+113}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 46.3% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 5.09999999999999994e113

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. clear-num42.0%

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

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

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

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

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

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

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

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

    if 5.09999999999999994e113 < z

    1. Initial program 87.3%

      \[\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 t around 0 94.4%

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y - z} \]
    8. Step-by-step derivation
      1. div-inv94.4%

        \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot \frac{1}{z}}}{y - z} \]
      2. associate-/l*88.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{z \cdot \left(y - z\right)}} \]
      3. *-rgt-identity82.8%

        \[\leadsto \frac{\color{blue}{x}}{z \cdot \left(y - z\right)} \]
      4. associate-/r*82.3%

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

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

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]
    13. Step-by-step derivation
      1. *-commutative31.7%

        \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]
    14. Simplified31.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.1 \cdot 10^{+113}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 45.9% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.7e115

    1. Initial program 91.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    7. Step-by-step derivation
      1. *-commutative41.5%

        \[\leadsto \frac{x}{\color{blue}{y \cdot t}} \]
      2. associate-/r*43.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    8. Simplified43.6%

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

    if 1.7e115 < z

    1. Initial program 87.3%

      \[\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 t around 0 94.4%

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y - z} \]
    8. Step-by-step derivation
      1. div-inv94.4%

        \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot \frac{1}{z}}}{y - z} \]
      2. associate-/l*88.8%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{z \cdot \left(y - z\right)}} \]
      3. *-rgt-identity82.8%

        \[\leadsto \frac{\color{blue}{x}}{z \cdot \left(y - z\right)} \]
      4. associate-/r*82.3%

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

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

      \[\leadsto \color{blue}{\frac{x}{y \cdot z}} \]
    13. Step-by-step derivation
      1. *-commutative31.7%

        \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]
    14. Simplified31.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.7 \cdot 10^{+115}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 39.6% accurate, 1.8× speedup?

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

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

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

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

Developer target: 87.8% 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 2024053 
(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))))