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

Percentage Accurate: 61.4% → 88.8%
Time: 21.0s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 61.4% accurate, 1.0× speedup?

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

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

Alternative 1: 88.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 39.4%

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

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

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

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

      \[\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 -6.2e21 < z < 3.59999999999999968e-272

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

    if 3.59999999999999968e-272 < z

    1. Initial program 56.3%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\sqrt{\color{blue}{\frac{\sqrt{z \cdot z - t \cdot a} \cdot \sqrt{z \cdot z - t \cdot a}}{z \cdot z}}}} \]
      4. add-sqr-sqrt50.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 81.9% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [t, a] = \mathsf{sort}([t, a])\\ \\ \begin{array}{l} t_1 := \frac{t \cdot a}{z}\\ t_2 := \sqrt{a \cdot \left(-t\right)}\\ t_3 := y \cdot \frac{z \cdot x}{t_2}\\ \mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-60}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1.48 \cdot 10^{-92}:\\ \;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot t_1 - z}{z}}\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-226}:\\ \;\;\;\;z \cdot \frac{y \cdot x}{t_2}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-167}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-80}:\\ \;\;\;\;z \cdot \frac{y \cdot x}{z + -0.5 \cdot t_1}\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{-57}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{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.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* t a) z))
        (t_2 (sqrt (* a (- t))))
        (t_3 (* y (/ (* z x) t_2))))
   (if (<= z -5e-10)
     (* y (- x))
     (if (<= z -5.8e-60)
       t_3
       (if (<= z -1.48e-92)
         (/ (* y x) (/ (- (* 0.5 t_1) z) z))
         (if (<= z -2.45e-226)
           (* z (/ (* y x) t_2))
           (if (<= z 1.65e-167)
             t_3
             (if (<= z 5.5e-80)
               (* z (/ (* y x) (+ z (* -0.5 t_1))))
               (if (<= z 2.55e-57)
                 t_3
                 (/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t * a) / z;
	double t_2 = sqrt((a * -t));
	double t_3 = y * ((z * x) / t_2);
	double tmp;
	if (z <= -5e-10) {
		tmp = y * -x;
	} else if (z <= -5.8e-60) {
		tmp = t_3;
	} else if (z <= -1.48e-92) {
		tmp = (y * x) / (((0.5 * t_1) - z) / z);
	} else if (z <= -2.45e-226) {
		tmp = z * ((y * x) / t_2);
	} else if (z <= 1.65e-167) {
		tmp = t_3;
	} else if (z <= 5.5e-80) {
		tmp = z * ((y * x) / (z + (-0.5 * t_1)));
	} else if (z <= 2.55e-57) {
		tmp = t_3;
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (t * a) / z
    t_2 = sqrt((a * -t))
    t_3 = y * ((z * x) / t_2)
    if (z <= (-5d-10)) then
        tmp = y * -x
    else if (z <= (-5.8d-60)) then
        tmp = t_3
    else if (z <= (-1.48d-92)) then
        tmp = (y * x) / (((0.5d0 * t_1) - z) / z)
    else if (z <= (-2.45d-226)) then
        tmp = z * ((y * x) / t_2)
    else if (z <= 1.65d-167) then
        tmp = t_3
    else if (z <= 5.5d-80) then
        tmp = z * ((y * x) / (z + ((-0.5d0) * t_1)))
    else if (z <= 2.55d-57) then
        tmp = t_3
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
    end if
    code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (t * a) / z;
	double t_2 = Math.sqrt((a * -t));
	double t_3 = y * ((z * x) / t_2);
	double tmp;
	if (z <= -5e-10) {
		tmp = y * -x;
	} else if (z <= -5.8e-60) {
		tmp = t_3;
	} else if (z <= -1.48e-92) {
		tmp = (y * x) / (((0.5 * t_1) - z) / z);
	} else if (z <= -2.45e-226) {
		tmp = z * ((y * x) / t_2);
	} else if (z <= 1.65e-167) {
		tmp = t_3;
	} else if (z <= 5.5e-80) {
		tmp = z * ((y * x) / (z + (-0.5 * t_1)));
	} else if (z <= 2.55e-57) {
		tmp = t_3;
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	t_1 = (t * a) / z
	t_2 = math.sqrt((a * -t))
	t_3 = y * ((z * x) / t_2)
	tmp = 0
	if z <= -5e-10:
		tmp = y * -x
	elif z <= -5.8e-60:
		tmp = t_3
	elif z <= -1.48e-92:
		tmp = (y * x) / (((0.5 * t_1) - z) / z)
	elif z <= -2.45e-226:
		tmp = z * ((y * x) / t_2)
	elif z <= 1.65e-167:
		tmp = t_3
	elif z <= 5.5e-80:
		tmp = z * ((y * x) / (z + (-0.5 * t_1)))
	elif z <= 2.55e-57:
		tmp = t_3
	else:
		tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t * a) / z)
	t_2 = sqrt(Float64(a * Float64(-t)))
	t_3 = Float64(y * Float64(Float64(z * x) / t_2))
	tmp = 0.0
	if (z <= -5e-10)
		tmp = Float64(y * Float64(-x));
	elseif (z <= -5.8e-60)
		tmp = t_3;
	elseif (z <= -1.48e-92)
		tmp = Float64(Float64(y * x) / Float64(Float64(Float64(0.5 * t_1) - z) / z));
	elseif (z <= -2.45e-226)
		tmp = Float64(z * Float64(Float64(y * x) / t_2));
	elseif (z <= 1.65e-167)
		tmp = t_3;
	elseif (z <= 5.5e-80)
		tmp = Float64(z * Float64(Float64(y * x) / Float64(z + Float64(-0.5 * t_1))));
	elseif (z <= 2.55e-57)
		tmp = t_3;
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t)))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = (t * a) / z;
	t_2 = sqrt((a * -t));
	t_3 = y * ((z * x) / t_2);
	tmp = 0.0;
	if (z <= -5e-10)
		tmp = y * -x;
	elseif (z <= -5.8e-60)
		tmp = t_3;
	elseif (z <= -1.48e-92)
		tmp = (y * x) / (((0.5 * t_1) - z) / z);
	elseif (z <= -2.45e-226)
		tmp = z * ((y * x) / t_2);
	elseif (z <= 1.65e-167)
		tmp = t_3;
	elseif (z <= 5.5e-80)
		tmp = z * ((y * x) / (z + (-0.5 * t_1)));
	elseif (z <= 2.55e-57)
		tmp = t_3;
	else
		tmp = (y * x) / (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.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(N[(z * x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e-10], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -5.8e-60], t$95$3, If[LessEqual[z, -1.48e-92], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(0.5 * t$95$1), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.45e-226], N[(z * N[(N[(y * x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-167], t$95$3, If[LessEqual[z, 5.5e-80], N[(z * N[(N[(y * x), $MachinePrecision] / N[(z + N[(-0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e-57], t$95$3, N[(N[(y * x), $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])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{t \cdot a}{z}\\
t_2 := \sqrt{a \cdot \left(-t\right)}\\
t_3 := y \cdot \frac{z \cdot x}{t_2}\\
\mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq -5.8 \cdot 10^{-60}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq -1.48 \cdot 10^{-92}:\\
\;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot t_1 - z}{z}}\\

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

\mathbf{elif}\;z \leq 1.65 \cdot 10^{-167}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-80}:\\
\;\;\;\;z \cdot \frac{y \cdot x}{z + -0.5 \cdot t_1}\\

\mathbf{elif}\;z \leq 2.55 \cdot 10^{-57}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -5.00000000000000031e-10

    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*42.6%

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

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

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

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

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

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

    if -5.00000000000000031e-10 < z < -5.7999999999999999e-60 or -2.44999999999999993e-226 < z < 1.64999999999999998e-167 or 5.4999999999999997e-80 < z < 2.55e-57

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

    if -5.7999999999999999e-60 < z < -1.48000000000000001e-92

    1. Initial program 89.6%

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

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

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

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

    if -1.48000000000000001e-92 < z < -2.44999999999999993e-226

    1. Initial program 80.2%

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

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

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

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

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

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

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

    if 1.64999999999999998e-167 < z < 5.4999999999999997e-80

    1. Initial program 80.4%

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

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

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

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

    if 2.55e-57 < z

    1. Initial program 52.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-60}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{elif}\;z \leq -1.48 \cdot 10^{-92}:\\ \;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot \frac{t \cdot a}{z} - z}{z}}\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-226}:\\ \;\;\;\;z \cdot \frac{y \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-167}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-80}:\\ \;\;\;\;z \cdot \frac{y \cdot x}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{-57}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \end{array} \]

Alternative 3: 81.8% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.5000000000000003e-10

    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*42.6%

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

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

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

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

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

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

    if -6.5000000000000003e-10 < z < -6.00000000000000038e-60

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

    if -6.00000000000000038e-60 < z < -2.29999999999999995e-141

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

    if -2.29999999999999995e-141 < z < 1.75e-167

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.75e-167 < z

    1. Initial program 55.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{-10}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-60}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-141}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{-z}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-167}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{a \cdot \left(-t\right)}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\ \end{array} \]

Alternative 4: 90.5% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{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 < -7.00000000000000051e160

    1. Initial program 5.7%

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

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

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

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

      \[\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 -7.00000000000000051e160 < z < 4.0000000000000003e54

    1. Initial program 79.2%

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

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

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

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

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

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

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

    if 4.0000000000000003e54 < z

    1. Initial program 40.4%

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

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

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

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

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

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

      \[\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 simplification92.0%

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

Alternative 5: 89.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 5.7%

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

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

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

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

      \[\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 -7.00000000000000051e160 < z < 3.59999999999999968e-272

    1. Initial program 79.7%

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

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

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

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

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

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

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

    if 3.59999999999999968e-272 < z

    1. Initial program 56.3%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\sqrt{\color{blue}{\frac{\sqrt{z \cdot z - t \cdot a} \cdot \sqrt{z \cdot z - t \cdot a}}{z \cdot z}}}} \]
      4. add-sqr-sqrt50.2%

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u62.0%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.3% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq 6 \cdot 10^{-273}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z \cdot y}}\\

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


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

    1. Initial program 39.4%

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

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

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

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

      \[\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 -6.2e21 < z < 5.99999999999999975e-273

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999975e-273 < z

    1. Initial program 56.3%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\sqrt{\color{blue}{\frac{\sqrt{z \cdot z - t \cdot a} \cdot \sqrt{z \cdot z - t \cdot a}}{z \cdot z}}}} \]
      4. add-sqr-sqrt50.2%

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u62.0%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 82.1% accurate, 1.0× speedup?

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

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

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


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

    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*42.6%

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

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

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

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

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

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

    if -5.60000000000000031e-10 < z < 1.75e-167

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

    if 1.75e-167 < z

    1. Initial program 55.2%

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

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

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

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

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

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

      \[\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 simplification87.1%

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

Alternative 8: 76.9% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

    if -1.3200000000000001e-198 < z < 1.2500000000000001e49

    1. Initial program 74.8%

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

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

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

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

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

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

    if 1.2500000000000001e49 < z

    1. Initial program 40.4%

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

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

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

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

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

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

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

Alternative 9: 76.8% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

    if -1.84999999999999986e-198 < z < 6.2999999999999997e112

    1. Initial program 76.8%

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

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

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

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

    if 6.2999999999999997e112 < z

    1. Initial program 30.0%

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

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

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

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

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

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

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

Alternative 10: 76.2% accurate, 6.6× speedup?

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

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


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

    1. Initial program 59.7%

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z \cdot x}{0.5 \cdot \frac{a \cdot t}{z} + -1 \cdot z}} \]
    6. Step-by-step derivation
      1. fma-def62.0%

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

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

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

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

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

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

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

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

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

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

    if 3.4999999999999999e-138 < z

    1. Initial program 54.3%

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

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

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

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

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

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

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

Alternative 11: 76.9% accurate, 6.6× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{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 < -1.45e-198

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

    if -1.45e-198 < z

    1. Initial program 59.4%

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

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

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

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

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

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

      \[\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 simplification77.3%

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

Alternative 12: 75.0% accurate, 10.2× speedup?

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

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

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


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

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

    if -1.85e-199 < z < 9.9999999999999998e-201

    1. Initial program 66.1%

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

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

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

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

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

      \[\leadsto y \cdot \frac{x \cdot z}{\color{blue}{z}} \]
    5. Applied egg-rr32.8%

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

    if 9.9999999999999998e-201 < z

    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*54.8%

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

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

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

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

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

Alternative 13: 75.8% accurate, 10.2× speedup?

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-143}:\\
\;\;\;\;y \cdot \left(z \cdot \left(z \cdot x\right)\right)\\

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


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

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

    if -7.2000000000000003e-200 < z < 1.3999999999999999e-143

    1. Initial program 69.0%

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

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

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

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

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

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

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

    if 1.3999999999999999e-143 < z

    1. Initial program 54.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-200}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-143}:\\ \;\;\;\;y \cdot \left(z \cdot \left(z \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 14: 76.2% accurate, 10.2× speedup?

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-140}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot x\right)\right)\\

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


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

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

    if -1.84999999999999986e-198 < z < 2.5999999999999998e-140

    1. Initial program 69.0%

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

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

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

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

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

    if 2.5999999999999998e-140 < z

    1. Initial program 54.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{-198}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-140}:\\ \;\;\;\;z \cdot \left(z \cdot \left(y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 15: 72.7% accurate, 18.6× speedup?

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

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


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

    1. Initial program 57.1%

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

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

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

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

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

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

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

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

    if -8.4999999999999995e-307 < 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*57.5%

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

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

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

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

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

Alternative 16: 42.8% accurate, 37.7× speedup?

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

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

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

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

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

    \[\leadsto y \cdot \color{blue}{x} \]
  5. Final simplification41.3%

    \[\leadsto y \cdot x \]

Developer target: 89.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (< z -3.1921305903852764e+46)
   (- (* y x))
   (if (< z 5.976268120920894e+90)
     (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
     (* y x))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z < (-3.1921305903852764d+46)) then
        tmp = -(y * x)
    else if (z < 5.976268120920894d+90) then
        tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
    else
        tmp = y * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z < -3.1921305903852764e+46:
		tmp = -(y * x)
	elif z < 5.976268120920894e+90:
		tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y)
	else:
		tmp = y * x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z < -3.1921305903852764e+46)
		tmp = Float64(-Float64(y * x));
	elseif (z < 5.976268120920894e+90)
		tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y));
	else
		tmp = Float64(y * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z < -3.1921305903852764e+46)
		tmp = -(y * x);
	elseif (z < 5.976268120920894e+90)
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\

\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023171 
(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)))))