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

Percentage Accurate: 88.5% → 97.0%
Time: 15.9s
Alternatives: 22
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 88.5% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 0.4× speedup?

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

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


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

    1. Initial program 94.0%

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

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

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

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

    if 1e-107 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 93.4%

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

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

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

Alternative 2: 81.5% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{z}}{z - t}\\ \mathbf{if}\;y \leq -7.4:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-71}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-229}:\\ \;\;\;\;\frac{x}{t - z} \cdot \frac{-1}{z}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-278}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-154}:\\ \;\;\;\;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 -7.4)
     (/ (/ x y) (- t z))
     (if (<= y -3.3e-46)
       t_1
       (if (<= y -3.8e-71)
         (/ x (* (- y z) t))
         (if (<= y -1.7e-229)
           (* (/ x (- t z)) (/ -1.0 z))
           (if (<= y 5.5e-278)
             (/ x (* z (- z t)))
             (if (<= y 9.5e-154) 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 <= -7.4) {
		tmp = (x / y) / (t - z);
	} else if (y <= -3.3e-46) {
		tmp = t_1;
	} else if (y <= -3.8e-71) {
		tmp = x / ((y - z) * t);
	} else if (y <= -1.7e-229) {
		tmp = (x / (t - z)) * (-1.0 / z);
	} else if (y <= 5.5e-278) {
		tmp = x / (z * (z - t));
	} else if (y <= 9.5e-154) {
		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 <= (-7.4d0)) then
        tmp = (x / y) / (t - z)
    else if (y <= (-3.3d-46)) then
        tmp = t_1
    else if (y <= (-3.8d-71)) then
        tmp = x / ((y - z) * t)
    else if (y <= (-1.7d-229)) then
        tmp = (x / (t - z)) * ((-1.0d0) / z)
    else if (y <= 5.5d-278) then
        tmp = x / (z * (z - t))
    else if (y <= 9.5d-154) 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 <= -7.4) {
		tmp = (x / y) / (t - z);
	} else if (y <= -3.3e-46) {
		tmp = t_1;
	} else if (y <= -3.8e-71) {
		tmp = x / ((y - z) * t);
	} else if (y <= -1.7e-229) {
		tmp = (x / (t - z)) * (-1.0 / z);
	} else if (y <= 5.5e-278) {
		tmp = x / (z * (z - t));
	} else if (y <= 9.5e-154) {
		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 <= -7.4:
		tmp = (x / y) / (t - z)
	elif y <= -3.3e-46:
		tmp = t_1
	elif y <= -3.8e-71:
		tmp = x / ((y - z) * t)
	elif y <= -1.7e-229:
		tmp = (x / (t - z)) * (-1.0 / z)
	elif y <= 5.5e-278:
		tmp = x / (z * (z - t))
	elif y <= 9.5e-154:
		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 / z) / Float64(z - t))
	tmp = 0.0
	if (y <= -7.4)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= -3.3e-46)
		tmp = t_1;
	elseif (y <= -3.8e-71)
		tmp = Float64(x / Float64(Float64(y - z) * t));
	elseif (y <= -1.7e-229)
		tmp = Float64(Float64(x / Float64(t - z)) * Float64(-1.0 / z));
	elseif (y <= 5.5e-278)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	elseif (y <= 9.5e-154)
		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 <= -7.4)
		tmp = (x / y) / (t - z);
	elseif (y <= -3.3e-46)
		tmp = t_1;
	elseif (y <= -3.8e-71)
		tmp = x / ((y - z) * t);
	elseif (y <= -1.7e-229)
		tmp = (x / (t - z)) * (-1.0 / z);
	elseif (y <= 5.5e-278)
		tmp = x / (z * (z - t));
	elseif (y <= 9.5e-154)
		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 / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.4], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.3e-46], t$95$1, If[LessEqual[y, -3.8e-71], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-229], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-278], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-154], 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}}{z - t}\\
\mathbf{if}\;y \leq -7.4:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{elif}\;y \leq -3.3 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\

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

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

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

\mathbf{elif}\;y \leq 9.5 \cdot 10^{-154}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

    if -7.4000000000000004 < y < -3.30000000000000013e-46 or 5.49999999999999989e-278 < y < 9.50000000000000057e-154

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Step-by-step derivation
      1. frac-2neg29.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.30000000000000013e-46 < y < -3.79999999999999992e-71

    1. Initial program 99.5%

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

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

    if -3.79999999999999992e-71 < y < -1.7e-229

    1. Initial program 95.5%

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

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

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

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

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

    if -1.7e-229 < y < 5.49999999999999989e-278

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Step-by-step derivation
      1. frac-2neg53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000057e-154 < y

    1. Initial program 94.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-71}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-229}:\\ \;\;\;\;\frac{x}{t - z} \cdot \frac{-1}{z}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-278}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-154}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.0% accurate, 0.2× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+42}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-15}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-120}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-16}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \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.5e+42)
   (/ (/ x z) z)
   (if (<= z -8e-15)
     (/ (/ x y) t)
     (if (<= z -2.8e-15)
       (* (/ x z) (/ 1.0 z))
       (if (<= z 7e-120)
         (/ (/ x t) y)
         (if (<= z 2.15e-16)
           (/ (/ x (- y)) z)
           (if (<= z 7.2e+84) (/ (/ x (- z)) t) (/ 1.0 (* z (/ z x))))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.5e+42) {
		tmp = (x / z) / z;
	} else if (z <= -8e-15) {
		tmp = (x / y) / t;
	} else if (z <= -2.8e-15) {
		tmp = (x / z) * (1.0 / z);
	} else if (z <= 7e-120) {
		tmp = (x / t) / y;
	} else if (z <= 2.15e-16) {
		tmp = (x / -y) / z;
	} else if (z <= 7.2e+84) {
		tmp = (x / -z) / t;
	} else {
		tmp = 1.0 / (z * (z / x));
	}
	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.5d+42)) then
        tmp = (x / z) / z
    else if (z <= (-8d-15)) then
        tmp = (x / y) / t
    else if (z <= (-2.8d-15)) then
        tmp = (x / z) * (1.0d0 / z)
    else if (z <= 7d-120) then
        tmp = (x / t) / y
    else if (z <= 2.15d-16) then
        tmp = (x / -y) / z
    else if (z <= 7.2d+84) then
        tmp = (x / -z) / t
    else
        tmp = 1.0d0 / (z * (z / x))
    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.5e+42) {
		tmp = (x / z) / z;
	} else if (z <= -8e-15) {
		tmp = (x / y) / t;
	} else if (z <= -2.8e-15) {
		tmp = (x / z) * (1.0 / z);
	} else if (z <= 7e-120) {
		tmp = (x / t) / y;
	} else if (z <= 2.15e-16) {
		tmp = (x / -y) / z;
	} else if (z <= 7.2e+84) {
		tmp = (x / -z) / t;
	} else {
		tmp = 1.0 / (z * (z / x));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= -3.5e+42:
		tmp = (x / z) / z
	elif z <= -8e-15:
		tmp = (x / y) / t
	elif z <= -2.8e-15:
		tmp = (x / z) * (1.0 / z)
	elif z <= 7e-120:
		tmp = (x / t) / y
	elif z <= 2.15e-16:
		tmp = (x / -y) / z
	elif z <= 7.2e+84:
		tmp = (x / -z) / t
	else:
		tmp = 1.0 / (z * (z / x))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -3.5e+42)
		tmp = Float64(Float64(x / z) / z);
	elseif (z <= -8e-15)
		tmp = Float64(Float64(x / y) / t);
	elseif (z <= -2.8e-15)
		tmp = Float64(Float64(x / z) * Float64(1.0 / z));
	elseif (z <= 7e-120)
		tmp = Float64(Float64(x / t) / y);
	elseif (z <= 2.15e-16)
		tmp = Float64(Float64(x / Float64(-y)) / z);
	elseif (z <= 7.2e+84)
		tmp = Float64(Float64(x / Float64(-z)) / t);
	else
		tmp = Float64(1.0 / Float64(z * Float64(z / x)));
	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.5e+42)
		tmp = (x / z) / z;
	elseif (z <= -8e-15)
		tmp = (x / y) / t;
	elseif (z <= -2.8e-15)
		tmp = (x / z) * (1.0 / z);
	elseif (z <= 7e-120)
		tmp = (x / t) / y;
	elseif (z <= 2.15e-16)
		tmp = (x / -y) / z;
	elseif (z <= 7.2e+84)
		tmp = (x / -z) / t;
	else
		tmp = 1.0 / (z * (z / x));
	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.5e+42], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, -8e-15], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -2.8e-15], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-120], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.15e-16], N[(N[(x / (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 7.2e+84], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+42}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

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

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\

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

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

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

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


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

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac281.5%

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg81.5%

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. un-div-inv81.5%

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

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

    if -3.50000000000000023e42 < z < -8.0000000000000006e-15

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000006e-15 < z < -2.80000000000000014e-15

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac280.4%

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg80.4%

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

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

    if -2.80000000000000014e-15 < z < 7e-120

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

    if 7e-120 < z < 2.1499999999999999e-16

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

    if 2.1499999999999999e-16 < z < 7.1999999999999999e84

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. *-lft-identity45.2%

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

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

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

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

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

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

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

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

    if 7.1999999999999999e84 < z

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac281.0%

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg81.0%

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. clear-num81.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+42}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-15}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-120}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-16}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.0% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.20000000000000007e44 or 6.9999999999999998e84 < z

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.20000000000000007e44 < z < -5.6000000000000001e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -5.6000000000000001e-14 < z < -3e-15

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac280.4%

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg80.4%

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

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

    if -3e-15 < z < 8.8000000000000005e-120

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

    if 8.8000000000000005e-120 < z < 5.5e-18

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

    if 5.5e-18 < z < 6.9999999999999998e84

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. *-lft-identity45.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+44}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-15}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-120}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-18}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.9% accurate, 0.2× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -4.5000000000000001e46 or -1.26e-11 < z < -7.5e-16 or 1.17999999999999997e85 < z

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-z} \cdot \frac{1}{z} \]
      4. sqrt-unprod64.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. un-div-inv81.2%

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

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

    if -4.5000000000000001e46 < z < -1.26e-11

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e-16 < z < 8.8000000000000005e-120

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

    if 8.8000000000000005e-120 < z < 4.1000000000000002e-13

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

    if 4.1000000000000002e-13 < z < 1.17999999999999997e85

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. *-lft-identity45.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+46}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{-11}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-16}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-120}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{+85}:\\ \;\;\;\;\frac{\frac{x}{-z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.7% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.60000000000000007e45 or -1.3e-13 < z < -3e-15 or 6.9999999999999998e84 < z

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-z} \cdot \frac{1}{z} \]
      4. sqrt-unprod64.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. un-div-inv81.2%

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

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

    if -2.60000000000000007e45 < z < -1.3e-13

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -3e-15 < z < 7e-120

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

    if 7e-120 < z < 1.4000000000000001e-13

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

    if 1.4000000000000001e-13 < z < 6.9999999999999998e84

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-120}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+84}:\\ \;\;\;\;\frac{x}{-z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.0% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;z \leq -4 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.40000000000000004e42 or -1.4999999999999999e-14 < z < -4.0000000000000003e-15 or 1.95000000000000017e85 < z

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac281.0%

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg81.0%

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

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

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

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

    if -6.40000000000000004e42 < z < -1.4999999999999999e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000003e-15 < z < 3.79999999999999973e-108

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

    if 3.79999999999999973e-108 < z < 2.5000000000000002e-19

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000002e-19 < z < 1.95000000000000017e85

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+42}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-108}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{-z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.75000000000000001e42 or -4.7999999999999999e-15 < z < -2.80000000000000014e-15 or 7.6000000000000002e84 < z

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-z} \cdot \frac{1}{z} \]
      4. sqrt-unprod64.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. un-div-inv81.2%

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

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

    if -2.75000000000000001e42 < z < -4.7999999999999999e-15

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    if -2.80000000000000014e-15 < z < 2.49999999999999991e-65

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

    if 2.49999999999999991e-65 < z < 7.6000000000000002e84

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{+42}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{+84}:\\ \;\;\;\;\frac{x}{-z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 80.5% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{z}}{z - t}\\ \mathbf{if}\;y \leq -5:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-72}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-280}:\\ \;\;\;\;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 -5.0)
     (/ (/ x y) (- t z))
     (if (<= y -5.2e-46)
       t_1
       (if (<= y -8e-72)
         (/ x (* (- y z) t))
         (if (<= y 3.9e-280) 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 <= -5.0) {
		tmp = (x / y) / (t - z);
	} else if (y <= -5.2e-46) {
		tmp = t_1;
	} else if (y <= -8e-72) {
		tmp = x / ((y - z) * t);
	} else if (y <= 3.9e-280) {
		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 <= (-5.0d0)) then
        tmp = (x / y) / (t - z)
    else if (y <= (-5.2d-46)) then
        tmp = t_1
    else if (y <= (-8d-72)) then
        tmp = x / ((y - z) * t)
    else if (y <= 3.9d-280) 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 <= -5.0) {
		tmp = (x / y) / (t - z);
	} else if (y <= -5.2e-46) {
		tmp = t_1;
	} else if (y <= -8e-72) {
		tmp = x / ((y - z) * t);
	} else if (y <= 3.9e-280) {
		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 <= -5.0:
		tmp = (x / y) / (t - z)
	elif y <= -5.2e-46:
		tmp = t_1
	elif y <= -8e-72:
		tmp = x / ((y - z) * t)
	elif y <= 3.9e-280:
		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 / z) / Float64(z - t))
	tmp = 0.0
	if (y <= -5.0)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= -5.2e-46)
		tmp = t_1;
	elseif (y <= -8e-72)
		tmp = Float64(x / Float64(Float64(y - z) * t));
	elseif (y <= 3.9e-280)
		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 <= -5.0)
		tmp = (x / y) / (t - z);
	elseif (y <= -5.2e-46)
		tmp = t_1;
	elseif (y <= -8e-72)
		tmp = x / ((y - z) * t);
	elseif (y <= 3.9e-280)
		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 / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.0], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e-46], t$95$1, If[LessEqual[y, -8e-72], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-280], 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}}{z - t}\\
\mathbf{if}\;y \leq -5:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-280}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

    if -5 < y < -5.2000000000000004e-46 or -7.9999999999999997e-72 < y < 3.89999999999999998e-280

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000004e-46 < y < -7.9999999999999997e-72

    1. Initial program 85.9%

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

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

    if 3.89999999999999998e-280 < y

    1. Initial program 94.9%

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

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

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

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

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

Alternative 10: 69.5% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq 1.95 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.18 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr74.8%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative74.8%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/72.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/72.7%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/72.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity72.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified72.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity72.7%

        \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{t - z}}{z}} \]
      2. associate-/l/74.8%

        \[\leadsto 1 \cdot \color{blue}{\frac{x}{z \cdot \left(t - z\right)}} \]
      3. sub-neg74.8%

        \[\leadsto 1 \cdot \frac{x}{z \cdot \color{blue}{\left(t + \left(-z\right)\right)}} \]
      4. distribute-rgt-in63.9%

        \[\leadsto 1 \cdot \frac{x}{\color{blue}{t \cdot z + \left(-z\right) \cdot z}} \]
      5. add-sqr-sqrt63.9%

        \[\leadsto 1 \cdot \frac{x}{t \cdot z + \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot z} \]
      6. sqrt-unprod63.9%

        \[\leadsto 1 \cdot \frac{x}{t \cdot z + \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot z} \]
      7. sqr-neg63.9%

        \[\leadsto 1 \cdot \frac{x}{t \cdot z + \sqrt{\color{blue}{z \cdot z}} \cdot z} \]
      8. sqrt-unprod0.0%

        \[\leadsto 1 \cdot \frac{x}{t \cdot z + \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot z} \]
      9. add-sqr-sqrt74.5%

        \[\leadsto 1 \cdot \frac{x}{t \cdot z + \color{blue}{z} \cdot z} \]
      10. +-commutative74.5%

        \[\leadsto 1 \cdot \frac{x}{\color{blue}{z \cdot z + t \cdot z}} \]
      11. distribute-rgt-out87.5%

        \[\leadsto 1 \cdot \frac{x}{\color{blue}{z \cdot \left(z + t\right)}} \]
    11. Applied egg-rr87.5%

      \[\leadsto \color{blue}{1 \cdot \frac{x}{z \cdot \left(z + t\right)}} \]
    12. Step-by-step derivation
      1. *-lft-identity87.5%

        \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z + t\right)}} \]
    13. Simplified87.5%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z + t\right)}} \]

    if -3.3000000000000001e45 < z < 1.95000000000000008e-101 or 9.49999999999999939e-30 < z < 1.17999999999999997e85

    1. Initial program 96.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 72.0%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(y - z\right)}} \]

    if 1.95000000000000008e-101 < z < 9.49999999999999939e-30

    1. Initial program 93.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 69.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified69.8%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]
    6. Taylor expanded in t around 0 54.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg54.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. associate-/r*58.8%

        \[\leadsto -\color{blue}{\frac{\frac{x}{y}}{z}} \]
      3. distribute-neg-frac258.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    8. Simplified58.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]

    if 1.17999999999999997e85 < z

    1. Initial program 84.0%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 81.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/81.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-181.3%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified81.3%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv81.3%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt42.3%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod66.7%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg66.7%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod32.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt71.3%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*70.0%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr70.0%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative70.0%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/68.9%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/68.9%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/68.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity68.9%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified68.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Taylor expanded in t around 0 64.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{z} \]
    11. Step-by-step derivation
      1. associate-*r/92.8%

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y - z} \]
      2. neg-mul-192.8%

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified64.8%

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv64.8%

        \[\leadsto \color{blue}{\frac{-x}{z} \cdot \frac{1}{z}} \]
      2. frac-2neg64.8%

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-z}} \cdot \frac{1}{z} \]
      3. add-sqr-sqrt34.1%

        \[\leadsto \frac{-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-z} \cdot \frac{1}{z} \]
      4. sqrt-unprod66.1%

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-z} \cdot \frac{1}{z} \]
      5. sqr-neg66.1%

        \[\leadsto \frac{-\sqrt{\color{blue}{x \cdot x}}}{-z} \cdot \frac{1}{z} \]
      6. sqrt-unprod38.9%

        \[\leadsto \frac{-\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-z} \cdot \frac{1}{z} \]
      7. add-sqr-sqrt81.0%

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac281.0%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right)} \cdot \frac{1}{z} \]
      9. distribute-frac-neg81.0%

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg81.0%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr81.0%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. clear-num81.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{1}{z} \]
      2. frac-times81.9%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{z}{x} \cdot z}} \]
      3. metadata-eval81.9%

        \[\leadsto \frac{\color{blue}{1}}{\frac{z}{x} \cdot z} \]
    16. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x} \cdot z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification76.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+45}:\\ \;\;\;\;\frac{x}{z \cdot \left(z + t\right)}\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-101}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 69.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}{\left(y - z\right) \cdot t}\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+133}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* (- y z) t))))
   (if (<= z -4.5e+133)
     (/ (/ x z) z)
     (if (<= z 1.95e-101)
       t_1
       (if (<= z 9.2e-30)
         (/ (/ x (- y)) z)
         (if (<= z 5.6e+55) t_1 (/ 1.0 (* z (/ z x)))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / ((y - z) * t);
	double tmp;
	if (z <= -4.5e+133) {
		tmp = (x / z) / z;
	} else if (z <= 1.95e-101) {
		tmp = t_1;
	} else if (z <= 9.2e-30) {
		tmp = (x / -y) / z;
	} else if (z <= 5.6e+55) {
		tmp = t_1;
	} else {
		tmp = 1.0 / (z * (z / x));
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / ((y - z) * t)
    if (z <= (-4.5d+133)) then
        tmp = (x / z) / z
    else if (z <= 1.95d-101) then
        tmp = t_1
    else if (z <= 9.2d-30) then
        tmp = (x / -y) / z
    else if (z <= 5.6d+55) then
        tmp = t_1
    else
        tmp = 1.0d0 / (z * (z / x))
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / ((y - z) * t);
	double tmp;
	if (z <= -4.5e+133) {
		tmp = (x / z) / z;
	} else if (z <= 1.95e-101) {
		tmp = t_1;
	} else if (z <= 9.2e-30) {
		tmp = (x / -y) / z;
	} else if (z <= 5.6e+55) {
		tmp = t_1;
	} else {
		tmp = 1.0 / (z * (z / x));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / ((y - z) * t)
	tmp = 0
	if z <= -4.5e+133:
		tmp = (x / z) / z
	elif z <= 1.95e-101:
		tmp = t_1
	elif z <= 9.2e-30:
		tmp = (x / -y) / z
	elif z <= 5.6e+55:
		tmp = t_1
	else:
		tmp = 1.0 / (z * (z / x))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(Float64(y - z) * t))
	tmp = 0.0
	if (z <= -4.5e+133)
		tmp = Float64(Float64(x / z) / z);
	elseif (z <= 1.95e-101)
		tmp = t_1;
	elseif (z <= 9.2e-30)
		tmp = Float64(Float64(x / Float64(-y)) / z);
	elseif (z <= 5.6e+55)
		tmp = t_1;
	else
		tmp = Float64(1.0 / Float64(z * Float64(z / x)));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / ((y - z) * t);
	tmp = 0.0;
	if (z <= -4.5e+133)
		tmp = (x / z) / z;
	elseif (z <= 1.95e-101)
		tmp = t_1;
	elseif (z <= 9.2e-30)
		tmp = (x / -y) / z;
	elseif (z <= 5.6e+55)
		tmp = t_1;
	else
		tmp = 1.0 / (z * (z / x));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+133], N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.95e-101], t$95$1, If[LessEqual[z, 9.2e-30], N[(N[(x / (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 5.6e+55], t$95$1, N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot t}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+133}:\\
\;\;\;\;\frac{\frac{x}{z}}{z}\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{\frac{x}{-y}}{z}\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.49999999999999985e133

    1. Initial program 99.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 99.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-199.8%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified99.8%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv99.8%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt44.0%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod84.2%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg84.2%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod52.1%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt96.1%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*96.1%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr96.1%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative96.1%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/96.0%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/96.0%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/96.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity96.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified96.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Taylor expanded in t around 0 96.0%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{z} \]
    11. Step-by-step derivation
      1. associate-*r/100.0%

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y - z} \]
      2. neg-mul-1100.0%

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified96.0%

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv96.0%

        \[\leadsto \color{blue}{\frac{-x}{z} \cdot \frac{1}{z}} \]
      2. frac-2neg96.0%

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-z}} \cdot \frac{1}{z} \]
      3. add-sqr-sqrt44.0%

        \[\leadsto \frac{-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-z} \cdot \frac{1}{z} \]
      4. sqrt-unprod88.2%

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-z} \cdot \frac{1}{z} \]
      5. sqr-neg88.2%

        \[\leadsto \frac{-\sqrt{\color{blue}{x \cdot x}}}{-z} \cdot \frac{1}{z} \]
      6. sqrt-unprod55.9%

        \[\leadsto \frac{-\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-z} \cdot \frac{1}{z} \]
      7. add-sqr-sqrt100.0%

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac2100.0%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right)} \cdot \frac{1}{z} \]
      9. distribute-frac-neg100.0%

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg100.0%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. un-div-inv100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
    16. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]

    if -4.49999999999999985e133 < z < 1.95000000000000008e-101 or 9.19999999999999937e-30 < z < 5.6000000000000002e55

    1. Initial program 95.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 66.7%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(y - z\right)}} \]

    if 1.95000000000000008e-101 < z < 9.19999999999999937e-30

    1. Initial program 93.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 69.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified69.8%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]
    6. Taylor expanded in t around 0 54.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg54.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. associate-/r*58.8%

        \[\leadsto -\color{blue}{\frac{\frac{x}{y}}{z}} \]
      3. distribute-neg-frac258.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    8. Simplified58.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]

    if 5.6000000000000002e55 < z

    1. Initial program 85.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 83.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/83.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-183.2%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified83.2%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv83.2%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt43.1%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod66.7%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg66.7%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod32.7%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt70.9%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*69.7%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr69.7%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative69.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/68.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/68.7%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/68.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity68.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified68.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Taylor expanded in t around 0 60.4%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{z} \]
    11. Step-by-step derivation
      1. associate-*r/85.5%

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y - z} \]
      2. neg-mul-185.5%

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified60.4%

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv60.4%

        \[\leadsto \color{blue}{\frac{-x}{z} \cdot \frac{1}{z}} \]
      2. frac-2neg60.4%

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-z}} \cdot \frac{1}{z} \]
      3. add-sqr-sqrt30.9%

        \[\leadsto \frac{-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-z} \cdot \frac{1}{z} \]
      4. sqrt-unprod61.4%

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-z} \cdot \frac{1}{z} \]
      5. sqr-neg61.4%

        \[\leadsto \frac{-\sqrt{\color{blue}{x \cdot x}}}{-z} \cdot \frac{1}{z} \]
      6. sqrt-unprod36.8%

        \[\leadsto \frac{-\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-z} \cdot \frac{1}{z} \]
      7. add-sqr-sqrt74.9%

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac274.9%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right)} \cdot \frac{1}{z} \]
      9. distribute-frac-neg74.9%

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg74.9%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr74.9%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. clear-num74.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{x}}} \cdot \frac{1}{z} \]
      2. frac-times75.7%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{z}{x} \cdot z}} \]
      3. metadata-eval75.7%

        \[\leadsto \frac{\color{blue}{1}}{\frac{z}{x} \cdot z} \]
    16. Applied egg-rr75.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{z}{x} \cdot z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification71.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+133}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-101}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+55}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 65.1% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{z}}{z}\\ \mathbf{if}\;z \leq -4.7 \cdot 10^{+42}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-15} \lor \neg \left(z \leq 3.1 \cdot 10^{-69}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x z) z)))
   (if (<= z -4.7e+42)
     t_1
     (if (<= z -1.05e-14)
       (/ (/ x y) t)
       (if (or (<= z -1.15e-15) (not (<= z 3.1e-69))) t_1 (/ (/ x t) y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double tmp;
	if (z <= -4.7e+42) {
		tmp = t_1;
	} else if (z <= -1.05e-14) {
		tmp = (x / y) / t;
	} else if ((z <= -1.15e-15) || !(z <= 3.1e-69)) {
		tmp = t_1;
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x / z) / z
    if (z <= (-4.7d+42)) then
        tmp = t_1
    else if (z <= (-1.05d-14)) then
        tmp = (x / y) / t
    else if ((z <= (-1.15d-15)) .or. (.not. (z <= 3.1d-69))) then
        tmp = t_1
    else
        tmp = (x / t) / y
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (x / z) / z;
	double tmp;
	if (z <= -4.7e+42) {
		tmp = t_1;
	} else if (z <= -1.05e-14) {
		tmp = (x / y) / t;
	} else if ((z <= -1.15e-15) || !(z <= 3.1e-69)) {
		tmp = t_1;
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (x / z) / z
	tmp = 0
	if z <= -4.7e+42:
		tmp = t_1
	elif z <= -1.05e-14:
		tmp = (x / y) / t
	elif (z <= -1.15e-15) or not (z <= 3.1e-69):
		tmp = t_1
	else:
		tmp = (x / t) / y
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) / z)
	tmp = 0.0
	if (z <= -4.7e+42)
		tmp = t_1;
	elseif (z <= -1.05e-14)
		tmp = Float64(Float64(x / y) / t);
	elseif ((z <= -1.15e-15) || !(z <= 3.1e-69))
		tmp = t_1;
	else
		tmp = Float64(Float64(x / t) / y);
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / z) / z;
	tmp = 0.0;
	if (z <= -4.7e+42)
		tmp = t_1;
	elseif (z <= -1.05e-14)
		tmp = (x / y) / t;
	elseif ((z <= -1.15e-15) || ~((z <= 3.1e-69)))
		tmp = t_1;
	else
		tmp = (x / t) / y;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -4.7e+42], t$95$1, If[LessEqual[z, -1.05e-14], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, -1.15e-15], N[Not[LessEqual[z, 3.1e-69]], $MachinePrecision]], t$95$1, N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{z}}{z}\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-15} \lor \neg \left(z \leq 3.1 \cdot 10^{-69}\right):\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.69999999999999986e42 or -1.0499999999999999e-14 < z < -1.14999999999999995e-15 or 3.0999999999999999e-69 < z

    1. Initial program 91.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 78.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/78.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-178.2%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified78.2%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv78.2%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt37.3%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod60.0%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg60.0%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod29.7%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt59.7%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*59.2%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr59.2%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative59.2%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/58.1%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/58.1%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/58.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity58.1%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified58.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Taylor expanded in t around 0 51.6%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{z} \]
    11. Step-by-step derivation
      1. associate-*r/83.8%

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y - z} \]
      2. neg-mul-183.8%

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    12. Simplified51.6%

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{z} \]
    13. Step-by-step derivation
      1. div-inv51.6%

        \[\leadsto \color{blue}{\frac{-x}{z} \cdot \frac{1}{z}} \]
      2. frac-2neg51.6%

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-z}} \cdot \frac{1}{z} \]
      3. add-sqr-sqrt24.6%

        \[\leadsto \frac{-\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-z} \cdot \frac{1}{z} \]
      4. sqrt-unprod54.1%

        \[\leadsto \frac{-\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-z} \cdot \frac{1}{z} \]
      5. sqr-neg54.1%

        \[\leadsto \frac{-\sqrt{\color{blue}{x \cdot x}}}{-z} \cdot \frac{1}{z} \]
      6. sqrt-unprod34.0%

        \[\leadsto \frac{-\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-z} \cdot \frac{1}{z} \]
      7. add-sqr-sqrt67.0%

        \[\leadsto \frac{-\color{blue}{x}}{-z} \cdot \frac{1}{z} \]
      8. distribute-neg-frac267.0%

        \[\leadsto \color{blue}{\left(-\frac{-x}{z}\right)} \cdot \frac{1}{z} \]
      9. distribute-frac-neg67.0%

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{z} \]
      10. remove-double-neg67.0%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{z} \]
    14. Applied egg-rr67.0%

      \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    15. Step-by-step derivation
      1. un-div-inv67.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
    16. Applied egg-rr67.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]

    if -4.69999999999999986e42 < z < -1.0499999999999999e-14

    1. Initial program 99.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.7%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z}{x}}} \cdot \frac{1}{y - z} \]
      2. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y - z}}{\frac{t - z}{x}}} \]
      3. *-un-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{y - z}}}{\frac{t - z}{x}} \]
    6. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    7. Taylor expanded in z around 0 44.3%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/l/50.3%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    9. Simplified50.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]

    if -1.14999999999999995e-15 < z < 3.0999999999999999e-69

    1. Initial program 95.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/93.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv93.3%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr93.3%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. clear-num93.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z}{x}}} \cdot \frac{1}{y - z} \]
      2. associate-*l/94.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y - z}}{\frac{t - z}{x}}} \]
      3. *-un-lft-identity94.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{y - z}}}{\frac{t - z}{x}} \]
    6. Applied egg-rr94.7%

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    7. Taylor expanded in z around 0 69.7%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/r*68.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified68.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.7 \cdot 10^{+42}:\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-15} \lor \neg \left(z \leq 3.1 \cdot 10^{-69}\right):\\ \;\;\;\;\frac{\frac{x}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 48.2% 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 t}\\ \mathbf{if}\;z \leq -1.2 \cdot 10^{+59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-32}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+183}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* z t))))
   (if (<= z -1.2e+59)
     t_1
     (if (<= z -1.12e-32)
       (/ (/ x y) t)
       (if (<= z 3.4e+62)
         (/ (/ x t) y)
         (if (<= z 1.25e+183) (/ x (* y z)) t_1))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * t);
	double tmp;
	if (z <= -1.2e+59) {
		tmp = t_1;
	} else if (z <= -1.12e-32) {
		tmp = (x / y) / t;
	} else if (z <= 3.4e+62) {
		tmp = (x / t) / y;
	} else if (z <= 1.25e+183) {
		tmp = x / (y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (z * t)
    if (z <= (-1.2d+59)) then
        tmp = t_1
    else if (z <= (-1.12d-32)) then
        tmp = (x / y) / t
    else if (z <= 3.4d+62) then
        tmp = (x / t) / y
    else if (z <= 1.25d+183) then
        tmp = x / (y * z)
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z * t);
	double tmp;
	if (z <= -1.2e+59) {
		tmp = t_1;
	} else if (z <= -1.12e-32) {
		tmp = (x / y) / t;
	} else if (z <= 3.4e+62) {
		tmp = (x / t) / y;
	} else if (z <= 1.25e+183) {
		tmp = x / (y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / (z * t)
	tmp = 0
	if z <= -1.2e+59:
		tmp = t_1
	elif z <= -1.12e-32:
		tmp = (x / y) / t
	elif z <= 3.4e+62:
		tmp = (x / t) / y
	elif z <= 1.25e+183:
		tmp = x / (y * z)
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * t))
	tmp = 0.0
	if (z <= -1.2e+59)
		tmp = t_1;
	elseif (z <= -1.12e-32)
		tmp = Float64(Float64(x / y) / t);
	elseif (z <= 3.4e+62)
		tmp = Float64(Float64(x / t) / y);
	elseif (z <= 1.25e+183)
		tmp = Float64(x / Float64(y * z));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z * t);
	tmp = 0.0;
	if (z <= -1.2e+59)
		tmp = t_1;
	elseif (z <= -1.12e-32)
		tmp = (x / y) / t;
	elseif (z <= 3.4e+62)
		tmp = (x / t) / y;
	elseif (z <= 1.25e+183)
		tmp = x / (y * z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+59], t$95$1, If[LessEqual[z, -1.12e-32], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.4e+62], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.25e+183], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot t}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.12 \cdot 10^{-32}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+183}:\\
\;\;\;\;\frac{x}{y \cdot z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.2000000000000001e59 or 1.25000000000000002e183 < z

    1. Initial program 90.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 52.2%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
    6. Taylor expanded in y around 0 55.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/55.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. mul-1-neg55.0%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    8. Simplified55.0%

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. clear-num55.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot z}{-x}}} \]
      2. inv-pow55.4%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot z}{-x}\right)}^{-1}} \]
      3. *-commutative55.4%

        \[\leadsto {\left(\frac{\color{blue}{z \cdot t}}{-x}\right)}^{-1} \]
      4. associate-/l*51.3%

        \[\leadsto {\color{blue}{\left(z \cdot \frac{t}{-x}\right)}}^{-1} \]
      5. add-sqr-sqrt28.5%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}\right)}^{-1} \]
      6. sqrt-unprod53.7%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}\right)}^{-1} \]
      7. sqr-neg53.7%

        \[\leadsto {\left(z \cdot \frac{t}{\sqrt{\color{blue}{x \cdot x}}}\right)}^{-1} \]
      8. sqrt-unprod21.4%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}\right)}^{-1} \]
      9. add-sqr-sqrt48.5%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{x}}\right)}^{-1} \]
    10. Applied egg-rr48.5%

      \[\leadsto \color{blue}{{\left(z \cdot \frac{t}{x}\right)}^{-1}} \]
    11. Step-by-step derivation
      1. unpow-148.5%

        \[\leadsto \color{blue}{\frac{1}{z \cdot \frac{t}{x}}} \]
    12. Simplified48.5%

      \[\leadsto \color{blue}{\frac{1}{z \cdot \frac{t}{x}}} \]
    13. Taylor expanded in z around 0 54.9%

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    14. Step-by-step derivation
      1. *-commutative54.9%

        \[\leadsto \frac{x}{\color{blue}{z \cdot t}} \]
    15. Simplified54.9%

      \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]

    if -1.2000000000000001e59 < z < -1.12e-32

    1. Initial program 99.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv99.5%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr99.5%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z}{x}}} \cdot \frac{1}{y - z} \]
      2. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y - z}}{\frac{t - z}{x}}} \]
      3. *-un-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{y - z}}}{\frac{t - z}{x}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    7. Taylor expanded in z around 0 38.4%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/l/42.4%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    9. Simplified42.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]

    if -1.12e-32 < z < 3.40000000000000014e62

    1. Initial program 95.6%

      \[\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.9%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr93.9%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. clear-num93.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z}{x}}} \cdot \frac{1}{y - z} \]
      2. associate-*l/95.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y - z}}{\frac{t - z}{x}}} \]
      3. *-un-lft-identity95.0%

        \[\leadsto \frac{\color{blue}{\frac{1}{y - z}}}{\frac{t - z}{x}} \]
    6. Applied egg-rr95.0%

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    7. Taylor expanded in z around 0 60.5%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/r*60.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified60.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]

    if 3.40000000000000014e62 < z < 1.25000000000000002e183

    1. Initial program 87.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 31.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative31.4%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified31.4%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]
    6. Taylor expanded in t around 0 27.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg27.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. associate-/r*33.6%

        \[\leadsto -\color{blue}{\frac{\frac{x}{y}}{z}} \]
      3. distribute-neg-frac233.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    8. Simplified33.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    9. Step-by-step derivation
      1. div-inv33.6%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{-z}} \]
      2. metadata-eval33.6%

        \[\leadsto \frac{x}{y} \cdot \frac{\color{blue}{--1}}{-z} \]
      3. frac-2neg33.6%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{-1}{z}} \]
      4. add-sqr-sqrt0.0%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(\sqrt{\frac{-1}{z}} \cdot \sqrt{\frac{-1}{z}}\right)} \]
      5. sqrt-unprod28.6%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\sqrt{\frac{-1}{z} \cdot \frac{-1}{z}}} \]
      6. frac-times28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{z \cdot z}}} \]
      7. metadata-eval28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\frac{\color{blue}{1}}{z \cdot z}} \]
      8. metadata-eval28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{z \cdot z}} \]
      9. frac-times28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\color{blue}{\frac{1}{z} \cdot \frac{1}{z}}} \]
      10. sqrt-unprod25.3%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(\sqrt{\frac{1}{z}} \cdot \sqrt{\frac{1}{z}}\right)} \]
      11. add-sqr-sqrt25.3%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{1}{z}} \]
      12. div-inv25.3%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{z}} \]
      13. *-un-lft-identity25.3%

        \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{y}}{z}} \]
      14. associate-/l/25.4%

        \[\leadsto 1 \cdot \color{blue}{\frac{x}{z \cdot y}} \]
    10. Applied egg-rr25.4%

      \[\leadsto \color{blue}{1 \cdot \frac{x}{z \cdot y}} \]
    11. Step-by-step derivation
      1. *-lft-identity25.4%

        \[\leadsto \color{blue}{\frac{x}{z \cdot y}} \]
    12. Simplified25.4%

      \[\leadsto \color{blue}{\frac{x}{z \cdot y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification53.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+59}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{elif}\;z \leq -1.12 \cdot 10^{-32}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+183}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 79.6% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-77} \lor \neg \left(y \leq 2.6 \cdot 10^{-163}\right):\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.6e-38)
   (/ (/ x y) (- t z))
   (if (or (<= y -4.4e-77) (not (<= y 2.6e-163)))
     (/ (/ x t) (- y z))
     (/ x (* z (- z t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.6e-38) {
		tmp = (x / y) / (t - z);
	} else if ((y <= -4.4e-77) || !(y <= 2.6e-163)) {
		tmp = (x / t) / (y - z);
	} else {
		tmp = x / (z * (z - t));
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.6d-38)) then
        tmp = (x / y) / (t - z)
    else if ((y <= (-4.4d-77)) .or. (.not. (y <= 2.6d-163))) then
        tmp = (x / t) / (y - z)
    else
        tmp = x / (z * (z - t))
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.6e-38) {
		tmp = (x / y) / (t - z);
	} else if ((y <= -4.4e-77) || !(y <= 2.6e-163)) {
		tmp = (x / t) / (y - z);
	} else {
		tmp = x / (z * (z - t));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -2.6e-38:
		tmp = (x / y) / (t - z)
	elif (y <= -4.4e-77) or not (y <= 2.6e-163):
		tmp = (x / t) / (y - z)
	else:
		tmp = x / (z * (z - t))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.6e-38)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif ((y <= -4.4e-77) || !(y <= 2.6e-163))
		tmp = Float64(Float64(x / t) / Float64(y - z));
	else
		tmp = Float64(x / Float64(z * Float64(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 (y <= -2.6e-38)
		tmp = (x / y) / (t - z);
	elseif ((y <= -4.4e-77) || ~((y <= 2.6e-163)))
		tmp = (x / t) / (y - z);
	else
		tmp = x / (z * (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[y, -2.6e-38], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -4.4e-77], N[Not[LessEqual[y, 2.6e-163]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-38}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{elif}\;y \leq -4.4 \cdot 10^{-77} \lor \neg \left(y \leq 2.6 \cdot 10^{-163}\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.60000000000000011e-38

    1. Initial program 89.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/98.4%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv98.4%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. clear-num98.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z}{x}}} \cdot \frac{1}{y - z} \]
      2. associate-*l/98.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y - z}}{\frac{t - z}{x}}} \]
      3. *-un-lft-identity98.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{y - z}}}{\frac{t - z}{x}} \]
    6. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    7. Taylor expanded in y around inf 80.2%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    8. Step-by-step derivation
      1. associate-/r*84.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t - z}} \]
    9. Simplified84.5%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t - z}} \]

    if -2.60000000000000011e-38 < y < -4.40000000000000014e-77 or 2.60000000000000002e-163 < y

    1. Initial program 93.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/96.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 61.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]

    if -4.40000000000000014e-77 < y < 2.60000000000000002e-163

    1. Initial program 97.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 88.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/88.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-188.6%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified88.6%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv87.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt43.2%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod51.8%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg51.8%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod17.5%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt41.5%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*41.5%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr41.5%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative41.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/41.4%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/43.9%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/43.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity43.9%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified43.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Step-by-step derivation
      1. frac-2neg43.9%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t - z}}{-z}} \]
      2. div-inv43.9%

        \[\leadsto \color{blue}{\left(-\frac{x}{t - z}\right) \cdot \frac{1}{-z}} \]
      3. distribute-neg-frac243.9%

        \[\leadsto \color{blue}{\frac{x}{-\left(t - z\right)}} \cdot \frac{1}{-z} \]
      4. sub-neg43.9%

        \[\leadsto \frac{x}{-\color{blue}{\left(t + \left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      5. distribute-neg-in43.9%

        \[\leadsto \frac{x}{\color{blue}{\left(-t\right) + \left(-\left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      6. remove-double-neg43.9%

        \[\leadsto \frac{x}{\left(-t\right) + \color{blue}{z}} \cdot \frac{1}{-z} \]
      7. add-sqr-sqrt19.9%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      8. sqrt-unprod66.2%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      9. sqr-neg66.2%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\sqrt{\color{blue}{z \cdot z}}} \]
      10. sqrt-unprod51.0%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      11. add-sqr-sqrt91.5%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{z}} \]
    11. Applied egg-rr91.5%

      \[\leadsto \color{blue}{\frac{x}{\left(-t\right) + z} \cdot \frac{1}{z}} \]
    12. Step-by-step derivation
      1. associate-*l/86.3%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{\left(-t\right) + z}} \]
      2. associate-*r/86.4%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot 1}{z}}}{\left(-t\right) + z} \]
      3. *-rgt-identity86.4%

        \[\leadsto \frac{\frac{\color{blue}{x}}{z}}{\left(-t\right) + z} \]
      4. +-commutative86.4%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z + \left(-t\right)}} \]
      5. unsub-neg86.4%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - t}} \]
    13. Simplified86.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    14. Taylor expanded in x around 0 88.6%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z - t\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-77} \lor \neg \left(y \leq 2.6 \cdot 10^{-163}\right):\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 71.0% 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(z - t\right)}\\ \mathbf{if}\;z \leq -2000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-102}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* z (- z t)))))
   (if (<= z -2000000.0)
     t_1
     (if (<= z 7.2e-102)
       (/ x (* (- y z) t))
       (if (<= z 1.2e-29) (/ (/ x (- y)) z) t_1)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * (z - t));
	double tmp;
	if (z <= -2000000.0) {
		tmp = t_1;
	} else if (z <= 7.2e-102) {
		tmp = x / ((y - z) * t);
	} else if (z <= 1.2e-29) {
		tmp = (x / -y) / z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (z * (z - t))
    if (z <= (-2000000.0d0)) then
        tmp = t_1
    else if (z <= 7.2d-102) then
        tmp = x / ((y - z) * t)
    else if (z <= 1.2d-29) then
        tmp = (x / -y) / z
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z * (z - t));
	double tmp;
	if (z <= -2000000.0) {
		tmp = t_1;
	} else if (z <= 7.2e-102) {
		tmp = x / ((y - z) * t);
	} else if (z <= 1.2e-29) {
		tmp = (x / -y) / z;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / (z * (z - t))
	tmp = 0
	if z <= -2000000.0:
		tmp = t_1
	elif z <= 7.2e-102:
		tmp = x / ((y - z) * t)
	elif z <= 1.2e-29:
		tmp = (x / -y) / z
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * Float64(z - t)))
	tmp = 0.0
	if (z <= -2000000.0)
		tmp = t_1;
	elseif (z <= 7.2e-102)
		tmp = Float64(x / Float64(Float64(y - z) * t));
	elseif (z <= 1.2e-29)
		tmp = Float64(Float64(x / Float64(-y)) / z);
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z * (z - t));
	tmp = 0.0;
	if (z <= -2000000.0)
		tmp = t_1;
	elseif (z <= 7.2e-102)
		tmp = x / ((y - z) * t);
	elseif (z <= 1.2e-29)
		tmp = (x / -y) / z;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2000000.0], t$95$1, If[LessEqual[z, 7.2e-102], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-29], N[(N[(x / (-y)), $MachinePrecision] / z), $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(z - t\right)}\\
\mathbf{if}\;z \leq -2000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{-102}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{\frac{x}{-y}}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2e6 or 1.19999999999999996e-29 < z

    1. Initial program 92.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 79.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/79.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-179.8%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified79.8%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv79.8%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt39.6%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod63.8%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg63.8%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod31.8%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt61.3%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*60.5%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr60.5%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative60.5%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/59.3%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/59.3%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/59.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity59.3%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified59.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Step-by-step derivation
      1. frac-2neg59.3%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t - z}}{-z}} \]
      2. div-inv59.3%

        \[\leadsto \color{blue}{\left(-\frac{x}{t - z}\right) \cdot \frac{1}{-z}} \]
      3. distribute-neg-frac259.3%

        \[\leadsto \color{blue}{\frac{x}{-\left(t - z\right)}} \cdot \frac{1}{-z} \]
      4. sub-neg59.3%

        \[\leadsto \frac{x}{-\color{blue}{\left(t + \left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      5. distribute-neg-in59.3%

        \[\leadsto \frac{x}{\color{blue}{\left(-t\right) + \left(-\left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      6. remove-double-neg59.3%

        \[\leadsto \frac{x}{\left(-t\right) + \color{blue}{z}} \cdot \frac{1}{-z} \]
      7. add-sqr-sqrt27.1%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      8. sqrt-unprod71.7%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      9. sqr-neg71.7%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\sqrt{\color{blue}{z \cdot z}}} \]
      10. sqrt-unprod47.2%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      11. add-sqr-sqrt82.4%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{z}} \]
    11. Applied egg-rr82.4%

      \[\leadsto \color{blue}{\frac{x}{\left(-t\right) + z} \cdot \frac{1}{z}} \]
    12. Step-by-step derivation
      1. associate-*l/82.4%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{\left(-t\right) + z}} \]
      2. associate-*r/82.4%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot 1}{z}}}{\left(-t\right) + z} \]
      3. *-rgt-identity82.4%

        \[\leadsto \frac{\frac{\color{blue}{x}}{z}}{\left(-t\right) + z} \]
      4. +-commutative82.4%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z + \left(-t\right)}} \]
      5. unsub-neg82.4%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - t}} \]
    13. Simplified82.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    14. Taylor expanded in x around 0 79.8%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z - t\right)}} \]

    if -2e6 < z < 7.2e-102

    1. Initial program 95.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 77.1%

      \[\leadsto \color{blue}{\frac{x}{t \cdot \left(y - z\right)}} \]

    if 7.2e-102 < z < 1.19999999999999996e-29

    1. Initial program 93.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 69.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified69.8%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]
    6. Taylor expanded in t around 0 54.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg54.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. associate-/r*58.8%

        \[\leadsto -\color{blue}{\frac{\frac{x}{y}}{z}} \]
      3. distribute-neg-frac258.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    8. Simplified58.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2000000:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-102}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 97.6% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-242}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* (- y z) (- t z)))))
   (if (<= t_1 -1e-242) t_1 (/ (/ x (- t z)) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -1e-242) {
		tmp = t_1;
	} else {
		tmp = (x / (t - z)) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / ((y - z) * (t - z))
    if (t_1 <= (-1d-242)) then
        tmp = t_1
    else
        tmp = (x / (t - z)) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -1e-242) {
		tmp = t_1;
	} else {
		tmp = (x / (t - z)) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / ((y - z) * (t - z))
	tmp = 0
	if t_1 <= -1e-242:
		tmp = t_1
	else:
		tmp = (x / (t - z)) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(Float64(y - z) * Float64(t - z)))
	tmp = 0.0
	if (t_1 <= -1e-242)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / Float64(t - z)) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / ((y - z) * (t - z));
	tmp = 0.0;
	if (t_1 <= -1e-242)
		tmp = t_1;
	else
		tmp = (x / (t - z)) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-242], t$95$1, N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-242}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z))) < -1e-242

    1. Initial program 98.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing

    if -1e-242 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 92.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/96.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified96.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 46.9% 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 t}\\ \mathbf{if}\;z \leq -4 \cdot 10^{+248}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+60}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+182}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* z t))))
   (if (<= z -4e+248)
     t_1
     (if (<= z 1.2e+60)
       (/ (/ x t) y)
       (if (<= z 2.6e+182) (/ x (* y z)) t_1)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * t);
	double tmp;
	if (z <= -4e+248) {
		tmp = t_1;
	} else if (z <= 1.2e+60) {
		tmp = (x / t) / y;
	} else if (z <= 2.6e+182) {
		tmp = x / (y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (z * t)
    if (z <= (-4d+248)) then
        tmp = t_1
    else if (z <= 1.2d+60) then
        tmp = (x / t) / y
    else if (z <= 2.6d+182) then
        tmp = x / (y * z)
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z * t);
	double tmp;
	if (z <= -4e+248) {
		tmp = t_1;
	} else if (z <= 1.2e+60) {
		tmp = (x / t) / y;
	} else if (z <= 2.6e+182) {
		tmp = x / (y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = x / (z * t)
	tmp = 0
	if z <= -4e+248:
		tmp = t_1
	elif z <= 1.2e+60:
		tmp = (x / t) / y
	elif z <= 2.6e+182:
		tmp = x / (y * z)
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * t))
	tmp = 0.0
	if (z <= -4e+248)
		tmp = t_1;
	elseif (z <= 1.2e+60)
		tmp = Float64(Float64(x / t) / y);
	elseif (z <= 2.6e+182)
		tmp = Float64(x / Float64(y * z));
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z * t);
	tmp = 0.0;
	if (z <= -4e+248)
		tmp = t_1;
	elseif (z <= 1.2e+60)
		tmp = (x / t) / y;
	elseif (z <= 2.6e+182)
		tmp = x / (y * z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+248], t$95$1, If[LessEqual[z, 1.2e+60], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 2.6e+182], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot t}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+60}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+182}:\\
\;\;\;\;\frac{x}{y \cdot z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.00000000000000018e248 or 2.6e182 < z

    1. Initial program 87.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/100.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 51.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
    6. Taylor expanded in y around 0 58.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/58.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. mul-1-neg58.8%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    8. Simplified58.8%

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. clear-num59.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot z}{-x}}} \]
      2. inv-pow59.6%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot z}{-x}\right)}^{-1}} \]
      3. *-commutative59.6%

        \[\leadsto {\left(\frac{\color{blue}{z \cdot t}}{-x}\right)}^{-1} \]
      4. associate-/l*52.1%

        \[\leadsto {\color{blue}{\left(z \cdot \frac{t}{-x}\right)}}^{-1} \]
      5. add-sqr-sqrt29.9%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}\right)}^{-1} \]
      6. sqrt-unprod56.6%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}\right)}^{-1} \]
      7. sqr-neg56.6%

        \[\leadsto {\left(z \cdot \frac{t}{\sqrt{\color{blue}{x \cdot x}}}\right)}^{-1} \]
      8. sqrt-unprod22.2%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}\right)}^{-1} \]
      9. add-sqr-sqrt49.6%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{x}}\right)}^{-1} \]
    10. Applied egg-rr49.6%

      \[\leadsto \color{blue}{{\left(z \cdot \frac{t}{x}\right)}^{-1}} \]
    11. Step-by-step derivation
      1. unpow-149.6%

        \[\leadsto \color{blue}{\frac{1}{z \cdot \frac{t}{x}}} \]
    12. Simplified49.6%

      \[\leadsto \color{blue}{\frac{1}{z \cdot \frac{t}{x}}} \]
    13. Taylor expanded in z around 0 58.8%

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    14. Step-by-step derivation
      1. *-commutative58.8%

        \[\leadsto \frac{x}{\color{blue}{z \cdot t}} \]
    15. Simplified58.8%

      \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]

    if -4.00000000000000018e248 < z < 1.2e60

    1. Initial program 95.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/95.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. div-inv95.6%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    4. Applied egg-rr95.6%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. clear-num95.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{t - z}{x}}} \cdot \frac{1}{y - z} \]
      2. associate-*l/96.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{y - z}}{\frac{t - z}{x}}} \]
      3. *-un-lft-identity96.4%

        \[\leadsto \frac{\color{blue}{\frac{1}{y - z}}}{\frac{t - z}{x}} \]
    6. Applied egg-rr96.4%

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    7. Taylor expanded in z around 0 51.9%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    8. Step-by-step derivation
      1. associate-/r*55.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    9. Simplified55.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]

    if 1.2e60 < z < 2.6e182

    1. Initial program 87.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 31.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative31.4%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified31.4%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]
    6. Taylor expanded in t around 0 27.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{y \cdot z}} \]
    7. Step-by-step derivation
      1. mul-1-neg27.6%

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. associate-/r*33.6%

        \[\leadsto -\color{blue}{\frac{\frac{x}{y}}{z}} \]
      3. distribute-neg-frac233.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    8. Simplified33.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{-z}} \]
    9. Step-by-step derivation
      1. div-inv33.6%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{-z}} \]
      2. metadata-eval33.6%

        \[\leadsto \frac{x}{y} \cdot \frac{\color{blue}{--1}}{-z} \]
      3. frac-2neg33.6%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{-1}{z}} \]
      4. add-sqr-sqrt0.0%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(\sqrt{\frac{-1}{z}} \cdot \sqrt{\frac{-1}{z}}\right)} \]
      5. sqrt-unprod28.6%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\sqrt{\frac{-1}{z} \cdot \frac{-1}{z}}} \]
      6. frac-times28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{z \cdot z}}} \]
      7. metadata-eval28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\frac{\color{blue}{1}}{z \cdot z}} \]
      8. metadata-eval28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{z \cdot z}} \]
      9. frac-times28.6%

        \[\leadsto \frac{x}{y} \cdot \sqrt{\color{blue}{\frac{1}{z} \cdot \frac{1}{z}}} \]
      10. sqrt-unprod25.3%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\left(\sqrt{\frac{1}{z}} \cdot \sqrt{\frac{1}{z}}\right)} \]
      11. add-sqr-sqrt25.3%

        \[\leadsto \frac{x}{y} \cdot \color{blue}{\frac{1}{z}} \]
      12. div-inv25.3%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{z}} \]
      13. *-un-lft-identity25.3%

        \[\leadsto \color{blue}{1 \cdot \frac{\frac{x}{y}}{z}} \]
      14. associate-/l/25.4%

        \[\leadsto 1 \cdot \color{blue}{\frac{x}{z \cdot y}} \]
    10. Applied egg-rr25.4%

      \[\leadsto \color{blue}{1 \cdot \frac{x}{z \cdot y}} \]
    11. Step-by-step derivation
      1. *-lft-identity25.4%

        \[\leadsto \color{blue}{\frac{x}{z \cdot y}} \]
    12. Simplified25.4%

      \[\leadsto \color{blue}{\frac{x}{z \cdot y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification52.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+248}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+60}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+182}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 78.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -5.2:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-153}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -5.2)
   (/ x (* y (- t z)))
   (if (<= y 1.5e-153) (/ x (* z (- z t))) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -5.2) {
		tmp = x / (y * (t - z));
	} else if (y <= 1.5e-153) {
		tmp = x / (z * (z - t));
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-5.2d0)) then
        tmp = x / (y * (t - z))
    else if (y <= 1.5d-153) then
        tmp = x / (z * (z - t))
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -5.2) {
		tmp = x / (y * (t - z));
	} else if (y <= 1.5e-153) {
		tmp = x / (z * (z - t));
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -5.2:
		tmp = x / (y * (t - z))
	elif y <= 1.5e-153:
		tmp = x / (z * (z - t))
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -5.2)
		tmp = Float64(x / Float64(y * Float64(t - z)));
	elseif (y <= 1.5e-153)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -5.2)
		tmp = x / (y * (t - z));
	elseif (y <= 1.5e-153)
		tmp = x / (z * (z - t));
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-153], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-153}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.20000000000000018

    1. Initial program 88.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 84.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative84.4%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified84.4%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]

    if -5.20000000000000018 < y < 1.5e-153

    1. Initial program 95.9%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 84.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/84.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-184.0%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified84.0%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv83.1%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt41.6%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod53.8%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg53.8%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod19.3%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt40.7%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*40.7%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr40.7%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/40.6%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/42.6%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/42.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity42.6%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified42.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Step-by-step derivation
      1. frac-2neg42.6%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t - z}}{-z}} \]
      2. div-inv42.6%

        \[\leadsto \color{blue}{\left(-\frac{x}{t - z}\right) \cdot \frac{1}{-z}} \]
      3. distribute-neg-frac242.6%

        \[\leadsto \color{blue}{\frac{x}{-\left(t - z\right)}} \cdot \frac{1}{-z} \]
      4. sub-neg42.6%

        \[\leadsto \frac{x}{-\color{blue}{\left(t + \left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      5. distribute-neg-in42.6%

        \[\leadsto \frac{x}{\color{blue}{\left(-t\right) + \left(-\left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      6. remove-double-neg42.6%

        \[\leadsto \frac{x}{\left(-t\right) + \color{blue}{z}} \cdot \frac{1}{-z} \]
      7. add-sqr-sqrt20.3%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      8. sqrt-unprod62.3%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      9. sqr-neg62.3%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\sqrt{\color{blue}{z \cdot z}}} \]
      10. sqrt-unprod46.8%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      11. add-sqr-sqrt88.1%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{z}} \]
    11. Applied egg-rr88.1%

      \[\leadsto \color{blue}{\frac{x}{\left(-t\right) + z} \cdot \frac{1}{z}} \]
    12. Step-by-step derivation
      1. associate-*l/84.1%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{\left(-t\right) + z}} \]
      2. associate-*r/84.1%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot 1}{z}}}{\left(-t\right) + z} \]
      3. *-rgt-identity84.1%

        \[\leadsto \frac{\frac{\color{blue}{x}}{z}}{\left(-t\right) + z} \]
      4. +-commutative84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z + \left(-t\right)}} \]
      5. unsub-neg84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - t}} \]
    13. Simplified84.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    14. Taylor expanded in x around 0 84.0%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z - t\right)}} \]

    if 1.5e-153 < y

    1. Initial program 94.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/95.4%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified95.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 60.2%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-153}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 77.4% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -850:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.38 \cdot 10^{-154}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -850.0)
   (/ x (* y (- t z)))
   (if (<= y 1.38e-154) (/ x (* z (- z t))) (/ x (* (- y z) t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -850.0) {
		tmp = x / (y * (t - z));
	} else if (y <= 1.38e-154) {
		tmp = x / (z * (z - t));
	} else {
		tmp = x / ((y - z) * t);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-850.0d0)) then
        tmp = x / (y * (t - z))
    else if (y <= 1.38d-154) then
        tmp = x / (z * (z - t))
    else
        tmp = x / ((y - z) * t)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -850.0) {
		tmp = x / (y * (t - z));
	} else if (y <= 1.38e-154) {
		tmp = x / (z * (z - t));
	} else {
		tmp = x / ((y - z) * t);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -850.0:
		tmp = x / (y * (t - z))
	elif y <= 1.38e-154:
		tmp = x / (z * (z - t))
	else:
		tmp = x / ((y - z) * t)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -850.0)
		tmp = Float64(x / Float64(y * Float64(t - z)));
	elseif (y <= 1.38e-154)
		tmp = Float64(x / Float64(z * Float64(z - t)));
	else
		tmp = Float64(x / Float64(Float64(y - z) * t));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -850.0)
		tmp = x / (y * (t - z));
	elseif (y <= 1.38e-154)
		tmp = x / (z * (z - t));
	else
		tmp = x / ((y - z) * t);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -850.0], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.38e-154], N[(x / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -850:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\

\mathbf{elif}\;y \leq 1.38 \cdot 10^{-154}:\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -850

    1. Initial program 88.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 84.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. *-commutative84.4%

        \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot y}} \]
    5. Simplified84.4%

      \[\leadsto \color{blue}{\frac{x}{\left(t - z\right) \cdot y}} \]

    if -850 < y < 1.37999999999999995e-154

    1. Initial program 95.9%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 84.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{z \cdot \left(t - z\right)}} \]
    4. Step-by-step derivation
      1. associate-*r/84.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-184.0%

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot \left(t - z\right)} \]
    5. Simplified84.0%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
    6. Step-by-step derivation
      1. div-inv83.1%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{z \cdot \left(t - z\right)}} \]
      2. add-sqr-sqrt41.6%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      3. sqrt-unprod53.8%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      4. sqr-neg53.8%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      5. sqrt-unprod19.3%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      6. add-sqr-sqrt40.7%

        \[\leadsto \color{blue}{x} \cdot \frac{1}{z \cdot \left(t - z\right)} \]
      7. associate-/r*40.7%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{z}}{t - z}} \]
    7. Applied egg-rr40.7%

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{t - z}} \]
    8. Step-by-step derivation
      1. *-commutative40.7%

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{t - z} \cdot x} \]
      2. associate-*l/40.6%

        \[\leadsto \color{blue}{\frac{\frac{1}{z} \cdot x}{t - z}} \]
      3. associate-*r/42.6%

        \[\leadsto \color{blue}{\frac{1}{z} \cdot \frac{x}{t - z}} \]
      4. associate-*l/42.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity42.6%

        \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{z} \]
    9. Simplified42.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{z}} \]
    10. Step-by-step derivation
      1. frac-2neg42.6%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t - z}}{-z}} \]
      2. div-inv42.6%

        \[\leadsto \color{blue}{\left(-\frac{x}{t - z}\right) \cdot \frac{1}{-z}} \]
      3. distribute-neg-frac242.6%

        \[\leadsto \color{blue}{\frac{x}{-\left(t - z\right)}} \cdot \frac{1}{-z} \]
      4. sub-neg42.6%

        \[\leadsto \frac{x}{-\color{blue}{\left(t + \left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      5. distribute-neg-in42.6%

        \[\leadsto \frac{x}{\color{blue}{\left(-t\right) + \left(-\left(-z\right)\right)}} \cdot \frac{1}{-z} \]
      6. remove-double-neg42.6%

        \[\leadsto \frac{x}{\left(-t\right) + \color{blue}{z}} \cdot \frac{1}{-z} \]
      7. add-sqr-sqrt20.3%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      8. sqrt-unprod62.3%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      9. sqr-neg62.3%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\sqrt{\color{blue}{z \cdot z}}} \]
      10. sqrt-unprod46.8%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      11. add-sqr-sqrt88.1%

        \[\leadsto \frac{x}{\left(-t\right) + z} \cdot \frac{1}{\color{blue}{z}} \]
    11. Applied egg-rr88.1%

      \[\leadsto \color{blue}{\frac{x}{\left(-t\right) + z} \cdot \frac{1}{z}} \]
    12. Step-by-step derivation
      1. associate-*l/84.1%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{z}}{\left(-t\right) + z}} \]
      2. associate-*r/84.1%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot 1}{z}}}{\left(-t\right) + z} \]
      3. *-rgt-identity84.1%

        \[\leadsto \frac{\frac{\color{blue}{x}}{z}}{\left(-t\right) + z} \]
      4. +-commutative84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z + \left(-t\right)}} \]
      5. unsub-neg84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - t}} \]
    13. Simplified84.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    14. Taylor expanded in x around 0 84.0%

      \[\leadsto \color{blue}{\frac{x}{z \cdot \left(z - t\right)}} \]

    if 1.37999999999999995e-154 < y

    1. Initial program 94.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 simplification76.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -850:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.38 \cdot 10^{-154}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 46.1% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+66} \lor \neg \left(z \leq 3.45 \cdot 10^{+20}\right):\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -7.5e+66) (not (<= z 3.45e+20))) (/ x (* z t)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.5e+66) || !(z <= 3.45e+20)) {
		tmp = x / (z * t);
	} else {
		tmp = x / (y * t);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-7.5d+66)) .or. (.not. (z <= 3.45d+20))) then
        tmp = x / (z * t)
    else
        tmp = x / (y * t)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.5e+66) || !(z <= 3.45e+20)) {
		tmp = x / (z * t);
	} else {
		tmp = x / (y * t);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -7.5e+66) or not (z <= 3.45e+20):
		tmp = x / (z * t)
	else:
		tmp = x / (y * t)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -7.5e+66) || !(z <= 3.45e+20))
		tmp = Float64(x / Float64(z * t));
	else
		tmp = Float64(x / Float64(y * t));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -7.5e+66) || ~((z <= 3.45e+20)))
		tmp = x / (z * t);
	else
		tmp = x / (y * t);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.5e+66], N[Not[LessEqual[z, 3.45e+20]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+66} \lor \neg \left(z \leq 3.45 \cdot 10^{+20}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.50000000000000024e66 or 3.45e20 < z

    1. Initial program 90.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/l/99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 51.6%

      \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y - z} \]
    6. Taylor expanded in y around 0 51.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{t \cdot z}} \]
    7. Step-by-step derivation
      1. associate-*r/51.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. mul-1-neg51.6%

        \[\leadsto \frac{\color{blue}{-x}}{t \cdot z} \]
    8. Simplified51.6%

      \[\leadsto \color{blue}{\frac{-x}{t \cdot z}} \]
    9. Step-by-step derivation
      1. clear-num52.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot z}{-x}}} \]
      2. inv-pow52.0%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot z}{-x}\right)}^{-1}} \]
      3. *-commutative52.0%

        \[\leadsto {\left(\frac{\color{blue}{z \cdot t}}{-x}\right)}^{-1} \]
      4. associate-/l*50.1%

        \[\leadsto {\color{blue}{\left(z \cdot \frac{t}{-x}\right)}}^{-1} \]
      5. add-sqr-sqrt25.6%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}\right)}^{-1} \]
      6. sqrt-unprod51.4%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}\right)}^{-1} \]
      7. sqr-neg51.4%

        \[\leadsto {\left(z \cdot \frac{t}{\sqrt{\color{blue}{x \cdot x}}}\right)}^{-1} \]
      8. sqrt-unprod21.0%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}\right)}^{-1} \]
      9. add-sqr-sqrt44.8%

        \[\leadsto {\left(z \cdot \frac{t}{\color{blue}{x}}\right)}^{-1} \]
    10. Applied egg-rr44.8%

      \[\leadsto \color{blue}{{\left(z \cdot \frac{t}{x}\right)}^{-1}} \]
    11. Step-by-step derivation
      1. unpow-144.8%

        \[\leadsto \color{blue}{\frac{1}{z \cdot \frac{t}{x}}} \]
    12. Simplified44.8%

      \[\leadsto \color{blue}{\frac{1}{z \cdot \frac{t}{x}}} \]
    13. Taylor expanded in z around 0 48.8%

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    14. Step-by-step derivation
      1. *-commutative48.8%

        \[\leadsto \frac{x}{\color{blue}{z \cdot t}} \]
    15. Simplified48.8%

      \[\leadsto \color{blue}{\frac{x}{z \cdot t}} \]

    if -7.50000000000000024e66 < z < 3.45e20

    1. Initial program 96.0%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 58.2%

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+66} \lor \neg \left(z \leq 3.45 \cdot 10^{+20}\right):\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 90.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 1.9 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= z 1.9e+85) (/ x (* (- y z) (- t z))) (/ (/ x z) (- z y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 1.9e+85) {
		tmp = x / ((y - z) * (t - z));
	} else {
		tmp = (x / z) / (z - y);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= 1.9d+85) then
        tmp = x / ((y - z) * (t - z))
    else
        tmp = (x / z) / (z - y)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 1.9e+85) {
		tmp = x / ((y - z) * (t - z));
	} else {
		tmp = (x / z) / (z - y);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if z <= 1.9e+85:
		tmp = x / ((y - z) * (t - z))
	else:
		tmp = (x / z) / (z - y)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (z <= 1.9e+85)
		tmp = Float64(x / Float64(Float64(y - z) * Float64(t - z)));
	else
		tmp = Float64(Float64(x / z) / Float64(z - y));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= 1.9e+85)
		tmp = x / ((y - z) * (t - z));
	else
		tmp = (x / z) / (z - y);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[z, 1.9e+85], N[(x / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.9 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.89999999999999996e85

    1. Initial program 96.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing

    if 1.89999999999999996e85 < z

    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.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 0 92.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{x}{z}}}{y - z} \]
    6. Step-by-step derivation
      1. associate-*r/92.8%

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot x}{z}}}{y - z} \]
      2. neg-mul-192.8%

        \[\leadsto \frac{\frac{\color{blue}{-x}}{z}}{y - z} \]
    7. Simplified92.8%

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y - z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.9 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 39.2% accurate, 1.8× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{y \cdot t} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t) :precision binary64 (/ x (* y t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return x / (y * t);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x / (y * t)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return x / (y * t);
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return x / (y * t)
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(x / Float64(y * t))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = x / (y * t);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y \cdot t}
\end{array}
Derivation
  1. Initial program 93.6%

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 43.0%

    \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
  4. Final simplification43.0%

    \[\leadsto \frac{x}{y \cdot t} \]
  5. Add Preprocessing

Developer target: 87.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;\frac{x}{t\_1} < 0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (- t z))))
   (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - z) * (t - z)
    if ((x / t_1) < 0.0d0) then
        tmp = (x / (y - z)) / (t - z)
    else
        tmp = x * (1.0d0 / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if (x / t_1) < 0.0:
		tmp = (x / (y - z)) / (t - z)
	else:
		tmp = x * (1.0 / t_1)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (Float64(x / t_1) < 0.0)
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(x * Float64(1.0 / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * (t - z);
	tmp = 0.0;
	if ((x / t_1) < 0.0)
		tmp = (x / (y - z)) / (t - z);
	else
		tmp = x * (1.0 / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024105 
(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))))