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

Percentage Accurate: 61.5% → 91.1%
Time: 14.8s
Alternatives: 13
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 13 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 91.1% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := \sqrt{z \cdot z - t \cdot a}\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+84}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-223}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+106}:\\ \;\;\;\;\frac{y \cdot x}{\frac{t_1}{z}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \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) (* t a)))))
   (if (<= z -1.7e+84)
     (* y (- x))
     (if (<= z 7.5e-223)
       (* y (/ (* z x) t_1))
       (if (<= z 2.8e+106) (/ (* y x) (/ t_1 z)) (* y x))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double t_1 = sqrt(((z * z) - (t * a)));
	double tmp;
	if (z <= -1.7e+84) {
		tmp = y * -x;
	} else if (z <= 7.5e-223) {
		tmp = y * ((z * x) / t_1);
	} else if (z <= 2.8e+106) {
		tmp = (y * x) / (t_1 / z);
	} else {
		tmp = y * x;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = sqrt(((z * z) - (t * a)))
    if (z <= (-1.7d+84)) then
        tmp = y * -x
    else if (z <= 7.5d-223) then
        tmp = y * ((z * x) / t_1)
    else if (z <= 2.8d+106) then
        tmp = (y * x) / (t_1 / z)
    else
        tmp = y * x
    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) - (t * a)));
	double tmp;
	if (z <= -1.7e+84) {
		tmp = y * -x;
	} else if (z <= 7.5e-223) {
		tmp = y * ((z * x) / t_1);
	} else if (z <= 2.8e+106) {
		tmp = (y * x) / (t_1 / z);
	} else {
		tmp = y * x;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	t_1 = math.sqrt(((z * z) - (t * a)))
	tmp = 0
	if z <= -1.7e+84:
		tmp = y * -x
	elif z <= 7.5e-223:
		tmp = y * ((z * x) / t_1)
	elif z <= 2.8e+106:
		tmp = (y * x) / (t_1 / z)
	else:
		tmp = y * x
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a)))
	tmp = 0.0
	if (z <= -1.7e+84)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 7.5e-223)
		tmp = Float64(y * Float64(Float64(z * x) / t_1));
	elseif (z <= 2.8e+106)
		tmp = Float64(Float64(y * x) / Float64(t_1 / z));
	else
		tmp = Float64(y * x);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = sqrt(((z * z) - (t * a)));
	tmp = 0.0;
	if (z <= -1.7e+84)
		tmp = y * -x;
	elseif (z <= 7.5e-223)
		tmp = y * ((z * x) / t_1);
	elseif (z <= 2.8e+106)
		tmp = (y * x) / (t_1 / z);
	else
		tmp = y * x;
	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[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.7e+84], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 7.5e-223], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+106], N[(N[(y * x), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+84}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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

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


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

    1. Initial program 38.6%

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

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

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

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

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

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

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

    if -1.6999999999999999e84 < z < 7.50000000000000074e-223

    1. Initial program 87.5%

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

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

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

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

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

    if 7.50000000000000074e-223 < z < 2.79999999999999993e106

    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. associate-/l*98.3%

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

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

    if 2.79999999999999993e106 < z

    1. Initial program 31.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+84}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-223}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+106}:\\ \;\;\;\;\frac{y \cdot x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 2: 90.3% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := \sqrt{z \cdot z - t \cdot a}\\ t_2 := y \cdot \frac{z \cdot x}{t_1}\\ \mathbf{if}\;z \leq -2.3 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-192}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-46}:\\ \;\;\;\;x \cdot \left(z \cdot \frac{y}{t_1}\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+88}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{t}{z} \cdot \frac{a}{z}\right)}\\ \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) (* t a)))) (t_2 (* y (/ (* z x) t_1))))
   (if (<= z -2.3e+86)
     (* y (- x))
     (if (<= z 1.1e-192)
       t_2
       (if (<= z 1.12e-46)
         (* x (* z (/ y t_1)))
         (if (<= z 1.25e+88)
           t_2
           (/ (* y x) (+ 1.0 (* -0.5 (* (/ t z) (/ a z)))))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double t_1 = sqrt(((z * z) - (t * a)));
	double t_2 = y * ((z * x) / t_1);
	double tmp;
	if (z <= -2.3e+86) {
		tmp = y * -x;
	} else if (z <= 1.1e-192) {
		tmp = t_2;
	} else if (z <= 1.12e-46) {
		tmp = x * (z * (y / t_1));
	} else if (z <= 1.25e+88) {
		tmp = t_2;
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
	}
	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) - (t * a)))
    t_2 = y * ((z * x) / t_1)
    if (z <= (-2.3d+86)) then
        tmp = y * -x
    else if (z <= 1.1d-192) then
        tmp = t_2
    else if (z <= 1.12d-46) then
        tmp = x * (z * (y / t_1))
    else if (z <= 1.25d+88) then
        tmp = t_2
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((t / z) * (a / z))))
    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) - (t * a)));
	double t_2 = y * ((z * x) / t_1);
	double tmp;
	if (z <= -2.3e+86) {
		tmp = y * -x;
	} else if (z <= 1.1e-192) {
		tmp = t_2;
	} else if (z <= 1.12e-46) {
		tmp = x * (z * (y / t_1));
	} else if (z <= 1.25e+88) {
		tmp = t_2;
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	t_1 = math.sqrt(((z * z) - (t * a)))
	t_2 = y * ((z * x) / t_1)
	tmp = 0
	if z <= -2.3e+86:
		tmp = y * -x
	elif z <= 1.1e-192:
		tmp = t_2
	elif z <= 1.12e-46:
		tmp = x * (z * (y / t_1))
	elif z <= 1.25e+88:
		tmp = t_2
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))))
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a)))
	t_2 = Float64(y * Float64(Float64(z * x) / t_1))
	tmp = 0.0
	if (z <= -2.3e+86)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.1e-192)
		tmp = t_2;
	elseif (z <= 1.12e-46)
		tmp = Float64(x * Float64(z * Float64(y / t_1)));
	elseif (z <= 1.25e+88)
		tmp = t_2;
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(t / z) * Float64(a / z)))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = sqrt(((z * z) - (t * a)));
	t_2 = y * ((z * x) / t_1);
	tmp = 0.0;
	if (z <= -2.3e+86)
		tmp = y * -x;
	elseif (z <= 1.1e-192)
		tmp = t_2;
	elseif (z <= 1.12e-46)
		tmp = x * (z * (y / t_1));
	elseif (z <= 1.25e+88)
		tmp = t_2;
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
	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[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+86], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.1e-192], t$95$2, If[LessEqual[z, 1.12e-46], N[(x * N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+88], t$95$2, N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(t / z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
t_2 := y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-192}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 1.25 \cdot 10^{+88}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 38.6%

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

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

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

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

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

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

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

    if -2.2999999999999999e86 < z < 1.10000000000000003e-192 or 1.11999999999999997e-46 < z < 1.24999999999999999e88

    1. Initial program 91.0%

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

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

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

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

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

    if 1.10000000000000003e-192 < z < 1.11999999999999997e-46

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)\right)} \]
      5. expm1-udef36.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)} - 1} \]
      6. div-inv36.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
      7. associate-*l*36.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)}\right)} - 1 \]
      8. div-inv36.0%

        \[\leadsto e^{\mathsf{log1p}\left(\left(x \cdot y\right) \cdot \color{blue}{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
    5. Applied egg-rr36.0%

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

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

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

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

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

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

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

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

    if 1.24999999999999999e88 < z

    1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-192}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-46}:\\ \;\;\;\;x \cdot \left(z \cdot \frac{y}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+88}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{t}{z} \cdot \frac{a}{z}\right)}\\ \end{array} \]

Alternative 3: 90.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 36.3%

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

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

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

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

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

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

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

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

    if -1.69999999999999997e100 < z < 2.65e106

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)} - 1} \]
      6. div-inv39.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
      7. associate-*l*39.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)}\right)} - 1 \]
      8. div-inv39.7%

        \[\leadsto e^{\mathsf{log1p}\left(\left(x \cdot y\right) \cdot \color{blue}{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
    5. Applied egg-rr39.7%

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

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

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

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

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

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

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

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

    if 2.65e106 < z

    1. Initial program 31.6%

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

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

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

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

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

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

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

Alternative 4: 83.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 59.0%

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

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

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

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

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

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

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

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

    if -8.5000000000000004e-58 < z < 3.59999999999999978e-135

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999978e-135 < z

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{1 + -0.5 \cdot \frac{\color{blue}{t \cdot a}}{{z}^{2}}} \]
      2. unpow283.7%

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

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

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

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

Alternative 5: 76.9% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

    if -3.2000000000000001e-141 < z < 1.2e88

    1. Initial program 91.4%

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

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

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

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

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

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

    if 1.2e88 < z

    1. Initial program 36.4%

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

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

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

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

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

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

Alternative 6: 75.2% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

    if -1.25e-136 < z < 4.20000000000000005e-263

    1. Initial program 76.1%

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

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

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

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

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

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

    if 4.20000000000000005e-263 < z

    1. Initial program 66.0%

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

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

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

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

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

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

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

Alternative 7: 75.9% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

    if -2.80000000000000012e-141 < z < 1.25000000000000005e-167

    1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

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

    if 1.25000000000000005e-167 < z

    1. Initial program 63.6%

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

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

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

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

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

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

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

Alternative 8: 75.2% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

    if -8.5000000000000003e-139 < z < 4.20000000000000005e-263

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)\right)} \]
      5. expm1-udef57.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)} - 1} \]
      6. div-inv57.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
      7. associate-*l*57.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)}\right)} - 1 \]
      8. div-inv57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000005e-263 < z

    1. Initial program 66.0%

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

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

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

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

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

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

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

Alternative 9: 75.5% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

    if -4.8000000000000002e-141 < z < 4.20000000000000005e-263

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)\right)} \]
      5. expm1-udef57.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)} - 1} \]
      6. div-inv57.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
      7. associate-*l*57.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)}\right)} - 1 \]
      8. div-inv57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000005e-263 < z

    1. Initial program 66.0%

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

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

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

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

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

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

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

Alternative 10: 77.7% accurate, 6.6× speedup?

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

    if -3.9999999999999999e-140 < z

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{1 + -0.5 \cdot \frac{\color{blue}{t \cdot a}}{{z}^{2}}} \]
      2. unpow274.7%

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

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

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

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

Alternative 11: 73.8% accurate, 10.2× speedup?

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

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

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


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

    1. Initial program 64.7%

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

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

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

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

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

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

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

    if -1.90000000000000011e-171 < z < 4.20000000000000005e-263

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\right)} - 1} \]
      6. div-inv62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
      7. associate-*l*62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(x \cdot y\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)}\right)} - 1 \]
      8. div-inv62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\left(x \cdot y\right) \cdot \color{blue}{\frac{z}{\sqrt{z \cdot z - t \cdot a}}}\right)} - 1 \]
    5. Applied egg-rr62.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{y \cdot z}{z}} \]
    10. Applied egg-rr48.0%

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

    if 4.20000000000000005e-263 < z

    1. Initial program 66.0%

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

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

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

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

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

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

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

Alternative 12: 72.7% accurate, 18.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-311}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \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-311) (* y (- x)) (* y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4e-311) {
		tmp = y * -x;
	} else {
		tmp = y * x;
	}
	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-311)) then
        tmp = y * -x
    else
        tmp = y * x
    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-311) {
		tmp = y * -x;
	} else {
		tmp = y * x;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4e-311:
		tmp = y * -x
	else:
		tmp = y * x
	return tmp
x, y = sort([x, y])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4e-311)
		tmp = Float64(y * Float64(-x));
	else
		tmp = Float64(y * x);
	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-311)
		tmp = y * -x;
	else
		tmp = y * x;
	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-311], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-311}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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


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

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

    if -3.99999999999979e-311 < z

    1. Initial program 65.9%

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

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

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

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

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

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

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

Alternative 13: 42.7% accurate, 37.7× speedup?

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

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

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

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

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

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

    \[\leadsto y \cdot \color{blue}{x} \]
  5. Final simplification46.4%

    \[\leadsto y \cdot x \]

Developer target: 89.5% 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 2023224 
(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)))))