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

Percentage Accurate: 89.7% → 98.0%
Time: 12.1s
Alternatives: 16
Speedup: 0.5×

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 16 alternatives:

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

Initial Program: 89.7% 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: 98.0% 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 -4 \cdot 10^{-323}:\\ \;\;\;\;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 -4e-323) 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 <= -4e-323) {
		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 <= (-4d-323)) 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 <= -4e-323) {
		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 <= -4e-323:
		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 <= -4e-323)
		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 <= -4e-323)
		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, -4e-323], 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 -4 \cdot 10^{-323}:\\
\;\;\;\;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))) < -3.95253e-323

    1. Initial program 99.8%

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

    if -3.95253e-323 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 90.0%

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

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

      \[\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: 64.3% 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{\frac{x\_m}{y}}{t}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{+266}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{+172}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1 \cdot 10^{+37}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-51}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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) t)))
   (*
    x_s
    (if (<= y -1.12e+266)
      (/ (/ x_m z) (- y))
      (if (<= y -7.5e+172)
        t_1
        (if (<= y -1e+37)
          (/ x_m (* z (- y)))
          (if (<= y 7e-51) (/ x_m (* z (- z t))) t_1)))))))
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) / t;
	double tmp;
	if (y <= -1.12e+266) {
		tmp = (x_m / z) / -y;
	} else if (y <= -7.5e+172) {
		tmp = t_1;
	} else if (y <= -1e+37) {
		tmp = x_m / (z * -y);
	} else if (y <= 7e-51) {
		tmp = x_m / (z * (z - t));
	} else {
		tmp = t_1;
	}
	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) / t
    if (y <= (-1.12d+266)) then
        tmp = (x_m / z) / -y
    else if (y <= (-7.5d+172)) then
        tmp = t_1
    else if (y <= (-1d+37)) then
        tmp = x_m / (z * -y)
    else if (y <= 7d-51) then
        tmp = x_m / (z * (z - t))
    else
        tmp = t_1
    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) / t;
	double tmp;
	if (y <= -1.12e+266) {
		tmp = (x_m / z) / -y;
	} else if (y <= -7.5e+172) {
		tmp = t_1;
	} else if (y <= -1e+37) {
		tmp = x_m / (z * -y);
	} else if (y <= 7e-51) {
		tmp = x_m / (z * (z - t));
	} else {
		tmp = t_1;
	}
	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) / t
	tmp = 0
	if y <= -1.12e+266:
		tmp = (x_m / z) / -y
	elif y <= -7.5e+172:
		tmp = t_1
	elif y <= -1e+37:
		tmp = x_m / (z * -y)
	elif y <= 7e-51:
		tmp = x_m / (z * (z - t))
	else:
		tmp = t_1
	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 / y) / t)
	tmp = 0.0
	if (y <= -1.12e+266)
		tmp = Float64(Float64(x_m / z) / Float64(-y));
	elseif (y <= -7.5e+172)
		tmp = t_1;
	elseif (y <= -1e+37)
		tmp = Float64(x_m / Float64(z * Float64(-y)));
	elseif (y <= 7e-51)
		tmp = Float64(x_m / Float64(z * Float64(z - t)));
	else
		tmp = t_1;
	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) / t;
	tmp = 0.0;
	if (y <= -1.12e+266)
		tmp = (x_m / z) / -y;
	elseif (y <= -7.5e+172)
		tmp = t_1;
	elseif (y <= -1e+37)
		tmp = x_m / (z * -y);
	elseif (y <= 7e-51)
		tmp = x_m / (z * (z - t));
	else
		tmp = t_1;
	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 / y), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -1.12e+266], N[(N[(x$95$m / z), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[y, -7.5e+172], t$95$1, If[LessEqual[y, -1e+37], N[(x$95$m / N[(z * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-51], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]), $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}{y}}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+266}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\

\mathbf{elif}\;y \leq -7.5 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.11999999999999996e266

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.11999999999999996e266 < y < -7.4999999999999994e172 or 6.9999999999999995e-51 < y

    1. Initial program 89.8%

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

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

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

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

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

    if -7.4999999999999994e172 < y < -9.99999999999999954e36

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

    if -9.99999999999999954e36 < y < 6.9999999999999995e-51

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.7% 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{\frac{x\_m}{y}}{t}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -1.18 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-27}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{+136}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{-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) t)))
   (*
    x_s
    (if (<= t -1.18e+27)
      t_1
      (if (<= t 5.2e-27)
        (/ x_m (* z (- z y)))
        (if (<= t 6.6e+136)
          (/ x_m (* z (- z t)))
          (if (<= t 4.6e+154) t_1 (/ (/ x_m t) (- 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) / t;
	double tmp;
	if (t <= -1.18e+27) {
		tmp = t_1;
	} else if (t <= 5.2e-27) {
		tmp = x_m / (z * (z - y));
	} else if (t <= 6.6e+136) {
		tmp = x_m / (z * (z - t));
	} else if (t <= 4.6e+154) {
		tmp = t_1;
	} else {
		tmp = (x_m / t) / -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) / t
    if (t <= (-1.18d+27)) then
        tmp = t_1
    else if (t <= 5.2d-27) then
        tmp = x_m / (z * (z - y))
    else if (t <= 6.6d+136) then
        tmp = x_m / (z * (z - t))
    else if (t <= 4.6d+154) then
        tmp = t_1
    else
        tmp = (x_m / t) / -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) / t;
	double tmp;
	if (t <= -1.18e+27) {
		tmp = t_1;
	} else if (t <= 5.2e-27) {
		tmp = x_m / (z * (z - y));
	} else if (t <= 6.6e+136) {
		tmp = x_m / (z * (z - t));
	} else if (t <= 4.6e+154) {
		tmp = t_1;
	} else {
		tmp = (x_m / t) / -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) / t
	tmp = 0
	if t <= -1.18e+27:
		tmp = t_1
	elif t <= 5.2e-27:
		tmp = x_m / (z * (z - y))
	elif t <= 6.6e+136:
		tmp = x_m / (z * (z - t))
	elif t <= 4.6e+154:
		tmp = t_1
	else:
		tmp = (x_m / t) / -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 / y) / t)
	tmp = 0.0
	if (t <= -1.18e+27)
		tmp = t_1;
	elseif (t <= 5.2e-27)
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	elseif (t <= 6.6e+136)
		tmp = Float64(x_m / Float64(z * Float64(z - t)));
	elseif (t <= 4.6e+154)
		tmp = t_1;
	else
		tmp = Float64(Float64(x_m / t) / Float64(-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) / t;
	tmp = 0.0;
	if (t <= -1.18e+27)
		tmp = t_1;
	elseif (t <= 5.2e-27)
		tmp = x_m / (z * (z - y));
	elseif (t <= 6.6e+136)
		tmp = x_m / (z * (z - t));
	elseif (t <= 4.6e+154)
		tmp = t_1;
	else
		tmp = (x_m / t) / -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 / y), $MachinePrecision] / t), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t, -1.18e+27], t$95$1, If[LessEqual[t, 5.2e-27], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+136], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e+154], t$95$1, N[(N[(x$95$m / t), $MachinePrecision] / (-z)), $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}{y}}{t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -1.18 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;t \leq 4.6 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.18000000000000006e27 or 6.59999999999999984e136 < t < 4.6e154

    1. Initial program 94.4%

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

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

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

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

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

    if -1.18000000000000006e27 < t < 5.20000000000000034e-27

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

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000034e-27 < t < 6.59999999999999984e136

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

    if 4.6e154 < t

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 65.7% 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}{z} \cdot \frac{1}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-88}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+36}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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) (/ 1.0 z))))
   (*
    x_s
    (if (<= z -3e-50)
      t_1
      (if (<= z 1.95e-88)
        (/ (/ x_m y) t)
        (if (<= z 6.6e+36) (/ x_m (* z (- t))) t_1))))))
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) * (1.0 / z);
	double tmp;
	if (z <= -3e-50) {
		tmp = t_1;
	} else if (z <= 1.95e-88) {
		tmp = (x_m / y) / t;
	} else if (z <= 6.6e+36) {
		tmp = x_m / (z * -t);
	} else {
		tmp = t_1;
	}
	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) * (1.0d0 / z)
    if (z <= (-3d-50)) then
        tmp = t_1
    else if (z <= 1.95d-88) then
        tmp = (x_m / y) / t
    else if (z <= 6.6d+36) then
        tmp = x_m / (z * -t)
    else
        tmp = t_1
    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) * (1.0 / z);
	double tmp;
	if (z <= -3e-50) {
		tmp = t_1;
	} else if (z <= 1.95e-88) {
		tmp = (x_m / y) / t;
	} else if (z <= 6.6e+36) {
		tmp = x_m / (z * -t);
	} else {
		tmp = t_1;
	}
	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) * (1.0 / z)
	tmp = 0
	if z <= -3e-50:
		tmp = t_1
	elif z <= 1.95e-88:
		tmp = (x_m / y) / t
	elif z <= 6.6e+36:
		tmp = x_m / (z * -t)
	else:
		tmp = t_1
	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 / z) * Float64(1.0 / z))
	tmp = 0.0
	if (z <= -3e-50)
		tmp = t_1;
	elseif (z <= 1.95e-88)
		tmp = Float64(Float64(x_m / y) / t);
	elseif (z <= 6.6e+36)
		tmp = Float64(x_m / Float64(z * Float64(-t)));
	else
		tmp = t_1;
	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) * (1.0 / z);
	tmp = 0.0;
	if (z <= -3e-50)
		tmp = t_1;
	elseif (z <= 1.95e-88)
		tmp = (x_m / y) / t;
	elseif (z <= 6.6e+36)
		tmp = x_m / (z * -t);
	else
		tmp = t_1;
	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 / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3e-50], t$95$1, If[LessEqual[z, 1.95e-88], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 6.6e+36], N[(x$95$m / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $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 \frac{1}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9999999999999999e-50 or 6.5999999999999997e36 < z

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e-50 < z < 1.94999999999999996e-88

    1. Initial program 96.7%

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

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

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

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

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

    if 1.94999999999999996e-88 < z < 6.5999999999999997e36

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 62.3% 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}{z \cdot z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.08 \cdot 10^{-47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 10^{-88}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+37}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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))))
   (*
    x_s
    (if (<= z -1.08e-47)
      t_1
      (if (<= z 1e-88)
        (/ (/ x_m y) t)
        (if (<= z 5e+37) (/ x_m (* z (- t))) t_1))))))
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);
	double tmp;
	if (z <= -1.08e-47) {
		tmp = t_1;
	} else if (z <= 1e-88) {
		tmp = (x_m / y) / t;
	} else if (z <= 5e+37) {
		tmp = x_m / (z * -t);
	} else {
		tmp = t_1;
	}
	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)
    if (z <= (-1.08d-47)) then
        tmp = t_1
    else if (z <= 1d-88) then
        tmp = (x_m / y) / t
    else if (z <= 5d+37) then
        tmp = x_m / (z * -t)
    else
        tmp = t_1
    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);
	double tmp;
	if (z <= -1.08e-47) {
		tmp = t_1;
	} else if (z <= 1e-88) {
		tmp = (x_m / y) / t;
	} else if (z <= 5e+37) {
		tmp = x_m / (z * -t);
	} else {
		tmp = t_1;
	}
	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)
	tmp = 0
	if z <= -1.08e-47:
		tmp = t_1
	elif z <= 1e-88:
		tmp = (x_m / y) / t
	elif z <= 5e+37:
		tmp = x_m / (z * -t)
	else:
		tmp = t_1
	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 * z))
	tmp = 0.0
	if (z <= -1.08e-47)
		tmp = t_1;
	elseif (z <= 1e-88)
		tmp = Float64(Float64(x_m / y) / t);
	elseif (z <= 5e+37)
		tmp = Float64(x_m / Float64(z * Float64(-t)));
	else
		tmp = t_1;
	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);
	tmp = 0.0;
	if (z <= -1.08e-47)
		tmp = t_1;
	elseif (z <= 1e-88)
		tmp = (x_m / y) / t;
	elseif (z <= 5e+37)
		tmp = x_m / (z * -t);
	else
		tmp = t_1;
	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 * z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.08e-47], t$95$1, If[LessEqual[z, 1e-88], N[(N[(x$95$m / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5e+37], N[(x$95$m / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $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 z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.08000000000000005e-47 or 4.99999999999999989e37 < z

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.08000000000000005e-47 < z < 9.99999999999999934e-89

    1. Initial program 96.7%

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

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

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

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

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

    if 9.99999999999999934e-89 < z < 4.99999999999999989e37

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 93.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 -6 \cdot 10^{+86} \lor \neg \left(z \leq 2 \cdot 10^{+140}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\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 (<= z -6e+86) (not (<= z 2e+140)))
    (/ (/ x_m z) (- z t))
    (/ x_m (* (- y z) (- t 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 ((z <= -6e+86) || !(z <= 2e+140)) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = x_m / ((y - z) * (t - 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 ((z <= (-6d+86)) .or. (.not. (z <= 2d+140))) then
        tmp = (x_m / z) / (z - t)
    else
        tmp = x_m / ((y - z) * (t - 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 ((z <= -6e+86) || !(z <= 2e+140)) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = x_m / ((y - z) * (t - 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 (z <= -6e+86) or not (z <= 2e+140):
		tmp = (x_m / z) / (z - t)
	else:
		tmp = x_m / ((y - z) * (t - 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 ((z <= -6e+86) || !(z <= 2e+140))
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	else
		tmp = Float64(x_m / Float64(Float64(y - z) * Float64(t - 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 ((z <= -6e+86) || ~((z <= 2e+140)))
		tmp = (x_m / z) / (z - t);
	else
		tmp = x_m / ((y - z) * (t - 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[Or[LessEqual[z, -6e+86], N[Not[LessEqual[z, 2e+140]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - 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}\;z \leq -6 \cdot 10^{+86} \lor \neg \left(z \leq 2 \cdot 10^{+140}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.99999999999999954e86 or 2.00000000000000012e140 < z

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

    if -5.99999999999999954e86 < z < 2.00000000000000012e140

    1. Initial program 97.6%

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

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

Alternative 7: 80.7% 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 -9.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z - t}{x\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y - z}}{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 (<= y -9.5e-78)
    (/ x_m (* y (- t z)))
    (if (<= y 4.5e-65) (/ 1.0 (* z (/ (- z t) x_m))) (/ (/ x_m (- y z)) 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 (y <= -9.5e-78) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 4.5e-65) {
		tmp = 1.0 / (z * ((z - t) / x_m));
	} else {
		tmp = (x_m / (y - z)) / 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 (y <= (-9.5d-78)) then
        tmp = x_m / (y * (t - z))
    else if (y <= 4.5d-65) then
        tmp = 1.0d0 / (z * ((z - t) / x_m))
    else
        tmp = (x_m / (y - z)) / 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 (y <= -9.5e-78) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 4.5e-65) {
		tmp = 1.0 / (z * ((z - t) / x_m));
	} else {
		tmp = (x_m / (y - z)) / 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 y <= -9.5e-78:
		tmp = x_m / (y * (t - z))
	elif y <= 4.5e-65:
		tmp = 1.0 / (z * ((z - t) / x_m))
	else:
		tmp = (x_m / (y - z)) / 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 (y <= -9.5e-78)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= 4.5e-65)
		tmp = Float64(1.0 / Float64(z * Float64(Float64(z - t) / x_m)));
	else
		tmp = Float64(Float64(x_m / Float64(y - z)) / 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 (y <= -9.5e-78)
		tmp = x_m / (y * (t - z));
	elseif (y <= 4.5e-65)
		tmp = 1.0 / (z * ((z - t) / x_m));
	else
		tmp = (x_m / (y - z)) / 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[LessEqual[y, -9.5e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-65], N[(1.0 / N[(z * N[(N[(z - t), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $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}\;y \leq -9.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 93.4%

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

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

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

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

    if -9.4999999999999997e-78 < y < 4.4999999999999998e-65

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999998e-65 < y

    1. Initial program 91.1%

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

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

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

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

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

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

Alternative 8: 80.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 -9.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{-92}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{y - z}}{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 (<= y -9.5e-78)
    (/ x_m (* y (- t z)))
    (if (<= y 1.16e-92) (/ (/ x_m z) (- z t)) (/ (/ x_m (- y z)) 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 (y <= -9.5e-78) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 1.16e-92) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / (y - z)) / 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 (y <= (-9.5d-78)) then
        tmp = x_m / (y * (t - z))
    else if (y <= 1.16d-92) then
        tmp = (x_m / z) / (z - t)
    else
        tmp = (x_m / (y - z)) / 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 (y <= -9.5e-78) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 1.16e-92) {
		tmp = (x_m / z) / (z - t);
	} else {
		tmp = (x_m / (y - z)) / 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 y <= -9.5e-78:
		tmp = x_m / (y * (t - z))
	elif y <= 1.16e-92:
		tmp = (x_m / z) / (z - t)
	else:
		tmp = (x_m / (y - z)) / 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 (y <= -9.5e-78)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= 1.16e-92)
		tmp = Float64(Float64(x_m / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x_m / Float64(y - z)) / 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 (y <= -9.5e-78)
		tmp = x_m / (y * (t - z));
	elseif (y <= 1.16e-92)
		tmp = (x_m / z) / (z - t);
	else
		tmp = (x_m / (y - z)) / 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[LessEqual[y, -9.5e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e-92], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(y - z), $MachinePrecision]), $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}\;y \leq -9.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 93.4%

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

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

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

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

    if -9.4999999999999997e-78 < y < 1.1599999999999999e-92

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

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

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

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

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

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

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

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

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

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

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

    if 1.1599999999999999e-92 < y

    1. Initial program 90.7%

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

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

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

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

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

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

Alternative 9: 80.9% 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 -8.2 \cdot 10^{-78}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-91}:\\ \;\;\;\;\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 -8.2e-78)
    (/ x_m (* y (- t z)))
    (if (<= y 2.05e-91) (/ (/ 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 <= -8.2e-78) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 2.05e-91) {
		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 <= (-8.2d-78)) then
        tmp = x_m / (y * (t - z))
    else if (y <= 2.05d-91) 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 <= -8.2e-78) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 2.05e-91) {
		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 <= -8.2e-78:
		tmp = x_m / (y * (t - z))
	elif y <= 2.05e-91:
		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 <= -8.2e-78)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= 2.05e-91)
		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 <= -8.2e-78)
		tmp = x_m / (y * (t - z));
	elseif (y <= 2.05e-91)
		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, -8.2e-78], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-91], 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 -8.2 \cdot 10^{-78}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{-91}:\\
\;\;\;\;\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 < -8.1999999999999996e-78

    1. Initial program 93.4%

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

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

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

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

    if -8.1999999999999996e-78 < y < 2.05000000000000012e-91

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

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

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

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

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

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

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

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

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

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

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

    if 2.05000000000000012e-91 < y

    1. Initial program 90.7%

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

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

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

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

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

Alternative 10: 79.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}\;t \leq -1.35 \cdot 10^{-104}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-22}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\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 (<= t -1.35e-104)
    (/ x_m (* y (- t z)))
    (if (<= t 7e-22) (/ x_m (* z (- z y))) (/ (/ 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 (t <= -1.35e-104) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 7e-22) {
		tmp = x_m / (z * (z - y));
	} 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 (t <= (-1.35d-104)) then
        tmp = x_m / (y * (t - z))
    else if (t <= 7d-22) then
        tmp = x_m / (z * (z - y))
    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 (t <= -1.35e-104) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 7e-22) {
		tmp = x_m / (z * (z - y));
	} 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 t <= -1.35e-104:
		tmp = x_m / (y * (t - z))
	elif t <= 7e-22:
		tmp = x_m / (z * (z - y))
	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 (t <= -1.35e-104)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (t <= 7e-22)
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	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 (t <= -1.35e-104)
		tmp = x_m / (y * (t - z));
	elseif (t <= 7e-22)
		tmp = x_m / (z * (z - y));
	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[t, -1.35e-104], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7e-22], N[(x$95$m / N[(z * N[(z - y), $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}\;t \leq -1.35 \cdot 10^{-104}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 95.4%

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

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

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

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

    if -1.3499999999999999e-104 < t < 7.00000000000000011e-22

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

    if 7.00000000000000011e-22 < t

    1. Initial program 86.9%

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

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

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

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

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

Alternative 11: 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}\;t \leq -1.1 \cdot 10^{-103}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \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 (<= t -1.1e-103)
    (/ x_m (* y (- t z)))
    (if (<= t 7.8e-22) (/ x_m (* z (- z y))) (/ x_m (* (- y z) 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 (t <= -1.1e-103) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 7.8e-22) {
		tmp = x_m / (z * (z - y));
	} else {
		tmp = x_m / ((y - z) * 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 (t <= (-1.1d-103)) then
        tmp = x_m / (y * (t - z))
    else if (t <= 7.8d-22) then
        tmp = x_m / (z * (z - y))
    else
        tmp = x_m / ((y - z) * 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 (t <= -1.1e-103) {
		tmp = x_m / (y * (t - z));
	} else if (t <= 7.8e-22) {
		tmp = x_m / (z * (z - y));
	} else {
		tmp = x_m / ((y - z) * 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 t <= -1.1e-103:
		tmp = x_m / (y * (t - z))
	elif t <= 7.8e-22:
		tmp = x_m / (z * (z - y))
	else:
		tmp = x_m / ((y - z) * 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 (t <= -1.1e-103)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (t <= 7.8e-22)
		tmp = Float64(x_m / Float64(z * Float64(z - y)));
	else
		tmp = Float64(x_m / Float64(Float64(y - z) * 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 (t <= -1.1e-103)
		tmp = x_m / (y * (t - z));
	elseif (t <= 7.8e-22)
		tmp = x_m / (z * (z - y));
	else
		tmp = x_m / ((y - z) * 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[LessEqual[t, -1.1e-103], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e-22], N[(x$95$m / N[(z * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * 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}\;t \leq -1.1 \cdot 10^{-103}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 95.4%

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

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

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

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

    if -1.1e-103 < t < 7.79999999999999996e-22

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

    if 7.79999999999999996e-22 < t

    1. Initial program 86.9%

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

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

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

Alternative 12: 76.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 -3.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-51}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \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 (<= y -3.5e-80)
    (/ x_m (* y (- t z)))
    (if (<= y 9.2e-51) (/ x_m (* z (- z t))) (/ (/ 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 (y <= -3.5e-80) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 9.2e-51) {
		tmp = x_m / (z * (z - t));
	} 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 (y <= (-3.5d-80)) then
        tmp = x_m / (y * (t - z))
    else if (y <= 9.2d-51) then
        tmp = x_m / (z * (z - t))
    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 (y <= -3.5e-80) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 9.2e-51) {
		tmp = x_m / (z * (z - t));
	} 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 y <= -3.5e-80:
		tmp = x_m / (y * (t - z))
	elif y <= 9.2e-51:
		tmp = x_m / (z * (z - t))
	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 (y <= -3.5e-80)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= 9.2e-51)
		tmp = Float64(x_m / Float64(z * Float64(z - t)));
	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 (y <= -3.5e-80)
		tmp = x_m / (y * (t - z));
	elseif (y <= 9.2e-51)
		tmp = x_m / (z * (z - t));
	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[LessEqual[y, -3.5e-80], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-51], N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $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}\;y \leq -3.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

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


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

    1. Initial program 93.4%

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

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

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

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

    if -3.50000000000000015e-80 < y < 9.20000000000000007e-51

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

    if 9.20000000000000007e-51 < y

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-51}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \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 -7.8 \cdot 10^{-48} \lor \neg \left(z \leq 1.3 \cdot 10^{+79}\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 -7.8e-48) (not (<= z 1.3e+79)))
    (/ 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 <= -7.8e-48) || !(z <= 1.3e+79)) {
		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 <= (-7.8d-48)) .or. (.not. (z <= 1.3d+79))) 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 <= -7.8e-48) || !(z <= 1.3e+79)) {
		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 <= -7.8e-48) or not (z <= 1.3e+79):
		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 <= -7.8e-48) || !(z <= 1.3e+79))
		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 <= -7.8e-48) || ~((z <= 1.3e+79)))
		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, -7.8e-48], N[Not[LessEqual[z, 1.3e+79]], $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 -7.8 \cdot 10^{-48} \lor \neg \left(z \leq 1.3 \cdot 10^{+79}\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 < -7.800000000000001e-48 or 1.30000000000000007e79 < z

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

    if -7.800000000000001e-48 < z < 1.30000000000000007e79

    1. Initial program 97.6%

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

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

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

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

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

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

Alternative 14: 61.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 -1.05 \cdot 10^{-47} \lor \neg \left(z \leq 2.4 \cdot 10^{-72}\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 -1.05e-47) (not (<= z 2.4e-72)))
    (/ 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 <= -1.05e-47) || !(z <= 2.4e-72)) {
		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 <= (-1.05d-47)) .or. (.not. (z <= 2.4d-72))) 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 <= -1.05e-47) || !(z <= 2.4e-72)) {
		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 <= -1.05e-47) or not (z <= 2.4e-72):
		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 <= -1.05e-47) || !(z <= 2.4e-72))
		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 <= -1.05e-47) || ~((z <= 2.4e-72)))
		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, -1.05e-47], N[Not[LessEqual[z, 2.4e-72]], $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 -1.05 \cdot 10^{-47} \lor \neg \left(z \leq 2.4 \cdot 10^{-72}\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 < -1.05e-47 or 2.4e-72 < z

    1. Initial program 90.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e-47 < z < 2.4e-72

    1. Initial program 96.8%

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

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

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

Alternative 15: 45.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 -6.8 \cdot 10^{-44} \lor \neg \left(z \leq 1.25 \cdot 10^{+68}\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 -6.8e-44) (not (<= z 1.25e+68)))
    (/ 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 <= -6.8e-44) || !(z <= 1.25e+68)) {
		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 <= (-6.8d-44)) .or. (.not. (z <= 1.25d+68))) 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 <= -6.8e-44) || !(z <= 1.25e+68)) {
		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 <= -6.8e-44) or not (z <= 1.25e+68):
		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 <= -6.8e-44) || !(z <= 1.25e+68))
		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 <= -6.8e-44) || ~((z <= 1.25e+68)))
		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, -6.8e-44], N[Not[LessEqual[z, 1.25e+68]], $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 -6.8 \cdot 10^{-44} \lor \neg \left(z \leq 1.25 \cdot 10^{+68}\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 < -6.80000000000000033e-44 or 1.2500000000000001e68 < z

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-y}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt19.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000033e-44 < z < 1.2500000000000001e68

    1. Initial program 97.5%

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

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

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

Alternative 16: 40.5% 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 92.7%

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

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

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

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

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

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