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

Percentage Accurate: 60.9% → 90.9%
Time: 20.7s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 60.9% accurate, 1.0× speedup?

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

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

Alternative 1: 90.9% accurate, 0.3× speedup?

\[\begin{array}{l} [t, a] = \mathsf{sort}([t, a])\\ \\ \begin{array}{l} t_1 := \frac{a}{\frac{z \cdot z}{t}}\\ \mathbf{if}\;z \leq -2 \cdot 10^{+145}:\\ \;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-207}:\\ \;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-99}:\\ \;\;\;\;\frac{x}{\frac{{\left(e^{0.25 \cdot \left(\log \left(-t\right) - \log \left(\frac{1}{a}\right)\right)}\right)}^{2}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{\sqrt{1 - t_1}}\\ \end{array} \end{array} \]
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 (/ a (/ (* z z) t))))
   (if (<= z -2e+145)
     (/ (* x y) (fma 0.5 t_1 -1.0))
     (if (<= z -2.6e-207)
       (/ (* x y) (/ (sqrt (- (* z z) (* a t))) z))
       (if (<= z 1.7e-99)
         (/
          x
          (/ (pow (exp (* 0.25 (- (log (- t)) (log (/ 1.0 a))))) 2.0) (* z y)))
         (/ (* x y) (sqrt (- 1.0 t_1))))))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double t_1 = a / ((z * z) / t);
	double tmp;
	if (z <= -2e+145) {
		tmp = (x * y) / fma(0.5, t_1, -1.0);
	} else if (z <= -2.6e-207) {
		tmp = (x * y) / (sqrt(((z * z) - (a * t))) / z);
	} else if (z <= 1.7e-99) {
		tmp = x / (pow(exp((0.25 * (log(-t) - log((1.0 / a))))), 2.0) / (z * y));
	} else {
		tmp = (x * y) / sqrt((1.0 - t_1));
	}
	return tmp;
}
t, a = sort([t, a])
function code(x, y, z, t, a)
	t_1 = Float64(a / Float64(Float64(z * z) / t))
	tmp = 0.0
	if (z <= -2e+145)
		tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0));
	elseif (z <= -2.6e-207)
		tmp = Float64(Float64(x * y) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z));
	elseif (z <= 1.7e-99)
		tmp = Float64(x / Float64((exp(Float64(0.25 * Float64(log(Float64(-t)) - log(Float64(1.0 / a))))) ^ 2.0) / Float64(z * y)));
	else
		tmp = Float64(Float64(x * y) / sqrt(Float64(1.0 - t_1)));
	end
	return tmp
end
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[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+145], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-207], N[(N[(x * y), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-99], N[(x / N[(N[Power[N[Exp[N[(0.25 * N[(N[Log[(-t)], $MachinePrecision] - N[Log[N[(1.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z \cdot z}{t}}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+145}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\

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

\mathbf{elif}\;z \leq 1.7 \cdot 10^{-99}:\\
\;\;\;\;\frac{x}{\frac{{\left(e^{0.25 \cdot \left(\log \left(-t\right) - \log \left(\frac{1}{a}\right)\right)}\right)}^{2}}{z \cdot y}}\\

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


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

    1. Initial program 15.0%

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

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

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

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

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

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

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

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

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

    if -2e145 < z < -2.5999999999999999e-207

    1. Initial program 91.9%

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

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

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

    if -2.5999999999999999e-207 < z < 1.70000000000000003e-99

    1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.70000000000000003e-99 < z

    1. Initial program 66.1%

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Step-by-step derivation
      1. 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. Step-by-step derivation
      1. add-sqr-sqrt66.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-unprod66.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-times60.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+145}:\\ \;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{z \cdot z}{t}}, -1\right)}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-207}:\\ \;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-99}:\\ \;\;\;\;\frac{x}{\frac{{\left(e^{0.25 \cdot \left(\log \left(-t\right) - \log \left(\frac{1}{a}\right)\right)}\right)}^{2}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}\\ \end{array} \]

Alternative 2: 89.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 27.2%

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

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

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

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

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

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

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

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

    if -7.80000000000000032e84 < z < 6.6000000000000004e74

    1. Initial program 82.8%

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

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

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

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

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

    if 6.6000000000000004e74 < z

    1. Initial program 42.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.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 28.3%

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

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

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

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

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

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

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

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

    if -5.79999999999999984e79 < z < 6e75

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

    if 6e75 < z

    1. Initial program 42.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.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 90.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 28.3%

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

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

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

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

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

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

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

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

    if -7.20000000000000011e81 < z < 8.4999999999999996e-142

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999996e-142 < z

    1. Initial program 64.3%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt66.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-unprod66.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-times60.5%

        \[\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-sqrt60.5%

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

      \[\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-sub60.5%

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

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

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

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

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

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

Alternative 5: 90.2% accurate, 1.0× speedup?

\[\begin{array}{l} [t, a] = \mathsf{sort}([t, a])\\ \\ \begin{array}{l} t_1 := \frac{a}{\frac{z \cdot z}{t}}\\ \mathbf{if}\;z \leq -4.9 \cdot 10^{+79}:\\ \;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-142}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{\sqrt{1 - t_1}}\\ \end{array} \end{array} \]
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 (/ a (/ (* z z) t))))
   (if (<= z -4.9e+79)
     (/ (* x y) (fma 0.5 t_1 -1.0))
     (if (<= z 8.5e-142)
       (/ x (/ (sqrt (- (* z z) (* a t))) (* z y)))
       (/ (* x y) (sqrt (- 1.0 t_1)))))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
	double t_1 = a / ((z * z) / t);
	double tmp;
	if (z <= -4.9e+79) {
		tmp = (x * y) / fma(0.5, t_1, -1.0);
	} else if (z <= 8.5e-142) {
		tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
	} else {
		tmp = (x * y) / sqrt((1.0 - t_1));
	}
	return tmp;
}
t, a = sort([t, a])
function code(x, y, z, t, a)
	t_1 = Float64(a / Float64(Float64(z * z) / t))
	tmp = 0.0
	if (z <= -4.9e+79)
		tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0));
	elseif (z <= 8.5e-142)
		tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / Float64(z * y)));
	else
		tmp = Float64(Float64(x * y) / sqrt(Float64(1.0 - t_1)));
	end
	return tmp
end
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[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+79], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-142], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z \cdot z}{t}}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+79}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\

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

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


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

    1. Initial program 28.3%

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

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

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

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

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

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

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

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

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

    if -4.8999999999999999e79 < z < 8.4999999999999996e-142

    1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999996e-142 < z

    1. Initial program 64.3%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt66.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-unprod66.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-times60.5%

        \[\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-sqrt60.5%

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

      \[\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-sub60.5%

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

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

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

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

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

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

Alternative 6: 82.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

    if -1.44999999999999997e-136 < z < 7.79999999999999965e-66

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

    if 7.79999999999999965e-66 < z

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 82.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

    if -9.5000000000000007e-137 < z < 7.59999999999999961e-61

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999961e-61 < z

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 76.1% accurate, 5.9× speedup?

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+75}:\\
\;\;\;\;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 < -6.99999999999999991e-151

    1. Initial program 52.8%

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

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

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

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

      \[\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 -6.99999999999999991e-151 < z < 2.59999999999999985e75

    1. Initial program 79.6%

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

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

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

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

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

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

    if 2.59999999999999985e75 < z

    1. Initial program 42.5%

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

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

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

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

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

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

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

Alternative 9: 74.9% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 52.8%

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

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

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

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

      \[\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.60000000000000011e-151 < z < 4.20000000000000002e-177

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000002e-177 < z

    1. Initial program 64.2%

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

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

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

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

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

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

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

Alternative 10: 75.1% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

    if -2.6999999999999998e-142 < z < 1.89999999999999987e-179

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.89999999999999987e-179 < z

    1. Initial program 64.2%

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

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

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

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

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

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

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

Alternative 11: 75.1% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 52.8%

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

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

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

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

      \[\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 -4.8e-150 < z < 3.3e-177

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.3e-177 < z

    1. Initial program 64.2%

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

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

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

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

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

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

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

Alternative 12: 76.7% accurate, 6.6× speedup?

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

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


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

    1. Initial program 52.8%

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

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

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

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

      \[\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 -3.49999999999999995e-151 < z

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 73.5% accurate, 10.2× speedup?

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

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-177}:\\
\;\;\;\;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.8500000000000001e-218

    1. Initial program 56.0%

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

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

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

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

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

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

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

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

    if -1.8500000000000001e-218 < z < 2.89999999999999997e-177

    1. Initial program 73.1%

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

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

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

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

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

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

    if 2.89999999999999997e-177 < z

    1. Initial program 64.2%

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

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

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

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

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

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

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

Alternative 14: 73.1% accurate, 10.2× speedup?

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

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

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


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

    1. Initial program 52.8%

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

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

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

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

      \[\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.2e-150 < z < 1.50000000000000001e-201

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.50000000000000001e-201 < 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. *-commutative64.9%

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

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

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

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

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

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

Alternative 15: 74.3% accurate, 10.2× speedup?

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

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

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


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

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

    if -4.3e-181 < z < 2.49999999999999994e-138

    1. Initial program 73.5%

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

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

    if 2.49999999999999994e-138 < z

    1. Initial program 63.6%

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

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

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

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

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

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

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

Alternative 16: 71.8% accurate, 18.6× speedup?

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

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


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

    1. Initial program 57.1%

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

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

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

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

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

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

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

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

    if -2e-237 < z

    1. Initial program 65.5%

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

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

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

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

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

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

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

Alternative 17: 42.9% accurate, 37.7× speedup?

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

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

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

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

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

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

    \[\leadsto y \cdot \color{blue}{x} \]
  5. Final simplification39.7%

    \[\leadsto x \cdot y \]

Developer target: 89.1% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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