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

Percentage Accurate: 88.8% → 96.9%
Time: 11.1s
Alternatives: 21
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 21 alternatives:

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

Initial Program: 88.8% accurate, 1.0× speedup?

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

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

Alternative 1: 96.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 82.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{z - t}}{z}\\ \mathbf{if}\;y \leq -3.7 \cdot 10^{+146}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-109}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-44}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x (- z t)) z)))
   (if (<= y -3.7e+146)
     (/ (/ x y) (- t z))
     (if (<= y -1.25e+18)
       (/ x (* (- t z) y))
       (if (<= y -1.7e-101)
         t_1
         (if (<= y -1.55e-109)
           (/ (/ x t) y)
           (if (<= y 7.6e-44) t_1 (/ (/ x t) (- y z)))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / (z - t)) / z;
	double tmp;
	if (y <= -3.7e+146) {
		tmp = (x / y) / (t - z);
	} else if (y <= -1.25e+18) {
		tmp = x / ((t - z) * y);
	} else if (y <= -1.7e-101) {
		tmp = t_1;
	} else if (y <= -1.55e-109) {
		tmp = (x / t) / y;
	} else if (y <= 7.6e-44) {
		tmp = t_1;
	} 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 / (z - t)) / z
    if (y <= (-3.7d+146)) then
        tmp = (x / y) / (t - z)
    else if (y <= (-1.25d+18)) then
        tmp = x / ((t - z) * y)
    else if (y <= (-1.7d-101)) then
        tmp = t_1
    else if (y <= (-1.55d-109)) then
        tmp = (x / t) / y
    else if (y <= 7.6d-44) then
        tmp = t_1
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / (z - t)) / z;
	double tmp;
	if (y <= -3.7e+146) {
		tmp = (x / y) / (t - z);
	} else if (y <= -1.25e+18) {
		tmp = x / ((t - z) * y);
	} else if (y <= -1.7e-101) {
		tmp = t_1;
	} else if (y <= -1.55e-109) {
		tmp = (x / t) / y;
	} else if (y <= 7.6e-44) {
		tmp = t_1;
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / (z - t)) / z
	tmp = 0
	if y <= -3.7e+146:
		tmp = (x / y) / (t - z)
	elif y <= -1.25e+18:
		tmp = x / ((t - z) * y)
	elif y <= -1.7e-101:
		tmp = t_1
	elif y <= -1.55e-109:
		tmp = (x / t) / y
	elif y <= 7.6e-44:
		tmp = t_1
	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 / Float64(z - t)) / z)
	tmp = 0.0
	if (y <= -3.7e+146)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= -1.25e+18)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= -1.7e-101)
		tmp = t_1;
	elseif (y <= -1.55e-109)
		tmp = Float64(Float64(x / t) / y);
	elseif (y <= 7.6e-44)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / (z - t)) / z;
	tmp = 0.0;
	if (y <= -3.7e+146)
		tmp = (x / y) / (t - z);
	elseif (y <= -1.25e+18)
		tmp = x / ((t - z) * y);
	elseif (y <= -1.7e-101)
		tmp = t_1;
	elseif (y <= -1.55e-109)
		tmp = (x / t) / y;
	elseif (y <= 7.6e-44)
		tmp = t_1;
	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 / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -3.7e+146], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.25e+18], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-101], t$95$1, If[LessEqual[y, -1.55e-109], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 7.6e-44], t$95$1, N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z - t}}{z}\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{+146}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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

\mathbf{elif}\;y \leq -1.55 \cdot 10^{-109}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.70000000000000004e146

    1. Initial program 75.2%

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

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

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

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

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

    if -3.70000000000000004e146 < y < -1.25e18

    1. Initial program 88.5%

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

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

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

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

    if -1.25e18 < y < -1.69999999999999995e-101 or -1.55e-109 < y < 7.6000000000000002e-44

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999995e-101 < y < -1.55e-109

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.6000000000000002e-44 < y

    1. Initial program 93.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+146}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-101}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-109}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.6% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{if}\;y \leq -1.75 \cdot 10^{+146}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-87}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* z (- z t)))))
   (if (<= y -1.75e+146)
     (/ (/ x y) (- t z))
     (if (<= y -2.2e+17)
       (/ x (* (- t z) y))
       (if (<= y -1.7e-101)
         t_1
         (if (<= y -1.25e-106)
           (/ (/ x t) y)
           (if (<= y 5.6e-87) t_1 (/ (/ x t) (- y z)))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * (z - t));
	double tmp;
	if (y <= -1.75e+146) {
		tmp = (x / y) / (t - z);
	} else if (y <= -2.2e+17) {
		tmp = x / ((t - z) * y);
	} else if (y <= -1.7e-101) {
		tmp = t_1;
	} else if (y <= -1.25e-106) {
		tmp = (x / t) / y;
	} else if (y <= 5.6e-87) {
		tmp = t_1;
	} 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 / (z * (z - t))
    if (y <= (-1.75d+146)) then
        tmp = (x / y) / (t - z)
    else if (y <= (-2.2d+17)) then
        tmp = x / ((t - z) * y)
    else if (y <= (-1.7d-101)) then
        tmp = t_1
    else if (y <= (-1.25d-106)) then
        tmp = (x / t) / y
    else if (y <= 5.6d-87) then
        tmp = t_1
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z * (z - t));
	double tmp;
	if (y <= -1.75e+146) {
		tmp = (x / y) / (t - z);
	} else if (y <= -2.2e+17) {
		tmp = x / ((t - z) * y);
	} else if (y <= -1.7e-101) {
		tmp = t_1;
	} else if (y <= -1.25e-106) {
		tmp = (x / t) / y;
	} else if (y <= 5.6e-87) {
		tmp = t_1;
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / (z * (z - t))
	tmp = 0
	if y <= -1.75e+146:
		tmp = (x / y) / (t - z)
	elif y <= -2.2e+17:
		tmp = x / ((t - z) * y)
	elif y <= -1.7e-101:
		tmp = t_1
	elif y <= -1.25e-106:
		tmp = (x / t) / y
	elif y <= 5.6e-87:
		tmp = t_1
	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(x / Float64(z * Float64(z - t)))
	tmp = 0.0
	if (y <= -1.75e+146)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= -2.2e+17)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= -1.7e-101)
		tmp = t_1;
	elseif (y <= -1.25e-106)
		tmp = Float64(Float64(x / t) / y);
	elseif (y <= 5.6e-87)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z * (z - t));
	tmp = 0.0;
	if (y <= -1.75e+146)
		tmp = (x / y) / (t - z);
	elseif (y <= -2.2e+17)
		tmp = x / ((t - z) * y);
	elseif (y <= -1.7e-101)
		tmp = t_1;
	elseif (y <= -1.25e-106)
		tmp = (x / t) / y;
	elseif (y <= 5.6e-87)
		tmp = t_1;
	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[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.75e+146], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e+17], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-101], t$95$1, If[LessEqual[y, -1.25e-106], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 5.6e-87], t$95$1, 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{x}{z \cdot \left(z - t\right)}\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{+146}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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

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

\mathbf{elif}\;y \leq 5.6 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.7500000000000001e146

    1. Initial program 75.2%

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

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

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

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

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

    if -1.7500000000000001e146 < y < -2.2e17

    1. Initial program 88.5%

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

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

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

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

    if -2.2e17 < y < -1.69999999999999995e-101 or -1.24999999999999996e-106 < y < 5.6000000000000002e-87

    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 0 77.9%

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

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

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

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

    if -1.69999999999999995e-101 < y < -1.24999999999999996e-106

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6000000000000002e-87 < y

    1. Initial program 92.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+146}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-101}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-87}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 51.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 205000000000:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.60000000000000001e185 or -6e61 < z < -1.05000000000000003e-42

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.60000000000000001e185 < z < -6e61 or 2.05e11 < z < 1.1000000000000001e194

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05000000000000003e-42 < z < 2.05e11

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1000000000000001e194 < z

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{y}} \]
      4. distribute-frac-neg253.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-y}} \]
      5. add-sqr-sqrt25.6%

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

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

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

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

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

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

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

Alternative 5: 52.9% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-39} \lor \neg \left(z \leq 1.65 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= z -2.9e+185)
   (/ x (* z (- y)))
   (if (<= z -2.5e+84)
     (/ (/ x (- z)) t)
     (if (or (<= z -1.42e-39) (not (<= z 1.65e-26)))
       (/ -1.0 (* y (/ z x)))
       (/ (/ x t) y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.9e+185) {
		tmp = x / (z * -y);
	} else if (z <= -2.5e+84) {
		tmp = (x / -z) / t;
	} else if ((z <= -1.42e-39) || !(z <= 1.65e-26)) {
		tmp = -1.0 / (y * (z / x));
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-2.9d+185)) then
        tmp = x / (z * -y)
    else if (z <= (-2.5d+84)) then
        tmp = (x / -z) / t
    else if ((z <= (-1.42d-39)) .or. (.not. (z <= 1.65d-26))) then
        tmp = (-1.0d0) / (y * (z / x))
    else
        tmp = (x / t) / y
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.9e+185) {
		tmp = x / (z * -y);
	} else if (z <= -2.5e+84) {
		tmp = (x / -z) / t;
	} else if ((z <= -1.42e-39) || !(z <= 1.65e-26)) {
		tmp = -1.0 / (y * (z / x));
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -2.9e+185:
		tmp = x / (z * -y)
	elif z <= -2.5e+84:
		tmp = (x / -z) / t
	elif (z <= -1.42e-39) or not (z <= 1.65e-26):
		tmp = -1.0 / (y * (z / x))
	else:
		tmp = (x / t) / y
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -2.9e+185)
		tmp = Float64(x / Float64(z * Float64(-y)));
	elseif (z <= -2.5e+84)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	elseif ((z <= -1.42e-39) || !(z <= 1.65e-26))
		tmp = Float64(-1.0 / Float64(y * Float64(z / x)));
	else
		tmp = Float64(Float64(x / t) / y);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -2.9e+185)
		tmp = x / (z * -y);
	elseif (z <= -2.5e+84)
		tmp = (x / -z) / t;
	elseif ((z <= -1.42e-39) || ~((z <= 1.65e-26)))
		tmp = -1.0 / (y * (z / x));
	else
		tmp = (x / t) / y;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e+185], N[(x / N[(z * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e+84], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, -1.42e-39], N[Not[LessEqual[z, 1.65e-26]], $MachinePrecision]], N[(-1.0 / N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+185}:\\
\;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\

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

\mathbf{elif}\;z \leq -1.42 \cdot 10^{-39} \lor \neg \left(z \leq 1.65 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.89999999999999988e185

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.89999999999999988e185 < z < -2.5e84

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e84 < z < -1.42000000000000005e-39 or 1.6499999999999999e-26 < z

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.42000000000000005e-39 < z < 1.6499999999999999e-26

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-39} \lor \neg \left(z \leq 1.65 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 52.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.42 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.05e185 or -2.1500000000000001e61 < z < -1.42000000000000005e-39

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e185 < z < -2.1500000000000001e61

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.42000000000000005e-39 < z < 1.6499999999999999e-26

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6499999999999999e-26 < z

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+61}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq -1.42 \cdot 10^{-39}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{-z}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 52.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq 260000000000:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.70000000000000007e185

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt17.0%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod17.0%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity59.8%

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

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

    if -2.70000000000000007e185 < z < -2.7e24 or 2.6e11 < z < 2.69999999999999996e191

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7e24 < z < 2.6e11

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.69999999999999996e191 < z

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{\frac{x}{z}}{y}} \]
      4. distribute-frac-neg253.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{-y}} \]
      5. add-sqr-sqrt25.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+24}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{elif}\;z \leq 260000000000:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+191}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 66.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 2 \cdot 10^{+129}:\\
\;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8000000000000001e136 or 2e129 < z

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x}}{z \cdot \left(t - z\right)} \]
      6. *-un-lft-identity82.1%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t - z}} \]
      2. associate-/r*82.1%

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

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

    if -4.8000000000000001e136 < z < 1.40000000000000006e48

    1. Initial program 93.1%

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

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

    if 1.40000000000000006e48 < z < 2e129

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 81.3% accurate, 0.5× speedup?

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

\mathbf{elif}\;t \leq 3.8 \cdot 10^{+51}:\\
\;\;\;\;\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 < -2.09999999999999987e-46

    1. Initial program 93.7%

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

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

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

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

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

    if -2.09999999999999987e-46 < t < 3.7999999999999997e51

    1. Initial program 92.4%

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

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

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

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

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

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

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

    if 3.7999999999999997e51 < t

    1. Initial program 83.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{elif}\;t \leq 4.5 \cdot 10^{-141}:\\
\;\;\;\;\frac{-1}{y \cdot \frac{z}{x}}\\

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


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

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e-47 < t < 4.5e-141

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5e-141 < t

    1. Initial program 87.8%

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

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

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

Alternative 11: 46.2% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6000000000000001e84 or 0.160000000000000003 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg35.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity33.6%

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

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

    if -2.6000000000000001e84 < z < 0.160000000000000003

    1. Initial program 94.1%

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

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

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

Alternative 12: 49.8% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt13.0%

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

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg50.1%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod13.0%

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

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

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

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

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

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

    if -3.8e121 < z < 1.4e53

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e53 < z

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{z}} \cdot \frac{1}{y} \]
    9. Step-by-step derivation
      1. un-div-inv46.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+121}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+53}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 49.9% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt13.0%

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

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg50.1%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod13.0%

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

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

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

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

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

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

    if -6.50000000000000019e121 < z < 4.4000000000000001e45

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4000000000000001e45 < z

    1. Initial program 89.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt18.1%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      2. sqrt-unprod42.6%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      5. add-sqr-sqrt33.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. associate-/r*33.1%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
      3. *-lft-identity33.1%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{t} \]
    12. Simplified41.5%

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

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

Alternative 14: 48.8% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt13.0%

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

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg50.1%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod13.0%

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

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

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

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

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

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

    if -4.20000000000000032e122 < z < 1.15000000000000006e45

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15000000000000006e45 < z

    1. Initial program 89.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt18.1%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      2. sqrt-unprod42.6%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      5. add-sqr-sqrt33.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. associate-/l/33.1%

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

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

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

Alternative 15: 46.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{z \cdot y}} \]
      10. add-sqr-sqrt14.0%

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

        \[\leadsto x \cdot \frac{1}{z \cdot \color{blue}{\sqrt{y \cdot y}}} \]
      12. sqr-neg46.5%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\sqrt{\color{blue}{y \cdot y}} \cdot z} \]
      19. sqrt-unprod14.0%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{y \cdot z}} \]
      2. *-rgt-identity47.0%

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

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

    if -2.6000000000000001e84 < z < 2.40000000000000008e46

    1. Initial program 94.0%

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

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

    if 2.40000000000000008e46 < z

    1. Initial program 89.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt18.1%

        \[\leadsto \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{t \cdot z} \]
      2. sqrt-unprod42.6%

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{t \cdot z} \]
      5. add-sqr-sqrt33.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{z}} \]
      2. associate-/l/33.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+84}:\\ \;\;\;\;\frac{x}{z \cdot y}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+46}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 90.6% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5.99999999999999965e204

    1. Initial program 93.0%

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

    if 5.99999999999999965e204 < t

    1. Initial program 68.5%

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

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

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

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

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

Alternative 17: 73.8% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.4000000000000001e40

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    8. Step-by-step derivation
      1. associate-/l/56.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]
    9. Simplified56.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y}} \]

    if 1.4000000000000001e40 < t

    1. Initial program 82.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/96.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified96.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 92.2%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 72.7% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.2 \cdot 10^{-69}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t 1.2e-69) (/ (/ x y) (- t z)) (/ (/ x t) (- y z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.2e-69) {
		tmp = (x / y) / (t - z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= 1.2d-69) then
        tmp = (x / y) / (t - z)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.2e-69) {
		tmp = (x / y) / (t - z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= 1.2e-69:
		tmp = (x / y) / (t - z)
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 1.2e-69)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= 1.2e-69)
		tmp = (x / y) / (t - z);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[t, 1.2e-69], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.2 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.2000000000000001e-69

    1. Initial program 92.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 92.8%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}} \]
    4. Step-by-step derivation
      1. associate-/l/97.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    5. Simplified97.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    6. Taylor expanded in y around inf 55.2%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t - z} \]

    if 1.2000000000000001e-69 < t

    1. Initial program 86.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/97.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified97.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 78.1%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 72.5% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 6.5 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot 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 6.5e-68) (/ x (* (- t 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 <= 6.5e-68) {
		tmp = x / ((t - 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 <= 6.5d-68) then
        tmp = x / ((t - 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 <= 6.5e-68) {
		tmp = x / ((t - 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 <= 6.5e-68:
		tmp = x / ((t - 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 <= 6.5e-68)
		tmp = Float64(x / Float64(Float64(t - 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 <= 6.5e-68)
		tmp = x / ((t - 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, 6.5e-68], N[(x / N[(N[(t - z), $MachinePrecision] * 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 6.5 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6.4999999999999997e-68

    1. Initial program 92.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 55.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative55.6%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified55.6%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]

    if 6.4999999999999997e-68 < t

    1. Initial program 86.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/97.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified97.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 78.1%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 70.4% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.3e+18) (/ x (* (- t 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 (y <= -1.3e+18) {
		tmp = x / ((t - 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 (y <= (-1.3d+18)) then
        tmp = x / ((t - 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 (y <= -1.3e+18) {
		tmp = x / ((t - 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 y <= -1.3e+18:
		tmp = x / ((t - 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 (y <= -1.3e+18)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	else
		tmp = Float64(x / Float64(t * Float64(y - z)));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.3e+18)
		tmp = x / ((t - 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[y, -1.3e+18], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3e18

    1. Initial program 82.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 81.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative81.9%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified81.9%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]

    if -1.3e18 < y

    1. Initial program 93.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 53.4%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(y - z\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 39.4% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{t \cdot y} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (/ x (* t y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return x / (t * y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x / (t * y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return x / (t * y);
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return x / (t * y)
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(x / Float64(t * y))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = x / (t * y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{t \cdot y}
\end{array}
Derivation
  1. Initial program 90.8%

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 36.6%

    \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
  4. Add Preprocessing

Developer target: 87.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;\frac{x}{t\_1} < 0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (- t z))))
   (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - z) * (t - z)
    if ((x / t_1) < 0.0d0) then
        tmp = (x / (y - z)) / (t - z)
    else
        tmp = x * (1.0d0 / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if (x / t_1) < 0.0:
		tmp = (x / (y - z)) / (t - z)
	else:
		tmp = x * (1.0 / t_1)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (Float64(x / t_1) < 0.0)
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(x * Float64(1.0 / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * (t - z);
	tmp = 0.0;
	if ((x / t_1) < 0.0)
		tmp = (x / (y - z)) / (t - z);
	else
		tmp = x * (1.0 / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024107 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
  :precision binary64

  :alt
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))

  (/ x (* (- y z) (- t z))))