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

Percentage Accurate: 61.8% → 91.9%
Time: 19.0s
Alternatives: 7
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 7 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.9% accurate, 1.0× speedup?

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

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


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

    1. Initial program 70.4%

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

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

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

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

    if 9.99999999999999944e118 < z

    1. Initial program 20.2%

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

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

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

      \[\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 t around 0 86.7%

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

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

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{z + \frac{-0.5 \cdot \left(a \cdot t\right)}{z}}}\right) \]
    8. Taylor expanded in a around 0 86.7%

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

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

        \[\leadsto x \cdot \left(y \cdot \frac{z}{z + \frac{\color{blue}{\left(a \cdot t\right) \cdot -0.5}}{z}}\right) \]
      3. associate-*r/86.7%

        \[\leadsto x \cdot \left(y \cdot \frac{z}{z + \color{blue}{\left(a \cdot t\right) \cdot \frac{-0.5}{z}}}\right) \]
      4. associate-*l*98.7%

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

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

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

Alternative 2: 83.8% accurate, 1.0× speedup?

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

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


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

    1. Initial program 64.8%

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

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

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

      \[\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 41.3%

      \[\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*41.3%

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

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

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

    if 8.99999999999999987e-111 < z

    1. Initial program 53.5%

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

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

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

      \[\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 t around 0 84.2%

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

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

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{z + \frac{-0.5 \cdot \left(a \cdot t\right)}{z}}}\right) \]
    8. Taylor expanded in a around 0 84.2%

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

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

        \[\leadsto x \cdot \left(y \cdot \frac{z}{z + \frac{\color{blue}{\left(a \cdot t\right) \cdot -0.5}}{z}}\right) \]
      3. associate-*r/84.2%

        \[\leadsto x \cdot \left(y \cdot \frac{z}{z + \color{blue}{\left(a \cdot t\right) \cdot \frac{-0.5}{z}}}\right) \]
      4. associate-*l*90.4%

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

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

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

Alternative 3: 75.8% accurate, 6.3× speedup?

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

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


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

    1. Initial program 64.2%

      \[\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 26.3%

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

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{z + \frac{-0.5 \cdot \left(a \cdot t\right)}{z}}} \]
    6. Taylor expanded in t around inf 26.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right) \cdot \frac{z}{t \cdot \frac{-0.5 \cdot a}{z}}} \]
    12. Step-by-step derivation
      1. associate-*l*21.7%

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

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

    if 6.3999999999999997e-187 < z

    1. Initial program 55.5%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative82.4%

        \[\leadsto \color{blue}{y \cdot x} \]
    7. Simplified82.4%

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

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

Alternative 4: 76.1% accurate, 6.3× speedup?

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

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


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

    1. Initial program 64.4%

      \[\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 26.1%

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

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

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{z + \frac{-0.5 \cdot \left(a \cdot t\right)}{z}}} \]
    6. Taylor expanded in t around inf 26.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(y \cdot z\right)}{\color{blue}{\frac{-0.5 \cdot a}{z} \cdot t}} \]
      5. associate-/l/24.7%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot \left(y \cdot z\right)}{t}}{\frac{-0.5 \cdot a}{z}}} \]
      6. associate-/r/26.1%

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

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

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

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

    if 6.1000000000000002e-183 < z

    1. Initial program 55.1%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    7. Simplified83.1%

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

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

Alternative 5: 78.8% accurate, 7.5× speedup?

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

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

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

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

    \[\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 t around 0 49.0%

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

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

    \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{z + \frac{-0.5 \cdot \left(a \cdot t\right)}{z}}}\right) \]
  8. Taylor expanded in a around 0 49.0%

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

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

      \[\leadsto x \cdot \left(y \cdot \frac{z}{z + \frac{\color{blue}{\left(a \cdot t\right) \cdot -0.5}}{z}}\right) \]
    3. associate-*r/49.0%

      \[\leadsto x \cdot \left(y \cdot \frac{z}{z + \color{blue}{\left(a \cdot t\right) \cdot \frac{-0.5}{z}}}\right) \]
    4. associate-*l*51.4%

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

    \[\leadsto x \cdot \left(y \cdot \frac{z}{z + \color{blue}{a \cdot \left(t \cdot \frac{-0.5}{z}\right)}}\right) \]
  11. Final simplification51.4%

    \[\leadsto x \cdot \left(y \cdot \frac{z}{z + a \cdot \left(t \cdot \frac{-0.5}{z}\right)}\right) \]
  12. Add Preprocessing

Alternative 6: 75.4% accurate, 9.4× speedup?

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

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


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

    1. Initial program 64.4%

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified65.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 23.7%

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

    if 3.4e-136 < z

    1. Initial program 54.4%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    7. Simplified87.1%

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

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

Alternative 7: 72.8% accurate, 37.7× speedup?

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot x} \]
  7. Simplified45.8%

    \[\leadsto \color{blue}{y \cdot x} \]
  8. Final simplification45.8%

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

Developer target: 88.4% 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 2024095 
(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)))))