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

Percentage Accurate: 88.4% → 96.7%
Time: 10.8s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 88.4% 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.7% 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 88.6%

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

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

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

Alternative 2: 92.2% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \left(t - z\right) \cdot \left(y - z\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{1}{t \cdot \frac{y - z}{x}}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\ \;\;\;\;\frac{x}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-1}{\frac{z}{x}}}{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 (* (- t z) (- y z))))
   (if (<= t_1 (- INFINITY))
     (/ 1.0 (* t (/ (- y z) x)))
     (if (<= t_1 5e+278) (/ x t_1) (/ (/ -1.0 (/ z x)) (- y z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (t - z) * (y - z);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = 1.0 / (t * ((y - z) / x));
	} else if (t_1 <= 5e+278) {
		tmp = x / t_1;
	} else {
		tmp = (-1.0 / (z / x)) / (y - z);
	}
	return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (t - z) * (y - z);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = 1.0 / (t * ((y - z) / x));
	} else if (t_1 <= 5e+278) {
		tmp = x / t_1;
	} else {
		tmp = (-1.0 / (z / x)) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (t - z) * (y - z)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = 1.0 / (t * ((y - z) / x))
	elif t_1 <= 5e+278:
		tmp = x / t_1
	else:
		tmp = (-1.0 / (z / x)) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(t - z) * Float64(y - z))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(1.0 / Float64(t * Float64(Float64(y - z) / x)));
	elseif (t_1 <= 5e+278)
		tmp = Float64(x / t_1);
	else
		tmp = Float64(Float64(-1.0 / Float64(z / x)) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (t - z) * (y - z);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = 1.0 / (t * ((y - z) / x));
	elseif (t_1 <= 5e+278)
		tmp = x / t_1;
	else
		tmp = (-1.0 / (z / x)) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(1.0 / N[(t * N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], N[(x / t$95$1), $MachinePrecision], N[(N[(-1.0 / N[(z / x), $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(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{1}{t \cdot \frac{y - z}{x}}\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;\frac{x}{t\_1}\\

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


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

    1. Initial program 51.3%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 5.00000000000000029e278

    1. Initial program 99.4%

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

    if 5.00000000000000029e278 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot \color{blue}{\frac{1}{\frac{z}{x}}}}{y - z} \]
      4. un-div-inv89.2%

        \[\leadsto \frac{\color{blue}{\frac{-1}{\frac{z}{x}}}}{y - z} \]
    9. Applied egg-rr89.2%

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

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

Alternative 3: 92.2% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \left(t - z\right) \cdot \left(y - z\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{1}{t \cdot \frac{y - z}{x}}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\ \;\;\;\;\frac{x}{t\_1}\\ \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
 (let* ((t_1 (* (- t z) (- y z))))
   (if (<= t_1 (- INFINITY))
     (/ 1.0 (* t (/ (- y z) x)))
     (if (<= t_1 5e+278) (/ x t_1) (/ (/ x z) (- z y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (t - z) * (y - z);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = 1.0 / (t * ((y - z) / x));
	} else if (t_1 <= 5e+278) {
		tmp = x / t_1;
	} else {
		tmp = (x / z) / (z - y);
	}
	return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = (t - z) * (y - z);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = 1.0 / (t * ((y - z) / x));
	} else if (t_1 <= 5e+278) {
		tmp = x / t_1;
	} else {
		tmp = (x / z) / (z - y);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = (t - z) * (y - z)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = 1.0 / (t * ((y - z) / x))
	elif t_1 <= 5e+278:
		tmp = x / t_1
	else:
		tmp = (x / z) / (z - y)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(t - z) * Float64(y - z))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(1.0 / Float64(t * Float64(Float64(y - z) / x)));
	elseif (t_1 <= 5e+278)
		tmp = Float64(x / t_1);
	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)
	t_1 = (t - z) * (y - z);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = 1.0 / (t * ((y - z) / x));
	elseif (t_1 <= 5e+278)
		tmp = x / t_1;
	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_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(1.0 / N[(t * N[(N[(y - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], N[(x / t$95$1), $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}
t_1 := \left(t - z\right) \cdot \left(y - z\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{1}{t \cdot \frac{y - z}{x}}\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;\frac{x}{t\_1}\\

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


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

    1. Initial program 51.3%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (-.f64 y z) (-.f64 t z)) < 5.00000000000000029e278

    1. Initial program 99.4%

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

    if 5.00000000000000029e278 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

Alternative 4: 82.2% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 86.0%

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

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

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

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

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

    if -3.7000000000000002e-116 < t < 4.4999999999999998e-82

    1. Initial program 96.1%

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

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

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

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

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

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

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

    if 4.4999999999999998e-82 < t < 3.5e95

    1. Initial program 93.4%

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

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

    if 3.5e95 < t

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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


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

    1. Initial program 86.0%

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

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

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

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

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

    if -1.7500000000000001e-115 < t < 2.29999999999999997e-82

    1. Initial program 96.1%

      \[\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. associate-*r/80.7%

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

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

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

    if 2.29999999999999997e-82 < t < 2.94999999999999995e94

    1. Initial program 93.4%

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

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

    if 2.94999999999999995e94 < t

    1. Initial program 80.2%

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

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

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

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

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

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

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

\mathbf{elif}\;z \leq 5.4 \cdot 10^{+147}:\\
\;\;\;\;\frac{\frac{x}{y}}{-z}\\

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


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

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.042999999999999997 < z < 3.34999999999999999e-19

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

    if 3.34999999999999999e-19 < z < 5.39999999999999995e147

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.39999999999999995e147 < z

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 49.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.042999999999999997 or 2.50000000000000018e-18 < z < 8.5000000000000007e147

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.042999999999999997 < z < 2.50000000000000018e-18

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

    if 8.5000000000000007e147 < z

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 45.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -21 or 6.00000000000000021e45 < z < 1.15e148

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -21 < z < 6.00000000000000021e45

    1. Initial program 94.1%

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

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

    if 1.15e148 < 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 0 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 86.7%

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

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

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

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

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

    if -9e-72 < y < 2.10000000000000009e-204

    1. Initial program 92.5%

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

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

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

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

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

    if 2.10000000000000009e-204 < y

    1. Initial program 88.0%

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

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

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

Alternative 10: 65.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

    if -5.0999999999999999e-79 < t < 7.00000000000000041e-86

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{\color{blue}{1}}{-z}}{y} \]
      7. un-div-inv55.9%

        \[\leadsto \frac{\color{blue}{\frac{x}{-z}}}{y} \]
    14. Applied egg-rr55.9%

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

    if 7.00000000000000041e-86 < t

    1. Initial program 84.8%

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

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

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

Alternative 11: 53.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 -0.029 \lor \neg \left(z \leq 5.2 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \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 -0.029) (not (<= z 5.2e-19))) (/ (/ (- x) z) y) (/ (/ x t) y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -0.029) || !(z <= 5.2e-19)) {
		tmp = (-x / z) / y;
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-0.029d0)) .or. (.not. (z <= 5.2d-19))) then
        tmp = (-x / z) / y
    else
        tmp = (x / t) / y
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -0.029) || !(z <= 5.2e-19)) {
		tmp = (-x / z) / y;
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -0.029) or not (z <= 5.2e-19):
		tmp = (-x / z) / y
	else:
		tmp = (x / t) / y
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -0.029) || !(z <= 5.2e-19))
		tmp = Float64(Float64(Float64(-x) / z) / y);
	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 <= -0.029) || ~((z <= 5.2e-19)))
		tmp = (-x / z) / y;
	else
		tmp = (x / t) / y;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.029], N[Not[LessEqual[z, 5.2e-19]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] / y), $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 -0.029 \lor \neg \left(z \leq 5.2 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.0290000000000000015 or 5.20000000000000026e-19 < z

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{-z}}}{y} \]
    14. Applied egg-rr49.3%

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

    if -0.0290000000000000015 < z < 5.20000000000000026e-19

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{y \cdot z}} \]
    12. Applied egg-rr35.1%

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

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

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

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

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

    if -1.56000000000000004e31 < z < 2.2000000000000001e87

    1. Initial program 92.9%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. div-inv57.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
    7. Simplified63.1%

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

    if 2.2000000000000001e87 < z

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 45.2% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+35} \lor \neg \left(z \leq 3.8 \cdot 10^{+135}\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 -2.4e+35) (not (<= z 3.8e+135))) (/ 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 <= -2.4e+35) || !(z <= 3.8e+135)) {
		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 <= (-2.4d+35)) .or. (.not. (z <= 3.8d+135))) 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 <= -2.4e+35) || !(z <= 3.8e+135)) {
		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 <= -2.4e+35) or not (z <= 3.8e+135):
		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 <= -2.4e+35) || !(z <= 3.8e+135))
		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 <= -2.4e+35) || ~((z <= 3.8e+135)))
		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, -2.4e+35], N[Not[LessEqual[z, 3.8e+135]], $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 -2.4 \cdot 10^{+35} \lor \neg \left(z \leq 3.8 \cdot 10^{+135}\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 < -2.40000000000000015e35 or 3.8000000000000001e135 < z

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000015e35 < z < 3.8000000000000001e135

    1. Initial program 92.0%

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

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

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

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

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

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


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

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{y \cdot z}} \]
    12. Applied egg-rr35.1%

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

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

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

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

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

    if -7.69999999999999967e31 < z < 1.9500000000000001e136

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
    7. Simplified61.1%

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

    if 1.9500000000000001e136 < z

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -29 < z < 1.9500000000000001e136

    1. Initial program 92.1%

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num94.8%

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

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

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

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

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

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

    if 1.9500000000000001e136 < z

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 71.2% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.72000000000000002e37

    1. Initial program 90.6%

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

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

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

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

    if 1.72000000000000002e37 < t

    1. Initial program 81.8%

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

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

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

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

Alternative 17: 70.5% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.28000000000000005e-23

    1. Initial program 90.8%

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

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

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

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

    if 1.28000000000000005e-23 < t

    1. Initial program 82.4%

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

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

Alternative 18: 39.2% 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 88.6%

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

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

Developer target: 87.1% 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 2024090 
(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))))