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

Percentage Accurate: 89.6% → 97.9%
Time: 11.9s
Alternatives: 17
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 89.6% 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.9% 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^{-299}:\\ \;\;\;\;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-299) 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-299) {
		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-299)) 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-299) {
		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-299:
		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-299)
		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-299)
		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-299], 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^{-299}:\\
\;\;\;\;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))) < -1.99999999999999998e-299

    1. Initial program 96.9%

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

    if -1.99999999999999998e-299 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 89.6%

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

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

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

Alternative 2: 82.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{\frac{x\_m}{t - z}}{y}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+204}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-16}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-135}:\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \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 (- t z)) y)))
   (*
    x_s
    (if (<= y -2.25e+204)
      t_1
      (if (<= y -2e-16)
        (/ x_m (* y (- t z)))
        (if (<= y -5.6e-81)
          t_1
          (if (<= y 6e-135) (/ (/ 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 t_1 = (x_m / (t - z)) / y;
	double tmp;
	if (y <= -2.25e+204) {
		tmp = t_1;
	} else if (y <= -2e-16) {
		tmp = x_m / (y * (t - z));
	} else if (y <= -5.6e-81) {
		tmp = t_1;
	} else if (y <= 6e-135) {
		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) :: t_1
    real(8) :: tmp
    t_1 = (x_m / (t - z)) / y
    if (y <= (-2.25d+204)) then
        tmp = t_1
    else if (y <= (-2d-16)) then
        tmp = x_m / (y * (t - z))
    else if (y <= (-5.6d-81)) then
        tmp = t_1
    else if (y <= 6d-135) 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 t_1 = (x_m / (t - z)) / y;
	double tmp;
	if (y <= -2.25e+204) {
		tmp = t_1;
	} else if (y <= -2e-16) {
		tmp = x_m / (y * (t - z));
	} else if (y <= -5.6e-81) {
		tmp = t_1;
	} else if (y <= 6e-135) {
		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):
	t_1 = (x_m / (t - z)) / y
	tmp = 0
	if y <= -2.25e+204:
		tmp = t_1
	elif y <= -2e-16:
		tmp = x_m / (y * (t - z))
	elif y <= -5.6e-81:
		tmp = t_1
	elif y <= 6e-135:
		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)
	t_1 = Float64(Float64(x_m / Float64(t - z)) / y)
	tmp = 0.0
	if (y <= -2.25e+204)
		tmp = t_1;
	elseif (y <= -2e-16)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= -5.6e-81)
		tmp = t_1;
	elseif (y <= 6e-135)
		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)
	t_1 = (x_m / (t - z)) / y;
	tmp = 0.0;
	if (y <= -2.25e+204)
		tmp = t_1;
	elseif (y <= -2e-16)
		tmp = x_m / (y * (t - z));
	elseif (y <= -5.6e-81)
		tmp = t_1;
	elseif (y <= 6e-135)
		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_] := Block[{t$95$1 = N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -2.25e+204], t$95$1, If[LessEqual[y, -2e-16], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.6e-81], t$95$1, If[LessEqual[y, 6e-135], 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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{t - z}}{y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\

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

\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.25000000000000001e204 or -2e-16 < y < -5.5999999999999998e-81

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25000000000000001e204 < y < -2e-16

    1. Initial program 88.3%

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

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

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

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

    if -5.5999999999999998e-81 < y < 6.00000000000000024e-135

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

    if 6.00000000000000024e-135 < y

    1. Initial program 91.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+204}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-81}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-135}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.4% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x\_m}{t - z}}{y}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+203}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.9 \cdot 10^{-18}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-86}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{-137}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \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 (- t z)) y)))
   (*
    x_s
    (if (<= y -1.55e+203)
      t_1
      (if (<= y -6.9e-18)
        (/ x_m (* y (- t z)))
        (if (<= y -1.7e-86)
          t_1
          (if (<= y 8.6e-137)
            (/ 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 t_1 = (x_m / (t - z)) / y;
	double tmp;
	if (y <= -1.55e+203) {
		tmp = t_1;
	} else if (y <= -6.9e-18) {
		tmp = x_m / (y * (t - z));
	} else if (y <= -1.7e-86) {
		tmp = t_1;
	} else if (y <= 8.6e-137) {
		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) :: t_1
    real(8) :: tmp
    t_1 = (x_m / (t - z)) / y
    if (y <= (-1.55d+203)) then
        tmp = t_1
    else if (y <= (-6.9d-18)) then
        tmp = x_m / (y * (t - z))
    else if (y <= (-1.7d-86)) then
        tmp = t_1
    else if (y <= 8.6d-137) 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 t_1 = (x_m / (t - z)) / y;
	double tmp;
	if (y <= -1.55e+203) {
		tmp = t_1;
	} else if (y <= -6.9e-18) {
		tmp = x_m / (y * (t - z));
	} else if (y <= -1.7e-86) {
		tmp = t_1;
	} else if (y <= 8.6e-137) {
		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):
	t_1 = (x_m / (t - z)) / y
	tmp = 0
	if y <= -1.55e+203:
		tmp = t_1
	elif y <= -6.9e-18:
		tmp = x_m / (y * (t - z))
	elif y <= -1.7e-86:
		tmp = t_1
	elif y <= 8.6e-137:
		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)
	t_1 = Float64(Float64(x_m / Float64(t - z)) / y)
	tmp = 0.0
	if (y <= -1.55e+203)
		tmp = t_1;
	elseif (y <= -6.9e-18)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= -1.7e-86)
		tmp = t_1;
	elseif (y <= 8.6e-137)
		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)
	t_1 = (x_m / (t - z)) / y;
	tmp = 0.0;
	if (y <= -1.55e+203)
		tmp = t_1;
	elseif (y <= -6.9e-18)
		tmp = x_m / (y * (t - z));
	elseif (y <= -1.7e-86)
		tmp = t_1;
	elseif (y <= 8.6e-137)
		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_] := Block[{t$95$1 = N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, N[(x$95$s * If[LessEqual[y, -1.55e+203], t$95$1, If[LessEqual[y, -6.9e-18], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-86], t$95$1, If[LessEqual[y, 8.6e-137], 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])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x\_m}{t - z}}{y}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\

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

\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 < -1.55e203 or -6.9000000000000003e-18 < y < -1.7e-86

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55e203 < y < -6.9000000000000003e-18

    1. Initial program 88.3%

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

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

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

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

    if -1.7e-86 < y < 8.59999999999999959e-137

    1. Initial program 93.6%

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

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

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

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

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

    if 8.59999999999999959e-137 < y

    1. Initial program 91.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+203}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq -6.9 \cdot 10^{-18}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-86}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{-137}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

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

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

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.59999999999999985e123 or 1.05e-141 < y

    1. Initial program 89.7%

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{t \cdot y}{x}\right)}^{-1}} \]
      3. *-commutative58.8%

        \[\leadsto {\left(\frac{\color{blue}{y \cdot t}}{x}\right)}^{-1} \]
      4. associate-/l*65.2%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{y \cdot t}{x}}} \]
      3. *-commutative58.8%

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

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

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

    if -2.59999999999999985e123 < y < -1.8999999999999999e57

    1. Initial program 94.5%

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac253.6%

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

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

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

    if -1.8999999999999999e57 < y < -1.54999999999999994e-86

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\frac{t - z}{\frac{x}{y - z}}\right)}}^{-1} \]
      3. inv-pow95.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      8. *-un-lft-identity95.4%

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

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

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

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

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

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

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

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

    if -1.54999999999999994e-86 < y < 1.05e-141

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. associate-/l/54.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{t \cdot \frac{y}{x}}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{+57}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{-86}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-141}:\\ \;\;\;\;\frac{\frac{x}{z}}{-t}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t \cdot \frac{y}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq 2.15 \cdot 10^{+94}:\\
\;\;\;\;\frac{x\_m}{y \cdot t}\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{+170}:\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.4999999999999999e-65 or 1.2e170 < t

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\frac{t - z}{\frac{x}{y - z}}\right)}}^{-1} \]
      3. inv-pow95.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      8. *-un-lft-identity95.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    11. Simplified64.1%

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

    if -5.4999999999999999e-65 < t < 2.09999999999999996e-109

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

    if 2.09999999999999996e-109 < t < 2.15e94

    1. Initial program 94.5%

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

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

    if 2.15e94 < t < 1.2e170

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{z \cdot t}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt6.6%

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z \cdot t} \]
      5. add-sqr-sqrt2.0%

        \[\leadsto \frac{\color{blue}{x}}{z \cdot t} \]
      6. *-un-lft-identity2.0%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t}} \]
      2. associate-/l/2.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-109}:\\ \;\;\;\;\frac{x}{z \cdot \left(-y\right)}\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{+94}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+170}:\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{elif}\;y \leq -1.6 \cdot 10^{-86} \lor \neg \left(y \leq 4.1 \cdot 10^{-141}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.34999999999999981e46

    1. Initial program 87.7%

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac254.2%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. distribute-rgt-neg-out54.2%

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

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

    if -4.34999999999999981e46 < y < -1.60000000000000003e-86 or 4.10000000000000002e-141 < y

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\frac{t - z}{\frac{x}{y - z}}\right)}}^{-1} \]
      3. inv-pow95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000003e-86 < y < 4.10000000000000002e-141

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. associate-/l/54.9%

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

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

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

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

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

\mathbf{elif}\;y \leq -6 \cdot 10^{-85} \lor \neg \left(y \leq 2.75 \cdot 10^{-139}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.7999999999999999e46

    1. Initial program 87.7%

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{y \cdot z}} \]
      2. distribute-neg-frac254.2%

        \[\leadsto \color{blue}{\frac{x}{-y \cdot z}} \]
      3. distribute-rgt-neg-out54.2%

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

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

    if -7.7999999999999999e46 < y < -6.00000000000000044e-85 or 2.7499999999999998e-139 < y

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\frac{t - z}{\frac{x}{y - z}}\right)}}^{-1} \]
      3. inv-pow95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.00000000000000044e-85 < y < 2.7499999999999998e-139

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 80.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.09999999999999988e-81 < y < 2.0599999999999999e-135

    1. Initial program 93.6%

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

      \[\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 0 88.4%

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

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

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

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

    if 2.0599999999999999e-135 < y

    1. Initial program 91.1%

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

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

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

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

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

Alternative 9: 64.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 93.3%

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{t \cdot y}{x}\right)}^{-1}} \]
      3. *-commutative51.5%

        \[\leadsto {\left(\frac{\color{blue}{y \cdot t}}{x}\right)}^{-1} \]
      4. associate-/l*65.3%

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

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

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

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

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

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

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

    if -1750 < t < 3.79999999999999983e-113

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.79999999999999983e-113 < t

    1. Initial program 88.7%

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

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

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

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

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

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


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

    1. Initial program 89.7%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity58.6%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot y} \]
      2. times-frac65.4%

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

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

    if -4.80000000000000017e-82 < y < 4.6500000000000001e-141

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. associate-/l/54.9%

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

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

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

    if 4.6500000000000001e-141 < y

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\frac{t - z}{\frac{x}{y - z}}\right)}}^{-1} \]
      3. inv-pow96.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      8. *-un-lft-identity96.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    11. Simplified64.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-82}:\\ \;\;\;\;\frac{1}{t} \cdot \frac{x}{y}\\ \mathbf{elif}\;y \leq 4.65 \cdot 10^{-141}:\\ \;\;\;\;\frac{\frac{-x}{z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 45.7% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.79999999999999989e65 or 1.3999999999999999e67 < z

    1. Initial program 86.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{z \cdot t}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt25.0%

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z \cdot t} \]
      5. add-sqr-sqrt41.0%

        \[\leadsto \frac{\color{blue}{x}}{z \cdot t} \]
      6. *-un-lft-identity41.0%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t}} \]
      2. associate-/l/41.0%

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

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

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

    if -1.79999999999999989e65 < z < 1.3999999999999999e67

    1. Initial program 94.3%

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

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

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

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

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


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

    if -8.49999999999999956e149 < z

    1. Initial program 92.9%

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

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

Alternative 13: 72.6% accurate, 0.7× speedup?

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.45000000000000007e27 < t

    1. Initial program 87.5%

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

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

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

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

Alternative 14: 70.3% accurate, 0.7× speedup?

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

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


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

    1. Initial program 88.4%

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

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

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

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

    if -1.16e-17 < y

    1. Initial program 92.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 inf 61.0%

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

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

Alternative 15: 70.3% accurate, 0.7× speedup?

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

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


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

    1. Initial program 88.1%

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

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

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

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

    if -3.4999999999999998e-10 < y

    1. Initial program 92.8%

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

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

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

Alternative 16: 45.0% accurate, 0.9× 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.3 \cdot 10^{+118}:\\ \;\;\;\;\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 (<= z -1.3e+118) (/ 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 (z <= -1.3e+118) {
		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 (z <= (-1.3d+118)) 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 (z <= -1.3e+118) {
		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 z <= -1.3e+118:
		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 (z <= -1.3e+118)
		tmp = 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 (z <= -1.3e+118)
		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[z, -1.3e+118], 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}\;z \leq -1.3 \cdot 10^{+118}:\\
\;\;\;\;\frac{x\_m}{z \cdot t}\\

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


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

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{z \cdot t}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt22.4%

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z \cdot t} \]
      5. add-sqr-sqrt32.8%

        \[\leadsto \frac{\color{blue}{x}}{z \cdot t} \]
      6. *-un-lft-identity32.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{t}} \]
      2. associate-/l/32.8%

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

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

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

    if -1.30000000000000008e118 < z

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\frac{t - z}{\frac{x}{y - z}}\right)}}^{-1} \]
      3. inv-pow95.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{1}{t - z}}{\frac{y - z}{x}}} \]
      8. *-un-lft-identity95.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    11. Simplified51.6%

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

Alternative 17: 39.1% 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 91.6%

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

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

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

Developer target: 88.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;\frac{x}{t\_1} < 0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (- t z))))
   (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - z) * (t - z)
    if ((x / t_1) < 0.0d0) then
        tmp = (x / (y - z)) / (t - z)
    else
        tmp = x * (1.0d0 / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if (x / t_1) < 0.0:
		tmp = (x / (y - z)) / (t - z)
	else:
		tmp = x * (1.0 / t_1)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (Float64(x / t_1) < 0.0)
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(x * Float64(1.0 / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * (t - z);
	tmp = 0.0;
	if ((x / t_1) < 0.0)
		tmp = (x / (y - z)) / (t - z);
	else
		tmp = x * (1.0 / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \left(t - z\right)\\
\mathbf{if}\;\frac{x}{t\_1} < 0:\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024086 
(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))))