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

Percentage Accurate: 89.1% → 97.3%
Time: 12.4s
Alternatives: 14
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 14 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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 97.3% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 71.4% accurate, 0.4× speedup?

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

\mathbf{elif}\;z \leq -5 \cdot 10^{-75} \lor \neg \left(z \leq 4.7 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\

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


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

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg95.0%

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

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

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

    if -1.35000000000000003e154 < z < -4.99999999999999979e-75 or 4.7000000000000001e-42 < z

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999979e-75 < z < 4.7000000000000001e-42

    1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

Alternative 3: 75.6% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg95.0%

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

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

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

    if -1.35000000000000003e154 < z < -4.3e19

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

    if -4.3e19 < z < 1.05000000000000006e-41

    1. Initial program 89.6%

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

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

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

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

    if 1.05000000000000006e-41 < z

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 71.2% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{\left(-\left(-z\right)\right)} - y} \]
      9. remove-double-neg95.0%

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

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

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

    if -1.35000000000000003e154 < z < -3.6000000000000002e-74

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

    if -3.6000000000000002e-74 < z < 1.59999999999999992e-43

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

    if 1.59999999999999992e-43 < z

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 67.2% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3e22 or 1.05e26 < z

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e22 < z < 2.6e-42

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

    if 2.6e-42 < z < 1.05e26

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.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.45 \cdot 10^{-78}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{-194}:\\ \;\;\;\;\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 -1.45e-78)
   (/ (/ x (- t z)) y)
   (if (<= y 1.26e-194) (/ (/ 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.45e-78) {
		tmp = (x / (t - z)) / y;
	} else if (y <= 1.26e-194) {
		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.45d-78)) then
        tmp = (x / (t - z)) / y
    else if (y <= 1.26d-194) 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.45e-78) {
		tmp = (x / (t - z)) / y;
	} else if (y <= 1.26e-194) {
		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.45e-78:
		tmp = (x / (t - z)) / y
	elif y <= 1.26e-194:
		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.45e-78)
		tmp = Float64(Float64(x / Float64(t - z)) / y);
	elseif (y <= 1.26e-194)
		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 <= -1.45e-78)
		tmp = (x / (t - z)) / y;
	elseif (y <= 1.26e-194)
		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.45e-78], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 1.26e-194], 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 -1.45 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\

\mathbf{elif}\;y \leq 1.26 \cdot 10^{-194}:\\
\;\;\;\;\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 < -1.45e-78

    1. Initial program 89.8%

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

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

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

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

    if -1.45e-78 < y < 1.26e-194

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

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

    if 1.26e-194 < y

    1. Initial program 90.9%

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

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

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

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

Alternative 7: 81.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 -6.8 \cdot 10^{-78}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-195}:\\ \;\;\;\;\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 -6.8e-78)
   (/ (/ x y) (- t z))
   (if (<= y 7.2e-195) (/ (/ 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 <= -6.8e-78) {
		tmp = (x / y) / (t - z);
	} else if (y <= 7.2e-195) {
		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 <= (-6.8d-78)) then
        tmp = (x / y) / (t - z)
    else if (y <= 7.2d-195) 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 <= -6.8e-78) {
		tmp = (x / y) / (t - z);
	} else if (y <= 7.2e-195) {
		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 <= -6.8e-78:
		tmp = (x / y) / (t - z)
	elif y <= 7.2e-195:
		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 <= -6.8e-78)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= 7.2e-195)
		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 <= -6.8e-78)
		tmp = (x / y) / (t - z);
	elseif (y <= 7.2e-195)
		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, -6.8e-78], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-195], 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 -6.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-195}:\\
\;\;\;\;\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 < -6.80000000000000023e-78

    1. Initial program 89.8%

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

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

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

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

    if -6.80000000000000023e-78 < y < 7.2e-195

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

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

    if 7.2e-195 < y

    1. Initial program 90.9%

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

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

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

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

Alternative 8: 79.8% 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.35 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{-194}:\\ \;\;\;\;\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.35e-79)
   (/ (/ x y) (- t z))
   (if (<= y 1.26e-194) (/ 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.35e-79) {
		tmp = (x / y) / (t - z);
	} else if (y <= 1.26e-194) {
		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.35d-79)) then
        tmp = (x / y) / (t - z)
    else if (y <= 1.26d-194) 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.35e-79) {
		tmp = (x / y) / (t - z);
	} else if (y <= 1.26e-194) {
		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.35e-79:
		tmp = (x / y) / (t - z)
	elif y <= 1.26e-194:
		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.35e-79)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= 1.26e-194)
		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.35e-79)
		tmp = (x / y) / (t - z);
	elseif (y <= 1.26e-194)
		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.35e-79], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.26e-194], 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.35 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{elif}\;y \leq 1.26 \cdot 10^{-194}:\\
\;\;\;\;\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.3500000000000001e-79

    1. Initial program 89.8%

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

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

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

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

    if -1.3500000000000001e-79 < y < 1.26e-194

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

    if 1.26e-194 < y

    1. Initial program 90.9%

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

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

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

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

Alternative 9: 67.3% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2e20 or 7.7999999999999995e24 < z

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2e20 < z < 7.7999999999999995e24

    1. Initial program 90.5%

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

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

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

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

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

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

Alternative 10: 63.8% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6e22 or 2.1000000000000001e23 < z

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e22 < z < 2.1000000000000001e23

    1. Initial program 90.5%

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

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

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

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

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

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

Alternative 11: 62.0% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2e21 or 4.8000000000000001e24 < z

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

    if -2.2e21 < z < 4.8000000000000001e24

    1. Initial program 90.5%

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.60000000000000033e69 or 5.8000000000000002e98 < z

    1. Initial program 87.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{t}}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      2. div-inv24.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{z \cdot t}} \]
      3. *-rgt-identity38.9%

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

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

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

    if -4.60000000000000033e69 < z < 5.8000000000000002e98

    1. Initial program 91.9%

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

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

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

Alternative 13: 91.5% accurate, 0.6× speedup?

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

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


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

    1. Initial program 87.6%

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

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

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

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

    if -1.18000000000000006e176 < y

    1. Initial program 90.5%

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

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

Alternative 14: 40.3% accurate, 1.8× speedup?

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

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

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

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

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

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