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

Percentage Accurate: 61.3% → 90.4%
Time: 16.3s
Alternatives: 15
Speedup: 18.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 61.3% 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.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 36.5%

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e41 < z < 1.4e45

    1. Initial program 86.4%

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

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

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

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

    if 1.4e45 < z

    1. Initial program 33.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified94.1%

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

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

Alternative 2: 90.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 17.1%

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

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

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

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

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

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

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

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

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

    if -6.5e130 < z < 1.49999999999999988e86

    1. Initial program 86.1%

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

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

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

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

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

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

    if 1.49999999999999988e86 < z

    1. Initial program 27.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified96.7%

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

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

Alternative 3: 83.6% accurate, 1.0× speedup?

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

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

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


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

    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. associate-*l*52.4%

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

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

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

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

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

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

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

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

    if -1.5000000000000001e-119 < z < 3.0000000000000002e-66

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

    if 3.0000000000000002e-66 < z

    1. Initial program 52.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified88.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{-119}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{-66}:\\ \;\;\;\;x \cdot \frac{z}{\frac{\sqrt{t \cdot \left(-a\right)}}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 4: 83.0% accurate, 1.0× speedup?

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


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

    1. Initial program 57.6%

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

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

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

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

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

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

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

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

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

    if -4.79999999999999974e-154 < z < 7.79999999999999965e-66

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.79999999999999965e-66 < z

    1. Initial program 52.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified88.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{-154}:\\ \;\;\;\;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}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 5: 77.8% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

    if -2.50000000000000012e-231 < z < 3.19999999999999986e-73

    1. Initial program 79.0%

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

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

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

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

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

    if 3.19999999999999986e-73 < z

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 77.7% accurate, 5.9× speedup?

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

\mathbf{elif}\;z \leq 8.2 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\frac{a \cdot 0.5}{\frac{z}{t}} - z}\\

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


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

    1. Initial program 47.2%

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

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

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

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

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

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

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

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

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

    if -6.5e-25 < z < 8.1999999999999996e-98

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

    if 8.1999999999999996e-98 < z

    1. Initial program 53.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified85.5%

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

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

Alternative 7: 78.3% accurate, 5.9× speedup?

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

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

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


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

    1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

    if -2.6999999999999998e-229 < z < 9.9999999999999997e34

    1. Initial program 83.3%

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

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

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

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

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

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

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

    if 9.9999999999999997e34 < z

    1. Initial program 37.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified93.1%

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

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

Alternative 8: 76.1% accurate, 6.6× speedup?

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-77}:\\
\;\;\;\;-2 \cdot \left(\frac{x}{a} \cdot \frac{y \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 < -2.1999999999999999e-229

    1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e-229 < z < 4.99999999999999963e-77

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999963e-77 < z

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 76.6% accurate, 6.6× speedup?

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

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

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


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

    1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

    if -1.9e-233 < z < 1.14e-97

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{\frac{1}{-0.5}}{\frac{a}{x} \cdot \frac{t}{z \cdot y}}} \]
      7. metadata-eval60.3%

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

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

        \[\leadsto z \cdot \frac{-2}{\frac{\color{blue}{\frac{a \cdot t}{z \cdot y}}}{x}} \]
      10. times-frac60.7%

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

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

    if 1.14e-97 < z

    1. Initial program 53.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified85.5%

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

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

Alternative 10: 76.8% accurate, 8.6× speedup?

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

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

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


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

    1. Initial program 60.8%

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

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

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

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

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

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

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

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

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

    if -8.2000000000000002e-238 < z < 5.0000000000000002e-57

    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. *-commutative77.5%

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

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

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

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

        \[\leadsto \frac{z}{\color{blue}{\frac{-1 \cdot z}{x \cdot y}}} \]
      2. neg-mul-117.9%

        \[\leadsto \frac{z}{\frac{\color{blue}{-z}}{x \cdot y}} \]
      3. associate-/r*17.8%

        \[\leadsto \frac{z}{\color{blue}{\frac{\frac{-z}{x}}{y}}} \]
    6. Simplified17.8%

      \[\leadsto \frac{z}{\color{blue}{\frac{\frac{-z}{x}}{y}}} \]
    7. Step-by-step derivation
      1. clear-num17.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{\frac{-z}{x}}{y}}{z}}} \]
      2. inv-pow17.8%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\frac{-z}{x}}{y}}{z}\right)}^{-1}} \]
      3. associate-/l/17.9%

        \[\leadsto {\left(\frac{\color{blue}{\frac{-z}{y \cdot x}}}{z}\right)}^{-1} \]
      4. add-sqr-sqrt0.7%

        \[\leadsto {\left(\frac{\frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{y \cdot x}}{z}\right)}^{-1} \]
      5. sqrt-unprod11.3%

        \[\leadsto {\left(\frac{\frac{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}{y \cdot x}}{z}\right)}^{-1} \]
      6. sqr-neg11.3%

        \[\leadsto {\left(\frac{\frac{\sqrt{\color{blue}{z \cdot z}}}{y \cdot x}}{z}\right)}^{-1} \]
      7. sqrt-prod24.8%

        \[\leadsto {\left(\frac{\frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{y \cdot x}}{z}\right)}^{-1} \]
      8. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{{\left(\frac{\frac{z}{y \cdot x}}{z}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-125.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{z}{y \cdot x}}{z}}} \]
      2. associate-/l/46.2%

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

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

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

        \[\leadsto \frac{1}{\frac{z}{\color{blue}{y \cdot \left(z \cdot x\right)}}} \]
    10. Simplified48.2%

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

    if 5.0000000000000002e-57 < z

    1. Initial program 51.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified90.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-238}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-57}:\\ \;\;\;\;\frac{1}{\frac{z}{y \cdot \left(z \cdot x\right)}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 11: 75.8% accurate, 10.2× speedup?

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-110}:\\
\;\;\;\;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 < -2.6499999999999999e-241

    1. Initial program 60.8%

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

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

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

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

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

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

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

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

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

    if -2.6499999999999999e-241 < z < 2.5999999999999999e-110

    1. Initial program 76.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5999999999999999e-110 < z

    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. associate-*l*51.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified83.8%

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

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

Alternative 12: 75.3% accurate, 10.2× speedup?

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

\mathbf{elif}\;z \leq 4 \cdot 10^{-140}:\\
\;\;\;\;\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 < -4.1e-286

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

    if -4.1e-286 < z < 3.9999999999999999e-140

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e-140 < z

    1. Initial program 55.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified82.4%

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

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

Alternative 13: 76.4% accurate, 10.2× speedup?

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

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

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


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

    1. Initial program 60.7%

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

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

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

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

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

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

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

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

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

    if -1.99999999999999992e-268 < z < 5.0000000000000003e-134

    1. Initial program 79.2%

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

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

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

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

    if 5.0000000000000003e-134 < z

    1. Initial program 55.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified82.4%

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

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

Alternative 14: 74.1% accurate, 18.6× speedup?

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

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


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

    1. Initial program 60.4%

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

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

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

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

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

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

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

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

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

    if -2.89999999999999984e-301 < z

    1. Initial program 61.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot x} \]
    6. Simplified71.8%

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

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

Alternative 15: 44.1% accurate, 37.7× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot x} \]
  6. Simplified39.8%

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

    \[\leadsto x \cdot y \]

Developer target: 89.7% 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 2023293 
(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)))))