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

Percentage Accurate: 89.2% → 96.2%
Time: 13.5s
Alternatives: 20
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 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: 89.2% accurate, 1.0× speedup?

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

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

Alternative 1: 96.2% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;t\_1 \leq 1.5 \cdot 10^{+285}:\\ \;\;\;\;\frac{x}{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 (* (- y z) (- t z))))
   (if (<= t_1 1.5e+285) (/ x 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 = (y - z) * (t - z);
	double tmp;
	if (t_1 <= 1.5e+285) {
		tmp = x / 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 = (y - z) * (t - z)
    if (t_1 <= 1.5d+285) then
        tmp = x / 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 = (y - z) * (t - z);
	double tmp;
	if (t_1 <= 1.5e+285) {
		tmp = x / 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 = (y - z) * (t - z)
	tmp = 0
	if t_1 <= 1.5e+285:
		tmp = x / 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(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (t_1 <= 1.5e+285)
		tmp = Float64(x / 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 = (y - z) * (t - z);
	tmp = 0.0;
	if (t_1 <= 1.5e+285)
		tmp = x / 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[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1.5e+285], N[(x / t$95$1), $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}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;t\_1 \leq 1.5 \cdot 10^{+285}:\\
\;\;\;\;\frac{x}{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 (-.f64 y z) (-.f64 t z)) < 1.5000000000000001e285

    1. Initial program 95.9%

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

    if 1.5000000000000001e285 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 68.2%

      \[\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
  3. Recombined 2 regimes into one program.
  4. Final simplification97.3%

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

Alternative 2: 48.4% accurate, 0.0× speedup?

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

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt40.3%

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{x}}{y - z} \cdot \frac{\sqrt{x}}{t - z}} \]
  5. Final simplification43.3%

    \[\leadsto \frac{\sqrt{x}}{y - z} \cdot \frac{\sqrt{x}}{t - z} \]
  6. Add Preprocessing

Alternative 3: 51.4% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.44999999999999987e-138

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

    if -1.44999999999999987e-138 < t < 1.26e-57

    1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

    if 1.26e-57 < t < 5.19999999999999971e123

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(z + \color{blue}{\left(-t\right)}\right)} \]
      10. unsub-neg64.0%

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

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

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

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

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

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

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

    if 5.19999999999999971e123 < t

    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. add-sqr-sqrt40.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 51.5% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -8.5000000000000001e-137

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

    if -8.5000000000000001e-137 < t < 4.40000000000000011e-58

    1. Initial program 76.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.40000000000000011e-58 < t < 6.20000000000000013e123

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(z + \color{blue}{\left(-t\right)}\right)} \]
      10. unsub-neg64.0%

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

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

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

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

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

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

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

    if 6.20000000000000013e123 < t

    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. add-sqr-sqrt40.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{-137}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{-58}:\\ \;\;\;\;\frac{-1}{z} \cdot \frac{x}{y}\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+123}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 93.6% accurate, 0.5× speedup?

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

\mathbf{elif}\;z \leq 5 \cdot 10^{+146}:\\
\;\;\;\;\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 3 regimes
  2. if z < -2.5999999999999999e143

    1. Initial program 72.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num72.4%

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

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

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

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

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

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

        \[\leadsto \frac{1}{z \cdot \color{blue}{\left(0 - \left(t - z\right)\right)}} \cdot x \]
      4. associate--r-72.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999999e143 < z < 4.9999999999999999e146

    1. Initial program 95.4%

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

    if 4.9999999999999999e146 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. associate--r-95.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - y\right) + z}} \]
      6. neg-sub095.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+143}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+146}:\\ \;\;\;\;\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 6: 93.5% accurate, 0.5× speedup?

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

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+149}:\\
\;\;\;\;\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 3 regimes
  2. if z < -5.0000000000000003e129

    1. Initial program 75.0%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt28.5%

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e129 < z < 2.7000000000000001e149

    1. Initial program 95.3%

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

    if 2.7000000000000001e149 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{0 - \left(y - z\right)}} \]
      5. associate--r-95.8%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(0 - y\right) + z}} \]
      6. neg-sub095.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+129}:\\ \;\;\;\;\frac{\frac{-1}{z}}{\frac{t - z}{x}}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+149}:\\ \;\;\;\;\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 7: 72.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+24} \lor \neg \left(z \leq 520000000000\right):\\ \;\;\;\;\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 (or (<= z -2.6e+24) (not (<= z 520000000000.0)))
   (/ 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 ((z <= -2.6e+24) || !(z <= 520000000000.0)) {
		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 ((z <= (-2.6d+24)) .or. (.not. (z <= 520000000000.0d0))) 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 ((z <= -2.6e+24) || !(z <= 520000000000.0)) {
		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 (z <= -2.6e+24) or not (z <= 520000000000.0):
		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 ((z <= -2.6e+24) || !(z <= 520000000000.0))
		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 ((z <= -2.6e+24) || ~((z <= 520000000000.0)))
		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[Or[LessEqual[z, -2.6e+24], N[Not[LessEqual[z, 520000000000.0]], $MachinePrecision]], 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}\;z \leq -2.6 \cdot 10^{+24} \lor \neg \left(z \leq 520000000000\right):\\
\;\;\;\;\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 2 regimes
  2. if z < -2.5999999999999998e24 or 5.2e11 < z

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e24 < z < 5.2e11

    1. Initial program 94.5%

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

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

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

Alternative 8: 64.9% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

    if -4.00000000000000012e-139 < t < 8.0000000000000003e-61

    1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.0000000000000003e-61 < t

    1. Initial program 93.3%

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

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

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

Alternative 9: 78.0% accurate, 0.5× speedup?

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

\mathbf{elif}\;y \leq 3.7 \cdot 10^{-122}:\\
\;\;\;\;\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 < -9.6000000000000004e-61

    1. Initial program 89.2%

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

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

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

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

    if -9.6000000000000004e-61 < y < 3.6999999999999997e-122

    1. Initial program 86.5%

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \color{blue}{\left(\left(0 - t\right) + z\right)}} \]
      6. neg-sub072.8%

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

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

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

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

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

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

    if 3.6999999999999997e-122 < y

    1. Initial program 82.9%

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

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

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

Alternative 10: 78.6% 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 \cdot 10^{-61}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-115}:\\ \;\;\;\;\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 -5e-61)
   (/ x (* y (- t z)))
   (if (<= y 1.85e-115) (/ 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 <= -5e-61) {
		tmp = x / (y * (t - z));
	} else if (y <= 1.85e-115) {
		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 <= (-5d-61)) then
        tmp = x / (y * (t - z))
    else if (y <= 1.85d-115) 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 <= -5e-61) {
		tmp = x / (y * (t - z));
	} else if (y <= 1.85e-115) {
		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 <= -5e-61:
		tmp = x / (y * (t - z))
	elif y <= 1.85e-115:
		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 <= -5e-61)
		tmp = Float64(x / Float64(y * Float64(t - z)));
	elseif (y <= 1.85e-115)
		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 <= -5e-61)
		tmp = x / (y * (t - z));
	elseif (y <= 1.85e-115)
		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, -5e-61], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-115], 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 \cdot 10^{-61}:\\
\;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-115}:\\
\;\;\;\;\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 < -4.9999999999999999e-61

    1. Initial program 89.2%

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

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

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

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

    if -4.9999999999999999e-61 < y < 1.85e-115

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(z + \color{blue}{\left(-t\right)}\right)} \]
      10. unsub-neg73.0%

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

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

    if 1.85e-115 < y

    1. Initial program 82.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt44.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\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 t around inf 53.1%

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

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

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

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

Alternative 11: 79.7% accurate, 0.5× speedup?

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

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-115}:\\
\;\;\;\;\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 < -1.30000000000000003e-58

    1. Initial program 89.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt44.6%

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

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

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

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

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

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

    if -1.30000000000000003e-58 < y < 3.10000000000000007e-115

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{z \cdot \left(z + \color{blue}{\left(-t\right)}\right)} \]
      10. unsub-neg73.0%

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

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

    if 3.10000000000000007e-115 < y

    1. Initial program 82.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt44.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\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 t around inf 53.1%

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

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

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

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

Alternative 12: 82.0% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.9000000000000002e-35

    1. Initial program 89.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt44.2%

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

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

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

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

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

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

    if -2.9000000000000002e-35 < y < 1.99999999999999992e-80

    1. Initial program 86.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt36.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999992e-80 < y

    1. Initial program 82.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt42.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\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 t around inf 51.8%

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

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

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

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

Alternative 13: 82.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 -2.25 \cdot 10^{-34}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{\frac{x}{z - t}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.25e-34)
   (/ (/ x y) (- t z))
   (if (<= y 2.5e-80) (/ (/ x (- z t)) z) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.25e-34) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2.5e-80) {
		tmp = (x / (z - t)) / z;
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.25d-34)) then
        tmp = (x / y) / (t - z)
    else if (y <= 2.5d-80) then
        tmp = (x / (z - t)) / z
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.25e-34) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2.5e-80) {
		tmp = (x / (z - t)) / z;
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -2.25e-34:
		tmp = (x / y) / (t - z)
	elif y <= 2.5e-80:
		tmp = (x / (z - t)) / z
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.25e-34)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= 2.5e-80)
		tmp = Float64(Float64(x / Float64(z - t)) / z);
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.25e-34)
		tmp = (x / y) / (t - z);
	elseif (y <= 2.5e-80)
		tmp = (x / (z - t)) / z;
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -2.25e-34], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-80], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $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 -2.25 \cdot 10^{-34}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.25000000000000021e-34

    1. Initial program 89.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt44.2%

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

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

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

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

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

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

    if -2.25000000000000021e-34 < y < 2.5e-80

    1. Initial program 86.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num86.6%

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

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

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

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

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

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

        \[\leadsto \frac{1}{z \cdot \color{blue}{\left(0 - \left(t - z\right)\right)}} \cdot x \]
      4. associate--r-69.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5e-80 < y

    1. Initial program 82.2%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt42.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\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 t around inf 51.8%

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

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

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

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

Alternative 14: 51.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

    if -7.4e-141 < y < 3.8999999999999998e-115

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8999999999999998e-115 < y

    1. Initial program 82.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt44.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\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 z around 0 49.1%

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

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

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

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

Alternative 15: 46.9% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -44000 \lor \neg \left(z \leq 5.2 \cdot 10^{+92}\right):\\ \;\;\;\;\frac{x}{y \cdot z}\\ \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 -44000.0) (not (<= z 5.2e+92))) (/ x (* y z)) (/ x (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -44000.0) || !(z <= 5.2e+92)) {
		tmp = x / (y * z);
	} 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 <= (-44000.0d0)) .or. (.not. (z <= 5.2d+92))) then
        tmp = x / (y * z)
    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 <= -44000.0) || !(z <= 5.2e+92)) {
		tmp = x / (y * z);
	} 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 <= -44000.0) or not (z <= 5.2e+92):
		tmp = x / (y * z)
	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 <= -44000.0) || !(z <= 5.2e+92))
		tmp = Float64(x / Float64(y * z));
	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 <= -44000.0) || ~((z <= 5.2e+92)))
		tmp = x / (y * z);
	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, -44000.0], N[Not[LessEqual[z, 5.2e+92]], $MachinePrecision]], N[(x / N[(y * z), $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 -44000 \lor \neg \left(z \leq 5.2 \cdot 10^{+92}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -44000 or 5.1999999999999998e92 < z

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{y}} \]
      3. times-frac39.5%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{z \cdot y}} \]
      4. *-rgt-identity39.5%

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

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

    if -44000 < z < 5.1999999999999998e92

    1. Initial program 95.0%

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.62e106 or 1.0499999999999999e100 < z

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.62e106 < z < 1.0499999999999999e100

    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. add-sqr-sqrt45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 49.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 -1.5 \cdot 10^{+80} \lor \neg \left(z \leq 1.75 \cdot 10^{+127}\right):\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{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 -1.5e+80) (not (<= z 1.75e+127))) (/ x (* y z)) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.5e+80) || !(z <= 1.75e+127)) {
		tmp = x / (y * z);
	} 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 <= (-1.5d+80)) .or. (.not. (z <= 1.75d+127))) then
        tmp = x / (y * z)
    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 <= -1.5e+80) || !(z <= 1.75e+127)) {
		tmp = x / (y * z);
	} 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 <= -1.5e+80) or not (z <= 1.75e+127):
		tmp = x / (y * z)
	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 <= -1.5e+80) || !(z <= 1.75e+127))
		tmp = Float64(x / Float64(y * z));
	else
		tmp = Float64(Float64(x / 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 <= -1.5e+80) || ~((z <= 1.75e+127)))
		tmp = x / (y * z);
	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, -1.5e+80], N[Not[LessEqual[z, 1.75e+127]], $MachinePrecision]], N[(x / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+80} \lor \neg \left(z \leq 1.75 \cdot 10^{+127}\right):\\
\;\;\;\;\frac{x}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.49999999999999993e80 or 1.74999999999999989e127 < z

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{y}} \]
      3. times-frac42.5%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{z \cdot y}} \]
      4. *-rgt-identity42.5%

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

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

    if -1.49999999999999993e80 < z < 1.74999999999999989e127

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

Alternative 18: 50.8% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+80} \lor \neg \left(z \leq 1.5 \cdot 10^{+62}\right):\\ \;\;\;\;\frac{\frac{x}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{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 -1.02e+80) (not (<= z 1.5e+62))) (/ (/ x z) y) (/ (/ x y) t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.02e+80) || !(z <= 1.5e+62)) {
		tmp = (x / z) / y;
	} 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 <= (-1.02d+80)) .or. (.not. (z <= 1.5d+62))) then
        tmp = (x / z) / y
    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 <= -1.02e+80) || !(z <= 1.5e+62)) {
		tmp = (x / z) / y;
	} 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 <= -1.02e+80) or not (z <= 1.5e+62):
		tmp = (x / z) / y
	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 <= -1.02e+80) || !(z <= 1.5e+62))
		tmp = Float64(Float64(x / z) / y);
	else
		tmp = Float64(Float64(x / 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 <= -1.02e+80) || ~((z <= 1.5e+62)))
		tmp = (x / z) / y;
	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, -1.02e+80], N[Not[LessEqual[z, 1.5e+62]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+80} \lor \neg \left(z \leq 1.5 \cdot 10^{+62}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.02e80 or 1.5e62 < z

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{z \cdot y}} \]
    13. Taylor expanded in x around 0 39.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{y} \]
    15. Simplified43.9%

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

    if -1.02e80 < z < 1.5e62

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

Alternative 19: 96.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 20: 39.7% 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 86.2%

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

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

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

Developer target: 88.0% 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 2024096 
(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))))