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

Percentage Accurate: 89.5% → 97.8%
Time: 10.5s
Alternatives: 22
Speedup: 0.4×

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 22 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 97.8% 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 0:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\ \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 z) (- t z)))))
   (* x_s (if (<= t_1 0.0) (/ (/ x_m (- t z)) (- y z)) 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 - z) * (t - z));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = (x_m / (t - z)) / (y - z);
	} 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 - z) * (t - z))
    if (t_1 <= 0.0d0) then
        tmp = (x_m / (t - z)) / (y - z)
    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 - z) * (t - z));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = (x_m / (t - z)) / (y - z);
	} 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 - z) * (t - z))
	tmp = 0
	if t_1 <= 0.0:
		tmp = (x_m / (t - z)) / (y - z)
	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(Float64(y - z) * Float64(t - z)))
	tmp = 0.0
	if (t_1 <= 0.0)
		tmp = Float64(Float64(x_m / Float64(t - z)) / Float64(y - z));
	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 - z) * (t - z));
	tmp = 0.0;
	if (t_1 <= 0.0)
		tmp = (x_m / (t - z)) / (y - z);
	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[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, 0.0], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(y - z), $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}{\left(y - z\right) \cdot \left(t - z\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y - z}\\

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


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

    1. Initial program 79.4%

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

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

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

    if 0.0 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 98.4%

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

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

Alternative 2: 49.5% 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])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+106}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{y}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-42}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(-z\right)}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(-t\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 (<= z -4.5e+106)
    (/ (/ x_m z) y)
    (if (<= z -2.5e-42)
      (/ x_m (* y (- z)))
      (if (<= z 2.2e+18) (/ (/ x_m t) y) (/ x_m (* 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 (z <= -4.5e+106) {
		tmp = (x_m / z) / y;
	} else if (z <= -2.5e-42) {
		tmp = x_m / (y * -z);
	} else if (z <= 2.2e+18) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 (z <= (-4.5d+106)) then
        tmp = (x_m / z) / y
    else if (z <= (-2.5d-42)) then
        tmp = x_m / (y * -z)
    else if (z <= 2.2d+18) then
        tmp = (x_m / t) / y
    else
        tmp = x_m / (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 (z <= -4.5e+106) {
		tmp = (x_m / z) / y;
	} else if (z <= -2.5e-42) {
		tmp = x_m / (y * -z);
	} else if (z <= 2.2e+18) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 z <= -4.5e+106:
		tmp = (x_m / z) / y
	elif z <= -2.5e-42:
		tmp = x_m / (y * -z)
	elif z <= 2.2e+18:
		tmp = (x_m / t) / y
	else:
		tmp = x_m / (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 (z <= -4.5e+106)
		tmp = Float64(Float64(x_m / z) / y);
	elseif (z <= -2.5e-42)
		tmp = Float64(x_m / Float64(y * Float64(-z)));
	elseif (z <= 2.2e+18)
		tmp = Float64(Float64(x_m / t) / y);
	else
		tmp = Float64(x_m / Float64(z * Float64(-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 <= -4.5e+106)
		tmp = (x_m / z) / y;
	elseif (z <= -2.5e-42)
		tmp = x_m / (y * -z);
	elseif (z <= 2.2e+18)
		tmp = (x_m / t) / y;
	else
		tmp = x_m / (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[z, -4.5e+106], N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, -2.5e-42], N[(x$95$m / N[(y * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+18], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * (-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 -4.5 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{y}\\

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

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

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


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

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot y} \]
      3. add-sqr-sqrt17.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y}} \]
    10. Applied egg-rr40.2%

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

    if -4.4999999999999997e106 < z < -2.50000000000000001e-42

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

    if -2.50000000000000001e-42 < z < 2.2e18

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2e18 < z

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 49.6% 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])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+106}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{y}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-45}:\\ \;\;\;\;\frac{\frac{x\_m}{-y}}{z}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(-t\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 (<= z -2.6e+106)
    (/ (/ x_m z) y)
    (if (<= z -1.1e-45)
      (/ (/ x_m (- y)) z)
      (if (<= z 1.55e+18) (/ (/ x_m t) y) (/ x_m (* 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 (z <= -2.6e+106) {
		tmp = (x_m / z) / y;
	} else if (z <= -1.1e-45) {
		tmp = (x_m / -y) / z;
	} else if (z <= 1.55e+18) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 (z <= (-2.6d+106)) then
        tmp = (x_m / z) / y
    else if (z <= (-1.1d-45)) then
        tmp = (x_m / -y) / z
    else if (z <= 1.55d+18) then
        tmp = (x_m / t) / y
    else
        tmp = x_m / (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 (z <= -2.6e+106) {
		tmp = (x_m / z) / y;
	} else if (z <= -1.1e-45) {
		tmp = (x_m / -y) / z;
	} else if (z <= 1.55e+18) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 z <= -2.6e+106:
		tmp = (x_m / z) / y
	elif z <= -1.1e-45:
		tmp = (x_m / -y) / z
	elif z <= 1.55e+18:
		tmp = (x_m / t) / y
	else:
		tmp = x_m / (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 (z <= -2.6e+106)
		tmp = Float64(Float64(x_m / z) / y);
	elseif (z <= -1.1e-45)
		tmp = Float64(Float64(x_m / Float64(-y)) / z);
	elseif (z <= 1.55e+18)
		tmp = Float64(Float64(x_m / t) / y);
	else
		tmp = Float64(x_m / Float64(z * Float64(-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 <= -2.6e+106)
		tmp = (x_m / z) / y;
	elseif (z <= -1.1e-45)
		tmp = (x_m / -y) / z;
	elseif (z <= 1.55e+18)
		tmp = (x_m / t) / y;
	else
		tmp = x_m / (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[z, -2.6e+106], N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, -1.1e-45], N[(N[(x$95$m / (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.55e+18], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * (-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 -2.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{y}\\

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


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

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot y} \]
      3. add-sqr-sqrt17.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{y}} \]
    10. Applied egg-rr40.2%

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

    if -2.6000000000000002e106 < z < -1.09999999999999997e-45

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999997e-45 < z < 1.55e18

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.55e18 < z

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.5% 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{\frac{x\_m}{z}}{-z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x\_m}{-y}}{z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \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 -6.8e+102)
      t_1
      (if (<= z -2.7e-44)
        (/ (/ x_m (- y)) z)
        (if (<= z 3e+66) (/ (/ x_m t) y) 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 <= -6.8e+102) {
		tmp = t_1;
	} else if (z <= -2.7e-44) {
		tmp = (x_m / -y) / z;
	} else if (z <= 3e+66) {
		tmp = (x_m / t) / y;
	} 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 <= (-6.8d+102)) then
        tmp = t_1
    else if (z <= (-2.7d-44)) then
        tmp = (x_m / -y) / z
    else if (z <= 3d+66) then
        tmp = (x_m / t) / y
    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 <= -6.8e+102) {
		tmp = t_1;
	} else if (z <= -2.7e-44) {
		tmp = (x_m / -y) / z;
	} else if (z <= 3e+66) {
		tmp = (x_m / t) / y;
	} 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 <= -6.8e+102:
		tmp = t_1
	elif z <= -2.7e-44:
		tmp = (x_m / -y) / z
	elif z <= 3e+66:
		tmp = (x_m / t) / y
	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(-z))
	tmp = 0.0
	if (z <= -6.8e+102)
		tmp = t_1;
	elseif (z <= -2.7e-44)
		tmp = Float64(Float64(x_m / Float64(-y)) / z);
	elseif (z <= 3e+66)
		tmp = Float64(Float64(x_m / t) / y);
	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 <= -6.8e+102)
		tmp = t_1;
	elseif (z <= -2.7e-44)
		tmp = (x_m / -y) / z;
	elseif (z <= 3e+66)
		tmp = (x_m / t) / y;
	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] / (-z)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -6.8e+102], t$95$1, If[LessEqual[z, -2.7e-44], N[(N[(x$95$m / (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3e+66], N[(N[(x$95$m / t), $MachinePrecision] / y), $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}{z}}{-z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.8000000000000001e102 or 3.00000000000000002e66 < z

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity59.0%

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

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

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

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

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

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

    if -6.8000000000000001e102 < z < -2.6999999999999999e-44

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6999999999999999e-44 < z < 3.00000000000000002e66

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+102}:\\ \;\;\;\;\frac{\frac{x}{z}}{-z}\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x}{-y}}{z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{-z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 57.6% 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{\frac{x\_m}{z}}{-z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-43}:\\ \;\;\;\;\frac{-1}{z \cdot \frac{y}{x\_m}}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+69}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \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 -7.5e+102)
      t_1
      (if (<= z -4.2e-43)
        (/ -1.0 (* z (/ y x_m)))
        (if (<= z 1.3e+69) (/ (/ x_m t) y) 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 <= -7.5e+102) {
		tmp = t_1;
	} else if (z <= -4.2e-43) {
		tmp = -1.0 / (z * (y / x_m));
	} else if (z <= 1.3e+69) {
		tmp = (x_m / t) / y;
	} 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 <= (-7.5d+102)) then
        tmp = t_1
    else if (z <= (-4.2d-43)) then
        tmp = (-1.0d0) / (z * (y / x_m))
    else if (z <= 1.3d+69) then
        tmp = (x_m / t) / y
    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 <= -7.5e+102) {
		tmp = t_1;
	} else if (z <= -4.2e-43) {
		tmp = -1.0 / (z * (y / x_m));
	} else if (z <= 1.3e+69) {
		tmp = (x_m / t) / y;
	} 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 <= -7.5e+102:
		tmp = t_1
	elif z <= -4.2e-43:
		tmp = -1.0 / (z * (y / x_m))
	elif z <= 1.3e+69:
		tmp = (x_m / t) / y
	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(-z))
	tmp = 0.0
	if (z <= -7.5e+102)
		tmp = t_1;
	elseif (z <= -4.2e-43)
		tmp = Float64(-1.0 / Float64(z * Float64(y / x_m)));
	elseif (z <= 1.3e+69)
		tmp = Float64(Float64(x_m / t) / y);
	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 <= -7.5e+102)
		tmp = t_1;
	elseif (z <= -4.2e-43)
		tmp = -1.0 / (z * (y / x_m));
	elseif (z <= 1.3e+69)
		tmp = (x_m / t) / y;
	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] / (-z)), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -7.5e+102], t$95$1, If[LessEqual[z, -4.2e-43], N[(-1.0 / N[(z * N[(y / x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+69], N[(N[(x$95$m / t), $MachinePrecision] / y), $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}{z}}{-z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{-1}{z \cdot \frac{y}{x\_m}}\\

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.5e102 or 1.3000000000000001e69 < z

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity59.0%

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

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

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

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

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

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

    if -7.5e102 < z < -4.2000000000000001e-43

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000001e-43 < z < 1.3000000000000001e69

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+102}:\\ \;\;\;\;\frac{\frac{x}{z}}{-z}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-43}:\\ \;\;\;\;\frac{-1}{z \cdot \frac{y}{x}}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+69}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{-z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 92.4% accurate, 0.4× speedup?

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

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


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

    1. Initial program 95.1%

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

    if 4.9999999999999997e304 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 58.5%

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

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

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

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

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

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

Alternative 7: 92.4% accurate, 0.4× speedup?

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

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


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

    1. Initial program 95.1%

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

    if 4.9999999999999997e304 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 82.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 88.9%

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

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

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

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

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

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

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

    if -1.54999999999999992e-44 < y < 1.52000000000000008e-81

    1. Initial program 83.0%

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

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

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

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

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

    if 1.52000000000000008e-81 < y

    1. Initial program 84.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{-81}:\\ \;\;\;\;\frac{x}{t - z} \cdot \frac{-1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.4% 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 -4.9 \cdot 10^{-67}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{-161}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\ \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 -4.9e-67)
    (/ (/ x_m t) y)
    (if (<= t 4.3e-161) (/ (/ x_m 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 <= -4.9e-67) {
		tmp = (x_m / t) / y;
	} else if (t <= 4.3e-161) {
		tmp = (x_m / 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 <= (-4.9d-67)) then
        tmp = (x_m / t) / y
    else if (t <= 4.3d-161) then
        tmp = (x_m / 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 <= -4.9e-67) {
		tmp = (x_m / t) / y;
	} else if (t <= 4.3e-161) {
		tmp = (x_m / 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 <= -4.9e-67:
		tmp = (x_m / t) / y
	elif t <= 4.3e-161:
		tmp = (x_m / 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 <= -4.9e-67)
		tmp = Float64(Float64(x_m / t) / y);
	elseif (t <= 4.3e-161)
		tmp = Float64(Float64(x_m / z) / Float64(-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 <= -4.9e-67)
		tmp = (x_m / t) / y;
	elseif (t <= 4.3e-161)
		tmp = (x_m / 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, -4.9e-67], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 4.3e-161], N[(N[(x$95$m / z), $MachinePrecision] / (-y)), $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 -4.9 \cdot 10^{-67}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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

\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 < -4.89999999999999993e-67

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.89999999999999993e-67 < t < 4.29999999999999967e-161

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.29999999999999967e-161 < t

    1. Initial program 77.2%

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

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

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

Alternative 10: 80.0% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 89.0%

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

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

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

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

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

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

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

    if -1.22000000000000007e-45 < y < 1.95000000000000001e-220

    1. Initial program 82.3%

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

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

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

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

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

    if 1.95000000000000001e-220 < y

    1. Initial program 84.2%

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

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

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

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

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

Alternative 11: 82.5% accurate, 0.5× speedup?

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

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-118}:\\
\;\;\;\;\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 < -2.59999999999999987e-45

    1. Initial program 88.9%

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

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

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

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

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

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

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

    if -2.59999999999999987e-45 < y < 3.3e-118

    1. Initial program 83.3%

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

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

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

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

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

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

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

    if 3.3e-118 < y

    1. Initial program 83.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-45}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-118}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 49.7% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{-93} \lor \neg \left(y \leq 1.5 \cdot 10^{-81}\right):\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(-t\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 (<= y -1.55e-93) (not (<= y 1.5e-81)))
    (/ (/ x_m t) y)
    (/ x_m (* 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 <= -1.55e-93) || !(y <= 1.5e-81)) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 <= (-1.55d-93)) .or. (.not. (y <= 1.5d-81))) then
        tmp = (x_m / t) / y
    else
        tmp = x_m / (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 <= -1.55e-93) || !(y <= 1.5e-81)) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 <= -1.55e-93) or not (y <= 1.5e-81):
		tmp = (x_m / t) / y
	else:
		tmp = x_m / (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 <= -1.55e-93) || !(y <= 1.5e-81))
		tmp = Float64(Float64(x_m / t) / y);
	else
		tmp = Float64(x_m / Float64(z * Float64(-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 <= -1.55e-93) || ~((y <= 1.5e-81)))
		tmp = (x_m / t) / y;
	else
		tmp = x_m / (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[Or[LessEqual[y, -1.55e-93], N[Not[LessEqual[y, 1.5e-81]], $MachinePrecision]], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * (-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}\;y \leq -1.55 \cdot 10^{-93} \lor \neg \left(y \leq 1.5 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.55e-93 or 1.4999999999999999e-81 < y

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55e-93 < y < 1.4999999999999999e-81

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 50.5% 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 -2.2 \cdot 10^{-42}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(-t\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 (<= z -2.2e-42)
    (/ (/ x_m z) (- y))
    (if (<= z 2.5e+18) (/ (/ x_m t) y) (/ x_m (* 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 (z <= -2.2e-42) {
		tmp = (x_m / z) / -y;
	} else if (z <= 2.5e+18) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 (z <= (-2.2d-42)) then
        tmp = (x_m / z) / -y
    else if (z <= 2.5d+18) then
        tmp = (x_m / t) / y
    else
        tmp = x_m / (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 (z <= -2.2e-42) {
		tmp = (x_m / z) / -y;
	} else if (z <= 2.5e+18) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 z <= -2.2e-42:
		tmp = (x_m / z) / -y
	elif z <= 2.5e+18:
		tmp = (x_m / t) / y
	else:
		tmp = x_m / (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 (z <= -2.2e-42)
		tmp = Float64(Float64(x_m / z) / Float64(-y));
	elseif (z <= 2.5e+18)
		tmp = Float64(Float64(x_m / t) / y);
	else
		tmp = Float64(x_m / Float64(z * Float64(-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 <= -2.2e-42)
		tmp = (x_m / z) / -y;
	elseif (z <= 2.5e+18)
		tmp = (x_m / t) / y;
	else
		tmp = x_m / (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[z, -2.2e-42], N[(N[(x$95$m / z), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[z, 2.5e+18], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * (-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 -2.2 \cdot 10^{-42}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{-y}\\

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

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


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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000005e-42 < z < 2.5e18

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5e18 < z

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.59999999999999958e102 or 5.49999999999999986e70 < z

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity59.0%

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Step-by-step derivation
      1. *-commutative31.2%

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

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

    if -7.59999999999999958e102 < z < 5.49999999999999986e70

    1. Initial program 93.2%

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

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

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

Alternative 15: 45.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 -2.4 \cdot 10^{-11}:\\ \;\;\;\;\frac{x\_m}{y \cdot z}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{x\_m}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \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 (<= z -2.4e-11)
    (/ x_m (* y z))
    (if (<= z 5.5e+69) (/ x_m (* y t)) (/ x_m (* 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 (z <= -2.4e-11) {
		tmp = x_m / (y * z);
	} else if (z <= 5.5e+69) {
		tmp = x_m / (y * t);
	} else {
		tmp = x_m / (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 (z <= (-2.4d-11)) then
        tmp = x_m / (y * z)
    else if (z <= 5.5d+69) then
        tmp = x_m / (y * t)
    else
        tmp = x_m / (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 (z <= -2.4e-11) {
		tmp = x_m / (y * z);
	} else if (z <= 5.5e+69) {
		tmp = x_m / (y * t);
	} else {
		tmp = x_m / (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 z <= -2.4e-11:
		tmp = x_m / (y * z)
	elif z <= 5.5e+69:
		tmp = x_m / (y * t)
	else:
		tmp = x_m / (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 (z <= -2.4e-11)
		tmp = Float64(x_m / Float64(y * z));
	elseif (z <= 5.5e+69)
		tmp = Float64(x_m / Float64(y * t));
	else
		tmp = Float64(x_m / Float64(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 (z <= -2.4e-11)
		tmp = x_m / (y * z);
	elseif (z <= 5.5e+69)
		tmp = x_m / (y * t);
	else
		tmp = x_m / (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[z, -2.4e-11], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+69], N[(x$95$m / N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * 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 -2.4 \cdot 10^{-11}:\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\

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


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

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot y} \]
      3. add-sqr-sqrt16.2%

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

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

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

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

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

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

    if -2.4000000000000001e-11 < z < 5.50000000000000002e69

    1. Initial program 93.5%

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

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

    if 5.50000000000000002e69 < z

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity59.8%

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Step-by-step derivation
      1. *-commutative41.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 48.0% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+124}:\\ \;\;\;\;\frac{x\_m}{y \cdot z}\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{+116}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \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 (<= z -2.1e+124)
    (/ x_m (* y z))
    (if (<= z 5.3e+116) (/ (/ x_m t) y) (/ x_m (* 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 (z <= -2.1e+124) {
		tmp = x_m / (y * z);
	} else if (z <= 5.3e+116) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 (z <= (-2.1d+124)) then
        tmp = x_m / (y * z)
    else if (z <= 5.3d+116) then
        tmp = (x_m / t) / y
    else
        tmp = x_m / (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 (z <= -2.1e+124) {
		tmp = x_m / (y * z);
	} else if (z <= 5.3e+116) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 z <= -2.1e+124:
		tmp = x_m / (y * z)
	elif z <= 5.3e+116:
		tmp = (x_m / t) / y
	else:
		tmp = x_m / (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 (z <= -2.1e+124)
		tmp = Float64(x_m / Float64(y * z));
	elseif (z <= 5.3e+116)
		tmp = Float64(Float64(x_m / t) / y);
	else
		tmp = Float64(x_m / Float64(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 (z <= -2.1e+124)
		tmp = x_m / (y * z);
	elseif (z <= 5.3e+116)
		tmp = (x_m / t) / y;
	else
		tmp = x_m / (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[z, -2.1e+124], N[(x$95$m / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.3e+116], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * 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 -2.1 \cdot 10^{+124}:\\
\;\;\;\;\frac{x\_m}{y \cdot z}\\

\mathbf{elif}\;z \leq 5.3 \cdot 10^{+116}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


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

    1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{z \cdot y} \]
      3. add-sqr-sqrt19.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{x}}{z \cdot y} \]
    10. Applied egg-rr33.8%

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

    if -2.10000000000000011e124 < z < 5.3000000000000002e116

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.3000000000000002e116 < z

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity70.8%

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Step-by-step derivation
      1. *-commutative52.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+124}:\\ \;\;\;\;\frac{x}{y \cdot z}\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{+116}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 49.1% 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 -3.7 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{y}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+116}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \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 (<= z -3.7e+45)
    (/ (/ x_m z) y)
    (if (<= z 4.5e+116) (/ (/ x_m t) y) (/ x_m (* 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 (z <= -3.7e+45) {
		tmp = (x_m / z) / y;
	} else if (z <= 4.5e+116) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 (z <= (-3.7d+45)) then
        tmp = (x_m / z) / y
    else if (z <= 4.5d+116) then
        tmp = (x_m / t) / y
    else
        tmp = x_m / (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 (z <= -3.7e+45) {
		tmp = (x_m / z) / y;
	} else if (z <= 4.5e+116) {
		tmp = (x_m / t) / y;
	} else {
		tmp = x_m / (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 z <= -3.7e+45:
		tmp = (x_m / z) / y
	elif z <= 4.5e+116:
		tmp = (x_m / t) / y
	else:
		tmp = x_m / (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 (z <= -3.7e+45)
		tmp = Float64(Float64(x_m / z) / y);
	elseif (z <= 4.5e+116)
		tmp = Float64(Float64(x_m / t) / y);
	else
		tmp = Float64(x_m / Float64(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 (z <= -3.7e+45)
		tmp = (x_m / z) / y;
	elseif (z <= 4.5e+116)
		tmp = (x_m / t) / y;
	else
		tmp = x_m / (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[z, -3.7e+45], N[(N[(x$95$m / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.5e+116], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], N[(x$95$m / N[(z * 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 -3.7 \cdot 10^{+45}:\\
\;\;\;\;\frac{\frac{x\_m}{z}}{y}\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+116}:\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


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

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.69999999999999977e45 < z < 4.50000000000000016e116

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.50000000000000016e116 < z

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{z}} \]
      5. *-lft-identity70.8%

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Step-by-step derivation
      1. *-commutative52.3%

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

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

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

Alternative 18: 71.3% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.46 \cdot 10^{-76}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\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 (<= y -1.46e-76) (/ x_m (* y (- t z))) (/ 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 <= -1.46e-76) {
		tmp = x_m / (y * (t - z));
	} 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 <= (-1.46d-76)) then
        tmp = x_m / (y * (t - z))
    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 <= -1.46e-76) {
		tmp = x_m / (y * (t - z));
	} 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 <= -1.46e-76:
		tmp = x_m / (y * (t - z))
	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 <= -1.46e-76)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	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 (y <= -1.46e-76)
		tmp = x_m / (y * (t - z));
	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, -1.46e-76], N[(x$95$m / N[(y * N[(t - z), $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}\;y \leq -1.46 \cdot 10^{-76}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.45999999999999985e-76

    1. Initial program 88.4%

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

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

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

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

    if -1.45999999999999985e-76 < y

    1. Initial program 83.6%

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

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

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

Alternative 19: 71.3% accurate, 0.7× speedup?

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

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


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

    1. Initial program 88.4%

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

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

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

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

    if -5.0999999999999999e-79 < y

    1. Initial program 83.6%

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

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

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

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

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

Alternative 20: 72.3% accurate, 0.7× 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 -6 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \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 -6e-79) (/ (/ x_m y) (- t z)) (/ (/ 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 <= -6e-79) {
		tmp = (x_m / y) / (t - z);
	} 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 <= (-6d-79)) then
        tmp = (x_m / y) / (t - z)
    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 <= -6e-79) {
		tmp = (x_m / y) / (t - z);
	} 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 <= -6e-79:
		tmp = (x_m / y) / (t - z)
	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 <= -6e-79)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	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 <= -6e-79)
		tmp = (x_m / y) / (t - z);
	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, -6e-79], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $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 -6 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.99999999999999999e-79

    1. Initial program 88.4%

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

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

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

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

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

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

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

    if -5.99999999999999999e-79 < y

    1. Initial program 83.6%

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

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

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

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

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

Alternative 21: 73.9% accurate, 0.7× 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 4.7 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\ \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 4.7e-30) (/ (/ x_m (- t 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 <= 4.7e-30) {
		tmp = (x_m / (t - 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 <= 4.7d-30) then
        tmp = (x_m / (t - 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 <= 4.7e-30) {
		tmp = (x_m / (t - 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 <= 4.7e-30:
		tmp = (x_m / (t - 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 <= 4.7e-30)
		tmp = Float64(Float64(x_m / Float64(t - 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 <= 4.7e-30)
		tmp = (x_m / (t - 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, 4.7e-30], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $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 4.7 \cdot 10^{-30}:\\
\;\;\;\;\frac{\frac{x\_m}{t - z}}{y}\\

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


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

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

    if 4.69999999999999969e-30 < t

    1. Initial program 76.6%

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

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

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

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

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

Alternative 22: 38.9% 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 85.0%

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

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

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

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

  :alt
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))

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