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

Percentage Accurate: 61.1% → 88.6%
Time: 19.1s
Alternatives: 15
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 15 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.1% 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: 88.6% 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}\\ t_2 := x \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -8.8 \cdot 10^{+114}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-147}:\\ \;\;\;\;\frac{x}{t_1} \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+26}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\ \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)))) (t_2 (* x (- y))))
   (if (<= z -8.8e+114)
     t_2
     (if (<= z -3.3e-147)
       (* (/ x t_1) (* z y))
       (if (<= z -3.35e-180)
         t_2
         (if (<= z 3.2e+26) (* y (/ (* z x) t_1)) (* 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 t_2 = x * -y;
	double tmp;
	if (z <= -8.8e+114) {
		tmp = t_2;
	} else if (z <= -3.3e-147) {
		tmp = (x / t_1) * (z * y);
	} else if (z <= -3.35e-180) {
		tmp = t_2;
	} else if (z <= 3.2e+26) {
		tmp = y * ((z * x) / t_1);
	} 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) :: t_2
    real(8) :: tmp
    t_1 = sqrt(((z * z) - (a * t)))
    t_2 = x * -y
    if (z <= (-8.8d+114)) then
        tmp = t_2
    else if (z <= (-3.3d-147)) then
        tmp = (x / t_1) * (z * y)
    else if (z <= (-3.35d-180)) then
        tmp = t_2
    else if (z <= 3.2d+26) then
        tmp = y * ((z * x) / t_1)
    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 t_2 = x * -y;
	double tmp;
	if (z <= -8.8e+114) {
		tmp = t_2;
	} else if (z <= -3.3e-147) {
		tmp = (x / t_1) * (z * y);
	} else if (z <= -3.35e-180) {
		tmp = t_2;
	} else if (z <= 3.2e+26) {
		tmp = y * ((z * x) / t_1);
	} 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)))
	t_2 = x * -y
	tmp = 0
	if z <= -8.8e+114:
		tmp = t_2
	elif z <= -3.3e-147:
		tmp = (x / t_1) * (z * y)
	elif z <= -3.35e-180:
		tmp = t_2
	elif z <= 3.2e+26:
		tmp = y * ((z * x) / t_1)
	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)))
	t_2 = Float64(x * Float64(-y))
	tmp = 0.0
	if (z <= -8.8e+114)
		tmp = t_2;
	elseif (z <= -3.3e-147)
		tmp = Float64(Float64(x / t_1) * Float64(z * y));
	elseif (z <= -3.35e-180)
		tmp = t_2;
	elseif (z <= 3.2e+26)
		tmp = Float64(y * Float64(Float64(z * x) / t_1));
	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)));
	t_2 = x * -y;
	tmp = 0.0;
	if (z <= -8.8e+114)
		tmp = t_2;
	elseif (z <= -3.3e-147)
		tmp = (x / t_1) * (z * y);
	elseif (z <= -3.35e-180)
		tmp = t_2;
	elseif (z <= 3.2e+26)
		tmp = y * ((z * x) / t_1);
	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]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -8.8e+114], t$95$2, If[LessEqual[z, -3.3e-147], N[(N[(x / t$95$1), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.35e-180], t$95$2, If[LessEqual[z, 3.2e+26], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $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}\\
t_2 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+114}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\
\;\;\;\;t_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.8000000000000001e114 or -3.29999999999999987e-147 < z < -3.3499999999999999e-180

    1. Initial program 27.2%

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

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

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

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

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

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

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

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

    if -8.8000000000000001e114 < z < -3.29999999999999987e-147

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3499999999999999e-180 < z < 3.20000000000000029e26

    1. Initial program 77.8%

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

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

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

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

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

    if 3.20000000000000029e26 < z

    1. Initial program 36.8%

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

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

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

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

      \[\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}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification88.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+114}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-147}:\\ \;\;\;\;\frac{x}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+26}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 2: 88.6% 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}\\ t_2 := x \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -5.3 \cdot 10^{+106}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-147}:\\ \;\;\;\;z \cdot \left(y \cdot \frac{x}{t_1}\right)\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+26}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\ \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)))) (t_2 (* x (- y))))
   (if (<= z -5.3e+106)
     t_2
     (if (<= z -3.3e-147)
       (* z (* y (/ x t_1)))
       (if (<= z -3.35e-180)
         t_2
         (if (<= z 3.8e+26) (* y (/ (* z x) t_1)) (* 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 t_2 = x * -y;
	double tmp;
	if (z <= -5.3e+106) {
		tmp = t_2;
	} else if (z <= -3.3e-147) {
		tmp = z * (y * (x / t_1));
	} else if (z <= -3.35e-180) {
		tmp = t_2;
	} else if (z <= 3.8e+26) {
		tmp = y * ((z * x) / t_1);
	} 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) :: t_2
    real(8) :: tmp
    t_1 = sqrt(((z * z) - (a * t)))
    t_2 = x * -y
    if (z <= (-5.3d+106)) then
        tmp = t_2
    else if (z <= (-3.3d-147)) then
        tmp = z * (y * (x / t_1))
    else if (z <= (-3.35d-180)) then
        tmp = t_2
    else if (z <= 3.8d+26) then
        tmp = y * ((z * x) / t_1)
    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 t_2 = x * -y;
	double tmp;
	if (z <= -5.3e+106) {
		tmp = t_2;
	} else if (z <= -3.3e-147) {
		tmp = z * (y * (x / t_1));
	} else if (z <= -3.35e-180) {
		tmp = t_2;
	} else if (z <= 3.8e+26) {
		tmp = y * ((z * x) / t_1);
	} 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)))
	t_2 = x * -y
	tmp = 0
	if z <= -5.3e+106:
		tmp = t_2
	elif z <= -3.3e-147:
		tmp = z * (y * (x / t_1))
	elif z <= -3.35e-180:
		tmp = t_2
	elif z <= 3.8e+26:
		tmp = y * ((z * x) / t_1)
	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)))
	t_2 = Float64(x * Float64(-y))
	tmp = 0.0
	if (z <= -5.3e+106)
		tmp = t_2;
	elseif (z <= -3.3e-147)
		tmp = Float64(z * Float64(y * Float64(x / t_1)));
	elseif (z <= -3.35e-180)
		tmp = t_2;
	elseif (z <= 3.8e+26)
		tmp = Float64(y * Float64(Float64(z * x) / t_1));
	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)));
	t_2 = x * -y;
	tmp = 0.0;
	if (z <= -5.3e+106)
		tmp = t_2;
	elseif (z <= -3.3e-147)
		tmp = z * (y * (x / t_1));
	elseif (z <= -3.35e-180)
		tmp = t_2;
	elseif (z <= 3.8e+26)
		tmp = y * ((z * x) / t_1);
	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]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -5.3e+106], t$95$2, If[LessEqual[z, -3.3e-147], N[(z * N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.35e-180], t$95$2, If[LessEqual[z, 3.8e+26], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $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}\\
t_2 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -5.3 \cdot 10^{+106}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\
\;\;\;\;t_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.3e106 or -3.29999999999999987e-147 < z < -3.3499999999999999e-180

    1. Initial program 30.5%

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

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

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

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

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

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

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

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

    if -5.3e106 < z < -3.29999999999999987e-147

    1. Initial program 91.6%

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

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

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

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

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

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

    if -3.3499999999999999e-180 < z < 3.8000000000000002e26

    1. Initial program 77.8%

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

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

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

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

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

    if 3.8000000000000002e26 < z

    1. Initial program 36.8%

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

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

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

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

      \[\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}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.3 \cdot 10^{+106}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-147}:\\ \;\;\;\;z \cdot \left(y \cdot \frac{x}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+26}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\ \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.4 \cdot 10^{+19}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+26}:\\ \;\;\;\;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 -1.4e+19)
   (* x (- y))
   (if (<= z 2.15e+26) (* 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 <= -1.4e+19) {
		tmp = x * -y;
	} else if (z <= 2.15e+26) {
		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 <= (-1.4d+19)) then
        tmp = x * -y
    else if (z <= 2.15d+26) 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 <= -1.4e+19) {
		tmp = x * -y;
	} else if (z <= 2.15e+26) {
		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 <= -1.4e+19:
		tmp = x * -y
	elif z <= 2.15e+26:
		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 <= -1.4e+19)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 2.15e+26)
		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 <= -1.4e+19)
		tmp = x * -y;
	elseif (z <= 2.15e+26)
		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, -1.4e+19], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.15e+26], 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.4 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{+26}:\\
\;\;\;\;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.4e19

    1. Initial program 50.7%

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

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

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

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

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

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

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

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

    if -1.4e19 < z < 2.1499999999999999e26

    1. Initial program 81.5%

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

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

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

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

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

    if 2.1499999999999999e26 < z

    1. Initial program 36.8%

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

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

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

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

      \[\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}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+19}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+26}:\\ \;\;\;\;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 -1.4 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{a}{z} \cdot \frac{t}{z}, -1\right) \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+26}:\\ \;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot 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 -1.4e+154)
   (* (fma -0.5 (* (/ a z) (/ t z)) -1.0) (* x y))
   (if (<= z 3.8e+26) (* (/ z (sqrt (- (* z z) (* a t)))) (* x y)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.4e+154) {
		tmp = fma(-0.5, ((a / z) * (t / z)), -1.0) * (x * y);
	} else if (z <= 3.8e+26) {
		tmp = (z / sqrt(((z * z) - (a * t)))) * (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 <= -1.4e+154)
		tmp = Float64(fma(-0.5, Float64(Float64(a / z) * Float64(t / z)), -1.0) * Float64(x * y));
	elseif (z <= 3.8e+26)
		tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * 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_] := If[LessEqual[z, -1.4e+154], N[(N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+26], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{a}{z} \cdot \frac{t}{z}, -1\right) \cdot \left(x \cdot y\right)\\

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

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


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

    1. Initial program 10.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e154 < z < 3.8000000000000002e26

    1. Initial program 81.7%

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

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

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

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

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

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

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

    if 3.8000000000000002e26 < z

    1. Initial program 36.8%

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

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

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

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

      \[\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}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{a}{z} \cdot \frac{t}{z}, -1\right) \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+26}:\\ \;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 5: 90.6% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+121}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+26}:\\ \;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot 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 -1e+121)
   (* x (- y))
   (if (<= z 3.4e+26) (* (/ z (sqrt (- (* z z) (* a t)))) (* x y)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1e+121) {
		tmp = x * -y;
	} else if (z <= 3.4e+26) {
		tmp = (z / sqrt(((z * z) - (a * t)))) * (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 <= (-1d+121)) then
        tmp = x * -y
    else if (z <= 3.4d+26) then
        tmp = (z / sqrt(((z * z) - (a * t)))) * (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 <= -1e+121) {
		tmp = x * -y;
	} else if (z <= 3.4e+26) {
		tmp = (z / Math.sqrt(((z * z) - (a * t)))) * (x * y);
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1e+121:
		tmp = x * -y
	elif z <= 3.4e+26:
		tmp = (z / math.sqrt(((z * z) - (a * t)))) * (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 <= -1e+121)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 3.4e+26)
		tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * 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 <= -1e+121)
		tmp = x * -y;
	elseif (z <= 3.4e+26)
		tmp = (z / sqrt(((z * z) - (a * t)))) * (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, -1e+121], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.4e+26], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $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^{+121}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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


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

    1. Initial program 27.6%

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

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

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

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

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

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

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

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

    if -1.00000000000000004e121 < z < 3.4000000000000003e26

    1. Initial program 82.0%

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

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

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

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

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

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

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

    if 3.4000000000000003e26 < z

    1. Initial program 36.8%

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

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

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

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

      \[\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}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.8%

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

Alternative 6: 83.1% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+56}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \frac{a \cdot t}{z} - z}{z}}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-106}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \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.7e+56)
   (* x (- y))
   (if (<= z -3.35e-180)
     (/ (* x y) (/ (- (* 0.5 (/ (* a t) z)) z) z))
     (if (<= z 7.2e-106)
       (* y (/ (* z x) (sqrt (* a (- t)))))
       (/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.7e+56) {
		tmp = x * -y;
	} else if (z <= -3.35e-180) {
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
	} else if (z <= 7.2e-106) {
		tmp = y * ((z * x) / sqrt((a * -t)));
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	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.7d+56)) then
        tmp = x * -y
    else if (z <= (-3.35d-180)) then
        tmp = (x * y) / (((0.5d0 * ((a * t) / z)) - z) / z)
    else if (z <= 7.2d-106) then
        tmp = y * ((z * x) / sqrt((a * -t)))
    else
        tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
    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.7e+56) {
		tmp = x * -y;
	} else if (z <= -3.35e-180) {
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
	} else if (z <= 7.2e-106) {
		tmp = y * ((z * x) / Math.sqrt((a * -t)));
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.7e+56:
		tmp = x * -y
	elif z <= -3.35e-180:
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z)
	elif z <= 7.2e-106:
		tmp = y * ((z * x) / math.sqrt((a * -t)))
	else:
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))))
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.7e+56)
		tmp = Float64(x * Float64(-y));
	elseif (z <= -3.35e-180)
		tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z) / z));
	elseif (z <= 7.2e-106)
		tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t)))));
	else
		tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t)))));
	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.7e+56)
		tmp = x * -y;
	elseif (z <= -3.35e-180)
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
	elseif (z <= 7.2e-106)
		tmp = y * ((z * x) / sqrt((a * -t)));
	else
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	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.7e+56], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -3.35e-180], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-106], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\


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

    1. Initial program 44.2%

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

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

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

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

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

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

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

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

    if -3.69999999999999997e56 < z < -3.3499999999999999e-180

    1. Initial program 89.5%

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

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

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

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

    if -3.3499999999999999e-180 < z < 7.20000000000000025e-106

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

    if 7.20000000000000025e-106 < z

    1. Initial program 55.6%

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification84.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+56}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \frac{a \cdot t}{z} - z}{z}}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-106}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \end{array} \]

Alternative 7: 77.4% accurate, 4.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := x \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -210000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-132}:\\ \;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-195}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+23}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{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
 (let* ((t_1 (* x (- y))))
   (if (<= z -210000.0)
     t_1
     (if (<= z -9e-132)
       (* y (/ z (/ (- (* 0.5 (* a (/ t z))) z) x)))
       (if (<= z -2.2e-195)
         t_1
         (if (<= z 2.1e+23)
           (* y (/ (* z x) (+ z (* -0.5 (/ (* a t) z)))))
           (* x y)))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * -y;
	double tmp;
	if (z <= -210000.0) {
		tmp = t_1;
	} else if (z <= -9e-132) {
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	} else if (z <= -2.2e-195) {
		tmp = t_1;
	} else if (z <= 2.1e+23) {
		tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / 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) :: t_1
    real(8) :: tmp
    t_1 = x * -y
    if (z <= (-210000.0d0)) then
        tmp = t_1
    else if (z <= (-9d-132)) then
        tmp = y * (z / (((0.5d0 * (a * (t / z))) - z) / x))
    else if (z <= (-2.2d-195)) then
        tmp = t_1
    else if (z <= 2.1d+23) then
        tmp = y * ((z * x) / (z + ((-0.5d0) * ((a * t) / 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 t_1 = x * -y;
	double tmp;
	if (z <= -210000.0) {
		tmp = t_1;
	} else if (z <= -9e-132) {
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	} else if (z <= -2.2e-195) {
		tmp = t_1;
	} else if (z <= 2.1e+23) {
		tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	t_1 = x * -y
	tmp = 0
	if z <= -210000.0:
		tmp = t_1
	elif z <= -9e-132:
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x))
	elif z <= -2.2e-195:
		tmp = t_1
	elif z <= 2.1e+23:
		tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(-y))
	tmp = 0.0
	if (z <= -210000.0)
		tmp = t_1;
	elseif (z <= -9e-132)
		tmp = Float64(y * Float64(z / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / x)));
	elseif (z <= -2.2e-195)
		tmp = t_1;
	elseif (z <= 2.1e+23)
		tmp = Float64(y * Float64(Float64(z * x) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / 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)
	t_1 = x * -y;
	tmp = 0.0;
	if (z <= -210000.0)
		tmp = t_1;
	elseif (z <= -9e-132)
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	elseif (z <= -2.2e-195)
		tmp = t_1;
	elseif (z <= 2.1e+23)
		tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / 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_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -210000.0], t$95$1, If[LessEqual[z, -9e-132], N[(y * N[(z / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-195], t$95$1, If[LessEqual[z, 2.1e+23], N[(y * N[(N[(z * x), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -210000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-195}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+23}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.1e5 or -8.9999999999999999e-132 < z < -2.20000000000000005e-195

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

    if -2.1e5 < z < -8.9999999999999999e-132

    1. Initial program 96.8%

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z}{\frac{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}{x}}} \]
      2. neg-mul-182.2%

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

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

        \[\leadsto y \cdot \frac{z}{\frac{\color{blue}{-1 \cdot z} + 0.5 \cdot \frac{a \cdot t}{z}}{x}} \]
      5. neg-mul-182.2%

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

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

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

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

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

    if -2.20000000000000005e-195 < z < 2.1000000000000001e23

    1. Initial program 77.5%

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

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

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

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

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

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

    if 2.1000000000000001e23 < z

    1. Initial program 36.8%

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

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

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

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

      \[\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}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -210000:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-132}:\\ \;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-195}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+23}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 8: 77.3% accurate, 5.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := x \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -180000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-135}:\\ \;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{-194}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \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 (* x (- y))))
   (if (<= z -180000.0)
     t_1
     (if (<= z -3e-135)
       (* y (/ z (/ (- (* 0.5 (* a (/ t z))) z) x)))
       (if (<= z -2.05e-194)
         t_1
         (/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * -y;
	double tmp;
	if (z <= -180000.0) {
		tmp = t_1;
	} else if (z <= -3e-135) {
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	} else if (z <= -2.05e-194) {
		tmp = t_1;
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	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 = x * -y
    if (z <= (-180000.0d0)) then
        tmp = t_1
    else if (z <= (-3d-135)) then
        tmp = y * (z / (((0.5d0 * (a * (t / z))) - z) / x))
    else if (z <= (-2.05d-194)) then
        tmp = t_1
    else
        tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
    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 = x * -y;
	double tmp;
	if (z <= -180000.0) {
		tmp = t_1;
	} else if (z <= -3e-135) {
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	} else if (z <= -2.05e-194) {
		tmp = t_1;
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	t_1 = x * -y
	tmp = 0
	if z <= -180000.0:
		tmp = t_1
	elif z <= -3e-135:
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x))
	elif z <= -2.05e-194:
		tmp = t_1
	else:
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))))
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(-y))
	tmp = 0.0
	if (z <= -180000.0)
		tmp = t_1;
	elseif (z <= -3e-135)
		tmp = Float64(y * Float64(z / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / x)));
	elseif (z <= -2.05e-194)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t)))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * -y;
	tmp = 0.0;
	if (z <= -180000.0)
		tmp = t_1;
	elseif (z <= -3e-135)
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	elseif (z <= -2.05e-194)
		tmp = t_1;
	else
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	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[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -180000.0], t$95$1, If[LessEqual[z, -3e-135], N[(y * N[(z / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.05e-194], t$95$1, N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -180000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -2.05 \cdot 10^{-194}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.8e5 or -3.00000000000000012e-135 < z < -2.0500000000000001e-194

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

    if -1.8e5 < z < -3.00000000000000012e-135

    1. Initial program 96.8%

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z}{\frac{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}{x}}} \]
      2. neg-mul-182.2%

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

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

        \[\leadsto y \cdot \frac{z}{\frac{\color{blue}{-1 \cdot z} + 0.5 \cdot \frac{a \cdot t}{z}}{x}} \]
      5. neg-mul-182.2%

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

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

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

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

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

    if -2.0500000000000001e-194 < z

    1. Initial program 58.1%

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -180000:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-135}:\\ \;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{-194}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \end{array} \]

Alternative 9: 77.4% accurate, 5.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := x \cdot \left(-y\right)\\ \mathbf{if}\;z \leq -2.05 \cdot 10^{+49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-137}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-195}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \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 (* x (- y))))
   (if (<= z -2.05e+49)
     t_1
     (if (<= z -9.2e-137)
       (/ (* z (* x y)) (- (* 0.5 (* a (/ t z))) z))
       (if (<= z -9e-195)
         t_1
         (/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * -y;
	double tmp;
	if (z <= -2.05e+49) {
		tmp = t_1;
	} else if (z <= -9.2e-137) {
		tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z);
	} else if (z <= -9e-195) {
		tmp = t_1;
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	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 = x * -y
    if (z <= (-2.05d+49)) then
        tmp = t_1
    else if (z <= (-9.2d-137)) then
        tmp = (z * (x * y)) / ((0.5d0 * (a * (t / z))) - z)
    else if (z <= (-9d-195)) then
        tmp = t_1
    else
        tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
    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 = x * -y;
	double tmp;
	if (z <= -2.05e+49) {
		tmp = t_1;
	} else if (z <= -9.2e-137) {
		tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z);
	} else if (z <= -9e-195) {
		tmp = t_1;
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	t_1 = x * -y
	tmp = 0
	if z <= -2.05e+49:
		tmp = t_1
	elif z <= -9.2e-137:
		tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z)
	elif z <= -9e-195:
		tmp = t_1
	else:
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))))
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(-y))
	tmp = 0.0
	if (z <= -2.05e+49)
		tmp = t_1;
	elseif (z <= -9.2e-137)
		tmp = Float64(Float64(z * Float64(x * y)) / Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z));
	elseif (z <= -9e-195)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t)))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * -y;
	tmp = 0.0;
	if (z <= -2.05e+49)
		tmp = t_1;
	elseif (z <= -9.2e-137)
		tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z);
	elseif (z <= -9e-195)
		tmp = t_1;
	else
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	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[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -2.05e+49], t$95$1, If[LessEqual[z, -9.2e-137], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-195], t$95$1, N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -9 \cdot 10^{-195}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.05e49 or -9.20000000000000032e-137 < z < -9e-195

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

    if -2.05e49 < z < -9.20000000000000032e-137

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(y \cdot z\right) \cdot x}}{\mathsf{fma}\left(0.5, a \cdot \frac{t}{z}, -z\right)} \]
      5. *-commutative83.0%

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

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

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

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

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

    if -9e-195 < z

    1. Initial program 58.1%

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-137}:\\ \;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-195}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \end{array} \]

Alternative 10: 76.9% accurate, 5.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -200000:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-176}:\\ \;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\ \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 -200000.0)
   (* x (- y))
   (if (<= z 2.2e-176) (* y (/ z (/ (- (* 0.5 (* a (/ t z))) z) x))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -200000.0) {
		tmp = x * -y;
	} else if (z <= 2.2e-176) {
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	} 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 <= (-200000.0d0)) then
        tmp = x * -y
    else if (z <= 2.2d-176) then
        tmp = y * (z / (((0.5d0 * (a * (t / z))) - z) / x))
    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 <= -200000.0) {
		tmp = x * -y;
	} else if (z <= 2.2e-176) {
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -200000.0:
		tmp = x * -y
	elif z <= 2.2e-176:
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x))
	else:
		tmp = x * y
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -200000.0)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 2.2e-176)
		tmp = Float64(y * Float64(z / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / x)));
	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 <= -200000.0)
		tmp = x * -y;
	elseif (z <= 2.2e-176)
		tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
	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, -200000.0], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.2e-176], N[(y * N[(z / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -200000:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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


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

    1. Initial program 53.5%

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

        \[\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/55.5%

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

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

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

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

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

    if -2e5 < z < 2.1999999999999999e-176

    1. Initial program 77.0%

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z}{\frac{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}{x}}} \]
      2. neg-mul-159.3%

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

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

        \[\leadsto y \cdot \frac{z}{\frac{\color{blue}{-1 \cdot z} + 0.5 \cdot \frac{a \cdot t}{z}}{x}} \]
      5. neg-mul-159.3%

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

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

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

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

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

    if 2.1999999999999999e-176 < z

    1. Initial program 55.5%

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

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

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

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

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

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

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

Alternative 11: 78.3% accurate, 5.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-282}:\\ \;\;\;\;z \cdot \frac{x \cdot y}{0.5 \cdot \frac{a \cdot t}{z} - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \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 -5.2e+51)
   (* x (- y))
   (if (<= z 1.45e-282)
     (* z (/ (* x y) (- (* 0.5 (/ (* a t) z)) z)))
     (/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.2e+51) {
		tmp = x * -y;
	} else if (z <= 1.45e-282) {
		tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z));
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	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 <= (-5.2d+51)) then
        tmp = x * -y
    else if (z <= 1.45d-282) then
        tmp = z * ((x * y) / ((0.5d0 * ((a * t) / z)) - z))
    else
        tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
    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 <= -5.2e+51) {
		tmp = x * -y;
	} else if (z <= 1.45e-282) {
		tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z));
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.2e+51:
		tmp = x * -y
	elif z <= 1.45e-282:
		tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z))
	else:
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))))
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5.2e+51)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 1.45e-282)
		tmp = Float64(z * Float64(Float64(x * y) / Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z)));
	else
		tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t)))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5.2e+51)
		tmp = x * -y;
	elseif (z <= 1.45e-282)
		tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z));
	else
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	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, -5.2e+51], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.45e-282], N[(z * N[(N[(x * y), $MachinePrecision] / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\


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

    1. Initial program 44.9%

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

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

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

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

      \[\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}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. neg-mul-192.3%

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

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

    if -5.2000000000000002e51 < z < 1.44999999999999999e-282

    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/81.1%

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

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

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

    if 1.44999999999999999e-282 < z

    1. Initial program 56.9%

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.5%

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

Alternative 12: 78.5% accurate, 5.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+56}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \frac{a \cdot t}{z} - z}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \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 -6.5e+56)
   (* x (- y))
   (if (<= z 3.2e-297)
     (/ (* x y) (/ (- (* 0.5 (/ (* a t) z)) z) z))
     (/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6.5e+56) {
		tmp = x * -y;
	} else if (z <= 3.2e-297) {
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	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 <= (-6.5d+56)) then
        tmp = x * -y
    else if (z <= 3.2d-297) then
        tmp = (x * y) / (((0.5d0 * ((a * t) / z)) - z) / z)
    else
        tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
    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 <= -6.5e+56) {
		tmp = x * -y;
	} else if (z <= 3.2e-297) {
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
	} else {
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -6.5e+56:
		tmp = x * -y
	elif z <= 3.2e-297:
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z)
	else:
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))))
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -6.5e+56)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 3.2e-297)
		tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z) / z));
	else
		tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t)))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -6.5e+56)
		tmp = x * -y;
	elseif (z <= 3.2e-297)
		tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
	else
		tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	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, -6.5e+56], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.2e-297], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\


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

    1. Initial program 44.2%

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

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

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

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

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

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

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

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

    if -6.5000000000000001e56 < z < 3.19999999999999972e-297

    1. Initial program 85.5%

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

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

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

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

    if 3.19999999999999972e-297 < z

    1. Initial program 55.9%

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+56}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \frac{a \cdot t}{z} - z}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \end{array} \]

Alternative 13: 75.5% accurate, 9.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-44}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-173}:\\ \;\;\;\;\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 -4e-44)
   (* x (- y))
   (if (<= z 6.6e-173) (/ (* 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 <= -4e-44) {
		tmp = x * -y;
	} else if (z <= 6.6e-173) {
		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 <= (-4d-44)) then
        tmp = x * -y
    else if (z <= 6.6d-173) 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 <= -4e-44) {
		tmp = x * -y;
	} else if (z <= 6.6e-173) {
		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 <= -4e-44:
		tmp = x * -y
	elif z <= 6.6e-173:
		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 <= -4e-44)
		tmp = Float64(x * Float64(-y));
	elseif (z <= 6.6e-173)
		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 <= -4e-44)
		tmp = x * -y;
	elseif (z <= 6.6e-173)
		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, -4e-44], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 6.6e-173], 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 -4 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \leq 6.6 \cdot 10^{-173}:\\
\;\;\;\;\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.99999999999999981e-44

    1. Initial program 56.8%

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

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

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

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

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

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

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

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

    if -3.99999999999999981e-44 < z < 6.6000000000000006e-173

    1. Initial program 74.5%

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

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

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

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

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

    if 6.6000000000000006e-173 < z

    1. Initial program 55.5%

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

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

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

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

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

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

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

Alternative 14: 73.1% accurate, 18.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-290}:\\ \;\;\;\;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 -5e-290) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5e-290) {
		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 <= (-5d-290)) 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 <= -5e-290) {
		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 <= -5e-290:
		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 <= -5e-290)
		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 <= -5e-290)
		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, -5e-290], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-290}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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


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

    1. Initial program 63.7%

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

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

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

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

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

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

    if -5.0000000000000001e-290 < z

    1. Initial program 57.1%

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

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

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

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

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

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

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

Alternative 15: 43.3% 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 60.8%

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

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

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

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

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

    \[\leadsto y \cdot \color{blue}{x} \]
  5. Final simplification40.7%

    \[\leadsto x \cdot y \]

Developer target: 89.3% 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 2023196 
(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)))))