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

Percentage Accurate: 61.2% → 90.7%
Time: 17.2s
Alternatives: 18
Speedup: 18.6×

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 18 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.2% 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: 90.7% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := \sqrt{z \cdot z - a \cdot t}\\ \mathbf{if}\;z \leq -3 \cdot 10^{+150}:\\ \;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{z \cdot z}{t}}, -1\right)}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-208}:\\ \;\;\;\;\frac{x \cdot y}{\frac{t_1}{z}}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{\frac{t_1}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (sqrt (- (* z z) (* a t)))))
   (if (<= z -3e+150)
     (/ (* x y) (fma 0.5 (/ a (/ (* z z) t)) -1.0))
     (if (<= z -4.2e-208)
       (/ (* x y) (/ t_1 z))
       (if (<= z 5.2e+51) (/ x (/ t_1 (* z y))) (* x y))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double t_1 = sqrt(((z * z) - (a * t)));
	double tmp;
	if (z <= -3e+150) {
		tmp = (x * y) / fma(0.5, (a / ((z * z) / t)), -1.0);
	} else if (z <= -4.2e-208) {
		tmp = (x * y) / (t_1 / z);
	} else if (z <= 5.2e+51) {
		tmp = x / (t_1 / (z * y));
	} else {
		tmp = x * y;
	}
	return tmp;
}
x, y = sort([x, y])
function code(x, y, z, t, a)
	t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t)))
	tmp = 0.0
	if (z <= -3e+150)
		tmp = Float64(Float64(x * y) / fma(0.5, Float64(a / Float64(Float64(z * z) / t)), -1.0));
	elseif (z <= -4.2e-208)
		tmp = Float64(Float64(x * y) / Float64(t_1 / z));
	elseif (z <= 5.2e+51)
		tmp = Float64(x / Float64(t_1 / Float64(z * y)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -3e+150], N[(N[(x * y), $MachinePrecision] / N[(0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-208], N[(N[(x * y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+51], N[(x / N[(t$95$1 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -3 \cdot 10^{+150}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{z \cdot z}{t}}, -1\right)}\\

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-208}:\\
\;\;\;\;\frac{x \cdot y}{\frac{t_1}{z}}\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\frac{t_1}{z \cdot y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.00000000000000012e150

    1. Initial program 16.7%

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{0.5 \cdot \frac{a \cdot t}{{z}^{2}} - 1}} \]
    5. Step-by-step derivation
      1. fma-neg85.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(0.5, \frac{a \cdot t}{{z}^{2}}, -1\right)}} \]
      2. unpow285.1%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(0.5, \color{blue}{\frac{a}{\frac{z \cdot z}{t}}}, -1\right)} \]
      4. metadata-eval97.6%

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

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

    if -3.00000000000000012e150 < z < -4.20000000000000024e-208

    1. Initial program 84.4%

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

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

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

    if -4.20000000000000024e-208 < z < 5.2000000000000002e51

    1. Initial program 81.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
      4. associate-/l/84.5%

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

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

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

    if 5.2000000000000002e51 < z

    1. Initial program 53.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+150}:\\ \;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{z \cdot z}{t}}, -1\right)}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-208}:\\ \;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 2: 90.7% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := \sqrt{z \cdot z - a \cdot t}\\ \mathbf{if}\;z \leq -2 \cdot 10^{+151}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-206}:\\ \;\;\;\;\frac{x \cdot y}{\frac{t_1}{z}}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{\frac{t_1}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (sqrt (- (* z z) (* a t)))))
   (if (<= z -2e+151)
     (* x (- y))
     (if (<= z -3.4e-206)
       (/ (* x y) (/ t_1 z))
       (if (<= z 5.2e+51) (/ x (/ t_1 (* z y))) (* x y))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double t_1 = sqrt(((z * z) - (a * t)));
	double tmp;
	if (z <= -2e+151) {
		tmp = x * -y;
	} else if (z <= -3.4e-206) {
		tmp = (x * y) / (t_1 / z);
	} else if (z <= 5.2e+51) {
		tmp = x / (t_1 / (z * y));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((z * z) - (a * t)))
    if (z <= (-2d+151)) then
        tmp = x * -y
    else if (z <= (-3.4d-206)) then
        tmp = (x * y) / (t_1 / z)
    else if (z <= 5.2d+51) then
        tmp = x / (t_1 / (z * y))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = Math.sqrt(((z * z) - (a * t)));
	double tmp;
	if (z <= -2e+151) {
		tmp = x * -y;
	} else if (z <= -3.4e-206) {
		tmp = (x * y) / (t_1 / z);
	} else if (z <= 5.2e+51) {
		tmp = x / (t_1 / (z * y));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	t_1 = math.sqrt(((z * z) - (a * t)))
	tmp = 0
	if z <= -2e+151:
		tmp = x * -y
	elif z <= -3.4e-206:
		tmp = (x * y) / (t_1 / z)
	elif z <= 5.2e+51:
		tmp = x / (t_1 / (z * y))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t)))
	tmp = 0.0
	if (z <= -2e+151)
		tmp = Float64(x * Float64(-y));
	elseif (z <= -3.4e-206)
		tmp = Float64(Float64(x * y) / Float64(t_1 / z));
	elseif (z <= 5.2e+51)
		tmp = Float64(x / Float64(t_1 / Float64(z * y)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = sqrt(((z * z) - (a * t)));
	tmp = 0.0;
	if (z <= -2e+151)
		tmp = x * -y;
	elseif (z <= -3.4e-206)
		tmp = (x * y) / (t_1 / z);
	elseif (z <= 5.2e+51)
		tmp = x / (t_1 / (z * y));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -2e+151], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -3.4e-206], N[(N[(x * y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+51], N[(x / N[(t$95$1 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+151}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-206}:\\
\;\;\;\;\frac{x \cdot y}{\frac{t_1}{z}}\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\frac{t_1}{z \cdot y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.00000000000000003e151

    1. Initial program 16.7%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-197.6%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified97.6%

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

    if -2.00000000000000003e151 < z < -3.39999999999999985e-206

    1. Initial program 84.4%

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

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

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

    if -3.39999999999999985e-206 < z < 5.2000000000000002e51

    1. Initial program 81.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
      4. associate-/l/84.5%

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

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

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

    if 5.2000000000000002e51 < z

    1. Initial program 53.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+151}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-206}:\\ \;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 3: 89.7% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+128}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+52}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1e+128)
   (* x (- y))
   (if (<= z 1.45e+52) (* y (/ (* z x) (sqrt (- (* z z) (* a t))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1e+128) {
		tmp = x * -y;
	} else if (z <= 1.45e+52) {
		tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1d+128)) then
        tmp = x * -y
    else if (z <= 1.45d+52) then
        tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1e+128) {
		tmp = x * -y;
	} else if (z <= 1.45e+52) {
		tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1e+128:
		tmp = x * -y
	elif z <= 1.45e+52:
		tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t))))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1e+128)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 1.45e+52)
		tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t)))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1e+128)
		tmp = x * -y;
	elseif (z <= 1.45e+52)
		tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+128], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.45e+52], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.0000000000000001e128

    1. Initial program 20.4%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-197.8%

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

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

    if -1.0000000000000001e128 < z < 1.45e52

    1. Initial program 83.4%

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

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

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

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

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

    if 1.45e52 < z

    1. Initial program 53.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+128}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+52}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 4: 90.6% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+150}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 10^{+44}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.85e+150)
   (* x (- y))
   (if (<= z 1e+44) (* y (* x (/ z (sqrt (- (* z z) (* a t)))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.85e+150) {
		tmp = x * -y;
	} else if (z <= 1e+44) {
		tmp = y * (x * (z / sqrt(((z * z) - (a * t)))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-2.85d+150)) then
        tmp = x * -y
    else if (z <= 1d+44) then
        tmp = y * (x * (z / sqrt(((z * z) - (a * t)))))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.85e+150) {
		tmp = x * -y;
	} else if (z <= 1e+44) {
		tmp = y * (x * (z / Math.sqrt(((z * z) - (a * t)))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.85e+150:
		tmp = x * -y
	elif z <= 1e+44:
		tmp = y * (x * (z / math.sqrt(((z * z) - (a * t)))))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.85e+150)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 1e+44)
		tmp = Float64(y * Float64(x * Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t))))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.85e+150)
		tmp = x * -y;
	elseif (z <= 1e+44)
		tmp = y * (x * (z / sqrt(((z * z) - (a * t)))));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.85e+150], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1e+44], N[(y * N[(x * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+150}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 10^{+44}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.8500000000000001e150

    1. Initial program 16.7%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-197.6%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified97.6%

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

    if -2.8500000000000001e150 < z < 1.0000000000000001e44

    1. Initial program 83.1%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    4. Step-by-step derivation
      1. associate-*l/84.9%

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

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

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

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

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

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

    if 1.0000000000000001e44 < z

    1. Initial program 53.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.85 \cdot 10^{+150}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 10^{+44}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 5: 89.9% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+64}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4.1e+64)
   (* x (- y))
   (if (<= z 9.5e+51) (/ x (/ (sqrt (- (* z z) (* a t))) (* z y))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.1e+64) {
		tmp = x * -y;
	} else if (z <= 9.5e+51) {
		tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-4.1d+64)) then
        tmp = x * -y
    else if (z <= 9.5d+51) then
        tmp = x / (sqrt(((z * z) - (a * t))) / (z * y))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.1e+64) {
		tmp = x * -y;
	} else if (z <= 9.5e+51) {
		tmp = x / (Math.sqrt(((z * z) - (a * t))) / (z * y));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4.1e+64:
		tmp = x * -y
	elif z <= 9.5e+51:
		tmp = x / (math.sqrt(((z * z) - (a * t))) / (z * y))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4.1e+64)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 9.5e+51)
		tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / Float64(z * y)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4.1e+64)
		tmp = x * -y;
	elseif (z <= 9.5e+51)
		tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e+64], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9.5e+51], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+64}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.09999999999999978e64

    1. Initial program 37.8%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-198.4%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified98.4%

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

    if -4.09999999999999978e64 < z < 9.4999999999999999e51

    1. Initial program 82.8%

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    4. Step-by-step derivation
      1. *-commutative81.9%

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
      4. associate-/l/84.2%

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

        \[\leadsto \frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{z \cdot y}}} \]
    5. Applied egg-rr84.2%

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

    if 9.4999999999999999e51 < z

    1. Initial program 53.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+64}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+51}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 6: 83.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-53}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.35e-53)
   (/ (* x y) (/ (- (* 0.5 (* a (/ t z))) z) z))
   (if (<= z 2.05e-79) (* y (/ (* z x) (sqrt (* a (- t))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.35e-53) {
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
	} else if (z <= 2.05e-79) {
		tmp = y * ((z * x) / sqrt((a * -t)));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.35d-53)) then
        tmp = (x * y) / (((0.5d0 * (a * (t / z))) - z) / z)
    else if (z <= 2.05d-79) then
        tmp = y * ((z * x) / sqrt((a * -t)))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.35e-53) {
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
	} else if (z <= 2.05e-79) {
		tmp = y * ((z * x) / Math.sqrt((a * -t)));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.35e-53:
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z)
	elif z <= 2.05e-79:
		tmp = y * ((z * x) / math.sqrt((a * -t)))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.35e-53)
		tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / z));
	elseif (z <= 2.05e-79)
		tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t)))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.35e-53)
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
	elseif (z <= 2.05e-79)
		tmp = y * ((z * x) / sqrt((a * -t)));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-53], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e-79], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-53}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\

\mathbf{elif}\;z \leq 2.05 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.35e-53

    1. Initial program 54.7%

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

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

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}}{z}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u87.1%

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

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{a \cdot t}{z}\right)} - 1\right)} + -1 \cdot z}{z}} \]
      3. *-commutative87.1%

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{t \cdot a}}{z}\right)} - 1\right) + -1 \cdot z}{z}} \]
    6. Applied egg-rr87.1%

      \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t \cdot a}{z}\right)} - 1\right)} + -1 \cdot z}{z}} \]
    7. Step-by-step derivation
      1. expm1-def87.1%

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

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \color{blue}{\frac{t \cdot a}{z}} + -1 \cdot z}{z}} \]
      3. *-commutative88.3%

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \frac{\color{blue}{a \cdot t}}{z} + -1 \cdot z}{z}} \]
      4. associate-*r/93.1%

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

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

    if -1.35e-53 < z < 2.04999999999999997e-79

    1. Initial program 75.5%

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

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

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

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

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

      \[\leadsto y \cdot \frac{x \cdot z}{\sqrt{\color{blue}{-1 \cdot \left(a \cdot t\right)}}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.1%

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

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

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

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

    if 2.04999999999999997e-79 < z

    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. *-commutative62.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-53}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 7: 76.2% accurate, 5.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-105}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-140}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{\frac{a \cdot \left(t \cdot -0.5\right)}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -8.2e-105)
   (* x (- y))
   (if (<= z 1.2e-140)
     (* (* z x) (/ y (- (/ (* a (* t -0.5)) z) z)))
     (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -8.2e-105) {
		tmp = x * -y;
	} else if (z <= 1.2e-140) {
		tmp = (z * x) * (y / (((a * (t * -0.5)) / z) - z));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-8.2d-105)) then
        tmp = x * -y
    else if (z <= 1.2d-140) then
        tmp = (z * x) * (y / (((a * (t * (-0.5d0))) / z) - z))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -8.2e-105) {
		tmp = x * -y;
	} else if (z <= 1.2e-140) {
		tmp = (z * x) * (y / (((a * (t * -0.5)) / z) - z));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -8.2e-105:
		tmp = x * -y
	elif z <= 1.2e-140:
		tmp = (z * x) * (y / (((a * (t * -0.5)) / z) - z))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -8.2e-105)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 1.2e-140)
		tmp = Float64(Float64(z * x) * Float64(y / Float64(Float64(Float64(a * Float64(t * -0.5)) / z) - z)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -8.2e-105)
		tmp = x * -y;
	elseif (z <= 1.2e-140)
		tmp = (z * x) * (y / (((a * (t * -0.5)) / z) - z));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e-105], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.2e-140], N[(N[(z * x), $MachinePrecision] * N[(y / N[(N[(N[(a * N[(t * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-105}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 1.2 \cdot 10^{-140}:\\
\;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{\frac{a \cdot \left(t \cdot -0.5\right)}{z} - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.20000000000000061e-105

    1. Initial program 56.5%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-186.2%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified86.2%

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

    if -8.20000000000000061e-105 < z < 1.19999999999999993e-140

    1. Initial program 72.7%

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

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

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}}{z}} \]
    5. Step-by-step derivation
      1. div-inv44.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \left(\left(t \cdot a\right) \cdot \frac{-1}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}\right) + -1 \cdot z}{z}} \]
      9. add-sqr-sqrt44.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{-1 \cdot z + -0.5 \cdot \frac{a \cdot t}{z}}{z \cdot x}}} \]
      2. associate-/r/44.9%

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

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

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

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

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

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

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

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

    if 1.19999999999999993e-140 < z

    1. Initial program 66.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-105}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-140}:\\ \;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{\frac{a \cdot \left(t \cdot -0.5\right)}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 8: 76.7% accurate, 5.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-141}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{0.5 \cdot \frac{a \cdot t}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.9e+49)
   (* x (- y))
   (if (<= z 2.8e-141) (* y (/ (* z x) (- (* 0.5 (/ (* a t) z)) z))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.9e+49) {
		tmp = x * -y;
	} else if (z <= 2.8e-141) {
		tmp = y * ((z * x) / ((0.5 * ((a * t) / z)) - z));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-1.9d+49)) then
        tmp = x * -y
    else if (z <= 2.8d-141) then
        tmp = y * ((z * x) / ((0.5d0 * ((a * t) / z)) - z))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.9e+49) {
		tmp = x * -y;
	} else if (z <= 2.8e-141) {
		tmp = y * ((z * x) / ((0.5 * ((a * t) / z)) - z));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.9e+49:
		tmp = x * -y
	elif z <= 2.8e-141:
		tmp = y * ((z * x) / ((0.5 * ((a * t) / z)) - z))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.9e+49)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 2.8e-141)
		tmp = Float64(y * Float64(Float64(z * x) / Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.9e+49)
		tmp = x * -y;
	elseif (z <= 2.8e-141)
		tmp = y * ((z * x) / ((0.5 * ((a * t) / z)) - z));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+49], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.8e-141], N[(y * N[(N[(z * x), $MachinePrecision] / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 2.8 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{0.5 \cdot \frac{a \cdot t}{z} - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.8999999999999999e49

    1. Initial program 39.8%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-196.9%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified96.9%

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

    if -1.8999999999999999e49 < z < 2.80000000000000012e-141

    1. Initial program 78.2%

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

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

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

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

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

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

    if 2.80000000000000012e-141 < z

    1. Initial program 66.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-141}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{0.5 \cdot \frac{a \cdot t}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 9: 75.0% accurate, 6.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-140}:\\ \;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -7e-106)
   (* x (- y))
   (if (<= z 2.7e-140) (* -2.0 (* (/ y a) (/ (* x (* z z)) t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e-106) {
		tmp = x * -y;
	} else if (z <= 2.7e-140) {
		tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-7d-106)) then
        tmp = x * -y
    else if (z <= 2.7d-140) then
        tmp = (-2.0d0) * ((y / a) * ((x * (z * z)) / t))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e-106) {
		tmp = x * -y;
	} else if (z <= 2.7e-140) {
		tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -7e-106:
		tmp = x * -y
	elif z <= 2.7e-140:
		tmp = -2.0 * ((y / a) * ((x * (z * z)) / t))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -7e-106)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 2.7e-140)
		tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(Float64(x * Float64(z * z)) / t)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -7e-106)
		tmp = x * -y;
	elseif (z <= 2.7e-140)
		tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e-106], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.7e-140], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7e-106

    1. Initial program 56.5%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-186.2%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified86.2%

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

    if -7e-106 < z < 2.7e-140

    1. Initial program 72.7%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    4. Step-by-step derivation
      1. associate-*l/73.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{y \cdot \left({z}^{2} \cdot x\right)}{a \cdot t}} \]
    8. Step-by-step derivation
      1. times-frac41.0%

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

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

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

    if 2.7e-140 < z

    1. Initial program 66.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-140}:\\ \;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 10: 74.7% accurate, 6.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-142}:\\ \;\;\;\;-2 \cdot \frac{y \cdot \left(z \cdot \left(z \cdot x\right)\right)}{a \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -7e-106)
   (* x (- y))
   (if (<= z 7.2e-142) (* -2.0 (/ (* y (* z (* z x))) (* a t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e-106) {
		tmp = x * -y;
	} else if (z <= 7.2e-142) {
		tmp = -2.0 * ((y * (z * (z * x))) / (a * t));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-7d-106)) then
        tmp = x * -y
    else if (z <= 7.2d-142) then
        tmp = (-2.0d0) * ((y * (z * (z * x))) / (a * t))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e-106) {
		tmp = x * -y;
	} else if (z <= 7.2e-142) {
		tmp = -2.0 * ((y * (z * (z * x))) / (a * t));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -7e-106:
		tmp = x * -y
	elif z <= 7.2e-142:
		tmp = -2.0 * ((y * (z * (z * x))) / (a * t))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -7e-106)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 7.2e-142)
		tmp = Float64(-2.0 * Float64(Float64(y * Float64(z * Float64(z * x))) / Float64(a * t)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -7e-106)
		tmp = x * -y;
	elseif (z <= 7.2e-142)
		tmp = -2.0 * ((y * (z * (z * x))) / (a * t));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e-106], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 7.2e-142], N[(-2.0 * N[(N[(y * N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7e-106

    1. Initial program 56.5%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-186.2%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified86.2%

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

    if -7e-106 < z < 7.20000000000000001e-142

    1. Initial program 72.7%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    4. Step-by-step derivation
      1. associate-*l/73.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{y \cdot \left({z}^{2} \cdot x\right)}{a \cdot t}} \]
    8. Step-by-step derivation
      1. times-frac41.0%

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

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

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

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

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

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

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

    if 7.20000000000000001e-142 < z

    1. Initial program 66.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-142}:\\ \;\;\;\;-2 \cdot \frac{y \cdot \left(z \cdot \left(z \cdot x\right)\right)}{a \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 11: 75.3% accurate, 6.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-100}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-140}:\\ \;\;\;\;2 \cdot \frac{y \cdot \frac{z \cdot \left(z \cdot x\right)}{t}}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.1e-100)
   (* x (- y))
   (if (<= z 1.2e-140) (* 2.0 (/ (* y (/ (* z (* z x)) t)) a)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.1e-100) {
		tmp = x * -y;
	} else if (z <= 1.2e-140) {
		tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a);
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.1d-100)) then
        tmp = x * -y
    else if (z <= 1.2d-140) then
        tmp = 2.0d0 * ((y * ((z * (z * x)) / t)) / a)
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.1e-100) {
		tmp = x * -y;
	} else if (z <= 1.2e-140) {
		tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a);
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.1e-100:
		tmp = x * -y
	elif z <= 1.2e-140:
		tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a)
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.1e-100)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 1.2e-140)
		tmp = Float64(2.0 * Float64(Float64(y * Float64(Float64(z * Float64(z * x)) / t)) / a));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.1e-100)
		tmp = x * -y;
	elseif (z <= 1.2e-140)
		tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a);
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e-100], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.2e-140], N[(2.0 * N[(N[(y * N[(N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.0999999999999999e-100

    1. Initial program 54.5%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-186.6%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified86.6%

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

    if -3.0999999999999999e-100 < z < 1.19999999999999993e-140

    1. Initial program 74.5%

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

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

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}}{z}} \]
    5. Taylor expanded in a around inf 43.5%

      \[\leadsto \color{blue}{2 \cdot \frac{y \cdot \left({z}^{2} \cdot x\right)}{a \cdot t}} \]
    6. Step-by-step derivation
      1. times-frac43.3%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{y \cdot \frac{{z}^{2} \cdot x}{t}}{a}} \]
      3. unpow243.7%

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

        \[\leadsto 2 \cdot \frac{y \cdot \frac{\color{blue}{z \cdot \left(z \cdot x\right)}}{t}}{a} \]
    7. Simplified45.4%

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

    if 1.19999999999999993e-140 < z

    1. Initial program 66.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-100}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-140}:\\ \;\;\;\;2 \cdot \frac{y \cdot \frac{z \cdot \left(z \cdot x\right)}{t}}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 12: 76.0% accurate, 6.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 7.5 \cdot 10^{-141}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a \cdot t}{z} - z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z 7.5e-141) (* y (* x (/ z (- (* 0.5 (/ (* a t) z)) z)))) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 7.5e-141) {
		tmp = y * (x * (z / ((0.5 * ((a * t) / z)) - z)));
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= 7.5d-141) then
        tmp = y * (x * (z / ((0.5d0 * ((a * t) / z)) - z)))
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 7.5e-141) {
		tmp = y * (x * (z / ((0.5 * ((a * t) / z)) - z)));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= 7.5e-141:
		tmp = y * (x * (z / ((0.5 * ((a * t) / z)) - z)))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= 7.5e-141)
		tmp = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z))));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= 7.5e-141)
		tmp = y * (x * (z / ((0.5 * ((a * t) / z)) - z)));
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 7.5e-141], N[(y * N[(x * N[(z / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.5 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a \cdot t}{z} - z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 7.50000000000000046e-141

    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.0%

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    4. Step-by-step derivation
      1. associate-*l/64.5%

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

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

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

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

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

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

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

    if 7.50000000000000046e-141 < z

    1. Initial program 66.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 7.5 \cdot 10^{-141}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a \cdot t}{z} - z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 13: 77.4% accurate, 6.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 7.2 \cdot 10^{-142}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z 7.2e-142) (/ (* x y) (/ (- (* 0.5 (* a (/ t z))) z) z)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 7.2e-142) {
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= 7.2d-142) then
        tmp = (x * y) / (((0.5d0 * (a * (t / z))) - z) / z)
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 7.2e-142) {
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= 7.2e-142:
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z)
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= 7.2e-142)
		tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / z));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= 7.2e-142)
		tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 7.2e-142], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.2 \cdot 10^{-142}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 7.20000000000000001e-142

    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.0%

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

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}}{z}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u61.0%

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

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{a \cdot t}{z}\right)} - 1\right)} + -1 \cdot z}{z}} \]
      3. *-commutative60.9%

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{t \cdot a}}{z}\right)} - 1\right) + -1 \cdot z}{z}} \]
    6. Applied egg-rr60.9%

      \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t \cdot a}{z}\right)} - 1\right)} + -1 \cdot z}{z}} \]
    7. Step-by-step derivation
      1. expm1-def61.0%

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

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \color{blue}{\frac{t \cdot a}{z}} + -1 \cdot z}{z}} \]
      3. *-commutative69.4%

        \[\leadsto \frac{x \cdot y}{\frac{0.5 \cdot \frac{\color{blue}{a \cdot t}}{z} + -1 \cdot z}{z}} \]
      4. associate-*r/72.1%

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

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

    if 7.20000000000000001e-142 < z

    1. Initial program 66.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 7.2 \cdot 10^{-142}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 14: 73.9% accurate, 9.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-160}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{-z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2e+51)
   (* x (- y))
   (if (<= z 9e-160) (* y (/ (* z x) (- z))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2e+51) {
		tmp = x * -y;
	} else if (z <= 9e-160) {
		tmp = y * ((z * x) / -z);
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-2d+51)) then
        tmp = x * -y
    else if (z <= 9d-160) then
        tmp = y * ((z * x) / -z)
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2e+51) {
		tmp = x * -y;
	} else if (z <= 9e-160) {
		tmp = y * ((z * x) / -z);
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2e+51:
		tmp = x * -y
	elif z <= 9e-160:
		tmp = y * ((z * x) / -z)
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2e+51)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 9e-160)
		tmp = Float64(y * Float64(Float64(z * x) / Float64(-z)));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2e+51)
		tmp = x * -y;
	elseif (z <= 9e-160)
		tmp = y * ((z * x) / -z);
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+51], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9e-160], N[(y * N[(N[(z * x), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-160}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{-z}\\

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


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

    1. Initial program 39.8%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-196.9%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified96.9%

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

    if -2e51 < z < 9.00000000000000053e-160

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

    if 9.00000000000000053e-160 < z

    1. Initial program 65.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-160}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{-z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 15: 75.5% accurate, 9.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-100}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-159}:\\ \;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{-z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.2e-100)
   (* x (- y))
   (if (<= z 2.15e-159) (/ (* y (* z x)) (- z)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.2e-100) {
		tmp = x * -y;
	} else if (z <= 2.15e-159) {
		tmp = (y * (z * x)) / -z;
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.2d-100)) then
        tmp = x * -y
    else if (z <= 2.15d-159) then
        tmp = (y * (z * x)) / -z
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.2e-100) {
		tmp = x * -y;
	} else if (z <= 2.15e-159) {
		tmp = (y * (z * x)) / -z;
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.2e-100:
		tmp = x * -y
	elif z <= 2.15e-159:
		tmp = (y * (z * x)) / -z
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.2e-100)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 2.15e-159)
		tmp = Float64(Float64(y * Float64(z * x)) / Float64(-z));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.2e-100)
		tmp = x * -y;
	elseif (z <= 2.15e-159)
		tmp = (y * (z * x)) / -z;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e-100], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.15e-159], N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.20000000000000017e-100

    1. Initial program 54.5%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-186.6%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified86.6%

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

    if -3.20000000000000017e-100 < z < 2.15e-159

    1. Initial program 75.2%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Taylor expanded in z around -inf 30.9%

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{-1 \cdot z}} \]
    3. Step-by-step derivation
      1. neg-mul-135.8%

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

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

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

    if 2.15e-159 < z

    1. Initial program 65.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-100}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-159}:\\ \;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{-z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 16: 73.0% accurate, 10.2× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 10^{-126}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -7e-106)
   (* x (- y))
   (if (<= z 1e-126) (* y (/ (* z x) z)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e-106) {
		tmp = x * -y;
	} else if (z <= 1e-126) {
		tmp = y * ((z * x) / z);
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-7d-106)) then
        tmp = x * -y
    else if (z <= 1d-126) then
        tmp = y * ((z * x) / z)
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7e-106) {
		tmp = x * -y;
	} else if (z <= 1e-126) {
		tmp = y * ((z * x) / z);
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -7e-106:
		tmp = x * -y
	elif z <= 1e-126:
		tmp = y * ((z * x) / z)
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -7e-106)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 1e-126)
		tmp = Float64(y * Float64(Float64(z * x) / z));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -7e-106)
		tmp = x * -y;
	elseif (z <= 1e-126)
		tmp = y * ((z * x) / z);
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e-106], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1e-126], N[(y * N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7e-106

    1. Initial program 56.5%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-186.2%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified86.2%

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

    if -7e-106 < z < 9.9999999999999995e-127

    1. Initial program 73.6%

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

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

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

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

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

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

    if 9.9999999999999995e-127 < z

    1. Initial program 65.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 10^{-126}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 17: 72.7% accurate, 18.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4e-310) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4e-310) {
		tmp = x * -y;
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-4d-310)) then
        tmp = x * -y
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4e-310) {
		tmp = x * -y;
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4e-310:
		tmp = x * -y
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4e-310)
		tmp = Float64(x * Float64(-y));
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4e-310)
		tmp = x * -y;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-310], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.999999999999988e-310

    1. Initial program 60.0%

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-169.8%

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

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

    if -3.999999999999988e-310 < z

    1. Initial program 67.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 18: 42.9% accurate, 37.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ x \cdot y \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	return x * y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
	return x * y;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	return x * y
x, y = sort([x, y])
function code(x, y, z, t, a)
	return Float64(x * y)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
	tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Derivation
  1. Initial program 64.0%

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

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

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

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

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

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

    \[\leadsto x \cdot y \]

Developer target: 89.2% accurate, 1.0× 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 2023195 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (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)))))