Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2

Percentage Accurate: 61.8% → 91.8%
Time: 20.3s
Alternatives: 11
Speedup: 37.7×

Specification

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

\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\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 11 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: 61.8% accurate, 1.0× speedup?

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

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

Alternative 1: 91.8% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ [x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\ \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 1.3 \cdot 10^{+38}:\\ \;\;\;\;x\_m \cdot \left(y\_m \cdot \frac{z\_m}{\sqrt{z\_m \cdot z\_m - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \left(x\_m \cdot \frac{z\_m}{\mathsf{fma}\left(a \cdot \frac{-0.5}{z\_m}, t, z\_m\right)}\right)\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
(FPCore (z_s y_s x_s x_m y_m z_m t a)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= z_m 1.3e+38)
      (* x_m (* y_m (/ z_m (sqrt (- (* z_m z_m) (* t a))))))
      (* y_m (* x_m (/ z_m (fma (* a (/ -0.5 z_m)) t z_m)))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
assert(x_m < y_m && y_m < z_m && z_m < t && t < a);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m, double t, double a) {
	double tmp;
	if (z_m <= 1.3e+38) {
		tmp = x_m * (y_m * (z_m / sqrt(((z_m * z_m) - (t * a)))));
	} else {
		tmp = y_m * (x_m * (z_m / fma((a * (-0.5 / z_m)), t, z_m)));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
x_m, y_m, z_m, t, a = sort([x_m, y_m, z_m, t, a])
function code(z_s, y_s, x_s, x_m, y_m, z_m, t, a)
	tmp = 0.0
	if (z_m <= 1.3e+38)
		tmp = Float64(x_m * Float64(y_m * Float64(z_m / sqrt(Float64(Float64(z_m * z_m) - Float64(t * a))))));
	else
		tmp = Float64(y_m * Float64(x_m * Float64(z_m / fma(Float64(a * Float64(-0.5 / z_m)), t, z_m))));
	end
	return Float64(z_s * Float64(y_s * Float64(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]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x_m, y_m, z_m, t, and a should be sorted in increasing order before calling this function.
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_, t_, a_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 1.3e+38], N[(x$95$m * N[(y$95$m * N[(z$95$m / N[Sqrt[N[(N[(z$95$m * z$95$m), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(x$95$m * N[(z$95$m / N[(N[(a * N[(-0.5 / z$95$m), $MachinePrecision]), $MachinePrecision] * t + z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)
\\
[x_m, y_m, z_m, t, a] = \mathsf{sort}([x_m, y_m, z_m, t, a])\\
\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 1.3 \cdot 10^{+38}:\\
\;\;\;\;x\_m \cdot \left(y\_m \cdot \frac{z\_m}{\sqrt{z\_m \cdot z\_m - t \cdot a}}\right)\\

\mathbf{else}:\\
\;\;\;\;y\_m \cdot \left(x\_m \cdot \frac{z\_m}{\mathsf{fma}\left(a \cdot \frac{-0.5}{z\_m}, t, z\_m\right)}\right)\\


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.3e38

    1. Initial program 65.5%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. associate-*l*70.6%

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
    4. Add Preprocessing

    if 1.3e38 < z

    1. Initial program 51.7%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative51.9%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*52.1%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/50.2%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified50.2%

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

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

        \[\leadsto y \cdot \frac{x \cdot z}{z + -0.5 \cdot \color{blue}{\frac{1}{\frac{z}{a \cdot t}}}} \]
      2. un-div-inv86.4%

        \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{z}{a \cdot t}}}} \]
    7. Applied egg-rr86.4%

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

        \[\leadsto y \cdot \frac{x \cdot z}{z + \frac{-0.5}{\color{blue}{\frac{\frac{z}{a}}{t}}}} \]
    9. Simplified88.0%

      \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{\frac{z}{a}}{t}}}} \]
    10. Step-by-step derivation
      1. associate-/r/88.0%

        \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{z}{a}} \cdot t}} \]
    11. Applied egg-rr88.0%

      \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{z}{a}} \cdot t}} \]
    12. Step-by-step derivation
      1. associate-/l*97.1%

        \[\leadsto y \cdot \color{blue}{\left(x \cdot \frac{z}{z + \frac{-0.5}{\frac{z}{a}} \cdot t}\right)} \]
      2. +-commutative97.1%

        \[\leadsto y \cdot \left(x \cdot \frac{z}{\color{blue}{\frac{-0.5}{\frac{z}{a}} \cdot t + z}}\right) \]
      3. fma-define97.1%

        \[\leadsto y \cdot \left(x \cdot \frac{z}{\color{blue}{\mathsf{fma}\left(\frac{-0.5}{\frac{z}{a}}, t, z\right)}}\right) \]
      4. associate-/r/97.1%

        \[\leadsto y \cdot \left(x \cdot \frac{z}{\mathsf{fma}\left(\color{blue}{\frac{-0.5}{z} \cdot a}, t, z\right)}\right) \]
    13. Applied egg-rr97.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.3 \cdot 10^{+38}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\mathsf{fma}\left(a \cdot \frac{-0.5}{z}, t, z\right)}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 91.6% accurate, 1.0× speedup?

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.3e38

    1. Initial program 65.5%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. associate-*l*70.6%

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

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
    4. Add Preprocessing

    if 1.3e38 < z

    1. Initial program 51.7%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative51.9%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*52.1%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/50.2%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified50.2%

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

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

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

Alternative 3: 84.8% accurate, 1.0× speedup?

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

\mathbf{elif}\;z\_m \leq 1.1 \cdot 10^{+28}:\\
\;\;\;\;\frac{z\_m \cdot \left(x\_m \cdot y\_m\right)}{z\_m + -0.5 \cdot \frac{t \cdot a}{z\_m}}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 5.49999999999999959e-119

    1. Initial program 61.6%

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

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

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

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{\left(-a\right)} \cdot t}} \]
      3. *-commutative35.7%

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

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

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

    if 5.49999999999999959e-119 < z < 1.09999999999999993e28

    1. Initial program 86.0%

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

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

    if 1.09999999999999993e28 < z

    1. Initial program 53.8%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative54.1%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*54.2%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/52.4%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified52.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{t \cdot \left(-a\right)}}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+28}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 84.5% accurate, 1.0× speedup?

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

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 8.99999999999999939e-117

    1. Initial program 61.6%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. associate-*l*66.8%

        \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
    3. Simplified66.8%

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 35.7%

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

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

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{\left(-a\right)} \cdot t}} \]
      3. *-commutative35.7%

        \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{t \cdot \left(-a\right)}}} \]
    7. Simplified35.7%

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

    if 8.99999999999999939e-117 < z < 6.9999999999999999e28

    1. Initial program 86.0%

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

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

    if 6.9999999999999999e28 < z

    1. Initial program 53.8%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative54.1%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*54.2%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/52.4%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified52.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 9 \cdot 10^{-117}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{t \cdot \left(-a\right)}}\right)\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+28}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.6% accurate, 5.6× speedup?

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.5000000000000002e27

    1. Initial program 65.0%

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

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

    if 3.5000000000000002e27 < z

    1. Initial program 53.8%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative54.1%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*54.2%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/52.4%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified52.4%

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

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

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

Alternative 6: 77.4% accurate, 5.6× speedup?

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6.99999999999999949e147

    1. Initial program 62.8%

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

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

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*66.1%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/63.4%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified63.4%

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

      \[\leadsto y \cdot \frac{x \cdot z}{\color{blue}{z + -0.5 \cdot \frac{a \cdot t}{z}}} \]
    6. Step-by-step derivation
      1. clear-num47.0%

        \[\leadsto y \cdot \frac{x \cdot z}{z + -0.5 \cdot \color{blue}{\frac{1}{\frac{z}{a \cdot t}}}} \]
      2. un-div-inv47.0%

        \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{z}{a \cdot t}}}} \]
    7. Applied egg-rr47.0%

      \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{z}{a \cdot t}}}} \]
    8. Step-by-step derivation
      1. associate-/r*47.4%

        \[\leadsto y \cdot \frac{x \cdot z}{z + \frac{-0.5}{\color{blue}{\frac{\frac{z}{a}}{t}}}} \]
    9. Simplified47.4%

      \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{\frac{z}{a}}{t}}}} \]
    10. Step-by-step derivation
      1. associate-/r/47.4%

        \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{z}{a}} \cdot t}} \]
    11. Applied egg-rr47.4%

      \[\leadsto y \cdot \frac{x \cdot z}{z + \color{blue}{\frac{-0.5}{\frac{z}{a}} \cdot t}} \]

    if 6.99999999999999949e147 < y

    1. Initial program 55.3%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative53.2%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*53.2%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/59.5%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified59.5%

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

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

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

Alternative 7: 77.7% accurate, 5.6× speedup?

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 9.99999999999999914e28

    1. Initial program 65.0%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative68.0%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*68.7%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/66.8%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified66.8%

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

      \[\leadsto y \cdot \frac{x \cdot z}{\color{blue}{z + -0.5 \cdot \frac{a \cdot t}{z}}} \]

    if 9.99999999999999914e28 < z

    1. Initial program 53.8%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative54.1%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*54.2%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/52.4%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified52.4%

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

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

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

Alternative 8: 76.5% accurate, 9.4× speedup?

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 8.0000000000000003e-83

    1. Initial program 62.6%

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

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

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*66.3%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/64.8%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified64.8%

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv64.8%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(z \cdot x\right)} \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right) \]
      3. associate-*l*66.2%

        \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(x \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)\right)} \]
      4. pow1/266.2%

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

        \[\leadsto y \cdot \left(z \cdot \left(x \cdot \color{blue}{{\left(z \cdot z - t \cdot a\right)}^{\left(-0.5\right)}}\right)\right) \]
      6. pow266.2%

        \[\leadsto y \cdot \left(z \cdot \left(x \cdot {\left(\color{blue}{{z}^{2}} - t \cdot a\right)}^{\left(-0.5\right)}\right)\right) \]
      7. metadata-eval66.2%

        \[\leadsto y \cdot \left(z \cdot \left(x \cdot {\left({z}^{2} - t \cdot a\right)}^{\color{blue}{-0.5}}\right)\right) \]
    6. Applied egg-rr66.2%

      \[\leadsto y \cdot \color{blue}{\left(z \cdot \left(x \cdot {\left({z}^{2} - t \cdot a\right)}^{-0.5}\right)\right)} \]
    7. Taylor expanded in z around inf 19.0%

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot \left(z \cdot x\right)}{z}} \]
    11. Applied egg-rr26.0%

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

    if 8.0000000000000003e-83 < z

    1. Initial program 61.1%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative61.9%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*62.0%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/59.4%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified59.4%

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

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

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

Alternative 9: 76.0% accurate, 9.4× speedup?

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.6999999999999999e-83

    1. Initial program 62.6%

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

      \[\leadsto \frac{\color{blue}{x \cdot \left(y \cdot z\right)}}{\sqrt{z \cdot z - t \cdot a}} \]
    4. Taylor expanded in z around inf 26.8%

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

    if 1.6999999999999999e-83 < z

    1. Initial program 61.1%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative61.9%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*62.0%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/59.4%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified59.4%

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

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

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

Alternative 10: 76.3% accurate, 9.4× speedup?

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.8e-105

    1. Initial program 61.7%

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

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
      2. *-commutative64.3%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*65.6%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/64.3%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified64.3%

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

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

    if 2.8e-105 < z

    1. Initial program 62.7%

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

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

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
      3. associate-*l*63.5%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
      4. associate-*r/60.7%

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified60.7%

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

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

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

Alternative 11: 72.7% accurate, 37.7× speedup?

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
    2. *-commutative64.3%

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}} \]
    3. associate-*l*64.9%

      \[\leadsto \color{blue}{y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)} \]
    4. associate-*r/63.0%

      \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
  3. Simplified63.0%

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

    \[\leadsto y \cdot \color{blue}{x} \]
  6. Final simplification42.3%

    \[\leadsto x \cdot y \]
  7. Add Preprocessing

Developer target: 87.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (< z -3.1921305903852764e+46)
   (- (* y x))
   (if (< z 5.976268120920894e+90)
     (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
     (* y x))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z < (-3.1921305903852764d+46)) then
        tmp = -(y * x)
    else if (z < 5.976268120920894d+90) then
        tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
    else
        tmp = y * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z < -3.1921305903852764e+46:
		tmp = -(y * x)
	elif z < 5.976268120920894e+90:
		tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y)
	else:
		tmp = y * x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z < -3.1921305903852764e+46)
		tmp = Float64(-Float64(y * x));
	elseif (z < 5.976268120920894e+90)
		tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y));
	else
		tmp = Float64(y * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z < -3.1921305903852764e+46)
		tmp = -(y * x);
	elseif (z < 5.976268120920894e+90)
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\

\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024110 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :alt
  (if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

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