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

Percentage Accurate: 88.4% → 97.7%
Time: 12.4s
Alternatives: 20
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 88.4% accurate, 1.0× speedup?

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

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

Alternative 1: 97.7% accurate, 0.4× speedup?

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

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


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

    1. Initial program 96.4%

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

    if -2.0000000000000001e-270 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 79.9%

      \[\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
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 73.6% accurate, 0.2× speedup?

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

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-284}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-165}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{-27}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.82e22 or 6.7999999999999995e86 < z

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.82e22 < z < -2.2000000000000001e-284 or 3.20000000000000013e-165 < z < 1.3500000000000001e-71 or 1.7999999999999999e-27 < z < 6.7999999999999995e86

    1. Initial program 92.5%

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

      \[\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 inf 66.5%

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

    if -2.2000000000000001e-284 < z < 3.20000000000000013e-165 or 1.3500000000000001e-71 < z < 1.7999999999999999e-27

    1. Initial program 82.2%

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

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

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

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

Alternative 3: 81.3% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{z}}{z - t}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x_m z) (- z t))))
   (*
    x_s
    (if (<= y -3e-8)
      (/ (/ x_m y) (- t z))
      (if (<= y -1.5e-36)
        t_1
        (if (<= y -3.2e-71)
          (/ x_m (* y (- t z)))
          (if (<= y 9.5e-98) t_1 (/ (/ 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 t_1 = (x_m / z) / (z - t);
	double tmp;
	if (y <= -3e-8) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -1.5e-36) {
		tmp = t_1;
	} else if (y <= -3.2e-71) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 9.5e-98) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (x_m / z) / (z - t)
    if (y <= (-3d-8)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= (-1.5d-36)) then
        tmp = t_1
    else if (y <= (-3.2d-71)) then
        tmp = x_m / (y * (t - z))
    else if (y <= 9.5d-98) then
        tmp = t_1
    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 t_1 = (x_m / z) / (z - t);
	double tmp;
	if (y <= -3e-8) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -1.5e-36) {
		tmp = t_1;
	} else if (y <= -3.2e-71) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 9.5e-98) {
		tmp = t_1;
	} 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):
	t_1 = (x_m / z) / (z - t)
	tmp = 0
	if y <= -3e-8:
		tmp = (x_m / y) / (t - z)
	elif y <= -1.5e-36:
		tmp = t_1
	elif y <= -3.2e-71:
		tmp = x_m / (y * (t - z))
	elif y <= 9.5e-98:
		tmp = t_1
	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)
	t_1 = Float64(Float64(x_m / z) / Float64(z - t))
	tmp = 0.0
	if (y <= -3e-8)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= -1.5e-36)
		tmp = t_1;
	elseif (y <= -3.2e-71)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= 9.5e-98)
		tmp = t_1;
	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)
	t_1 = (x_m / z) / (z - t);
	tmp = 0.0;
	if (y <= -3e-8)
		tmp = (x_m / y) / (t - z);
	elseif (y <= -1.5e-36)
		tmp = t_1;
	elseif (y <= -3.2e-71)
		tmp = x_m / (y * (t - z));
	elseif (y <= 9.5e-98)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -3e-8], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.5e-36], t$95$1, If[LessEqual[y, -3.2e-71], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-98], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{z}}{z - t}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

\mathbf{elif}\;y \leq -1.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.99999999999999973e-8

    1. Initial program 84.4%

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

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

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

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

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

    if -2.99999999999999973e-8 < y < -1.5000000000000001e-36 or -3.1999999999999999e-71 < y < 9.5000000000000001e-98

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

    if -1.5000000000000001e-36 < y < -3.1999999999999999e-71

    1. Initial program 100.0%

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

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

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

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

    if 9.5000000000000001e-98 < y

    1. Initial program 72.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-36}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.7% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-35}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.18 \cdot 10^{-85}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-127}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ x_m (* z (- z t)))))
   (*
    x_s
    (if (<= y -2.2e-9)
      (/ (/ x_m y) (- t z))
      (if (<= y -6.2e-35)
        t_1
        (if (<= y -1.18e-85)
          (/ x_m (* y (- t z)))
          (if (<= y 1.55e-127) t_1 (/ (/ 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 t_1 = x_m / (z * (z - t));
	double tmp;
	if (y <= -2.2e-9) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -6.2e-35) {
		tmp = t_1;
	} else if (y <= -1.18e-85) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 1.55e-127) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x_m / (z * (z - t))
    if (y <= (-2.2d-9)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= (-6.2d-35)) then
        tmp = t_1
    else if (y <= (-1.18d-85)) then
        tmp = x_m / (y * (t - z))
    else if (y <= 1.55d-127) then
        tmp = t_1
    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 t_1 = x_m / (z * (z - t));
	double tmp;
	if (y <= -2.2e-9) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -6.2e-35) {
		tmp = t_1;
	} else if (y <= -1.18e-85) {
		tmp = x_m / (y * (t - z));
	} else if (y <= 1.55e-127) {
		tmp = t_1;
	} 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):
	t_1 = x_m / (z * (z - t))
	tmp = 0
	if y <= -2.2e-9:
		tmp = (x_m / y) / (t - z)
	elif y <= -6.2e-35:
		tmp = t_1
	elif y <= -1.18e-85:
		tmp = x_m / (y * (t - z))
	elif y <= 1.55e-127:
		tmp = t_1
	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)
	t_1 = Float64(x_m / Float64(z * Float64(z - t)))
	tmp = 0.0
	if (y <= -2.2e-9)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= -6.2e-35)
		tmp = t_1;
	elseif (y <= -1.18e-85)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= 1.55e-127)
		tmp = t_1;
	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)
	t_1 = x_m / (z * (z - t));
	tmp = 0.0;
	if (y <= -2.2e-9)
		tmp = (x_m / y) / (t - z);
	elseif (y <= -6.2e-35)
		tmp = t_1;
	elseif (y <= -1.18e-85)
		tmp = x_m / (y * (t - z));
	elseif (y <= 1.55e-127)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(x$95$m / N[(z * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -2.2e-9], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.2e-35], t$95$1, If[LessEqual[y, -1.18e-85], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e-127], t$95$1, 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])\\
\\
\begin{array}{l}
t_1 := \frac{x\_m}{z \cdot \left(z - t\right)}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

\mathbf{elif}\;y \leq -6.2 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 1.55 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 84.4%

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

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

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

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

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

    if -2.1999999999999998e-9 < y < -6.20000000000000024e-35 or -1.18e-85 < y < 1.55e-127

    1. Initial program 91.8%

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

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

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

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

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

    if -6.20000000000000024e-35 < y < -1.18e-85

    1. Initial program 99.9%

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

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

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

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

    if 1.55e-127 < y

    1. Initial program 73.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-35}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{elif}\;y \leq -1.18 \cdot 10^{-85}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-127}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.1% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq -1.55 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5e18 or 9.99999999999999995e88 < z

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e18 < z < -1.55000000000000007e-108 or 1.19999999999999999e-147 < z < 9.99999999999999995e88

    1. Initial program 97.2%

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

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

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

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

    if -1.55000000000000007e-108 < z < 1.19999999999999999e-147

    1. Initial program 80.8%

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

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

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

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

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

Alternative 6: 72.8% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-305}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4.7 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.35e20 or 4.7000000000000002e86 < z

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.35e20 < z < -2.80000000000000014e-305 or 1.25000000000000009e-230 < z < 4.7000000000000002e86

    1. Initial program 92.1%

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

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

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

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

    if -2.80000000000000014e-305 < z < 1.25000000000000009e-230

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

Alternative 7: 72.9% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x\_m}{\left(y - z\right) \cdot t}\\ t_2 := \frac{1}{z} \cdot \frac{x\_m}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -0.00115:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{-307}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-230}:\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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))) (t_2 (* (/ 1.0 z) (/ x_m z))))
   (*
    x_s
    (if (<= z -0.00115)
      t_2
      (if (<= z -1.26e-307)
        t_1
        (if (<= z 1.25e-230) (/ (/ x_m t) y) (if (<= z 8.2e+34) t_1 t_2)))))))
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);
	double t_2 = (1.0 / z) * (x_m / z);
	double tmp;
	if (z <= -0.00115) {
		tmp = t_2;
	} else if (z <= -1.26e-307) {
		tmp = t_1;
	} else if (z <= 1.25e-230) {
		tmp = (x_m / t) / y;
	} else if (z <= 8.2e+34) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x_m / ((y - z) * t)
    t_2 = (1.0d0 / z) * (x_m / z)
    if (z <= (-0.00115d0)) then
        tmp = t_2
    else if (z <= (-1.26d-307)) then
        tmp = t_1
    else if (z <= 1.25d-230) then
        tmp = (x_m / t) / y
    else if (z <= 8.2d+34) then
        tmp = t_1
    else
        tmp = t_2
    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);
	double t_2 = (1.0 / z) * (x_m / z);
	double tmp;
	if (z <= -0.00115) {
		tmp = t_2;
	} else if (z <= -1.26e-307) {
		tmp = t_1;
	} else if (z <= 1.25e-230) {
		tmp = (x_m / t) / y;
	} else if (z <= 8.2e+34) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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)
	t_2 = (1.0 / z) * (x_m / z)
	tmp = 0
	if z <= -0.00115:
		tmp = t_2
	elif z <= -1.26e-307:
		tmp = t_1
	elif z <= 1.25e-230:
		tmp = (x_m / t) / y
	elif z <= 8.2e+34:
		tmp = t_1
	else:
		tmp = t_2
	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) * t))
	t_2 = Float64(Float64(1.0 / z) * Float64(x_m / z))
	tmp = 0.0
	if (z <= -0.00115)
		tmp = t_2;
	elseif (z <= -1.26e-307)
		tmp = t_1;
	elseif (z <= 1.25e-230)
		tmp = Float64(Float64(x_m / t) / y);
	elseif (z <= 8.2e+34)
		tmp = t_1;
	else
		tmp = t_2;
	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);
	t_2 = (1.0 / z) * (x_m / z);
	tmp = 0.0;
	if (z <= -0.00115)
		tmp = t_2;
	elseif (z <= -1.26e-307)
		tmp = t_1;
	elseif (z <= 1.25e-230)
		tmp = (x_m / t) / y;
	elseif (z <= 8.2e+34)
		tmp = t_1;
	else
		tmp = t_2;
	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] * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / z), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -0.00115], t$95$2, If[LessEqual[z, -1.26e-307], t$95$1, If[LessEqual[z, 1.25e-230], N[(N[(x$95$m / t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 8.2e+34], t$95$1, t$95$2]]]]), $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 t}\\
t_2 := \frac{1}{z} \cdot \frac{x\_m}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -0.00115:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1.26 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.00115 or 8.1999999999999997e34 < z

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.00115 < z < -1.2599999999999999e-307 or 1.25000000000000009e-230 < z < 8.1999999999999997e34

    1. Initial program 91.7%

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

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

    if -1.2599999999999999e-307 < z < 1.25000000000000009e-230

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

Alternative 8: 65.8% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq 4.7 \cdot 10^{-147}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 8 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.0023 or 7.99999999999999967e28 < z

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0023 < z < 4.69999999999999989e-147 or 1.7000000000000001e-98 < z < 7.99999999999999967e28

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

    if 4.69999999999999989e-147 < z < 1.7000000000000001e-98

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.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])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-182}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - y}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-98}:\\ \;\;\;\;\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.9e+66)
    (/ (/ x_m y) (- t z))
    (if (<= y -2.4e-182)
      (/ (/ x_m z) (- z y))
      (if (<= y 7e-98) (/ (/ 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.9e+66) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -2.4e-182) {
		tmp = (x_m / z) / (z - y);
	} else if (y <= 7e-98) {
		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.9d+66)) then
        tmp = (x_m / y) / (t - z)
    else if (y <= (-2.4d-182)) then
        tmp = (x_m / z) / (z - y)
    else if (y <= 7d-98) 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.9e+66) {
		tmp = (x_m / y) / (t - z);
	} else if (y <= -2.4e-182) {
		tmp = (x_m / z) / (z - y);
	} else if (y <= 7e-98) {
		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.9e+66:
		tmp = (x_m / y) / (t - z)
	elif y <= -2.4e-182:
		tmp = (x_m / z) / (z - y)
	elif y <= 7e-98:
		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.9e+66)
		tmp = Float64(Float64(x_m / y) / Float64(t - z));
	elseif (y <= -2.4e-182)
		tmp = Float64(Float64(x_m / z) / Float64(z - y));
	elseif (y <= 7e-98)
		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.9e+66)
		tmp = (x_m / y) / (t - z);
	elseif (y <= -2.4e-182)
		tmp = (x_m / z) / (z - y);
	elseif (y <= 7e-98)
		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.9e+66], N[(N[(x$95$m / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.4e-182], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-98], 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.9 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{t - z}\\

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

\mathbf{elif}\;y \leq 7 \cdot 10^{-98}:\\
\;\;\;\;\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 4 regimes
  2. if y < -2.89999999999999986e66

    1. Initial program 80.6%

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

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

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

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

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

    if -2.89999999999999986e66 < y < -2.3999999999999998e-182

    1. Initial program 92.8%

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

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

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

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

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

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

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

    if -2.3999999999999998e-182 < y < 7.0000000000000004e-98

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

    if 7.0000000000000004e-98 < y

    1. Initial program 72.9%

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

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

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

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

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

Alternative 10: 78.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 2.05 \cdot 10^{-125}:\\
\;\;\;\;\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 4 regimes
  2. if y < -9.9999999999999994e38

    1. Initial program 81.4%

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

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

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

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

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

    if -9.9999999999999994e38 < y < -5.79999999999999993e-114

    1. Initial program 99.9%

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

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

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

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

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

    if -5.79999999999999993e-114 < y < 2.0499999999999999e-125

    1. Initial program 90.9%

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

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

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

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

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

    if 2.0499999999999999e-125 < y

    1. Initial program 73.6%

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

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

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

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

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

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

\mathbf{elif}\;y \leq 1.75 \cdot 10^{-116}:\\
\;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\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.20000000000000005e182

    1. Initial program 73.2%

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

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

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

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

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

    if -1.20000000000000005e182 < y < 1.74999999999999992e-116

    1. Initial program 92.3%

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

    if 1.74999999999999992e-116 < y

    1. Initial program 73.0%

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.7000000000000001e-19 or 2.35e-88 < t

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

    if -2.7000000000000001e-19 < t < 2.35e-88

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 50.2% accurate, 0.6× speedup?

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

\mathbf{elif}\;t \leq 1.65 \cdot 10^{+62}:\\
\;\;\;\;\frac{\frac{x\_m}{-z}}{y}\\

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


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

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.80000000000000003e-19 < t < 1.65e62

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.65e62 < t

    1. Initial program 80.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{-19}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+62}:\\ \;\;\;\;\frac{\frac{x}{-z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 50.6% accurate, 0.6× speedup?

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

\mathbf{elif}\;t \leq 850000:\\
\;\;\;\;\frac{\frac{x\_m}{y}}{-z}\\

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


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

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.7000000000000001e-19 < t < 8.5e5

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

    if 8.5e5 < t

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000001e-182 < y < 6.50000000000000017e-98

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

    if 6.50000000000000017e-98 < y

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

Alternative 16: 48.3% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35000000000000002e115 or 4.5999999999999997e75 < z

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000002e115 < z < 4.5999999999999997e75

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 48.3% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35e116 or 1.7499999999999999e75 < z

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e116 < z < 1.7499999999999999e75

    1. Initial program 87.5%

      \[\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}} \]
    4. Step-by-step derivation
      1. associate-/r*54.3%

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6e115 or 1.5499999999999999e69 < z

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e115 < z < 1.5499999999999999e69

    1. Initial program 87.5%

      \[\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.4%

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

Alternative 19: 96.8% accurate, 1.0× 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{\frac{x\_m}{y - z}}{t - z} \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 z)) (- t z))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
assert(x_m < y && y < z && z < t);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * ((x_m / (y - z)) / (t - z));
}
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 - z)) / (t - z))
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 - z)) / (t - z));
}
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 - z)) / (t - z))
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(Float64(x_m / Float64(y - z)) / Float64(t - z)))
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 - z)) / (t - z));
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[(N[(x$95$m / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - 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 \frac{\frac{x\_m}{y - z}}{t - z}
\end{array}
Derivation
  1. Initial program 83.7%

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

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

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

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

Alternative 20: 39.7% 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 83.7%

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

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

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

Developer target: 87.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 2024101 
(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))))