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

Percentage Accurate: 61.2% → 90.9%
Time: 15.1s
Alternatives: 13
Speedup: 18.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 61.2% 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: 90.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 35.7%

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

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

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

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

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

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

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

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

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

    if -7.2e22 < z < 2.6999999999999999e-59

    1. Initial program 80.4%

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

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

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

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

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

    if 2.6999999999999999e-59 < z

    1. Initial program 51.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\sqrt{1 - \frac{\color{blue}{a \cdot t}}{z \cdot z}}} \]
      4. times-frac97.9%

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

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

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

Alternative 2: 89.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 35.7%

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

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

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

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

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

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

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

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

    if -8.9999999999999996e22 < z < 5.00000000000000029e83

    1. Initial program 82.9%

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

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

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

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

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

    if 5.00000000000000029e83 < z

    1. Initial program 32.2%

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{1 + -0.5 \cdot \frac{\color{blue}{t \cdot a}}{z \cdot z}} \]
      2. times-frac97.0%

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

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

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

Alternative 3: 90.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 35.7%

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

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

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

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

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

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

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

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

    if -7.80000000000000042e22 < z < 1.80000000000000007e-61

    1. Initial program 80.4%

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

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

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

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

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

    if 1.80000000000000007e-61 < z

    1. Initial program 51.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\sqrt{1 - \frac{\color{blue}{a \cdot t}}{z \cdot z}}} \]
      4. times-frac97.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+22}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-61}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{\sqrt{1 - \frac{a}{z} \cdot \frac{t}{z}}}\\ \end{array} \]

Alternative 4: 82.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 53.8%

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

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

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

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

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

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

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

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

    if -1.25000000000000002e-156 < z < 1.12e-60

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

    if 1.12e-60 < z

    1. Initial program 51.8%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 53.8%

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

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

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

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

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

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

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

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

    if -2.00000000000000008e-156 < z < 1.69999999999999986e-29

    1. Initial program 74.5%

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

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

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

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

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

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

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

    if 1.69999999999999986e-29 < z

    1. Initial program 49.5%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.2% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

    if -5.5000000000000002e-134 < z < 5.0000000000000001e-128

    1. Initial program 74.1%

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

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

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

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

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

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

    if 5.0000000000000001e-128 < z

    1. Initial program 55.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{-134}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-128}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 7: 75.4% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

    if -9.00000000000000029e-148 < z < 5.79999999999999968e-145

    1. Initial program 72.9%

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{y}{\frac{a \cdot t}{{z}^{2} \cdot x}}} \]
      2. *-commutative47.7%

        \[\leadsto -2 \cdot \frac{y}{\frac{\color{blue}{t \cdot a}}{{z}^{2} \cdot x}} \]
      3. times-frac49.9%

        \[\leadsto -2 \cdot \frac{y}{\color{blue}{\frac{t}{{z}^{2}} \cdot \frac{a}{x}}} \]
      4. unpow249.9%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{y}{\frac{\frac{t}{z}}{z} \cdot \frac{a}{x}}} \]
    10. Taylor expanded in y around 0 47.7%

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

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

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

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

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

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

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

    if 5.79999999999999968e-145 < z

    1. Initial program 55.8%

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

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

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

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

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

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

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

Alternative 8: 75.6% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

    if -1.07999999999999995e-147 < z < 3.4999999999999998e-150

    1. Initial program 72.9%

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{y}{\frac{a \cdot t}{{z}^{2} \cdot x}}} \]
      2. *-commutative47.7%

        \[\leadsto -2 \cdot \frac{y}{\frac{\color{blue}{t \cdot a}}{{z}^{2} \cdot x}} \]
      3. times-frac49.9%

        \[\leadsto -2 \cdot \frac{y}{\color{blue}{\frac{t}{{z}^{2}} \cdot \frac{a}{x}}} \]
      4. unpow249.9%

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

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

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

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

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

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

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

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

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

    if 3.4999999999999998e-150 < z

    1. Initial program 55.8%

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

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

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

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

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

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

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

Alternative 9: 75.6% accurate, 6.6× speedup?

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

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-156}:\\
\;\;\;\;-2 \cdot \frac{y}{\frac{a \cdot \frac{t}{z}}{z \cdot x}}\\

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


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

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

    if -1.04999999999999996e-145 < z < 3.7e-156

    1. Initial program 72.9%

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{y}{\frac{a \cdot t}{{z}^{2} \cdot x}}} \]
      2. *-commutative47.7%

        \[\leadsto -2 \cdot \frac{y}{\frac{\color{blue}{t \cdot a}}{{z}^{2} \cdot x}} \]
      3. times-frac49.9%

        \[\leadsto -2 \cdot \frac{y}{\color{blue}{\frac{t}{{z}^{2}} \cdot \frac{a}{x}}} \]
      4. unpow249.9%

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

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

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

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

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

    if 3.7e-156 < z

    1. Initial program 55.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-145}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-156}:\\ \;\;\;\;-2 \cdot \frac{y}{\frac{a \cdot \frac{t}{z}}{z \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 10: 77.2% accurate, 6.6× speedup?

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

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


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

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

    if -1.6000000000000001e-129 < 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*64.8%

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

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

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

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

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

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

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

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

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

Alternative 11: 74.1% accurate, 10.2× speedup?

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

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

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


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

    1. Initial program 53.7%

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

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

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

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

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

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

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

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

    if -1.6e-196 < z < 3.7000000000000002e-162

    1. Initial program 76.4%

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

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

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

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

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

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

    if 3.7000000000000002e-162 < z

    1. Initial program 55.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{-196}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-162}:\\ \;\;\;\;y \cdot \frac{z \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 12: 72.7% accurate, 18.6× speedup?

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

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


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

    1. Initial program 55.1%

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < z

    1. Initial program 59.5%

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

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

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

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

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

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

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

Alternative 13: 43.6% accurate, 37.7× speedup?

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

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

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

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

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

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

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

    \[\leadsto x \cdot y \]

Developer target: 89.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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