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

Percentage Accurate: 89.0% → 98.0%
Time: 9.9s
Alternatives: 17
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 98.0% accurate, 0.4× speedup?

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

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


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

    1. Initial program 98.3%

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

    if -9.99999999999948e-312 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 90.4%

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

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

      \[\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: 76.8% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{-33}:\\ \;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-137}:\\ \;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-180} \lor \neg \left(y \leq 3.2 \cdot 10^{-211}\right):\\ \;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{z \cdot \left(z - t\right)}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= y -2.5e-33)
    (/ x_m (* y (- t z)))
    (if (<= y -3.9e-137)
      (* (/ x_m z) (/ 1.0 z))
      (if (or (<= y -6.8e-180) (not (<= y 3.2e-211)))
        (/ (/ x_m t) (- y z))
        (/ x_m (* z (- 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 <= -2.5e-33) {
		tmp = x_m / (y * (t - z));
	} else if (y <= -3.9e-137) {
		tmp = (x_m / z) * (1.0 / z);
	} else if ((y <= -6.8e-180) || !(y <= 3.2e-211)) {
		tmp = (x_m / t) / (y - z);
	} else {
		tmp = x_m / (z * (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 <= (-2.5d-33)) then
        tmp = x_m / (y * (t - z))
    else if (y <= (-3.9d-137)) then
        tmp = (x_m / z) * (1.0d0 / z)
    else if ((y <= (-6.8d-180)) .or. (.not. (y <= 3.2d-211))) then
        tmp = (x_m / t) / (y - z)
    else
        tmp = x_m / (z * (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 <= -2.5e-33) {
		tmp = x_m / (y * (t - z));
	} else if (y <= -3.9e-137) {
		tmp = (x_m / z) * (1.0 / z);
	} else if ((y <= -6.8e-180) || !(y <= 3.2e-211)) {
		tmp = (x_m / t) / (y - z);
	} else {
		tmp = x_m / (z * (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 <= -2.5e-33:
		tmp = x_m / (y * (t - z))
	elif y <= -3.9e-137:
		tmp = (x_m / z) * (1.0 / z)
	elif (y <= -6.8e-180) or not (y <= 3.2e-211):
		tmp = (x_m / t) / (y - z)
	else:
		tmp = x_m / (z * (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 <= -2.5e-33)
		tmp = Float64(x_m / Float64(y * Float64(t - z)));
	elseif (y <= -3.9e-137)
		tmp = Float64(Float64(x_m / z) * Float64(1.0 / z));
	elseif ((y <= -6.8e-180) || !(y <= 3.2e-211))
		tmp = Float64(Float64(x_m / t) / Float64(y - z));
	else
		tmp = Float64(x_m / Float64(z * 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 <= -2.5e-33)
		tmp = x_m / (y * (t - z));
	elseif (y <= -3.9e-137)
		tmp = (x_m / z) * (1.0 / z);
	elseif ((y <= -6.8e-180) || ~((y <= 3.2e-211)))
		tmp = (x_m / t) / (y - z);
	else
		tmp = x_m / (z * (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, -2.5e-33], N[(x$95$m / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.9e-137], N[(N[(x$95$m / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -6.8e-180], N[Not[LessEqual[y, 3.2e-211]], $MachinePrecision]], N[(N[(x$95$m / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(z * N[(z - t), $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}\;y \leq -2.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{x\_m}{y \cdot \left(t - z\right)}\\

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

\mathbf{elif}\;y \leq -6.8 \cdot 10^{-180} \lor \neg \left(y \leq 3.2 \cdot 10^{-211}\right):\\
\;\;\;\;\frac{\frac{x\_m}{t}}{y - z}\\

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


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

    1. Initial program 96.8%

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

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

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

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

    if -2.50000000000000014e-33 < y < -3.8999999999999999e-137

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

    if -3.8999999999999999e-137 < y < -6.79999999999999963e-180 or 3.19999999999999985e-211 < y

    1. Initial program 90.0%

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

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

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

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

    if -6.79999999999999963e-180 < y < 3.19999999999999985e-211

    1. Initial program 95.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{-33}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-137}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-180} \lor \neg \left(y \leq 3.2 \cdot 10^{-211}\right):\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{elif}\;y \leq -1.05 \cdot 10^{-136} \lor \neg \left(y \leq -6.5 \cdot 10^{-181}\right) \land y \leq 5.5 \cdot 10^{-253}:\\
\;\;\;\;\frac{x\_m}{z} \cdot \frac{1}{z}\\

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


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

    1. Initial program 96.8%

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

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

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

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

    if -2.4499999999999999e-33 < y < -1.0499999999999999e-136 or -6.4999999999999997e-181 < y < 5.49999999999999974e-253

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

    if -1.0499999999999999e-136 < y < -6.4999999999999997e-181 or 5.49999999999999974e-253 < y

    1. Initial program 90.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.45 \cdot 10^{-33}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-136} \lor \neg \left(y \leq -6.5 \cdot 10^{-181}\right) \land y \leq 5.5 \cdot 10^{-253}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 55.3% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq -9.2 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.19999999999999992e103 or 2.79999999999999993e106 < z

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999992e103 < z < -9.19999999999999985e-86 or 2.09999999999999999e-152 < z < 2.79999999999999993e106

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

    if -9.19999999999999985e-86 < z < 2.09999999999999999e-152

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+103}:\\ \;\;\;\;-\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-86}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-152}:\\ \;\;\;\;\frac{1}{y \cdot \frac{t}{x}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+106}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-84}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.09999999999999996e103 or 4e104 < z

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999996e103 < z < -1.04999999999999999e-84 or 2.09999999999999999e-152 < z < 4e104

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

    if -1.04999999999999999e-84 < z < 2.09999999999999999e-152

    1. Initial program 93.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+103}:\\ \;\;\;\;-\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-152}:\\ \;\;\;\;\frac{x}{t} \cdot \frac{1}{y}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+104}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 55.0% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq -7.8 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.7 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.50000000000000011e102 or 3.69999999999999985e105 < z

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.50000000000000011e102 < z < -7.7999999999999996e-87 or 1.8499999999999999e-152 < z < 3.69999999999999985e105

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

    if -7.7999999999999996e-87 < z < 1.8499999999999999e-152

    1. Initial program 93.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+102}:\\ \;\;\;\;-\frac{\frac{x}{z}}{z}\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-87}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-152}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+105}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\frac{x}{z}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 48.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.01999999999999996e-112 or 2.5000000000000001e-90 < z < 2.29999999999999995e116

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

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

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

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

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

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

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

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

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

    if -1.01999999999999996e-112 < z < 2.5000000000000001e-90

    1. Initial program 93.7%

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

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

    if 2.29999999999999995e116 < z

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 93.4% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{+131} \lor \neg \left(z \leq 8.5 \cdot 10^{+136}\right):\\ \;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\left(y - z\right) \cdot \left(t - z\right)}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -1.32e+131) (not (<= z 8.5e+136)))
    (/ (/ 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 <= -1.32e+131) || !(z <= 8.5e+136)) {
		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 <= (-1.32d+131)) .or. (.not. (z <= 8.5d+136))) 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 <= -1.32e+131) || !(z <= 8.5e+136)) {
		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 <= -1.32e+131) or not (z <= 8.5e+136):
		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 <= -1.32e+131) || !(z <= 8.5e+136))
		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 <= -1.32e+131) || ~((z <= 8.5e+136)))
		tmp = (x_m / z) / (z - t);
	else
		tmp = x_m / ((y - z) * (t - z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y, z, and t should be sorted in increasing order before calling this function.
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.32e+131], N[Not[LessEqual[z, 8.5e+136]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
[x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\
\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+131} \lor \neg \left(z \leq 8.5 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{\frac{x\_m}{z}}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.32e131 or 8.49999999999999966e136 < z

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

    if -1.32e131 < z < 8.49999999999999966e136

    1. Initial program 95.5%

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.49999999999999975e-50 or 1.26e-90 < t

    1. Initial program 92.9%

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

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

    if -5.49999999999999975e-50 < t < 1.26e-90

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 92.9%

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

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

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

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

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

    if -2.50000000000000018e-18 < t < 6.00000000000000033e-77

    1. Initial program 91.8%

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

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

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

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

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

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

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

    if 6.00000000000000033e-77 < t

    1. Initial program 93.0%

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

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

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

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

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

Alternative 11: 80.7% accurate, 0.5× speedup?

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

\mathbf{elif}\;y \leq 5.3 \cdot 10^{-114}:\\
\;\;\;\;\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 < -1.26e8

    1. Initial program 96.3%

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

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

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

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

    if -1.26e8 < y < 5.29999999999999973e-114

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

    if 5.29999999999999973e-114 < y

    1. Initial program 91.5%

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

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

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

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

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

Alternative 12: 46.1% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2000000000000002e-86 or 2.09999999999999999e-152 < z

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

    if -2.2000000000000002e-86 < z < 2.09999999999999999e-152

    1. Initial program 93.2%

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

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

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

Alternative 13: 48.3% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.39999999999999994e102 or 3.4999999999999998e75 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{t} \]
    12. Simplified51.4%

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

    if -2.39999999999999994e102 < z < 3.4999999999999998e75

    1. Initial program 95.7%

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

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

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

Alternative 14: 45.9% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ [x_m, y, z, t] = \mathsf{sort}([x_m, y, z, t])\\ \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+70} \lor \neg \left(z \leq 3.3 \cdot 10^{+158}\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 -1e+70) (not (<= z 3.3e+158)))
    (/ 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 <= -1e+70) || !(z <= 3.3e+158)) {
		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 <= (-1d+70)) .or. (.not. (z <= 3.3d+158))) 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 <= -1e+70) || !(z <= 3.3e+158)) {
		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 <= -1e+70) or not (z <= 3.3e+158):
		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 <= -1e+70) || !(z <= 3.3e+158))
		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 <= -1e+70) || ~((z <= 3.3e+158)))
		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, -1e+70], N[Not[LessEqual[z, 3.3e+158]], $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 \cdot 10^{+70} \lor \neg \left(z \leq 3.3 \cdot 10^{+158}\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.00000000000000007e70 or 3.30000000000000017e158 < z

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000007e70 < z < 3.30000000000000017e158

    1. Initial program 95.3%

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

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

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

Alternative 15: 71.4% 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.1 \cdot 10^{-23}:\\ \;\;\;\;\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 (<= t 2.1e-23) (/ 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 (t <= 2.1e-23) {
		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 (t <= 2.1d-23) 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 (t <= 2.1e-23) {
		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 t <= 2.1e-23:
		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 (t <= 2.1e-23)
		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 (t <= 2.1e-23)
		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[t, 2.1e-23], 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}\;t \leq 2.1 \cdot 10^{-23}:\\
\;\;\;\;\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 t < 2.1000000000000001e-23

    1. Initial program 92.0%

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

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

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

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

    if 2.1000000000000001e-23 < t

    1. Initial program 93.6%

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

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

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

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

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

Alternative 16: 70.1% 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 1.1 \cdot 10^{-84}:\\ \;\;\;\;\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 (<= t 1.1e-84) (/ 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 (t <= 1.1e-84) {
		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 (t <= 1.1d-84) 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 (t <= 1.1e-84) {
		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 t <= 1.1e-84:
		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 (t <= 1.1e-84)
		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 (t <= 1.1e-84)
		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[t, 1.1e-84], 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}\;t \leq 1.1 \cdot 10^{-84}:\\
\;\;\;\;\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 t < 1.0999999999999999e-84

    1. Initial program 92.2%

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

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

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

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

    if 1.0999999999999999e-84 < t

    1. Initial program 93.0%

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

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

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

Alternative 17: 39.5% accurate, 1.8× speedup?

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

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

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

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

Developer target: 87.6% 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 2024103 
(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))))