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

Percentage Accurate: 61.5% → 91.8%
Time: 31.7s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 61.5% accurate, 1.0× speedup?

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

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

Alternative 1: 91.8% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [t, a] = \mathsf{sort}([t, a])\\ \\ \begin{array}{l} t_1 := \frac{\sqrt{z \cdot z - a \cdot t}}{z}\\ \mathbf{if}\;z \leq -2 \cdot 10^{+153}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-201}:\\ \;\;\;\;y \cdot \frac{x}{t_1}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-223}:\\ \;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot {\left(e^{-0.5}\right)}^{\left(\log a - \log \left(\frac{-1}{t}\right)\right)}\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\frac{t_1}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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 (- (* z z) (* a t))) z)))
   (if (<= z -2e+153)
     (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
     (if (<= z -2.9e-201)
       (* y (/ x t_1))
       (if (<= z 8.5e-223)
         (* x (* (* z y) (pow (exp -0.5) (- (log a) (log (/ -1.0 t))))))
         (if (<= z 4.6e+85)
           (/ x (/ t_1 y))
           (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double t_1 = sqrt(((z * z) - (a * t))) / z;
	double tmp;
	if (z <= -2e+153) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= -2.9e-201) {
		tmp = y * (x / t_1);
	} else if (z <= 8.5e-223) {
		tmp = x * ((z * y) * pow(exp(-0.5), (log(a) - log((-1.0 / t)))));
	} else if (z <= 4.6e+85) {
		tmp = x / (t_1 / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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(((z * z) - (a * t))) / z
    if (z <= (-2d+153)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= (-2.9d-201)) then
        tmp = y * (x / t_1)
    else if (z <= 8.5d-223) then
        tmp = x * ((z * y) * (exp((-0.5d0)) ** (log(a) - log(((-1.0d0) / t)))))
    else if (z <= 4.6d+85) then
        tmp = x / (t_1 / y)
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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(((z * z) - (a * t))) / z;
	double tmp;
	if (z <= -2e+153) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= -2.9e-201) {
		tmp = y * (x / t_1);
	} else if (z <= 8.5e-223) {
		tmp = x * ((z * y) * Math.pow(Math.exp(-0.5), (Math.log(a) - Math.log((-1.0 / t)))));
	} else if (z <= 4.6e+85) {
		tmp = x / (t_1 / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	t_1 = math.sqrt(((z * z) - (a * t))) / z
	tmp = 0
	if z <= -2e+153:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= -2.9e-201:
		tmp = y * (x / t_1)
	elif z <= 8.5e-223:
		tmp = x * ((z * y) * math.pow(math.exp(-0.5), (math.log(a) - math.log((-1.0 / t)))))
	elif z <= 4.6e+85:
		tmp = x / (t_1 / y)
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	t_1 = Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z)
	tmp = 0.0
	if (z <= -2e+153)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= -2.9e-201)
		tmp = Float64(y * Float64(x / t_1));
	elseif (z <= 8.5e-223)
		tmp = Float64(x * Float64(Float64(z * y) * (exp(-0.5) ^ Float64(log(a) - log(Float64(-1.0 / t))))));
	elseif (z <= 4.6e+85)
		tmp = Float64(x / Float64(t_1 / y));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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(((z * z) - (a * t))) / z;
	tmp = 0.0;
	if (z <= -2e+153)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= -2.9e-201)
		tmp = y * (x / t_1);
	elseif (z <= 8.5e-223)
		tmp = x * ((z * y) * (exp(-0.5) ^ (log(a) - log((-1.0 / t)))));
	elseif (z <= 4.6e+85)
		tmp = x / (t_1 / y);
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2e+153], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -2.9e-201], N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-223], N[(x * N[(N[(z * y), $MachinePrecision] * N[Power[N[Exp[-0.5], $MachinePrecision], N[(N[Log[a], $MachinePrecision] - N[Log[N[(-1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+85], N[(x / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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{\sqrt{z \cdot z - a \cdot t}}{z}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+153}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot {\left(e^{-0.5}\right)}^{\left(\log a - \log \left(\frac{-1}{t}\right)\right)}\right)\\

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

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


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

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\frac{a}{\frac{z}{t}}} - \frac{1}{y}} \]
      8. div-inv93.2%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in80.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr93.5%

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

    if -2e153 < z < -2.9000000000000002e-201

    1. Initial program 83.4%

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

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

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

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

    if -2.9000000000000002e-201 < z < 8.5000000000000003e-223

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{t \cdot \left(-a\right)}}\right)} \]
      4. distribute-rgt-neg-out73.3%

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

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

        \[\leadsto x \cdot \left(\left(y \cdot z\right) \cdot \color{blue}{{\left(-t \cdot a\right)}^{\left(-0.5\right)}}\right) \]
      7. distribute-rgt-neg-out73.3%

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

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot z\right) \cdot {\left(t \cdot \left(-a\right)\right)}^{-0.5}\right)} \]
    7. Taylor expanded in t around -inf 40.8%

      \[\leadsto x \cdot \left(\left(y \cdot z\right) \cdot \color{blue}{e^{-0.5 \cdot \left(\log a + -1 \cdot \log \left(\frac{-1}{t}\right)\right)}}\right) \]
    8. Step-by-step derivation
      1. exp-prod40.8%

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

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

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

    if 8.5000000000000003e-223 < z < 4.5999999999999998e85

    1. Initial program 88.1%

      \[\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}}} \]
      2. associate-/l*89.5%

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

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

    if 4.5999999999999998e85 < z

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+153}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-201}:\\ \;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-223}:\\ \;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot {\left(e^{-0.5}\right)}^{\left(\log a - \log \left(\frac{-1}{t}\right)\right)}\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \end{array} \]

Alternative 2: 91.8% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [t, a] = \mathsf{sort}([t, a])\\ \\ \begin{array}{l} t_1 := \frac{\sqrt{z \cdot z - a \cdot t}}{z}\\ \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-196}:\\ \;\;\;\;y \cdot \frac{x}{t_1}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-223}:\\ \;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot e^{-0.5 \cdot \left(\log a + \log \left(-t\right)\right)}\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\frac{t_1}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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 (- (* z z) (* a t))) z)))
   (if (<= z -1e+154)
     (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
     (if (<= z -8.2e-196)
       (* y (/ x t_1))
       (if (<= z 9e-223)
         (* x (* (* z y) (exp (* -0.5 (+ (log a) (log (- t)))))))
         (if (<= z 2.6e+85)
           (/ x (/ t_1 y))
           (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double t_1 = sqrt(((z * z) - (a * t))) / z;
	double tmp;
	if (z <= -1e+154) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= -8.2e-196) {
		tmp = y * (x / t_1);
	} else if (z <= 9e-223) {
		tmp = x * ((z * y) * exp((-0.5 * (log(a) + log(-t)))));
	} else if (z <= 2.6e+85) {
		tmp = x / (t_1 / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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(((z * z) - (a * t))) / z
    if (z <= (-1d+154)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= (-8.2d-196)) then
        tmp = y * (x / t_1)
    else if (z <= 9d-223) then
        tmp = x * ((z * y) * exp(((-0.5d0) * (log(a) + log(-t)))))
    else if (z <= 2.6d+85) then
        tmp = x / (t_1 / y)
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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(((z * z) - (a * t))) / z;
	double tmp;
	if (z <= -1e+154) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= -8.2e-196) {
		tmp = y * (x / t_1);
	} else if (z <= 9e-223) {
		tmp = x * ((z * y) * Math.exp((-0.5 * (Math.log(a) + Math.log(-t)))));
	} else if (z <= 2.6e+85) {
		tmp = x / (t_1 / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	t_1 = math.sqrt(((z * z) - (a * t))) / z
	tmp = 0
	if z <= -1e+154:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= -8.2e-196:
		tmp = y * (x / t_1)
	elif z <= 9e-223:
		tmp = x * ((z * y) * math.exp((-0.5 * (math.log(a) + math.log(-t)))))
	elif z <= 2.6e+85:
		tmp = x / (t_1 / y)
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	t_1 = Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z)
	tmp = 0.0
	if (z <= -1e+154)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= -8.2e-196)
		tmp = Float64(y * Float64(x / t_1));
	elseif (z <= 9e-223)
		tmp = Float64(x * Float64(Float64(z * y) * exp(Float64(-0.5 * Float64(log(a) + log(Float64(-t)))))));
	elseif (z <= 2.6e+85)
		tmp = Float64(x / Float64(t_1 / y));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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(((z * z) - (a * t))) / z;
	tmp = 0.0;
	if (z <= -1e+154)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= -8.2e-196)
		tmp = y * (x / t_1);
	elseif (z <= 9e-223)
		tmp = x * ((z * y) * exp((-0.5 * (log(a) + log(-t)))));
	elseif (z <= 2.6e+85)
		tmp = x / (t_1 / y);
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1e+154], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -8.2e-196], N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-223], N[(x * N[(N[(z * y), $MachinePrecision] * N[Exp[N[(-0.5 * N[(N[Log[a], $MachinePrecision] + N[Log[(-t)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+85], N[(x / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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{\sqrt{z \cdot z - a \cdot t}}{z}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

\mathbf{elif}\;z \leq 9 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot e^{-0.5 \cdot \left(\log a + \log \left(-t\right)\right)}\right)\\

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

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


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

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\frac{a}{\frac{z}{t}}} - \frac{1}{y}} \]
      8. div-inv93.2%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in80.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr93.5%

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

    if -1.00000000000000004e154 < z < -8.20000000000000043e-196

    1. Initial program 83.4%

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

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

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

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

    if -8.20000000000000043e-196 < z < 8.99999999999999935e-223

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{t \cdot \left(-a\right)}}\right)} \]
      4. distribute-rgt-neg-out73.3%

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

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

        \[\leadsto x \cdot \left(\left(y \cdot z\right) \cdot \color{blue}{{\left(-t \cdot a\right)}^{\left(-0.5\right)}}\right) \]
      7. distribute-rgt-neg-out73.3%

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

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

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

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

    if 8.99999999999999935e-223 < z < 2.60000000000000011e85

    1. Initial program 88.1%

      \[\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}}} \]
      2. associate-/l*89.5%

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

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

    if 2.60000000000000011e85 < z

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-196}:\\ \;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-223}:\\ \;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot e^{-0.5 \cdot \left(\log a + \log \left(-t\right)\right)}\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \end{array} \]

Alternative 3: 90.0% 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.5 \cdot 10^{+34}:\\ \;\;\;\;\frac{y \cdot \left(-x\right)}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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.5e+34)
   (/ (* y (- x)) (+ 1.0 (* -0.5 (/ a (* z (/ z t))))))
   (if (<= z 1.1e+86)
     (* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.5e+34) {
		tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t)))));
	} else if (z <= 1.1e+86) {
		tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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.5d+34)) then
        tmp = (y * -x) / (1.0d0 + ((-0.5d0) * (a / (z * (z / t)))))
    else if (z <= 1.1d+86) then
        tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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.5e+34) {
		tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t)))));
	} else if (z <= 1.1e+86) {
		tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.5e+34:
		tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t)))))
	elif z <= 1.1e+86:
		tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t))))
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	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.5e+34)
		tmp = Float64(Float64(y * Float64(-x)) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(z * Float64(z / t))))));
	elseif (z <= 1.1e+86)
		tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t)))));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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.5e+34)
		tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t)))));
	elseif (z <= 1.1e+86)
		tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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.5e+34], N[(N[(y * (-x)), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+86], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{y \cdot \left(-x\right)}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\

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

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


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

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\frac{a}{\frac{z}{t}}} - \frac{1}{y}} \]
      8. div-inv91.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999996e34 < z < 1.10000000000000002e86

    1. Initial program 84.4%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \cdot y \]
      4. *-commutative86.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}}} \]

    if 1.10000000000000002e86 < z

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 90.9% 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 -2 \cdot 10^{+153}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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 -2e+153)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 1.25e+86)
     (* y (/ x (/ (sqrt (- (* z z) (* a t))) z)))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2e+153) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 1.25e+86) {
		tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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 <= (-2d+153)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 1.25d+86) then
        tmp = y * (x / (sqrt(((z * z) - (a * t))) / z))
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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 <= -2e+153) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 1.25e+86) {
		tmp = y * (x / (Math.sqrt(((z * z) - (a * t))) / z));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2e+153:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 1.25e+86:
		tmp = y * (x / (math.sqrt(((z * z) - (a * t))) / z))
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2e+153)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 1.25e+86)
		tmp = Float64(y * Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z)));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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 <= -2e+153)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 1.25e+86)
		tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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, -2e+153], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.25e+86], N[(y * N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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 -2 \cdot 10^{+153}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 22.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\frac{a}{\frac{z}{t}}} - \frac{1}{y}} \]
      8. div-inv93.2%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in80.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr93.5%

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

    if -2e153 < z < 1.2499999999999999e86

    1. Initial program 84.5%

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

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

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

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

    if 1.2499999999999999e86 < z

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 90.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 -3.8 \cdot 10^{+115}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{+85}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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.8e+115)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 9.8e+85)
     (/ x (/ (/ (sqrt (- (* z z) (* a t))) z) y))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.8e+115) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 9.8e+85) {
		tmp = x / ((sqrt(((z * z) - (a * t))) / z) / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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.8d+115)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 9.8d+85) then
        tmp = x / ((sqrt(((z * z) - (a * t))) / z) / y)
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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.8e+115) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 9.8e+85) {
		tmp = x / ((Math.sqrt(((z * z) - (a * t))) / z) / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.8e+115:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 9.8e+85:
		tmp = x / ((math.sqrt(((z * z) - (a * t))) / z) / y)
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	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.8e+115)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 9.8e+85)
		tmp = Float64(x / Float64(Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z) / y));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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.8e+115)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 9.8e+85)
		tmp = x / ((sqrt(((z * z) - (a * t))) / z) / y);
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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.8e+115], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 9.8e+85], N[(x / N[(N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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 -3.8 \cdot 10^{+115}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 33.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\frac{a}{\frac{z}{t}}} - \frac{1}{y}} \]
      8. div-inv94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr94.7%

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

    if -3.8000000000000001e115 < z < 9.7999999999999993e85

    1. Initial program 84.8%

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

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

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

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

    if 9.7999999999999993e85 < z

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.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 -1.16 \cdot 10^{-82}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-124}:\\ \;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot {\left(a \cdot \left(-t\right)\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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.16e-82)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 3e-124)
     (* x (* (* z y) (pow (* a (- t)) -0.5)))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.16e-82) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 3e-124) {
		tmp = x * ((z * y) * pow((a * -t), -0.5));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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.16d-82)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 3d-124) then
        tmp = x * ((z * y) * ((a * -t) ** (-0.5d0)))
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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.16e-82) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 3e-124) {
		tmp = x * ((z * y) * Math.pow((a * -t), -0.5));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.16e-82:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 3e-124:
		tmp = x * ((z * y) * math.pow((a * -t), -0.5))
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	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.16e-82)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 3e-124)
		tmp = Float64(x * Float64(Float64(z * y) * (Float64(a * Float64(-t)) ^ -0.5)));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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.16e-82)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 3e-124)
		tmp = x * ((z * y) * ((a * -t) ^ -0.5));
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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.16e-82], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3e-124], N[(x * N[(N[(z * y), $MachinePrecision] * N[Power[N[(a * (-t)), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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.16 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in78.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr84.4%

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

    if -1.16e-82 < z < 3e-124

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{t \cdot \left(-a\right)}}\right)} \]
      4. distribute-rgt-neg-out79.1%

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

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

        \[\leadsto x \cdot \left(\left(y \cdot z\right) \cdot \color{blue}{{\left(-t \cdot a\right)}^{\left(-0.5\right)}}\right) \]
      7. distribute-rgt-neg-out79.1%

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

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

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

    if 3e-124 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.6% 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 -2.4 \cdot 10^{-87}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-127}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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 -2.4e-87)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 1.8e-127)
     (* y (/ (* z x) (sqrt (* a (- t)))))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.4e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 1.8e-127) {
		tmp = y * ((z * x) / sqrt((a * -t)));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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 <= (-2.4d-87)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 1.8d-127) then
        tmp = y * ((z * x) / sqrt((a * -t)))
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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 <= -2.4e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 1.8e-127) {
		tmp = y * ((z * x) / Math.sqrt((a * -t)));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.4e-87:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 1.8e-127:
		tmp = y * ((z * x) / math.sqrt((a * -t)))
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.4e-87)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 1.8e-127)
		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(Float64(a / z) * Float64(t / z)))));
	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 <= -2.4e-87)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 1.8e-127)
		tmp = y * ((z * x) / sqrt((a * -t)));
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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, -2.4e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.8e-127], 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[(N[(a / z), $MachinePrecision] * N[(t / z), $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 -2.4 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in78.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr84.4%

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

    if -2.4e-87 < z < 1.8e-127

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(z \cdot \color{blue}{\frac{y}{\sqrt{t \cdot \left(-a\right)}}}\right) \]
      5. distribute-rgt-neg-out72.5%

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

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

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

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

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

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

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

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

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

    if 1.8e-127 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 83.2% 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 -3.2 \cdot 10^{-87}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-126}:\\ \;\;\;\;x \cdot \left(z \cdot \frac{y}{\sqrt{a \cdot \left(-t\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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.2e-87)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 2.1e-126)
     (* x (* z (/ y (sqrt (* a (- t))))))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.2e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 2.1e-126) {
		tmp = x * (z * (y / sqrt((a * -t))));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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.2d-87)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 2.1d-126) then
        tmp = x * (z * (y / sqrt((a * -t))))
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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.2e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 2.1e-126) {
		tmp = x * (z * (y / Math.sqrt((a * -t))));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.2e-87:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 2.1e-126:
		tmp = x * (z * (y / math.sqrt((a * -t))))
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	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.2e-87)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 2.1e-126)
		tmp = Float64(x * Float64(z * Float64(y / sqrt(Float64(a * Float64(-t))))));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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.2e-87)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 2.1e-126)
		tmp = x * (z * (y / sqrt((a * -t))));
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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.2e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 2.1e-126], N[(x * N[(z * N[(y / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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 -3.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in78.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr84.4%

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

    if -3.19999999999999979e-87 < z < 2.0999999999999999e-126

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(z \cdot \color{blue}{\frac{y}{\sqrt{t \cdot \left(-a\right)}}}\right) \cdot x \]
      6. distribute-rgt-neg-out72.5%

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

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

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

    if 2.0999999999999999e-126 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 83.4% 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 -2.6 \cdot 10^{-87}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-122}:\\ \;\;\;\;\left(z \cdot y\right) \cdot \frac{x}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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 -2.6e-87)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 3e-122)
     (* (* z y) (/ x (sqrt (* a (- t)))))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.6e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 3e-122) {
		tmp = (z * y) * (x / sqrt((a * -t)));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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 <= (-2.6d-87)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 3d-122) then
        tmp = (z * y) * (x / sqrt((a * -t)))
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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 <= -2.6e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 3e-122) {
		tmp = (z * y) * (x / Math.sqrt((a * -t)));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.6e-87:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 3e-122:
		tmp = (z * y) * (x / math.sqrt((a * -t)))
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.6e-87)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 3e-122)
		tmp = Float64(Float64(z * y) * Float64(x / sqrt(Float64(a * Float64(-t)))));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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 <= -2.6e-87)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 3e-122)
		tmp = (z * y) * (x / sqrt((a * -t)));
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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, -2.6e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3e-122], N[(N[(z * y), $MachinePrecision] * N[(x / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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 -2.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in78.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr84.4%

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

    if -2.60000000000000002e-87 < z < 3.00000000000000004e-122

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000004e-122 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 83.0% 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 \cdot 10^{-85}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{\frac{\frac{\sqrt{a \cdot \left(-t\right)}}{z}}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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 -5e-85)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 3.1e-122)
     (/ x (/ (/ (sqrt (* a (- t))) z) y))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5e-85) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 3.1e-122) {
		tmp = x / ((sqrt((a * -t)) / z) / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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 <= (-5d-85)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 3.1d-122) then
        tmp = x / ((sqrt((a * -t)) / z) / y)
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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 <= -5e-85) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 3.1e-122) {
		tmp = x / ((Math.sqrt((a * -t)) / z) / y);
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5e-85:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 3.1e-122:
		tmp = x / ((math.sqrt((a * -t)) / z) / y)
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5e-85)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 3.1e-122)
		tmp = Float64(x / Float64(Float64(sqrt(Float64(a * Float64(-t))) / z) / y));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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 <= -5e-85)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 3.1e-122)
		tmp = x / ((sqrt((a * -t)) / z) / y);
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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, -5e-85], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3.1e-122], N[(x / N[(N[(N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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 \cdot 10^{-85}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in78.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr84.4%

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

    if -5.0000000000000002e-85 < z < 3.0999999999999998e-122

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

    if 3.0999999999999998e-122 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 83.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 -7.6 \cdot 10^{-87}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-123}:\\ \;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{a \cdot \left(-t\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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.6e-87)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (if (<= z 1.7e-123)
     (/ (* x (* z y)) (sqrt (* a (- t))))
     (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -7.6e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 1.7e-123) {
		tmp = (x * (z * y)) / sqrt((a * -t));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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.6d-87)) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else if (z <= 1.7d-123) then
        tmp = (x * (z * y)) / sqrt((a * -t))
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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.6e-87) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else if (z <= 1.7e-123) {
		tmp = (x * (z * y)) / Math.sqrt((a * -t));
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -7.6e-87:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	elif z <= 1.7e-123:
		tmp = (x * (z * y)) / math.sqrt((a * -t))
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	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.6e-87)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	elseif (z <= 1.7e-123)
		tmp = Float64(Float64(x * Float64(z * y)) / sqrt(Float64(a * Float64(-t))));
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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.6e-87)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	elseif (z <= 1.7e-123)
		tmp = (x * (z * y)) / sqrt((a * -t));
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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.6e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.7e-123], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

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

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


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

    1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in78.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr84.4%

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

    if -7.6e-87 < z < 1.7e-123

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

    if 1.7e-123 < z

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 79.0% accurate, 6.3× speedup?

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

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


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

    1. Initial program 63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y \cdot x}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      4. distribute-rgt-neg-out68.4%

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

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

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

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

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

    if 4.99999999999999998e-306 < z

    1. Initial program 64.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 74.6% 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 -5.3 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-137}:\\ \;\;\;\;2 \cdot \left(\frac{x}{a} \cdot \left(y \cdot \frac{z \cdot z}{t}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
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.3e-107)
   (* y (- x))
   (if (<= z 1.45e-137) (* 2.0 (* (/ x a) (* y (/ (* z z) t)))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.3e-107) {
		tmp = y * -x;
	} else if (z <= 1.45e-137) {
		tmp = 2.0 * ((x / a) * (y * ((z * z) / t)));
	} 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 <= (-5.3d-107)) then
        tmp = y * -x
    else if (z <= 1.45d-137) then
        tmp = 2.0d0 * ((x / a) * (y * ((z * z) / t)))
    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 <= -5.3e-107) {
		tmp = y * -x;
	} else if (z <= 1.45e-137) {
		tmp = 2.0 * ((x / a) * (y * ((z * z) / t)));
	} 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 <= -5.3e-107:
		tmp = y * -x
	elif z <= 1.45e-137:
		tmp = 2.0 * ((x / a) * (y * ((z * z) / t)))
	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 <= -5.3e-107)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.45e-137)
		tmp = Float64(2.0 * Float64(Float64(x / a) * Float64(y * Float64(Float64(z * z) / t))));
	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 <= -5.3e-107)
		tmp = y * -x;
	elseif (z <= 1.45e-137)
		tmp = 2.0 * ((x / a) * (y * ((z * z) / t)));
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.3e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.45e-137], N[(2.0 * N[(N[(x / a), $MachinePrecision] * N[(y * N[(N[(z * z), $MachinePrecision] / t), $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 -5.3 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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


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

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

    if -5.3e-107 < z < 1.44999999999999993e-137

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.44999999999999993e-137 < z

    1. Initial program 62.3%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative86.2%

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified86.2%

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

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

Alternative 14: 74.8% 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.35 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-136}:\\ \;\;\;\;y \cdot \left(-2 \cdot \frac{x}{t \cdot \frac{\frac{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 -1.35e-107)
   (* y (- x))
   (if (<= z 8.2e-136) (* y (* -2.0 (/ x (* 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 <= -1.35e-107) {
		tmp = y * -x;
	} else if (z <= 8.2e-136) {
		tmp = y * (-2.0 * (x / (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 <= (-1.35d-107)) then
        tmp = y * -x
    else if (z <= 8.2d-136) then
        tmp = y * ((-2.0d0) * (x / (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 <= -1.35e-107) {
		tmp = y * -x;
	} else if (z <= 8.2e-136) {
		tmp = y * (-2.0 * (x / (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 <= -1.35e-107:
		tmp = y * -x
	elif z <= 8.2e-136:
		tmp = y * (-2.0 * (x / (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 <= -1.35e-107)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 8.2e-136)
		tmp = Float64(y * Float64(-2.0 * Float64(x / Float64(t * Float64(Float64(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 <= -1.35e-107)
		tmp = y * -x;
	elseif (z <= 8.2e-136)
		tmp = y * (-2.0 * (x / (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, -1.35e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8.2e-136], N[(y * N[(-2.0 * N[(x / N[(t * N[(N[(a / z), $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.35 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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


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

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

    if -1.35e-107 < z < 8.20000000000000051e-136

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{t}{\frac{z}{a}}} \cdot -0.5}{z}} \cdot y \]
      9. associate-*l/44.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{t \cdot -0.5}{\frac{z}{a}}}}{z}} \cdot y \]
    11. Simplified44.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.20000000000000051e-136 < z

    1. Initial program 62.3%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative86.2%

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified86.2%

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

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

Alternative 15: 74.6% 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 -4.1 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-131}:\\ \;\;\;\;y \cdot \left(z \cdot \left(\frac{x}{a} \cdot \left(-2 \cdot \frac{z}{t}\right)\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 -4.1e-107)
   (* y (- x))
   (if (<= z 1.3e-131) (* y (* z (* (/ x a) (* -2.0 (/ z t))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.1e-107) {
		tmp = y * -x;
	} else if (z <= 1.3e-131) {
		tmp = y * (z * ((x / a) * (-2.0 * (z / t))));
	} 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 <= (-4.1d-107)) then
        tmp = y * -x
    else if (z <= 1.3d-131) then
        tmp = y * (z * ((x / a) * ((-2.0d0) * (z / t))))
    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 <= -4.1e-107) {
		tmp = y * -x;
	} else if (z <= 1.3e-131) {
		tmp = y * (z * ((x / a) * (-2.0 * (z / t))));
	} 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 <= -4.1e-107:
		tmp = y * -x
	elif z <= 1.3e-131:
		tmp = y * (z * ((x / a) * (-2.0 * (z / t))))
	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 <= -4.1e-107)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.3e-131)
		tmp = Float64(y * Float64(z * Float64(Float64(x / a) * Float64(-2.0 * Float64(z / t)))));
	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 <= -4.1e-107)
		tmp = y * -x;
	elseif (z <= 1.3e-131)
		tmp = y * (z * ((x / a) * (-2.0 * (z / t))));
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.3e-131], N[(y * N[(z * N[(N[(x / a), $MachinePrecision] * N[(-2.0 * N[(z / t), $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 -4.1 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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


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

    1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

    if -4.0999999999999999e-107 < z < 1.29999999999999998e-131

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{\frac{z + -0.5 \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)}}{z}} \cdot y \]
    9. Taylor expanded in z around 0 43.4%

      \[\leadsto \frac{x}{\color{blue}{-0.5 \cdot \frac{a \cdot t}{{z}^{2}}}} \cdot y \]
    10. Step-by-step derivation
      1. associate-*r/43.4%

        \[\leadsto \frac{x}{\color{blue}{\frac{-0.5 \cdot \left(a \cdot t\right)}{{z}^{2}}}} \cdot y \]
      2. unpow243.4%

        \[\leadsto \frac{x}{\frac{-0.5 \cdot \left(a \cdot t\right)}{\color{blue}{z \cdot z}}} \cdot y \]
      3. associate-/r*43.8%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{-0.5 \cdot \left(a \cdot t\right)}{z}}{z}}} \cdot y \]
      4. associate-*r/43.8%

        \[\leadsto \frac{x}{\frac{\color{blue}{-0.5 \cdot \frac{a \cdot t}{z}}}{z}} \cdot y \]
      5. *-commutative43.8%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{a \cdot t}{z} \cdot -0.5}}{z}} \cdot y \]
      6. associate-*r/43.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{\left(a \cdot \frac{t}{z}\right)} \cdot -0.5}{z}} \cdot y \]
      7. *-commutative43.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{\left(\frac{t}{z} \cdot a\right)} \cdot -0.5}{z}} \cdot y \]
      8. associate-/r/44.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{t}{\frac{z}{a}}} \cdot -0.5}{z}} \cdot y \]
      9. associate-*l/44.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{t \cdot -0.5}{\frac{z}{a}}}}{z}} \cdot y \]
    11. Simplified44.0%

      \[\leadsto \frac{x}{\color{blue}{\frac{\frac{t \cdot -0.5}{\frac{z}{a}}}{z}}} \cdot y \]
    12. Taylor expanded in x around 0 43.5%

      \[\leadsto \color{blue}{\left(-2 \cdot \frac{x \cdot {z}^{2}}{a \cdot t}\right)} \cdot y \]
    13. Step-by-step derivation
      1. *-commutative43.5%

        \[\leadsto \color{blue}{\left(\frac{x \cdot {z}^{2}}{a \cdot t} \cdot -2\right)} \cdot y \]
      2. associate-/r*43.8%

        \[\leadsto \left(\color{blue}{\frac{\frac{x \cdot {z}^{2}}{a}}{t}} \cdot -2\right) \cdot y \]
      3. unpow243.8%

        \[\leadsto \left(\frac{\frac{x \cdot \color{blue}{\left(z \cdot z\right)}}{a}}{t} \cdot -2\right) \cdot y \]
      4. associate-*r/43.8%

        \[\leadsto \left(\frac{\color{blue}{x \cdot \frac{z \cdot z}{a}}}{t} \cdot -2\right) \cdot y \]
      5. associate-*r/44.0%

        \[\leadsto \left(\frac{x \cdot \color{blue}{\left(z \cdot \frac{z}{a}\right)}}{t} \cdot -2\right) \cdot y \]
      6. associate-/r/44.0%

        \[\leadsto \color{blue}{\frac{x \cdot \left(z \cdot \frac{z}{a}\right)}{\frac{t}{-2}}} \cdot y \]
      7. associate-*l/43.7%

        \[\leadsto \color{blue}{\left(\frac{x}{\frac{t}{-2}} \cdot \left(z \cdot \frac{z}{a}\right)\right)} \cdot y \]
      8. *-commutative43.7%

        \[\leadsto \left(\frac{x}{\frac{t}{-2}} \cdot \color{blue}{\left(\frac{z}{a} \cdot z\right)}\right) \cdot y \]
      9. associate-/r/43.7%

        \[\leadsto \left(\frac{x}{\frac{t}{-2}} \cdot \color{blue}{\frac{z}{\frac{a}{z}}}\right) \cdot y \]
      10. associate-/r/43.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{t}{-2}}{\frac{z}{\frac{a}{z}}}}} \cdot y \]
      11. associate-/l*44.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{t}{-2} \cdot \frac{a}{z}}{z}}} \cdot y \]
      12. associate-/r/44.0%

        \[\leadsto \color{blue}{\left(\frac{x}{\frac{t}{-2} \cdot \frac{a}{z}} \cdot z\right)} \cdot y \]
      13. *-commutative44.0%

        \[\leadsto \color{blue}{\left(z \cdot \frac{x}{\frac{t}{-2} \cdot \frac{a}{z}}\right)} \cdot y \]
      14. *-commutative44.0%

        \[\leadsto \left(z \cdot \frac{x}{\color{blue}{\frac{a}{z} \cdot \frac{t}{-2}}}\right) \cdot y \]
      15. associate-/r/44.0%

        \[\leadsto \left(z \cdot \frac{x}{\color{blue}{\frac{a}{\frac{z}{\frac{t}{-2}}}}}\right) \cdot y \]
      16. associate-/r/43.9%

        \[\leadsto \left(z \cdot \color{blue}{\left(\frac{x}{a} \cdot \frac{z}{\frac{t}{-2}}\right)}\right) \cdot y \]
      17. associate-/r/43.9%

        \[\leadsto \left(z \cdot \left(\frac{x}{a} \cdot \color{blue}{\left(\frac{z}{t} \cdot -2\right)}\right)\right) \cdot y \]
    14. Simplified43.9%

      \[\leadsto \color{blue}{\left(z \cdot \left(\frac{x}{a} \cdot \left(\frac{z}{t} \cdot -2\right)\right)\right)} \cdot y \]

    if 1.29999999999999998e-131 < z

    1. Initial program 62.3%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*65.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*64.1%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified64.1%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around inf 86.2%

      \[\leadsto \color{blue}{x \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative86.2%

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified86.2%

      \[\leadsto \color{blue}{y \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-131}:\\ \;\;\;\;y \cdot \left(z \cdot \left(\frac{x}{a} \cdot \left(-2 \cdot \frac{z}{t}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 16: 74.8% 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.35 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-137}:\\ \;\;\;\;y \cdot \frac{x}{-0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{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 -1.35e-107)
   (* y (- x))
   (if (<= z 1.55e-137) (* y (/ x (* -0.5 (* (/ a z) (/ t 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.35e-107) {
		tmp = y * -x;
	} else if (z <= 1.55e-137) {
		tmp = y * (x / (-0.5 * ((a / z) * (t / 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.35d-107)) then
        tmp = y * -x
    else if (z <= 1.55d-137) then
        tmp = y * (x / ((-0.5d0) * ((a / z) * (t / 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.35e-107) {
		tmp = y * -x;
	} else if (z <= 1.55e-137) {
		tmp = y * (x / (-0.5 * ((a / z) * (t / 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.35e-107:
		tmp = y * -x
	elif z <= 1.55e-137:
		tmp = y * (x / (-0.5 * ((a / z) * (t / 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.35e-107)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.55e-137)
		tmp = Float64(y * Float64(x / Float64(-0.5 * Float64(Float64(a / z) * Float64(t / 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.35e-107)
		tmp = y * -x;
	elseif (z <= 1.55e-137)
		tmp = y * (x / (-0.5 * ((a / z) * (t / 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.35e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.55e-137], N[(y * N[(x / N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / 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.35 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-137}:\\
\;\;\;\;y \cdot \frac{x}{-0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.35e-107

    1. Initial program 57.9%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*60.3%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/60.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
      3. associate-/l*59.0%

        \[\leadsto \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \cdot y \]
      4. *-commutative59.0%

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified59.0%

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    4. Taylor expanded in z around -inf 79.6%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg79.6%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified79.6%

      \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]

    if -1.35e-107 < z < 1.54999999999999989e-137

    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*74.2%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/81.7%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
    3. Simplified81.7%

      \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
    4. Taylor expanded in z around inf 43.9%

      \[\leadsto \frac{x}{\frac{\color{blue}{z + -0.5 \cdot \frac{a \cdot t}{z}}}{z}} \cdot y \]
    5. Step-by-step derivation
      1. associate-/l*43.8%

        \[\leadsto \frac{x \cdot y}{\frac{z + -0.5 \cdot \color{blue}{\frac{a}{\frac{z}{t}}}}{z}} \]
    6. Simplified44.0%

      \[\leadsto \frac{x}{\frac{\color{blue}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}}{z}} \cdot y \]
    7. Taylor expanded in z around 0 43.4%

      \[\leadsto \frac{x}{\color{blue}{-0.5 \cdot \frac{a \cdot t}{{z}^{2}}}} \cdot y \]
    8. Step-by-step derivation
      1. unpow243.4%

        \[\leadsto \frac{x}{-0.5 \cdot \frac{a \cdot t}{\color{blue}{z \cdot z}}} \cdot y \]
      2. *-commutative43.4%

        \[\leadsto \frac{x}{-0.5 \cdot \frac{\color{blue}{t \cdot a}}{z \cdot z}} \cdot y \]
      3. times-frac44.0%

        \[\leadsto \frac{x}{-0.5 \cdot \color{blue}{\left(\frac{t}{z} \cdot \frac{a}{z}\right)}} \cdot y \]
    9. Simplified44.0%

      \[\leadsto \frac{x}{\color{blue}{-0.5 \cdot \left(\frac{t}{z} \cdot \frac{a}{z}\right)}} \cdot y \]

    if 1.54999999999999989e-137 < z

    1. Initial program 62.3%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*65.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*64.1%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified64.1%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around inf 86.2%

      \[\leadsto \color{blue}{x \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative86.2%

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified86.2%

      \[\leadsto \color{blue}{y \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-137}:\\ \;\;\;\;y \cdot \frac{x}{-0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 17: 75.0% 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.35 \cdot 10^{-105}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-137}:\\ \;\;\;\;\frac{x}{\frac{\frac{a}{z}}{\frac{\frac{z \cdot y}{0.5}}{t}}}\\ \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.35e-105)
   (* y (- x))
   (if (<= z 1.9e-137) (/ x (/ (/ a z) (/ (/ (* z y) 0.5) t))) (* 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.35e-105) {
		tmp = y * -x;
	} else if (z <= 1.9e-137) {
		tmp = x / ((a / z) / (((z * y) / 0.5) / t));
	} 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.35d-105)) then
        tmp = y * -x
    else if (z <= 1.9d-137) then
        tmp = x / ((a / z) / (((z * y) / 0.5d0) / t))
    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.35e-105) {
		tmp = y * -x;
	} else if (z <= 1.9e-137) {
		tmp = x / ((a / z) / (((z * y) / 0.5) / t));
	} 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.35e-105:
		tmp = y * -x
	elif z <= 1.9e-137:
		tmp = x / ((a / z) / (((z * y) / 0.5) / t))
	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.35e-105)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 1.9e-137)
		tmp = Float64(x / Float64(Float64(a / z) / Float64(Float64(Float64(z * y) / 0.5) / t)));
	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.35e-105)
		tmp = y * -x;
	elseif (z <= 1.9e-137)
		tmp = x / ((a / z) / (((z * y) / 0.5) / t));
	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.35e-105], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.9e-137], N[(x / N[(N[(a / z), $MachinePrecision] / N[(N[(N[(z * y), $MachinePrecision] / 0.5), $MachinePrecision] / t), $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.35 \cdot 10^{-105}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-137}:\\
\;\;\;\;\frac{x}{\frac{\frac{a}{z}}{\frac{\frac{z \cdot y}{0.5}}{t}}}\\

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.34999999999999996e-105

    1. Initial program 57.9%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*60.3%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/60.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
      3. associate-/l*59.0%

        \[\leadsto \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \cdot y \]
      4. *-commutative59.0%

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified59.0%

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    4. Taylor expanded in z around -inf 79.6%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg79.6%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified79.6%

      \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]

    if -1.34999999999999996e-105 < z < 1.89999999999999999e-137

    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*74.2%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*79.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around -inf 43.5%

      \[\leadsto \frac{x}{\color{blue}{0.5 \cdot \frac{a \cdot t}{y \cdot {z}^{2}} - \frac{1}{y}}} \]
    5. Step-by-step derivation
      1. *-commutative43.5%

        \[\leadsto \frac{x}{0.5 \cdot \frac{\color{blue}{t \cdot a}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      2. associate-*r/43.5%

        \[\leadsto \frac{x}{\color{blue}{\frac{0.5 \cdot \left(t \cdot a\right)}{y \cdot {z}^{2}}} - \frac{1}{y}} \]
      3. *-commutative43.5%

        \[\leadsto \frac{x}{\frac{0.5 \cdot \color{blue}{\left(a \cdot t\right)}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      4. associate-*r*43.5%

        \[\leadsto \frac{x}{\frac{\color{blue}{\left(0.5 \cdot a\right) \cdot t}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      5. unpow243.5%

        \[\leadsto \frac{x}{\frac{\left(0.5 \cdot a\right) \cdot t}{y \cdot \color{blue}{\left(z \cdot z\right)}} - \frac{1}{y}} \]
    6. Simplified43.5%

      \[\leadsto \frac{x}{\color{blue}{\frac{\left(0.5 \cdot a\right) \cdot t}{y \cdot \left(z \cdot z\right)} - \frac{1}{y}}} \]
    7. Step-by-step derivation
      1. times-frac43.3%

        \[\leadsto \frac{x}{\color{blue}{\frac{0.5 \cdot a}{y} \cdot \frac{t}{z \cdot z}} - \frac{1}{y}} \]
      2. associate-*l/43.8%

        \[\leadsto \frac{x}{\color{blue}{\frac{\left(0.5 \cdot a\right) \cdot \frac{t}{z \cdot z}}{y}} - \frac{1}{y}} \]
      3. sub-div43.8%

        \[\leadsto \frac{x}{\color{blue}{\frac{\left(0.5 \cdot a\right) \cdot \frac{t}{z \cdot z} - 1}{y}}} \]
      4. *-commutative43.8%

        \[\leadsto \frac{x}{\frac{\color{blue}{\left(a \cdot 0.5\right)} \cdot \frac{t}{z \cdot z} - 1}{y}} \]
    8. Applied egg-rr43.8%

      \[\leadsto \frac{x}{\color{blue}{\frac{\left(a \cdot 0.5\right) \cdot \frac{t}{z \cdot z} - 1}{y}}} \]
    9. Taylor expanded in a around inf 43.5%

      \[\leadsto \frac{x}{\color{blue}{0.5 \cdot \frac{a \cdot t}{y \cdot {z}^{2}}}} \]
    10. Step-by-step derivation
      1. *-commutative43.5%

        \[\leadsto \frac{x}{\color{blue}{\frac{a \cdot t}{y \cdot {z}^{2}} \cdot 0.5}} \]
      2. unpow243.5%

        \[\leadsto \frac{x}{\frac{a \cdot t}{y \cdot \color{blue}{\left(z \cdot z\right)}} \cdot 0.5} \]
      3. associate-*l/43.5%

        \[\leadsto \frac{x}{\color{blue}{\frac{\left(a \cdot t\right) \cdot 0.5}{y \cdot \left(z \cdot z\right)}}} \]
      4. associate-*r*43.5%

        \[\leadsto \frac{x}{\frac{\color{blue}{a \cdot \left(t \cdot 0.5\right)}}{y \cdot \left(z \cdot z\right)}} \]
      5. *-commutative43.5%

        \[\leadsto \frac{x}{\frac{a \cdot \left(t \cdot 0.5\right)}{\color{blue}{\left(z \cdot z\right) \cdot y}}} \]
      6. associate-*r*47.8%

        \[\leadsto \frac{x}{\frac{a \cdot \left(t \cdot 0.5\right)}{\color{blue}{z \cdot \left(z \cdot y\right)}}} \]
      7. associate-/r*47.8%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{a \cdot \left(t \cdot 0.5\right)}{z}}{z \cdot y}}} \]
      8. associate-*l/47.9%

        \[\leadsto \frac{x}{\frac{\color{blue}{\frac{a}{z} \cdot \left(t \cdot 0.5\right)}}{z \cdot y}} \]
      9. associate-/l*47.8%

        \[\leadsto \frac{x}{\color{blue}{\frac{\frac{a}{z}}{\frac{z \cdot y}{t \cdot 0.5}}}} \]
      10. *-commutative47.8%

        \[\leadsto \frac{x}{\frac{\frac{a}{z}}{\frac{z \cdot y}{\color{blue}{0.5 \cdot t}}}} \]
      11. associate-/r*47.8%

        \[\leadsto \frac{x}{\frac{\frac{a}{z}}{\color{blue}{\frac{\frac{z \cdot y}{0.5}}{t}}}} \]
    11. Simplified47.8%

      \[\leadsto \frac{x}{\color{blue}{\frac{\frac{a}{z}}{\frac{\frac{z \cdot y}{0.5}}{t}}}} \]

    if 1.89999999999999999e-137 < z

    1. Initial program 62.3%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*65.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*64.1%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified64.1%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around inf 86.2%

      \[\leadsto \color{blue}{x \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative86.2%

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified86.2%

      \[\leadsto \color{blue}{y \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-105}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-137}:\\ \;\;\;\;\frac{x}{\frac{\frac{a}{z}}{\frac{\frac{z \cdot y}{0.5}}{t}}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 18: 76.4% 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.35 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\ \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.35e-107)
   (* y (- x))
   (* y (/ x (/ (+ z (* -0.5 (* (/ a z) t))) z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.35e-107) {
		tmp = y * -x;
	} else {
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
	}
	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.35d-107)) then
        tmp = y * -x
    else
        tmp = y * (x / ((z + ((-0.5d0) * ((a / z) * t))) / z))
    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.35e-107) {
		tmp = y * -x;
	} else {
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.35e-107:
		tmp = y * -x
	else:
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z))
	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.35e-107)
		tmp = Float64(y * Float64(-x));
	else
		tmp = Float64(y * Float64(x / Float64(Float64(z + Float64(-0.5 * Float64(Float64(a / z) * t))) / z)));
	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.35e-107)
		tmp = y * -x;
	else
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
	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.35e-107], N[(y * (-x)), $MachinePrecision], N[(y * N[(x / N[(N[(z + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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.35 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35e-107

    1. Initial program 57.9%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*60.3%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/60.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
      3. associate-/l*59.0%

        \[\leadsto \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \cdot y \]
      4. *-commutative59.0%

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified59.0%

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    4. Taylor expanded in z around -inf 79.6%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg79.6%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified79.6%

      \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]

    if -1.35e-107 < z

    1. Initial program 67.5%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*67.9%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/70.2%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
    3. Simplified70.2%

      \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
    4. Taylor expanded in z around inf 72.1%

      \[\leadsto \frac{x}{\frac{\color{blue}{z + -0.5 \cdot \frac{a \cdot t}{z}}}{z}} \cdot y \]
    5. Step-by-step derivation
      1. associate-/l*75.0%

        \[\leadsto \frac{x \cdot y}{\frac{z + -0.5 \cdot \color{blue}{\frac{a}{\frac{z}{t}}}}{z}} \]
    6. Simplified75.1%

      \[\leadsto \frac{x}{\frac{\color{blue}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}}{z}} \cdot y \]
    7. Step-by-step derivation
      1. associate-/r/75.1%

        \[\leadsto \frac{x}{\frac{z + -0.5 \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)}}{z}} \cdot y \]
    8. Applied egg-rr75.1%

      \[\leadsto \frac{x}{\frac{z + -0.5 \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)}}{z}} \cdot y \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-107}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\ \end{array} \]

Alternative 19: 78.7% 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 4.7 \cdot 10^{-306}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\ \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 4.7e-306)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (* y (/ x (/ (+ z (* -0.5 (* (/ a z) t))) z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 4.7e-306) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else {
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
	}
	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 <= 4.7d-306) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else
        tmp = y * (x / ((z + ((-0.5d0) * ((a / z) * t))) / z))
    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 <= 4.7e-306) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else {
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= 4.7e-306:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	else:
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= 4.7e-306)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	else
		tmp = Float64(y * Float64(x / Float64(Float64(z + Float64(-0.5 * Float64(Float64(a / z) * t))) / z)));
	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 <= 4.7e-306)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	else
		tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
	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, 4.7e-306], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(y * N[(x / N[(N[(z + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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 4.7 \cdot 10^{-306}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.7000000000000001e-306

    1. Initial program 63.1%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*64.2%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*65.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified65.8%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around -inf 68.2%

      \[\leadsto \frac{x}{\color{blue}{0.5 \cdot \frac{a \cdot t}{y \cdot {z}^{2}} - \frac{1}{y}}} \]
    5. Step-by-step derivation
      1. *-commutative68.2%

        \[\leadsto \frac{x}{0.5 \cdot \frac{\color{blue}{t \cdot a}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      2. associate-*r/68.2%

        \[\leadsto \frac{x}{\color{blue}{\frac{0.5 \cdot \left(t \cdot a\right)}{y \cdot {z}^{2}}} - \frac{1}{y}} \]
      3. *-commutative68.2%

        \[\leadsto \frac{x}{\frac{0.5 \cdot \color{blue}{\left(a \cdot t\right)}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      4. associate-*r*68.2%

        \[\leadsto \frac{x}{\frac{\color{blue}{\left(0.5 \cdot a\right) \cdot t}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      5. unpow268.2%

        \[\leadsto \frac{x}{\frac{\left(0.5 \cdot a\right) \cdot t}{y \cdot \color{blue}{\left(z \cdot z\right)}} - \frac{1}{y}} \]
    6. Simplified68.2%

      \[\leadsto \frac{x}{\color{blue}{\frac{\left(0.5 \cdot a\right) \cdot t}{y \cdot \left(z \cdot z\right)} - \frac{1}{y}}} \]
    7. Step-by-step derivation
      1. associate-*l*68.2%

        \[\leadsto \frac{x}{\frac{\color{blue}{0.5 \cdot \left(a \cdot t\right)}}{y \cdot \left(z \cdot z\right)} - \frac{1}{y}} \]
      2. *-commutative68.2%

        \[\leadsto \frac{x}{\frac{0.5 \cdot \color{blue}{\left(t \cdot a\right)}}{y \cdot \left(z \cdot z\right)} - \frac{1}{y}} \]
      3. associate-*r*71.0%

        \[\leadsto \frac{x}{\frac{0.5 \cdot \left(t \cdot a\right)}{\color{blue}{\left(y \cdot z\right) \cdot z}} - \frac{1}{y}} \]
      4. times-frac72.2%

        \[\leadsto \frac{x}{\color{blue}{\frac{0.5}{y \cdot z} \cdot \frac{t \cdot a}{z}} - \frac{1}{y}} \]
      5. *-commutative72.2%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \frac{\color{blue}{a \cdot t}}{z} - \frac{1}{y}} \]
      6. associate-*l/75.6%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)} - \frac{1}{y}} \]
      7. associate-/r/75.6%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\frac{a}{\frac{z}{t}}} - \frac{1}{y}} \]
      8. div-inv75.6%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\left(a \cdot \frac{1}{\frac{z}{t}}\right)} - \frac{1}{y}} \]
      9. clear-num75.6%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \left(a \cdot \color{blue}{\frac{t}{z}}\right) - \frac{1}{y}} \]
    8. Applied egg-rr75.6%

      \[\leadsto \frac{x}{\color{blue}{\frac{0.5}{y \cdot z} \cdot \left(a \cdot \frac{t}{z}\right)} - \frac{1}{y}} \]
    9. Taylor expanded in y around -inf 68.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/68.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot y\right)}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}}} \]
      2. mul-1-neg68.4%

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in68.4%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-y\right)}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      4. +-commutative68.4%

        \[\leadsto \frac{x \cdot \left(-y\right)}{\color{blue}{-0.5 \cdot \frac{a \cdot t}{{z}^{2}} + 1}} \]
      5. associate-/l*73.0%

        \[\leadsto \frac{x \cdot \left(-y\right)}{-0.5 \cdot \color{blue}{\frac{a}{\frac{{z}^{2}}{t}}} + 1} \]
      6. unpow273.0%

        \[\leadsto \frac{x \cdot \left(-y\right)}{-0.5 \cdot \frac{a}{\frac{\color{blue}{z \cdot z}}{t}} + 1} \]
      7. associate-*r/75.6%

        \[\leadsto \frac{x \cdot \left(-y\right)}{-0.5 \cdot \frac{a}{\color{blue}{z \cdot \frac{z}{t}}} + 1} \]
    11. Simplified75.6%

      \[\leadsto \color{blue}{\frac{x \cdot \left(-y\right)}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \]
    12. Step-by-step derivation
      1. div-inv75.6%

        \[\leadsto \color{blue}{\left(x \cdot \left(-y\right)\right) \cdot \frac{1}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \]
      2. associate-*l*75.7%

        \[\leadsto \color{blue}{x \cdot \left(\left(-y\right) \cdot \frac{1}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}\right)} \]
      3. *-commutative75.7%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot \frac{1}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}\right) \cdot x} \]
      4. div-inv75.7%

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr75.8%

      \[\leadsto \color{blue}{\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x} \]

    if 4.7000000000000001e-306 < z

    1. Initial program 64.9%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*66.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/67.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
    3. Simplified67.4%

      \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
    4. Taylor expanded in z around inf 77.4%

      \[\leadsto \frac{x}{\frac{\color{blue}{z + -0.5 \cdot \frac{a \cdot t}{z}}}{z}} \cdot y \]
    5. Step-by-step derivation
      1. associate-/l*80.9%

        \[\leadsto \frac{x \cdot y}{\frac{z + -0.5 \cdot \color{blue}{\frac{a}{\frac{z}{t}}}}{z}} \]
    6. Simplified80.9%

      \[\leadsto \frac{x}{\frac{\color{blue}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}}{z}} \cdot y \]
    7. Step-by-step derivation
      1. associate-/r/81.0%

        \[\leadsto \frac{x}{\frac{z + -0.5 \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)}}{z}} \cdot y \]
    8. Applied egg-rr81.0%

      \[\leadsto \frac{x}{\frac{z + -0.5 \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)}}{z}} \cdot y \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 4.7 \cdot 10^{-306}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\ \end{array} \]

Alternative 20: 78.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 8 \cdot 10^{-304}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \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 8e-304)
   (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
   (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 8e-304) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	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 <= 8d-304) then
        tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
    else
        tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
    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 <= 8e-304) {
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	} else {
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	}
	return tmp;
}
[x, y] = sort([x, y])
[t, a] = sort([t, a])
def code(x, y, z, t, a):
	tmp = 0
	if z <= 8e-304:
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x
	else:
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))))
	return tmp
x, y = sort([x, y])
t, a = sort([t, a])
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= 8e-304)
		tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x);
	else
		tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))));
	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 <= 8e-304)
		tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
	else
		tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
	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, 8e-304], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $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 8 \cdot 10^{-304}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\

\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 7.99999999999999977e-304

    1. Initial program 62.9%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*64.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*66.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified66.4%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around -inf 68.0%

      \[\leadsto \frac{x}{\color{blue}{0.5 \cdot \frac{a \cdot t}{y \cdot {z}^{2}} - \frac{1}{y}}} \]
    5. Step-by-step derivation
      1. *-commutative68.0%

        \[\leadsto \frac{x}{0.5 \cdot \frac{\color{blue}{t \cdot a}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      2. associate-*r/68.0%

        \[\leadsto \frac{x}{\color{blue}{\frac{0.5 \cdot \left(t \cdot a\right)}{y \cdot {z}^{2}}} - \frac{1}{y}} \]
      3. *-commutative68.0%

        \[\leadsto \frac{x}{\frac{0.5 \cdot \color{blue}{\left(a \cdot t\right)}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      4. associate-*r*68.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{\left(0.5 \cdot a\right) \cdot t}}{y \cdot {z}^{2}} - \frac{1}{y}} \]
      5. unpow268.0%

        \[\leadsto \frac{x}{\frac{\left(0.5 \cdot a\right) \cdot t}{y \cdot \color{blue}{\left(z \cdot z\right)}} - \frac{1}{y}} \]
    6. Simplified68.0%

      \[\leadsto \frac{x}{\color{blue}{\frac{\left(0.5 \cdot a\right) \cdot t}{y \cdot \left(z \cdot z\right)} - \frac{1}{y}}} \]
    7. Step-by-step derivation
      1. associate-*l*68.0%

        \[\leadsto \frac{x}{\frac{\color{blue}{0.5 \cdot \left(a \cdot t\right)}}{y \cdot \left(z \cdot z\right)} - \frac{1}{y}} \]
      2. *-commutative68.0%

        \[\leadsto \frac{x}{\frac{0.5 \cdot \color{blue}{\left(t \cdot a\right)}}{y \cdot \left(z \cdot z\right)} - \frac{1}{y}} \]
      3. associate-*r*70.7%

        \[\leadsto \frac{x}{\frac{0.5 \cdot \left(t \cdot a\right)}{\color{blue}{\left(y \cdot z\right) \cdot z}} - \frac{1}{y}} \]
      4. times-frac71.8%

        \[\leadsto \frac{x}{\color{blue}{\frac{0.5}{y \cdot z} \cdot \frac{t \cdot a}{z}} - \frac{1}{y}} \]
      5. *-commutative71.8%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \frac{\color{blue}{a \cdot t}}{z} - \frac{1}{y}} \]
      6. associate-*l/75.2%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\left(\frac{a}{z} \cdot t\right)} - \frac{1}{y}} \]
      7. associate-/r/75.2%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\frac{a}{\frac{z}{t}}} - \frac{1}{y}} \]
      8. div-inv75.2%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \color{blue}{\left(a \cdot \frac{1}{\frac{z}{t}}\right)} - \frac{1}{y}} \]
      9. clear-num75.2%

        \[\leadsto \frac{x}{\frac{0.5}{y \cdot z} \cdot \left(a \cdot \color{blue}{\frac{t}{z}}\right) - \frac{1}{y}} \]
    8. Applied egg-rr75.2%

      \[\leadsto \frac{x}{\color{blue}{\frac{0.5}{y \cdot z} \cdot \left(a \cdot \frac{t}{z}\right)} - \frac{1}{y}} \]
    9. Taylor expanded in y around -inf 68.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}}} \]
    10. Step-by-step derivation
      1. associate-*r/68.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot y\right)}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}}} \]
      2. mul-1-neg68.1%

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      3. distribute-rgt-neg-in68.1%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-y\right)}}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}} \]
      4. +-commutative68.1%

        \[\leadsto \frac{x \cdot \left(-y\right)}{\color{blue}{-0.5 \cdot \frac{a \cdot t}{{z}^{2}} + 1}} \]
      5. associate-/l*72.6%

        \[\leadsto \frac{x \cdot \left(-y\right)}{-0.5 \cdot \color{blue}{\frac{a}{\frac{{z}^{2}}{t}}} + 1} \]
      6. unpow272.6%

        \[\leadsto \frac{x \cdot \left(-y\right)}{-0.5 \cdot \frac{a}{\frac{\color{blue}{z \cdot z}}{t}} + 1} \]
      7. associate-*r/75.2%

        \[\leadsto \frac{x \cdot \left(-y\right)}{-0.5 \cdot \frac{a}{\color{blue}{z \cdot \frac{z}{t}}} + 1} \]
    11. Simplified75.2%

      \[\leadsto \color{blue}{\frac{x \cdot \left(-y\right)}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \]
    12. Step-by-step derivation
      1. div-inv75.2%

        \[\leadsto \color{blue}{\left(x \cdot \left(-y\right)\right) \cdot \frac{1}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \]
      2. associate-*l*75.3%

        \[\leadsto \color{blue}{x \cdot \left(\left(-y\right) \cdot \frac{1}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}\right)} \]
      3. *-commutative75.3%

        \[\leadsto \color{blue}{\left(\left(-y\right) \cdot \frac{1}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}\right) \cdot x} \]
      4. div-inv75.3%

        \[\leadsto \color{blue}{\frac{-y}{-0.5 \cdot \frac{a}{z \cdot \frac{z}{t}} + 1}} \cdot x \]
    13. Applied egg-rr75.4%

      \[\leadsto \color{blue}{\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x} \]

    if 7.99999999999999977e-304 < z

    1. Initial program 65.1%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*66.2%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    3. Simplified66.2%

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    4. Taylor expanded in z around inf 77.8%

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{z + -0.5 \cdot \frac{a \cdot t}{z}}}{z}} \]
    5. Step-by-step derivation
      1. associate-/l*81.4%

        \[\leadsto \frac{x \cdot y}{\frac{z + -0.5 \cdot \color{blue}{\frac{a}{\frac{z}{t}}}}{z}} \]
    6. Simplified81.4%

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}}{z}} \]
    7. Taylor expanded in z around 0 76.7%

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 + -0.5 \cdot \frac{a \cdot t}{{z}^{2}}}} \]
    8. Step-by-step derivation
      1. unpow276.7%

        \[\leadsto \frac{x \cdot y}{1 + -0.5 \cdot \frac{a \cdot t}{\color{blue}{z \cdot z}}} \]
      2. *-commutative76.7%

        \[\leadsto \frac{x \cdot y}{1 + -0.5 \cdot \frac{\color{blue}{t \cdot a}}{z \cdot z}} \]
      3. times-frac81.4%

        \[\leadsto \frac{x \cdot y}{1 + -0.5 \cdot \color{blue}{\left(\frac{t}{z} \cdot \frac{a}{z}\right)}} \]
    9. Simplified81.4%

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 + -0.5 \cdot \left(\frac{t}{z} \cdot \frac{a}{z}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 8 \cdot 10^{-304}:\\ \;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\ \end{array} \]

Alternative 21: 74.3% 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 -4.7 \cdot 10^{-287}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{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 -4.7e-287)
   (* y (- x))
   (if (<= z 9.5e-97) (/ (* z (* y x)) 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 <= -4.7e-287) {
		tmp = y * -x;
	} else if (z <= 9.5e-97) {
		tmp = (z * (y * x)) / 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 <= (-4.7d-287)) then
        tmp = y * -x
    else if (z <= 9.5d-97) then
        tmp = (z * (y * x)) / 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 <= -4.7e-287) {
		tmp = y * -x;
	} else if (z <= 9.5e-97) {
		tmp = (z * (y * x)) / 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 <= -4.7e-287:
		tmp = y * -x
	elif z <= 9.5e-97:
		tmp = (z * (y * x)) / 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 <= -4.7e-287)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 9.5e-97)
		tmp = Float64(Float64(z * Float64(y * x)) / 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 <= -4.7e-287)
		tmp = y * -x;
	elseif (z <= 9.5e-97)
		tmp = (z * (y * x)) / 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, -4.7e-287], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9.5e-97], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $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 -4.7 \cdot 10^{-287}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{z}\\

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.6999999999999999e-287

    1. Initial program 62.1%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*63.3%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/65.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
      3. associate-/l*64.7%

        \[\leadsto \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \cdot y \]
      4. *-commutative64.7%

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified64.7%

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    4. Taylor expanded in z around -inf 71.5%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg71.5%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified71.5%

      \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]

    if -4.6999999999999999e-287 < z < 9.5000000000000001e-97

    1. Initial program 80.3%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Taylor expanded in z around inf 41.0%

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{z}} \]

    if 9.5000000000000001e-97 < z

    1. Initial program 61.0%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*63.9%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*63.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified63.0%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around inf 88.1%

      \[\leadsto \color{blue}{x \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative88.1%

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified88.1%

      \[\leadsto \color{blue}{y \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.7 \cdot 10^{-287}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 22: 72.5% 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 -2.3 \cdot 10^{-297}:\\ \;\;\;\;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 -2.3e-297) (* 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 <= -2.3e-297) {
		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 <= (-2.3d-297)) 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 <= -2.3e-297) {
		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 <= -2.3e-297:
		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 <= -2.3e-297)
		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 <= -2.3e-297)
		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, -2.3e-297], 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 -2.3 \cdot 10^{-297}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2999999999999999e-297

    1. Initial program 62.1%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*63.3%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-*l/65.8%

        \[\leadsto \color{blue}{\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}} \cdot y} \]
      3. associate-/l*64.7%

        \[\leadsto \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \cdot y \]
      4. *-commutative64.7%

        \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    3. Simplified64.7%

      \[\leadsto \color{blue}{y \cdot \frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}} \]
    4. Taylor expanded in z around -inf 71.5%

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot x\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg71.5%

        \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]
    6. Simplified71.5%

      \[\leadsto y \cdot \color{blue}{\left(-x\right)} \]

    if -2.2999999999999999e-297 < z

    1. Initial program 65.7%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. associate-/l*66.7%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
      2. associate-/l*66.7%

        \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    3. Simplified66.7%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
    4. Taylor expanded in z around inf 72.8%

      \[\leadsto \color{blue}{x \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative72.8%

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified72.8%

      \[\leadsto \color{blue}{y \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{-297}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Alternative 23: 42.7% 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 64.1%

    \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
  2. Step-by-step derivation
    1. associate-/l*65.2%

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \]
    2. associate-/l*65.9%

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
  3. Simplified65.9%

    \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}{y}}} \]
  4. Taylor expanded in z around inf 47.6%

    \[\leadsto \color{blue}{x \cdot y} \]
  5. Step-by-step derivation
    1. *-commutative47.6%

      \[\leadsto \color{blue}{y \cdot x} \]
  6. Simplified47.6%

    \[\leadsto \color{blue}{y \cdot x} \]
  7. Final simplification47.6%

    \[\leadsto y \cdot x \]

Developer target: 89.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (< z -3.1921305903852764e+46)
   (- (* y x))
   (if (< z 5.976268120920894e+90)
     (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
     (* y x))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z < (-3.1921305903852764d+46)) then
        tmp = -(y * x)
    else if (z < 5.976268120920894d+90) then
        tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
    else
        tmp = y * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z < -3.1921305903852764e+46) {
		tmp = -(y * x);
	} else if (z < 5.976268120920894e+90) {
		tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
	} else {
		tmp = y * x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z < -3.1921305903852764e+46:
		tmp = -(y * x)
	elif z < 5.976268120920894e+90:
		tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y)
	else:
		tmp = y * x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z < -3.1921305903852764e+46)
		tmp = Float64(-Float64(y * x));
	elseif (z < 5.976268120920894e+90)
		tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y));
	else
		tmp = Float64(y * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z < -3.1921305903852764e+46)
		tmp = -(y * x);
	elseif (z < 5.976268120920894e+90)
		tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
	else
		tmp = y * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\

\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023297 
(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)))))