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

Percentage Accurate: 88.8% → 97.4%
Time: 14.2s
Alternatives: 18
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 97.4% accurate, 0.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-243}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (* (- y z) (- t z)))))
   (* x_s (if (<= t_1 -1e-243) t_1 (/ (/ x_m (- t z)) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -1e-243) {
		tmp = t_1;
	} else {
		tmp = (x_m / (t - z)) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / ((y - z) * (t - z))
    if (t_1 <= (-1d-243)) then
        tmp = t_1
    else
        tmp = (x_m / (t - z)) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / ((y - z) * (t - z));
	double tmp;
	if (t_1 <= -1e-243) {
		tmp = t_1;
	} else {
		tmp = (x_m / (t - z)) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = x_m / ((y - z) * (t - z))
	tmp = 0
	if t_1 <= -1e-243:
		tmp = t_1
	else:
		tmp = (x_m / (t - z)) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m / Float64(Float64(y - z) * Float64(t - z)))
	tmp = 0.0
	if (t_1 <= -1e-243)
		tmp = t_1;
	else
		tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m / ((y - z) * (t - z));
	tmp = 0.0;
	if (t_1 <= -1e-243)
		tmp = t_1;
	else
		tmp = (x_m / (t - z)) / (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, -1e-243], t$95$1, N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-243}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 96.0%

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

    if -9.99999999999999995e-244 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 86.1%

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

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

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

Alternative 2: 69.4% accurate, 0.2× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{t}}{y}\\ t_2 := \frac{x\_m}{z \cdot \left(z - y\right)}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{-25}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.35 \cdot 10^{-122}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-144}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{1}{t}}{\frac{y}{x\_m}}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-186}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+138}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x_m t) y)) (t_2 (/ x_m (* z (- z y)))))
   (*
    x_s
    (if (<= z -3.8e-25)
      t_2
      (if (<= z -2.35e-122)
        t_1
        (if (<= z -1.5e-144)
          t_2
          (if (<= z 2.1e-202)
            (/ (/ 1.0 t) (/ y x_m))
            (if (<= z 3.2e-186)
              (/ x_m (* z (- z t)))
              (if (<= z 5.6e-39)
                t_1
                (if (<= z 3.6e+138) t_2 (* (/ x_m z) (/ 1.0 z))))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / t) / y;
	double t_2 = x_m / (z * (z - y));
	double tmp;
	if (z <= -3.8e-25) {
		tmp = t_2;
	} else if (z <= -2.35e-122) {
		tmp = t_1;
	} else if (z <= -1.5e-144) {
		tmp = t_2;
	} else if (z <= 2.1e-202) {
		tmp = (1.0 / t) / (y / x_m);
	} else if (z <= 3.2e-186) {
		tmp = x_m / (z * (z - t));
	} else if (z <= 5.6e-39) {
		tmp = t_1;
	} else if (z <= 3.6e+138) {
		tmp = t_2;
	} else {
		tmp = (x_m / z) * (1.0 / z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x_m / t) / y
    t_2 = x_m / (z * (z - y))
    if (z <= (-3.8d-25)) then
        tmp = t_2
    else if (z <= (-2.35d-122)) then
        tmp = t_1
    else if (z <= (-1.5d-144)) then
        tmp = t_2
    else if (z <= 2.1d-202) then
        tmp = (1.0d0 / t) / (y / x_m)
    else if (z <= 3.2d-186) then
        tmp = x_m / (z * (z - t))
    else if (z <= 5.6d-39) then
        tmp = t_1
    else if (z <= 3.6d+138) then
        tmp = t_2
    else
        tmp = (x_m / z) * (1.0d0 / z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / t) / y;
	double t_2 = x_m / (z * (z - y));
	double tmp;
	if (z <= -3.8e-25) {
		tmp = t_2;
	} else if (z <= -2.35e-122) {
		tmp = t_1;
	} else if (z <= -1.5e-144) {
		tmp = t_2;
	} else if (z <= 2.1e-202) {
		tmp = (1.0 / t) / (y / x_m);
	} else if (z <= 3.2e-186) {
		tmp = x_m / (z * (z - t));
	} else if (z <= 5.6e-39) {
		tmp = t_1;
	} else if (z <= 3.6e+138) {
		tmp = t_2;
	} else {
		tmp = (x_m / z) * (1.0 / z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = (x_m / t) / y
	t_2 = x_m / (z * (z - y))
	tmp = 0
	if z <= -3.8e-25:
		tmp = t_2
	elif z <= -2.35e-122:
		tmp = t_1
	elif z <= -1.5e-144:
		tmp = t_2
	elif z <= 2.1e-202:
		tmp = (1.0 / t) / (y / x_m)
	elif z <= 3.2e-186:
		tmp = x_m / (z * (z - t))
	elif z <= 5.6e-39:
		tmp = t_1
	elif z <= 3.6e+138:
		tmp = t_2
	else:
		tmp = (x_m / z) * (1.0 / z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(x_m / t) / y)
	t_2 = Float64(x_m / Float64(z * Float64(z - y)))
	tmp = 0.0
	if (z <= -3.8e-25)
		tmp = t_2;
	elseif (z <= -2.35e-122)
		tmp = t_1;
	elseif (z <= -1.5e-144)
		tmp = t_2;
	elseif (z <= 2.1e-202)
		tmp = Float64(Float64(1.0 / t) / Float64(y / x_m));
	elseif (z <= 3.2e-186)
		tmp = Float64(x_m / Float64(z * Float64(z - t)));
	elseif (z <= 5.6e-39)
		tmp = t_1;
	elseif (z <= 3.6e+138)
		tmp = t_2;
	else
		tmp = Float64(Float64(x_m / z) * Float64(1.0 / z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (x_m / t) / y;
	t_2 = x_m / (z * (z - y));
	tmp = 0.0;
	if (z <= -3.8e-25)
		tmp = t_2;
	elseif (z <= -2.35e-122)
		tmp = t_1;
	elseif (z <= -1.5e-144)
		tmp = t_2;
	elseif (z <= 2.1e-202)
		tmp = (1.0 / t) / (y / x_m);
	elseif (z <= 3.2e-186)
		tmp = x_m / (z * (z - t));
	elseif (z <= 5.6e-39)
		tmp = t_1;
	elseif (z <= 3.6e+138)
		tmp = t_2;
	else
		tmp = (x_m / z) * (1.0 / z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3.8e-25], t$95$2, If[LessEqual[z, -2.35e-122], t$95$1, If[LessEqual[z, -1.5e-144], t$95$2, If[LessEqual[z, 2.1e-202], N[(N[(1.0 / t), $MachinePrecision] / N[(y / x$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-186], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-39], t$95$1, If[LessEqual[z, 3.6e+138], t$95$2, N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{t}}{y}\\
t_2 := \frac{x\_m}{z \cdot \left(z - y\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.35 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-144}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{1}{t}}{\frac{y}{x\_m}}\\

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

\mathbf{elif}\;z \leq 5.6 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -3.7999999999999998e-25 or -2.35e-122 < z < -1.4999999999999999e-144 or 5.6000000000000003e-39 < z < 3.6000000000000001e138

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

    if -3.7999999999999998e-25 < z < -2.35e-122 or 3.2e-186 < z < 5.6000000000000003e-39

    1. Initial program 88.7%

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{y - z}{\frac{x}{t - z}}\right)}^{-1}} \]
      4. div-inv93.5%

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

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

      \[\leadsto \color{blue}{{\left(\left(y - z\right) \cdot \frac{t - z}{x}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-193.6%

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

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

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

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

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

    if -1.4999999999999999e-144 < z < 2.09999999999999985e-202

    1. Initial program 85.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
      2. clear-num78.9%

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

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

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

    if 2.09999999999999985e-202 < z < 3.2e-186

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if 3.6000000000000001e138 < z

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 69.5% accurate, 0.2× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{t}}{y}\\ t_2 := \frac{x\_m}{z \cdot \left(z - y\right)}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -9.8 \cdot 10^{-25}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-122}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-143}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-186}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+138}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x_m t) y)) (t_2 (/ x_m (* z (- z y)))))
   (*
    x_s
    (if (<= z -9.8e-25)
      t_2
      (if (<= z -2.45e-122)
        t_1
        (if (<= z -7.6e-143)
          t_2
          (if (<= z 2.1e-202)
            (/ (/ x_m y) t)
            (if (<= z 3.5e-186)
              (/ x_m (* z (- z t)))
              (if (<= z 3.4e-39)
                t_1
                (if (<= z 3.8e+138) t_2 (* (/ x_m z) (/ 1.0 z))))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / t) / y;
	double t_2 = x_m / (z * (z - y));
	double tmp;
	if (z <= -9.8e-25) {
		tmp = t_2;
	} else if (z <= -2.45e-122) {
		tmp = t_1;
	} else if (z <= -7.6e-143) {
		tmp = t_2;
	} else if (z <= 2.1e-202) {
		tmp = (x_m / y) / t;
	} else if (z <= 3.5e-186) {
		tmp = x_m / (z * (z - t));
	} else if (z <= 3.4e-39) {
		tmp = t_1;
	} else if (z <= 3.8e+138) {
		tmp = t_2;
	} else {
		tmp = (x_m / z) * (1.0 / z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x_m / t) / y
    t_2 = x_m / (z * (z - y))
    if (z <= (-9.8d-25)) then
        tmp = t_2
    else if (z <= (-2.45d-122)) then
        tmp = t_1
    else if (z <= (-7.6d-143)) then
        tmp = t_2
    else if (z <= 2.1d-202) then
        tmp = (x_m / y) / t
    else if (z <= 3.5d-186) then
        tmp = x_m / (z * (z - t))
    else if (z <= 3.4d-39) then
        tmp = t_1
    else if (z <= 3.8d+138) then
        tmp = t_2
    else
        tmp = (x_m / z) * (1.0d0 / z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m / t) / y;
	double t_2 = x_m / (z * (z - y));
	double tmp;
	if (z <= -9.8e-25) {
		tmp = t_2;
	} else if (z <= -2.45e-122) {
		tmp = t_1;
	} else if (z <= -7.6e-143) {
		tmp = t_2;
	} else if (z <= 2.1e-202) {
		tmp = (x_m / y) / t;
	} else if (z <= 3.5e-186) {
		tmp = x_m / (z * (z - t));
	} else if (z <= 3.4e-39) {
		tmp = t_1;
	} else if (z <= 3.8e+138) {
		tmp = t_2;
	} else {
		tmp = (x_m / z) * (1.0 / z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = (x_m / t) / y
	t_2 = x_m / (z * (z - y))
	tmp = 0
	if z <= -9.8e-25:
		tmp = t_2
	elif z <= -2.45e-122:
		tmp = t_1
	elif z <= -7.6e-143:
		tmp = t_2
	elif z <= 2.1e-202:
		tmp = (x_m / y) / t
	elif z <= 3.5e-186:
		tmp = x_m / (z * (z - t))
	elif z <= 3.4e-39:
		tmp = t_1
	elif z <= 3.8e+138:
		tmp = t_2
	else:
		tmp = (x_m / z) * (1.0 / z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(x_m / t) / y)
	t_2 = Float64(x_m / Float64(z * Float64(z - y)))
	tmp = 0.0
	if (z <= -9.8e-25)
		tmp = t_2;
	elseif (z <= -2.45e-122)
		tmp = t_1;
	elseif (z <= -7.6e-143)
		tmp = t_2;
	elseif (z <= 2.1e-202)
		tmp = Float64(Float64(x_m / y) / t);
	elseif (z <= 3.5e-186)
		tmp = Float64(x_m / Float64(z * Float64(z - t)));
	elseif (z <= 3.4e-39)
		tmp = t_1;
	elseif (z <= 3.8e+138)
		tmp = t_2;
	else
		tmp = Float64(Float64(x_m / z) * Float64(1.0 / z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (x_m / t) / y;
	t_2 = x_m / (z * (z - y));
	tmp = 0.0;
	if (z <= -9.8e-25)
		tmp = t_2;
	elseif (z <= -2.45e-122)
		tmp = t_1;
	elseif (z <= -7.6e-143)
		tmp = t_2;
	elseif (z <= 2.1e-202)
		tmp = (x_m / y) / t;
	elseif (z <= 3.5e-186)
		tmp = x_m / (z * (z - t));
	elseif (z <= 3.4e-39)
		tmp = t_1;
	elseif (z <= 3.8e+138)
		tmp = t_2;
	else
		tmp = (x_m / z) * (1.0 / z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -9.8e-25], t$95$2, If[LessEqual[z, -2.45e-122], t$95$1, If[LessEqual[z, -7.6e-143], t$95$2, If[LessEqual[z, 2.1e-202], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.5e-186], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-39], t$95$1, If[LessEqual[z, 3.8e+138], t$95$2, N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]]]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{t}}{y}\\
t_2 := \frac{x\_m}{z \cdot \left(z - y\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.45 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -7.6 \cdot 10^{-143}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -9.7999999999999998e-25 or -2.4499999999999998e-122 < z < -7.59999999999999962e-143 or 3.3999999999999999e-39 < z < 3.80000000000000012e138

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

    if -9.7999999999999998e-25 < z < -2.4499999999999998e-122 or 3.49999999999999989e-186 < z < 3.3999999999999999e-39

    1. Initial program 88.7%

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{y - z}{\frac{x}{t - z}}\right)}^{-1}} \]
      4. div-inv93.5%

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

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

      \[\leadsto \color{blue}{{\left(\left(y - z\right) \cdot \frac{t - z}{x}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-193.6%

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

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

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

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

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

    if -7.59999999999999962e-143 < z < 2.09999999999999985e-202

    1. Initial program 85.4%

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

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

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

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

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

    if 2.09999999999999985e-202 < z < 3.49999999999999989e-186

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if 3.80000000000000012e138 < z

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 69.1% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-186}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{elif}\;z \leq 10^{+139}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (* z (- z t)))))
   (*
    x_s
    (if (<= z -4.5e-19)
      t_1
      (if (<= z 2.1e-202)
        (/ (/ x_m y) t)
        (if (<= z 3.2e-186)
          t_1
          (if (<= z 1.3e-38)
            (/ (/ x_m t) y)
            (if (<= z 1e+139) t_1 (* (/ x_m z) (/ 1.0 z))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (z * (z - t));
	double tmp;
	if (z <= -4.5e-19) {
		tmp = t_1;
	} else if (z <= 2.1e-202) {
		tmp = (x_m / y) / t;
	} else if (z <= 3.2e-186) {
		tmp = t_1;
	} else if (z <= 1.3e-38) {
		tmp = (x_m / t) / y;
	} else if (z <= 1e+139) {
		tmp = t_1;
	} else {
		tmp = (x_m / z) * (1.0 / z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m / (z * (z - t))
    if (z <= (-4.5d-19)) then
        tmp = t_1
    else if (z <= 2.1d-202) then
        tmp = (x_m / y) / t
    else if (z <= 3.2d-186) then
        tmp = t_1
    else if (z <= 1.3d-38) then
        tmp = (x_m / t) / y
    else if (z <= 1d+139) then
        tmp = t_1
    else
        tmp = (x_m / z) * (1.0d0 / z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m / (z * (z - t));
	double tmp;
	if (z <= -4.5e-19) {
		tmp = t_1;
	} else if (z <= 2.1e-202) {
		tmp = (x_m / y) / t;
	} else if (z <= 3.2e-186) {
		tmp = t_1;
	} else if (z <= 1.3e-38) {
		tmp = (x_m / t) / y;
	} else if (z <= 1e+139) {
		tmp = t_1;
	} else {
		tmp = (x_m / z) * (1.0 / z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	t_1 = x_m / (z * (z - t))
	tmp = 0
	if z <= -4.5e-19:
		tmp = t_1
	elif z <= 2.1e-202:
		tmp = (x_m / y) / t
	elif z <= 3.2e-186:
		tmp = t_1
	elif z <= 1.3e-38:
		tmp = (x_m / t) / y
	elif z <= 1e+139:
		tmp = t_1
	else:
		tmp = (x_m / z) * (1.0 / z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m / Float64(z * Float64(z - t)))
	tmp = 0.0
	if (z <= -4.5e-19)
		tmp = t_1;
	elseif (z <= 2.1e-202)
		tmp = Float64(Float64(x_m / y) / t);
	elseif (z <= 3.2e-186)
		tmp = t_1;
	elseif (z <= 1.3e-38)
		tmp = Float64(Float64(x_m / t) / y);
	elseif (z <= 1e+139)
		tmp = t_1;
	else
		tmp = Float64(Float64(x_m / z) * Float64(1.0 / z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m / (z * (z - t));
	tmp = 0.0;
	if (z <= -4.5e-19)
		tmp = t_1;
	elseif (z <= 2.1e-202)
		tmp = (x_m / y) / t;
	elseif (z <= 3.2e-186)
		tmp = t_1;
	elseif (z <= 1.3e-38)
		tmp = (x_m / t) / y;
	elseif (z <= 1e+139)
		tmp = t_1;
	else
		tmp = (x_m / z) * (1.0 / z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -4.5e-19], t$95$1, If[LessEqual[z, 2.1e-202], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3.2e-186], t$95$1, If[LessEqual[z, 1.3e-38], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1e+139], t$95$1, N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t}\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 10^{+139}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.50000000000000013e-19 or 2.09999999999999985e-202 < z < 3.2e-186 or 1.30000000000000005e-38 < z < 1.00000000000000003e139

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000013e-19 < z < 2.09999999999999985e-202

    1. Initial program 87.1%

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

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

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

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

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

    if 3.2e-186 < z < 1.30000000000000005e-38

    1. Initial program 89.7%

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{y - z}{\frac{x}{t - z}}\right)}^{-1}} \]
      4. div-inv92.6%

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

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

      \[\leadsto \color{blue}{{\left(\left(y - z\right) \cdot \frac{t - z}{x}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-192.8%

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

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

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

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

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

    if 1.00000000000000003e139 < z

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.4% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -82000000000000:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-59}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{1}{t} \cdot \frac{x\_m}{y - z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= y -82000000000000.0)
    (/ (/ x_m y) (- t z))
    (if (<= y -3.1e-59)
      (/ (/ x_m z) (- z y))
      (if (<= y -3.5e-80)
        (* (/ 1.0 t) (/ x_m (- y z)))
        (if (<= y 1.2e-100) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -82000000000000.0) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -3.1e-59) {
		tmp = (x_m / z) / (z - y);
	} else if (y <= -3.5e-80) {
		tmp = (1.0 / t) * (x_m / (y - z));
	} else if (y <= 1.2e-100) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-82000000000000.0d0)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= (-3.1d-59)) then
        tmp = (x_m / z) / (z - y)
    else if (y <= (-3.5d-80)) then
        tmp = (1.0d0 / t) * (x_m / (y - z))
    else if (y <= 1.2d-100) then
        tmp = (x_m / z) / (z - t)
    else
        tmp = (x_m / t) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -82000000000000.0) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -3.1e-59) {
		tmp = (x_m / z) / (z - y);
	} else if (y <= -3.5e-80) {
		tmp = (1.0 / t) * (x_m / (y - z));
	} else if (y <= 1.2e-100) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if y <= -82000000000000.0:
		tmp = (x_m / y) / (t - z)
	elif y <= -3.1e-59:
		tmp = (x_m / z) / (z - y)
	elif y <= -3.5e-80:
		tmp = (1.0 / t) * (x_m / (y - z))
	elif y <= 1.2e-100:
		tmp = (x_m / z) / (z - t)
	else:
		tmp = (x_m / t) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (y <= -82000000000000.0)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= -3.1e-59)
		tmp = Float64(Float64(x_m / z) / Float64(z - y));
	elseif (y <= -3.5e-80)
		tmp = Float64(Float64(1.0 / t) * Float64(x_m / Float64(y - z)));
	elseif (y <= 1.2e-100)
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (y <= -82000000000000.0)
		tmp = (x_m / y) / (t - z);
	elseif (y <= -3.1e-59)
		tmp = (x_m / z) / (z - y);
	elseif (y <= -3.5e-80)
		tmp = (1.0 / t) * (x_m / (y - z));
	elseif (y <= 1.2e-100)
		tmp = (x_m / z) / (z - t);
	else
		tmp = (x_m / t) / (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -82000000000000.0], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.1e-59], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-80], N[(N[(1.0 / t), $MachinePrecision] * N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-100], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -82000000000000:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

\mathbf{elif}\;y \leq -3.1 \cdot 10^{-59}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\

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

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\

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


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

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

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

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

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

    if -8.2e13 < y < -3.09999999999999999e-59

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.09999999999999999e-59 < y < -3.50000000000000015e-80

    1. Initial program 81.6%

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

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

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

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

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

    if -3.50000000000000015e-80 < y < 1.2000000000000001e-100

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

    if 1.2000000000000001e-100 < y

    1. Initial program 78.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -82000000000000:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-59}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{1}{t} \cdot \frac{x}{y - z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 82.4% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= y -2.3e+14)
    (/ (/ x_m y) (- t z))
    (if (<= y -2.2e-76)
      (/ (/ x_m z) (- z y))
      (if (<= y -5.8e-79)
        (/ x_m (* y t))
        (if (<= y 5e-100) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -2.3e+14) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -2.2e-76) {
		tmp = (x_m / z) / (z - y);
	} else if (y <= -5.8e-79) {
		tmp = x_m / (y * t);
	} else if (y <= 5e-100) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.3d+14)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= (-2.2d-76)) then
        tmp = (x_m / z) / (z - y)
    else if (y <= (-5.8d-79)) then
        tmp = x_m / (y * t)
    else if (y <= 5d-100) then
        tmp = (x_m / z) / (z - t)
    else
        tmp = (x_m / t) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -2.3e+14) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -2.2e-76) {
		tmp = (x_m / z) / (z - y);
	} else if (y <= -5.8e-79) {
		tmp = x_m / (y * t);
	} else if (y <= 5e-100) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if y <= -2.3e+14:
		tmp = (x_m / y) / (t - z)
	elif y <= -2.2e-76:
		tmp = (x_m / z) / (z - y)
	elif y <= -5.8e-79:
		tmp = x_m / (y * t)
	elif y <= 5e-100:
		tmp = (x_m / z) / (z - t)
	else:
		tmp = (x_m / t) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (y <= -2.3e+14)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= -2.2e-76)
		tmp = Float64(Float64(x_m / z) / Float64(z - y));
	elseif (y <= -5.8e-79)
		tmp = Float64(x_m / Float64(y * t));
	elseif (y <= 5e-100)
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (y <= -2.3e+14)
		tmp = (x_m / y) / (t - z);
	elseif (y <= -2.2e-76)
		tmp = (x_m / z) / (z - y);
	elseif (y <= -5.8e-79)
		tmp = x_m / (y * t);
	elseif (y <= 5e-100)
		tmp = (x_m / z) / (z - t);
	else
		tmp = (x_m / t) / (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -2.3e+14], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e-76], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.8e-79], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-100], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

\mathbf{elif}\;y \leq -2.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\

\mathbf{elif}\;y \leq -5.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\

\mathbf{elif}\;y \leq 5 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\

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


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

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

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

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

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

    if -2.3e14 < y < -2.19999999999999999e-76

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999999e-76 < y < -5.8000000000000001e-79

    1. Initial program 100.0%

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

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

    if -5.8000000000000001e-79 < y < 5.0000000000000001e-100

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e-100 < y

    1. Initial program 78.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.5% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -480 \lor \neg \left(t \leq 5.2 \cdot 10^{-61}\right):\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= t -480.0) (not (<= t 5.2e-61)))
    (/ (/ x_m t) (- y z))
    (/ x_m (* z (- z y))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((t <= -480.0) || !(t <= 5.2e-61)) {
		tmp = (x_m / t) / (y - z);
	} else {
		tmp = x_m / (z * (z - y));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-480.0d0)) .or. (.not. (t <= 5.2d-61))) then
        tmp = (x_m / t) / (y - z)
    else
        tmp = x_m / (z * (z - y))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((t <= -480.0) || !(t <= 5.2e-61)) {
		tmp = (x_m / t) / (y - z);
	} else {
		tmp = x_m / (z * (z - y));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (t <= -480.0) or not (t <= 5.2e-61):
		tmp = (x_m / t) / (y - z)
	else:
		tmp = x_m / (z * (z - y))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((t <= -480.0) || !(t <= 5.2e-61))
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	else
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((t <= -480.0) || ~((t <= 5.2e-61)))
		tmp = (x_m / t) / (y - z);
	else
		tmp = x_m / (z * (z - y));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -480.0], N[Not[LessEqual[t, 5.2e-61]], $MachinePrecision]], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -480 \lor \neg \left(t \leq 5.2 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -480 or 5.20000000000000021e-61 < t

    1. Initial program 86.2%

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

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

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

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

    if -480 < t < 5.20000000000000021e-61

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.8% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -130000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+25}\right):\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -130000000.0) (not (<= z 9.2e+25)))
    (* (/ x_m z) (/ 1.0 z))
    (/ (/ x_m y) t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -130000000.0) || !(z <= 9.2e+25)) {
		tmp = (x_m / z) * (1.0 / z);
	} else {
		tmp = (x_m / y) / t;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-130000000.0d0)) .or. (.not. (z <= 9.2d+25))) then
        tmp = (x_m / z) * (1.0d0 / z)
    else
        tmp = (x_m / y) / t
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -130000000.0) || !(z <= 9.2e+25)) {
		tmp = (x_m / z) * (1.0 / z);
	} else {
		tmp = (x_m / y) / t;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -130000000.0) or not (z <= 9.2e+25):
		tmp = (x_m / z) * (1.0 / z)
	else:
		tmp = (x_m / y) / t
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -130000000.0) || !(z <= 9.2e+25))
		tmp = Float64(Float64(x_m / z) * Float64(1.0 / z));
	else
		tmp = Float64(Float64(x_m / y) / t);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -130000000.0) || ~((z <= 9.2e+25)))
		tmp = (x_m / z) * (1.0 / z);
	else
		tmp = (x_m / y) / t;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -130000000.0], N[Not[LessEqual[z, 9.2e+25]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -130000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3e8 or 9.1999999999999992e25 < z

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e8 < z < 9.1999999999999992e25

    1. Initial program 89.9%

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

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

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

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

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

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

Alternative 9: 82.6% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= y -5.8e-22)
    (/ (/ x_m y) (- t z))
    (if (<= y 2.1e-100) (/ (/ x_m z) (- z t)) (/ (/ x_m t) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -5.8e-22) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= 2.1e-100) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-5.8d-22)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= 2.1d-100) then
        tmp = (x_m / z) / (z - t)
    else
        tmp = (x_m / t) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -5.8e-22) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= 2.1e-100) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if y <= -5.8e-22:
		tmp = (x_m / y) / (t - z)
	elif y <= 2.1e-100:
		tmp = (x_m / z) / (z - t)
	else:
		tmp = (x_m / t) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (y <= -5.8e-22)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= 2.1e-100)
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (y <= -5.8e-22)
		tmp = (x_m / y) / (t - z);
	elseif (y <= 2.1e-100)
		tmp = (x_m / z) / (z - t);
	else
		tmp = (x_m / t) / (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -5.8e-22], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-100], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\

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


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

    1. Initial program 90.4%

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

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

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

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

    if -5.8000000000000003e-22 < y < 2.10000000000000009e-100

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000009e-100 < y

    1. Initial program 78.9%

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

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

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

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

Alternative 10: 78.8% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{-23}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-256}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= y -1.25e-23)
    (/ (/ x_m y) (- t z))
    (if (<= y 4.6e-256) (/ x_m (* z (- z t))) (/ (/ x_m t) (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -1.25e-23) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= 4.6e-256) {
		tmp = x_m / (z * (z - t));
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-1.25d-23)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= 4.6d-256) then
        tmp = x_m / (z * (z - t))
    else
        tmp = (x_m / t) / (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (y <= -1.25e-23) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= 4.6e-256) {
		tmp = x_m / (z * (z - t));
	} else {
		tmp = (x_m / t) / (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if y <= -1.25e-23:
		tmp = (x_m / y) / (t - z)
	elif y <= 4.6e-256:
		tmp = x_m / (z * (z - t))
	else:
		tmp = (x_m / t) / (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (y <= -1.25e-23)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= 4.6e-256)
		tmp = Float64(x_m / Float64(z * Float64(z - t)));
	else
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (y <= -1.25e-23)
		tmp = (x_m / y) / (t - z);
	elseif (y <= 4.6e-256)
		tmp = x_m / (z * (z - t));
	else
		tmp = (x_m / t) / (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[y, -1.25e-23], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e-256], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-23}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

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

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


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

    1. Initial program 90.4%

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

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

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

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

    if -1.2500000000000001e-23 < y < 4.6e-256

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

    if 4.6e-256 < y

    1. Initial program 83.2%

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

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

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

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

Alternative 11: 66.8% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -98000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+21}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -98000000.0) (not (<= z 9.2e+21)))
    (/ (/ x_m z) z)
    (/ (/ x_m y) t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -98000000.0) || !(z <= 9.2e+21)) {
		tmp = (x_m / z) / z;
	} else {
		tmp = (x_m / y) / t;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-98000000.0d0)) .or. (.not. (z <= 9.2d+21))) then
        tmp = (x_m / z) / z
    else
        tmp = (x_m / y) / t
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -98000000.0) || !(z <= 9.2e+21)) {
		tmp = (x_m / z) / z;
	} else {
		tmp = (x_m / y) / t;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -98000000.0) or not (z <= 9.2e+21):
		tmp = (x_m / z) / z
	else:
		tmp = (x_m / y) / t
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -98000000.0) || !(z <= 9.2e+21))
		tmp = Float64(Float64(x_m / z) / z);
	else
		tmp = Float64(Float64(x_m / y) / t);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -98000000.0) || ~((z <= 9.2e+21)))
		tmp = (x_m / z) / z;
	else
		tmp = (x_m / y) / t;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -98000000.0], N[Not[LessEqual[z, 9.2e+21]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / z), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -98000000 \lor \neg \left(z \leq 9.2 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.8e7 or 9.2e21 < z

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.8e7 < z < 9.2e21

    1. Initial program 89.9%

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

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

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

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

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

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

Alternative 12: 62.8% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -145000000 \lor \neg \left(z \leq 3.8 \cdot 10^{+27}\right):\\ \;\;\;\;\frac{x\_m}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -145000000.0) (not (<= z 3.8e+27)))
    (/ x_m (* z z))
    (/ (/ x_m y) t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -145000000.0) || !(z <= 3.8e+27)) {
		tmp = x_m / (z * z);
	} else {
		tmp = (x_m / y) / t;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-145000000.0d0)) .or. (.not. (z <= 3.8d+27))) then
        tmp = x_m / (z * z)
    else
        tmp = (x_m / y) / t
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -145000000.0) || !(z <= 3.8e+27)) {
		tmp = x_m / (z * z);
	} else {
		tmp = (x_m / y) / t;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -145000000.0) or not (z <= 3.8e+27):
		tmp = x_m / (z * z)
	else:
		tmp = (x_m / y) / t
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -145000000.0) || !(z <= 3.8e+27))
		tmp = Float64(x_m / Float64(z * z));
	else
		tmp = Float64(Float64(x_m / y) / t);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -145000000.0) || ~((z <= 3.8e+27)))
		tmp = x_m / (z * z);
	else
		tmp = (x_m / y) / t;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -145000000.0], N[Not[LessEqual[z, 3.8e+27]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -145000000 \lor \neg \left(z \leq 3.8 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.45e8 or 3.80000000000000022e27 < z

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e8 < z < 3.80000000000000022e27

    1. Initial program 89.9%

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

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

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

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

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

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

Alternative 13: 62.6% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -106000000 \lor \neg \left(z \leq 1.05 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x\_m}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -106000000.0) (not (<= z 1.05e+23)))
    (/ x_m (* z z))
    (/ (/ x_m t) y))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -106000000.0) || !(z <= 1.05e+23)) {
		tmp = x_m / (z * z);
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-106000000.0d0)) .or. (.not. (z <= 1.05d+23))) then
        tmp = x_m / (z * z)
    else
        tmp = (x_m / t) / y
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -106000000.0) || !(z <= 1.05e+23)) {
		tmp = x_m / (z * z);
	} else {
		tmp = (x_m / t) / y;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -106000000.0) or not (z <= 1.05e+23):
		tmp = x_m / (z * z)
	else:
		tmp = (x_m / t) / y
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -106000000.0) || !(z <= 1.05e+23))
		tmp = Float64(x_m / Float64(z * z));
	else
		tmp = Float64(Float64(x_m / t) / y);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -106000000.0) || ~((z <= 1.05e+23)))
		tmp = x_m / (z * z);
	else
		tmp = (x_m / t) / y;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -106000000.0], N[Not[LessEqual[z, 1.05e+23]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -106000000 \lor \neg \left(z \leq 1.05 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.06e8 or 1.0500000000000001e23 < z

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.06e8 < z < 1.0500000000000001e23

    1. Initial program 89.9%

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{y - z}{\frac{x}{t - z}}\right)}^{-1}} \]
      4. div-inv95.8%

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

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

      \[\leadsto \color{blue}{{\left(\left(y - z\right) \cdot \frac{t - z}{x}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-195.9%

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

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

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

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

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

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

Alternative 14: 61.0% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -100000000 \lor \neg \left(z \leq 2.05 \cdot 10^{-38}\right):\\ \;\;\;\;\frac{x\_m}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -100000000.0) (not (<= z 2.05e-38)))
    (/ x_m (* z z))
    (/ x_m (* y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -100000000.0) || !(z <= 2.05e-38)) {
		tmp = x_m / (z * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-100000000.0d0)) .or. (.not. (z <= 2.05d-38))) then
        tmp = x_m / (z * z)
    else
        tmp = x_m / (y * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -100000000.0) || !(z <= 2.05e-38)) {
		tmp = x_m / (z * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -100000000.0) or not (z <= 2.05e-38):
		tmp = x_m / (z * z)
	else:
		tmp = x_m / (y * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -100000000.0) || !(z <= 2.05e-38))
		tmp = Float64(x_m / Float64(z * z));
	else
		tmp = Float64(x_m / Float64(y * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -100000000.0) || ~((z <= 2.05e-38)))
		tmp = x_m / (z * z);
	else
		tmp = x_m / (y * t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -100000000.0], N[Not[LessEqual[z, 2.05e-38]], $MachinePrecision]], N[(x$95$m / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -100000000 \lor \neg \left(z \leq 2.05 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x\_m}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1e8 or 2.0499999999999999e-38 < z

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e8 < z < 2.0499999999999999e-38

    1. Initial program 89.2%

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

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

Alternative 15: 46.2% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -150000000 \lor \neg \left(z \leq 2.4 \cdot 10^{+90}\right):\\ \;\;\;\;\frac{x\_m}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -150000000.0) (not (<= z 2.4e+90)))
    (/ x_m (* y z))
    (/ x_m (* y t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -150000000.0) || !(z <= 2.4e+90)) {
		tmp = x_m / (y * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-150000000.0d0)) .or. (.not. (z <= 2.4d+90))) then
        tmp = x_m / (y * z)
    else
        tmp = x_m / (y * t)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -150000000.0) || !(z <= 2.4e+90)) {
		tmp = x_m / (y * z);
	} else {
		tmp = x_m / (y * t);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -150000000.0) or not (z <= 2.4e+90):
		tmp = x_m / (y * z)
	else:
		tmp = x_m / (y * t)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -150000000.0) || !(z <= 2.4e+90))
		tmp = Float64(x_m / Float64(y * z));
	else
		tmp = Float64(x_m / Float64(y * t));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -150000000.0) || ~((z <= 2.4e+90)))
		tmp = x_m / (y * z);
	else
		tmp = x_m / (y * t);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -150000000.0], N[Not[LessEqual[z, 2.4e+90]], $MachinePrecision]], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -150000000 \lor \neg \left(z \leq 2.4 \cdot 10^{+90}\right):\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e8 or 2.4000000000000001e90 < z

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{z}}{-y}} \]
      3. add-sqr-sqrt23.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e8 < z < 2.4000000000000001e90

    1. Initial program 89.9%

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

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

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

Alternative 16: 90.7% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq 8.4 \cdot 10^{+168}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t}}{\frac{y - z}{x\_m}}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t 8.4e+168)
    (/ x_m (* (- y z) (- t z)))
    (/ (/ 1.0 t) (/ (- y z) x_m)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= 8.4e+168) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = (1.0 / t) / ((y - z) / x_m);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= 8.4d+168) then
        tmp = x_m / ((y - z) * (t - z))
    else
        tmp = (1.0d0 / t) / ((y - z) / x_m)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= 8.4e+168) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = (1.0 / t) / ((y - z) / x_m);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= 8.4e+168:
		tmp = x_m / ((y - z) * (t - z))
	else:
		tmp = (1.0 / t) / ((y - z) / x_m)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= 8.4e+168)
		tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z)));
	else
		tmp = Float64(Float64(1.0 / t) / Float64(Float64(y - z) / x_m));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= 8.4e+168)
		tmp = x_m / ((y - z) * (t - z));
	else
		tmp = (1.0 / t) / ((y - z) / x_m);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 8.4e+168], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t), $MachinePrecision] / N[(N[(y - z), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 8.4 \cdot 10^{+168}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\

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


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

    1. Initial program 90.3%

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

    if 8.40000000000000011e168 < t

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

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

Alternative 17: 90.6% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq 2.35 \cdot 10^{+166}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t} \cdot \frac{x\_m}{y - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t 2.35e+166)
    (/ x_m (* (- y z) (- t z)))
    (* (/ 1.0 t) (/ x_m (- y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= 2.35e+166) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = (1.0 / t) * (x_m / (y - z));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= 2.35d+166) then
        tmp = x_m / ((y - z) * (t - z))
    else
        tmp = (1.0d0 / t) * (x_m / (y - z))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= 2.35e+166) {
		tmp = x_m / ((y - z) * (t - z));
	} else {
		tmp = (1.0 / t) * (x_m / (y - z));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= 2.35e+166:
		tmp = x_m / ((y - z) * (t - z))
	else:
		tmp = (1.0 / t) * (x_m / (y - z))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= 2.35e+166)
		tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - z)));
	else
		tmp = Float64(Float64(1.0 / t) * Float64(x_m / Float64(y - z)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= 2.35e+166)
		tmp = x_m / ((y - z) * (t - z));
	else
		tmp = (1.0 / t) * (x_m / (y - z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, 2.35e+166], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t), $MachinePrecision] * N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq 2.35 \cdot 10^{+166}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\

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


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

    1. Initial program 90.3%

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

    if 2.35e166 < t

    1. Initial program 69.4%

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

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

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

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

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

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

Alternative 18: 39.4% accurate, 1.8× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \frac{x\_m}{y \cdot t} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t) :precision binary64 (* x_s (/ x_m (* y t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m / (y * t));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * (x_m / (y * t))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
assert x_m < y && y < z && z < t;
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m / (y * t));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
[x_m, y, z, t] = sort([x_m, y, z, t])
def code(x_s, x_m, y, z, t):
	return x_s * (x_m / (y * t))
x\_m = abs(x)
x\_s = copysign(1.0, x)
x_m, y, z, t = sort([x_m, y, z, t])
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(x_m / Float64(y * t)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
x_m, y, z, t = num2cell(sort([x_m, y, z, t])){:}
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * (x_m / (y * t));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \frac{x\_m}{y \cdot t}
\end{array}
Derivation
  1. Initial program 88.2%

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

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

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

Developer target: 87.8% 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 2024110 
(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))))