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

Percentage Accurate: 60.9% → 89.5%
Time: 20.6s
Alternatives: 15
Speedup: 18.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 60.9% 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: 89.5% accurate, 0.9× speedup?

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-289}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+55}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 13.6%

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

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

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

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

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

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

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

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

    if -1.00000000000000004e154 < z < -2.90000000000000006e-289 or 9.4999999999999996e-86 < z < 4.40000000000000021e55

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

    if -2.90000000000000006e-289 < z < 9.4999999999999996e-86

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.40000000000000021e55 < z

    1. Initial program 45.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-289}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-86}:\\ \;\;\;\;\left(z \cdot y\right) \cdot \frac{x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+55}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 2: 89.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 29.7%

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

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

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

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

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

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

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

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

    if -2.6e110 < z < 3.59999999999999987e55

    1. Initial program 79.0%

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

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

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

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

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

    if 3.59999999999999987e55 < z

    1. Initial program 45.4%

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

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

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

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

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

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

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

Alternative 3: 89.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\frac{\mathsf{fma}\left(z, -1, \frac{0.5}{\frac{z}{t \cdot a}}\right)}{z}} \]
      5. rem-log-exp14.9%

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

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

        \[\leadsto \frac{x \cdot y}{\frac{\log \left(e^{\color{blue}{-1 \cdot z} + \frac{0.5}{\frac{z}{t \cdot a}}}\right)}{z}} \]
      8. neg-mul-114.9%

        \[\leadsto \frac{x \cdot y}{\frac{\log \left(e^{\color{blue}{\left(-z\right)} + \frac{0.5}{\frac{z}{t \cdot a}}}\right)}{z}} \]
      9. prod-exp14.9%

        \[\leadsto \frac{x \cdot y}{\frac{\log \color{blue}{\left(e^{-z} \cdot e^{\frac{0.5}{\frac{z}{t \cdot a}}}\right)}}{z}} \]
      10. *-commutative14.9%

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

        \[\leadsto \frac{x \cdot y}{\frac{\log \color{blue}{\left(e^{\frac{0.5}{\frac{z}{t \cdot a}} + \left(-z\right)}\right)}}{z}} \]
      12. rem-log-exp93.4%

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

        \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{\frac{0.5}{\frac{z}{t \cdot a}} - z}}{z}} \]
      14. associate-/r/93.4%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\frac{0.5}{z} \cdot \left(a \cdot t\right) - z}{z}}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u64.3%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{\frac{\frac{\frac{0.5}{z} \cdot \left(a \cdot t\right) - z}{z}}{y}}}\right)} - 1 \]
      4. div-sub37.5%

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x}{\frac{\frac{\left(t \cdot a\right) \cdot \frac{0.5}{z}}{z} - \color{blue}{{z}^{\left(1 - 1\right)}}}{y}}\right)} - 1 \]
      10. metadata-eval37.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x}{\frac{\frac{\left(t \cdot a\right) \cdot \frac{0.5}{z}}{z} - {z}^{\color{blue}{0}}}{y}}\right)} - 1 \]
      11. metadata-eval37.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{0.5 \cdot \frac{a \cdot t}{{z}^{2}}} - 1} \cdot y \]
      10. fma-neg93.3%

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

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

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

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

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

    if -4.0499999999999998e61 < z < 8.39999999999999943e54

    1. Initial program 77.9%

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

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

        \[\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. *-commutative82.2%

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

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

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

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

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

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

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

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

    if 8.39999999999999943e54 < z

    1. Initial program 45.4%

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

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

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

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

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

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

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

Alternative 4: 89.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 36.6%

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

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

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

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

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

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

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

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

    if -3.99999999999999969e81 < z < 1.3200000000000001e54

    1. Initial program 77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3200000000000001e54 < z

    1. Initial program 45.4%

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

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

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

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

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

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

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

Alternative 5: 81.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.24999999999999992e-125 < z < 2.4e5

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

    if 2.4e5 < z

    1. Initial program 49.6%

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

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

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

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

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

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

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

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

Alternative 6: 81.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e-121 < z < 2.4e5

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4e5 < z

    1. Initial program 49.6%

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

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

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

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

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

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

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

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

Alternative 7: 83.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5499999999999999e-121 < z < 9.5e-88

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.5e-88 < z

    1. Initial program 55.5%

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

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

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

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

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

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

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

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

Alternative 8: 76.1% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 36.6%

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

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

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

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

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

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

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

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

    if -3.7000000000000001e81 < z < 9.4999999999999996e-86

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \frac{x \cdot y}{\log \left(e^{\color{blue}{-1 \cdot z} + \frac{0.5}{\frac{z}{t \cdot a}}}\right)} \]
      7. neg-mul-130.7%

        \[\leadsto z \cdot \frac{x \cdot y}{\log \left(e^{\color{blue}{\left(-z\right)} + \frac{0.5}{\frac{z}{t \cdot a}}}\right)} \]
      8. prod-exp30.0%

        \[\leadsto z \cdot \frac{x \cdot y}{\log \color{blue}{\left(e^{-z} \cdot e^{\frac{0.5}{\frac{z}{t \cdot a}}}\right)}} \]
      9. *-commutative30.0%

        \[\leadsto z \cdot \frac{x \cdot y}{\log \color{blue}{\left(e^{\frac{0.5}{\frac{z}{t \cdot a}}} \cdot e^{-z}\right)}} \]
      10. prod-exp30.7%

        \[\leadsto z \cdot \frac{x \cdot y}{\log \color{blue}{\left(e^{\frac{0.5}{\frac{z}{t \cdot a}} + \left(-z\right)}\right)}} \]
      11. rem-log-exp56.3%

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

        \[\leadsto z \cdot \frac{x \cdot y}{\color{blue}{\frac{0.5}{\frac{z}{t \cdot a}} - z}} \]
      13. associate-/r/56.3%

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

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

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

    if 9.4999999999999996e-86 < z

    1. Initial program 56.0%

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

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

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

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

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

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

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

Alternative 9: 78.4% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 36.6%

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

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

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

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

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

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

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

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

    if -3.99999999999999969e81 < z < -8.19999999999999945e-232

    1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x \cdot y}{\mathsf{fma}\left(z, -1, \color{blue}{\frac{0.5}{\frac{z}{t \cdot a}}}\right)} \cdot z\right)} - 1 \]
    8. Applied egg-rr38.4%

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

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

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

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

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

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

        \[\leadsto z \cdot \frac{x \cdot y}{\log \left(e^{\color{blue}{-1 \cdot z} + \frac{0.5}{\frac{z}{t \cdot a}}}\right)} \]
      7. neg-mul-130.1%

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

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

        \[\leadsto z \cdot \frac{x \cdot y}{\log \color{blue}{\left(e^{\frac{0.5}{\frac{z}{t \cdot a}}} \cdot e^{-z}\right)}} \]
      10. prod-exp30.1%

        \[\leadsto z \cdot \frac{x \cdot y}{\log \color{blue}{\left(e^{\frac{0.5}{\frac{z}{t \cdot a}} + \left(-z\right)}\right)}} \]
      11. rem-log-exp69.1%

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

        \[\leadsto z \cdot \frac{x \cdot y}{\color{blue}{\frac{0.5}{\frac{z}{t \cdot a}} - z}} \]
      13. associate-/r/69.1%

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

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

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

    if -8.19999999999999945e-232 < z

    1. Initial program 56.7%

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

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

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

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

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

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

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

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

Alternative 10: 74.3% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

    if -2.2999999999999999e-254 < z < 9.4999999999999996e-86

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

    if 9.4999999999999996e-86 < z

    1. Initial program 56.0%

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

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

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

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

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

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

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

Alternative 11: 75.1% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 52.5%

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

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

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

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

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

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

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

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

    if -1.7499999999999999e-124 < z < 9.4999999999999996e-86

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

    if 9.4999999999999996e-86 < z

    1. Initial program 56.0%

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

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

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

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

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

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

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

Alternative 12: 77.7% accurate, 6.6× speedup?

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

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


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

    1. Initial program 57.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\frac{\mathsf{fma}\left(z, -1, \frac{0.5}{\frac{z}{t \cdot a}}\right)}{z}} \]
      5. rem-log-exp20.9%

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

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

        \[\leadsto \frac{x \cdot y}{\frac{\log \left(e^{\color{blue}{-1 \cdot z} + \frac{0.5}{\frac{z}{t \cdot a}}}\right)}{z}} \]
      8. neg-mul-120.9%

        \[\leadsto \frac{x \cdot y}{\frac{\log \left(e^{\color{blue}{\left(-z\right)} + \frac{0.5}{\frac{z}{t \cdot a}}}\right)}{z}} \]
      9. prod-exp20.5%

        \[\leadsto \frac{x \cdot y}{\frac{\log \color{blue}{\left(e^{-z} \cdot e^{\frac{0.5}{\frac{z}{t \cdot a}}}\right)}}{z}} \]
      10. *-commutative20.5%

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

        \[\leadsto \frac{x \cdot y}{\frac{\log \color{blue}{\left(e^{\frac{0.5}{\frac{z}{t \cdot a}} + \left(-z\right)}\right)}}{z}} \]
      12. rem-log-exp83.5%

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

        \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{\frac{0.5}{\frac{z}{t \cdot a}} - z}}{z}} \]
      14. associate-/r/83.5%

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

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

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

    if -8.19999999999999945e-232 < z

    1. Initial program 56.7%

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

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

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

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

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

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

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

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

Alternative 13: 77.3% accurate, 6.6× speedup?

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

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


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

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9999999999999997e-107 < z

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

Alternative 14: 73.0% accurate, 18.6× speedup?

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

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


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

    1. Initial program 55.3%

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < z

    1. Initial program 58.4%

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

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

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

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

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

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

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

Alternative 15: 43.5% accurate, 37.7× speedup?

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

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

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

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

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

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

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

    \[\leadsto x \cdot y \]

Developer target: 89.1% 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 2023221 
(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)))))