Data.Colour.Matrix:inverse from colour-2.3.3, B

Percentage Accurate: 91.4% → 95.9%
Time: 7.6s
Alternatives: 14
Speedup: 0.7×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot y - z \cdot t}{a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (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 * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a):
	return ((x * y) - (z * t)) / a
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(z * t)) / a)
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - (z * t)) / a;
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y - z \cdot t}{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 14 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: 91.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot y - z \cdot t}{a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* z t)) a))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (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 * t)) / a
end function
public static double code(double x, double y, double z, double t, double a) {
	return ((x * y) - (z * t)) / a;
}
def code(x, y, z, t, a):
	return ((x * y) - (z * t)) / a
function code(x, y, z, t, a)
	return Float64(Float64(Float64(x * y) - Float64(z * t)) / a)
end
function tmp = code(x, y, z, t, a)
	tmp = ((x * y) - (z * t)) / a;
end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y - z \cdot t}{a}
\end{array}

Alternative 1: 95.9% accurate, 0.0× speedup?

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

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{t_1}{a}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{-z}{\frac{a}{t}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0

    1. Initial program 79.0%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub79.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}} \]
      2. add-cube-cbrt79.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\color{blue}{\frac{z}{\frac{a}{t}}}\right) \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg92.8%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000001e276

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]

    if 5.00000000000000001e276 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 78.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub78.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{x}{a}} - \frac{z \cdot t}{a} \]
      5. fma-neg86.5%

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{1}, \frac{x}{a}, -\color{blue}{\frac{z}{\frac{a}{t}}}\right) \]
    3. Applied egg-rr97.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{x}{a}, -\frac{z}{\frac{a}{t}}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -\infty:\\ \;\;\;\;{\left(\frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}\right)}^{3} - \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;x \cdot y - z \cdot t \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{-z}{\frac{a}{t}}\right)\\ \end{array} \]

Alternative 2: 97.4% accurate, 0.1× speedup?

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

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{t_1}{a}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{-z}{\frac{a}{t}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0

    1. Initial program 79.0%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub79.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}} \]
      2. add-cube-cbrt79.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\color{blue}{\frac{z}{\frac{a}{t}}}\right) \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000001e276

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]

    if 5.00000000000000001e276 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 78.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub78.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{x}{a}} - \frac{z \cdot t}{a} \]
      5. fma-neg86.5%

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{1}, \frac{x}{a}, -\color{blue}{\frac{z}{\frac{a}{t}}}\right) \]
    3. Applied egg-rr97.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{1}, \frac{x}{a}, -\frac{z}{\frac{a}{t}}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -\infty:\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;x \cdot y - z \cdot t \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{x}{a}, \frac{-z}{\frac{a}{t}}\right)\\ \end{array} \]

Alternative 3: 97.1% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+299}\right):\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{a}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* x y) (* z t))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+299)))
     (- (* x (/ y a)) (/ t (/ a z)))
     (/ t_1 a))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+299)) {
		tmp = (x * (y / a)) - (t / (a / z));
	} else {
		tmp = t_1 / a;
	}
	return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+299)) {
		tmp = (x * (y / a)) - (t / (a / z));
	} else {
		tmp = t_1 / a;
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	t_1 = (x * y) - (z * t)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 1e+299):
		tmp = (x * (y / a)) - (t / (a / z))
	else:
		tmp = t_1 / a
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+299))
		tmp = Float64(Float64(x * Float64(y / a)) - Float64(t / Float64(a / z)));
	else
		tmp = Float64(t_1 / a);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x * y) - (z * t);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 1e+299)))
		tmp = (x * (y / a)) - (t / (a / z));
	else
		tmp = t_1 / a;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+299]], $MachinePrecision]], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+299}\right):\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0 or 1.0000000000000001e299 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 76.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub76.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\sqrt[3]{x \cdot y} \cdot \sqrt[3]{x \cdot y}\right) \cdot \sqrt[3]{x \cdot y}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}} - \frac{t}{\frac{a}{z}} \]
      4. add-cube-cbrt89.9%

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e299

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -\infty \lor \neg \left(x \cdot y - z \cdot t \leq 10^{+299}\right):\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \end{array} \]

Alternative 4: 97.1% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \frac{t}{\frac{a}{z}}\\ t_2 := x \cdot y - z \cdot t\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;x \cdot \frac{y}{a} - t_1\\ \mathbf{elif}\;t_2 \leq 10^{+299}:\\ \;\;\;\;\frac{t_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}} - t_1\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ t (/ a z))) (t_2 (- (* x y) (* z t))))
   (if (<= t_2 (- INFINITY))
     (- (* x (/ y a)) t_1)
     (if (<= t_2 1e+299) (/ t_2 a) (- (/ x (/ a y)) t_1)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = t / (a / z);
	double t_2 = (x * y) - (z * t);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = (x * (y / a)) - t_1;
	} else if (t_2 <= 1e+299) {
		tmp = t_2 / a;
	} else {
		tmp = (x / (a / y)) - t_1;
	}
	return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t / (a / z);
	double t_2 = (x * y) - (z * t);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = (x * (y / a)) - t_1;
	} else if (t_2 <= 1e+299) {
		tmp = t_2 / a;
	} else {
		tmp = (x / (a / y)) - t_1;
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	t_1 = t / (a / z)
	t_2 = (x * y) - (z * t)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = (x * (y / a)) - t_1
	elif t_2 <= 1e+299:
		tmp = t_2 / a
	else:
		tmp = (x / (a / y)) - t_1
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	t_1 = Float64(t / Float64(a / z))
	t_2 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(Float64(x * Float64(y / a)) - t_1);
	elseif (t_2 <= 1e+299)
		tmp = Float64(t_2 / a);
	else
		tmp = Float64(Float64(x / Float64(a / y)) - t_1);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = t / (a / z);
	t_2 = (x * y) - (z * t);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = (x * (y / a)) - t_1;
	elseif (t_2 <= 1e+299)
		tmp = t_2 / a;
	else
		tmp = (x / (a / y)) - t_1;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+299], N[(t$95$2 / a), $MachinePrecision], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{a}{z}}\\
t_2 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - t_1\\

\mathbf{elif}\;t_2 \leq 10^{+299}:\\
\;\;\;\;\frac{t_2}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a}{y}} - t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0

    1. Initial program 79.0%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub79.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}} \]
      2. add-cube-cbrt79.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\color{blue}{\frac{z}{\frac{a}{t}}}\right) \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e299

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]

    if 1.0000000000000001e299 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 74.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub74.4%

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{z}{\frac{a}{t}}} \]
    3. Applied egg-rr99.9%

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

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

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

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

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

Alternative 5: 97.1% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;t_1 \leq 10^{+299}:\\ \;\;\;\;\frac{t_1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* x y) (* z t))))
   (if (<= t_1 (- INFINITY))
     (- (* x (/ y a)) (/ t (/ a z)))
     (if (<= t_1 1e+299) (/ t_1 a) (- (/ x (/ a y)) (/ z (/ a t)))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (x * (y / a)) - (t / (a / z));
	} else if (t_1 <= 1e+299) {
		tmp = t_1 / a;
	} else {
		tmp = (x / (a / y)) - (z / (a / t));
	}
	return tmp;
}
assert x < y;
assert z < t;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (x * (y / a)) - (t / (a / z));
	} else if (t_1 <= 1e+299) {
		tmp = t_1 / a;
	} else {
		tmp = (x / (a / y)) - (z / (a / t));
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	t_1 = (x * y) - (z * t)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (x * (y / a)) - (t / (a / z))
	elif t_1 <= 1e+299:
		tmp = t_1 / a
	else:
		tmp = (x / (a / y)) - (z / (a / t))
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(x * Float64(y / a)) - Float64(t / Float64(a / z)));
	elseif (t_1 <= 1e+299)
		tmp = Float64(t_1 / a);
	else
		tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x * y) - (z * t);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (x * (y / a)) - (t / (a / z));
	elseif (t_1 <= 1e+299)
		tmp = t_1 / a;
	else
		tmp = (x / (a / y)) - (z / (a / t));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision] - N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+299], N[(t$95$1 / a), $MachinePrecision], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{t}{\frac{a}{z}}\\

\mathbf{elif}\;t_1 \leq 10^{+299}:\\
\;\;\;\;\frac{t_1}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -inf.0

    1. Initial program 79.0%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub79.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{a} - \frac{z \cdot t}{a}} \]
      2. add-cube-cbrt79.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\color{blue}{\frac{z}{\frac{a}{t}}}\right) \]
    3. Applied egg-rr92.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\sqrt[3]{x \cdot y}\right)}^{2}}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{\sqrt[3]{x \cdot y}}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e299

    1. Initial program 99.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]

    if 1.0000000000000001e299 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 74.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Step-by-step derivation
      1. div-sub74.4%

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{z}{\frac{a}{t}}} \]
    3. Applied egg-rr99.9%

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

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

Alternative 6: 73.3% accurate, 0.4× speedup?

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

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-261}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+47}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.9999999999999999e-40

    1. Initial program 93.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 77.8%

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

    if -1.9999999999999999e-40 < (*.f64 x y) < -1.99999999999999997e-261 or 5.00000000000000018e-285 < (*.f64 x y) < 2.0000000000000001e47

    1. Initial program 97.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 73.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg73.4%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative73.4%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative66.9%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      5. distribute-rgt-neg-in66.9%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg66.9%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified66.9%

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

    if -1.99999999999999997e-261 < (*.f64 x y) < 5.00000000000000018e-285

    1. Initial program 93.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 90.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg90.5%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative90.5%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative90.4%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      5. distribute-rgt-neg-in90.4%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg90.4%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified90.4%

      \[\leadsto \color{blue}{t \cdot \frac{-z}{a}} \]
    5. Step-by-step derivation
      1. distribute-frac-neg90.4%

        \[\leadsto t \cdot \color{blue}{\left(-\frac{z}{a}\right)} \]
      2. distribute-rgt-neg-out90.4%

        \[\leadsto \color{blue}{-t \cdot \frac{z}{a}} \]
      3. clear-num90.4%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      4. div-inv91.9%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/81.8%

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot z} \]
    6. Applied egg-rr81.8%

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

    if 2.0000000000000001e47 < (*.f64 x y)

    1. Initial program 91.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 75.1%

      \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. associate-*l/79.4%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    4. Simplified79.4%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    5. Step-by-step derivation
      1. clear-num79.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x}}} \]
      3. *-un-lft-identity79.4%

        \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x}} \]
    6. Applied egg-rr79.4%

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

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

Alternative 7: 73.3% accurate, 0.4× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -1.9999999999999999e-40

    1. Initial program 93.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 77.8%

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

    if -1.9999999999999999e-40 < (*.f64 x y) < -1.99999999999999997e-261

    1. Initial program 99.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 83.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg83.8%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative83.8%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative73.5%

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

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg73.5%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified73.5%

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

    if -1.99999999999999997e-261 < (*.f64 x y) < 5.00000000000000018e-285

    1. Initial program 93.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 90.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg90.5%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative90.5%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative90.4%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      5. distribute-rgt-neg-in90.4%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg90.4%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified90.4%

      \[\leadsto \color{blue}{t \cdot \frac{-z}{a}} \]
    5. Step-by-step derivation
      1. distribute-frac-neg90.4%

        \[\leadsto t \cdot \color{blue}{\left(-\frac{z}{a}\right)} \]
      2. distribute-rgt-neg-out90.4%

        \[\leadsto \color{blue}{-t \cdot \frac{z}{a}} \]
      3. clear-num90.4%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      4. div-inv91.9%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/81.8%

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot z} \]
    6. Applied egg-rr81.8%

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

    if 5.00000000000000018e-285 < (*.f64 x y) < 2.0000000000000001e47

    1. Initial program 96.2%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 65.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg65.9%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative65.9%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative62.1%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      5. distribute-rgt-neg-in62.1%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg62.1%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified62.1%

      \[\leadsto \color{blue}{t \cdot \frac{-z}{a}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt30.7%

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

        \[\leadsto \color{blue}{\sqrt{\left(t \cdot \frac{-z}{a}\right) \cdot \left(t \cdot \frac{-z}{a}\right)}} \]
      3. swap-sqr18.7%

        \[\leadsto \sqrt{\color{blue}{\left(t \cdot t\right) \cdot \left(\frac{-z}{a} \cdot \frac{-z}{a}\right)}} \]
      4. distribute-frac-neg18.7%

        \[\leadsto \sqrt{\left(t \cdot t\right) \cdot \left(\color{blue}{\left(-\frac{z}{a}\right)} \cdot \frac{-z}{a}\right)} \]
      5. distribute-frac-neg18.7%

        \[\leadsto \sqrt{\left(t \cdot t\right) \cdot \left(\left(-\frac{z}{a}\right) \cdot \color{blue}{\left(-\frac{z}{a}\right)}\right)} \]
      6. sqr-neg18.7%

        \[\leadsto \sqrt{\left(t \cdot t\right) \cdot \color{blue}{\left(\frac{z}{a} \cdot \frac{z}{a}\right)}} \]
      7. swap-sqr24.5%

        \[\leadsto \sqrt{\color{blue}{\left(t \cdot \frac{z}{a}\right) \cdot \left(t \cdot \frac{z}{a}\right)}} \]
      8. clear-num24.5%

        \[\leadsto \sqrt{\left(t \cdot \color{blue}{\frac{1}{\frac{a}{z}}}\right) \cdot \left(t \cdot \frac{z}{a}\right)} \]
      9. div-inv24.6%

        \[\leadsto \sqrt{\color{blue}{\frac{t}{\frac{a}{z}}} \cdot \left(t \cdot \frac{z}{a}\right)} \]
      10. clear-num24.6%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \left(t \cdot \color{blue}{\frac{1}{\frac{a}{z}}}\right)} \]
      11. div-inv24.6%

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \color{blue}{\frac{t}{\frac{a}{z}}}} \]
      12. sqrt-unprod8.8%

        \[\leadsto \color{blue}{\sqrt{\frac{t}{\frac{a}{z}}} \cdot \sqrt{\frac{t}{\frac{a}{z}}}} \]
      13. add-sqr-sqrt9.2%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{z}}} \]
      14. frac-2neg9.2%

        \[\leadsto \color{blue}{\frac{-t}{-\frac{a}{z}}} \]
      15. distribute-neg-frac9.2%

        \[\leadsto \frac{-t}{\color{blue}{\frac{-a}{z}}} \]
      16. add-sqr-sqrt4.3%

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}} \]
      17. sqrt-unprod20.9%

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{\sqrt{z \cdot z}}}} \]
      18. sqr-neg20.9%

        \[\leadsto \frac{-t}{\frac{-a}{\sqrt{\color{blue}{\left(-z\right) \cdot \left(-z\right)}}}} \]
      19. sqrt-unprod24.3%

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}} \]
      20. add-sqr-sqrt62.3%

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{-z}}} \]
      21. frac-2neg62.3%

        \[\leadsto \frac{-t}{\color{blue}{\frac{a}{z}}} \]
    6. Applied egg-rr62.3%

      \[\leadsto \color{blue}{\frac{-t}{\frac{a}{z}}} \]

    if 2.0000000000000001e47 < (*.f64 x y)

    1. Initial program 91.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 75.1%

      \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. associate-*l/79.4%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    4. Simplified79.4%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    5. Step-by-step derivation
      1. clear-num79.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x}}} \]
      3. *-un-lft-identity79.4%

        \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x}} \]
    6. Applied egg-rr79.4%

      \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification74.8%

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

Alternative 8: 75.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+141}:\\
\;\;\;\;-\frac{z \cdot t}{a}\\

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-t}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 z t) < -9.9999999999999996e-39

    1. Initial program 92.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 76.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg76.2%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative76.2%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative73.0%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      5. distribute-rgt-neg-in73.0%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg73.0%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified73.0%

      \[\leadsto \color{blue}{t \cdot \frac{-z}{a}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt41.2%

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

        \[\leadsto \color{blue}{\sqrt{\left(t \cdot \frac{-z}{a}\right) \cdot \left(t \cdot \frac{-z}{a}\right)}} \]
      3. swap-sqr24.0%

        \[\leadsto \sqrt{\color{blue}{\left(t \cdot t\right) \cdot \left(\frac{-z}{a} \cdot \frac{-z}{a}\right)}} \]
      4. distribute-frac-neg24.0%

        \[\leadsto \sqrt{\left(t \cdot t\right) \cdot \left(\color{blue}{\left(-\frac{z}{a}\right)} \cdot \frac{-z}{a}\right)} \]
      5. distribute-frac-neg24.0%

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

        \[\leadsto \sqrt{\left(t \cdot t\right) \cdot \color{blue}{\left(\frac{z}{a} \cdot \frac{z}{a}\right)}} \]
      7. swap-sqr36.3%

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{t}{\frac{a}{z}}} \cdot \left(t \cdot \frac{z}{a}\right)} \]
      10. clear-num36.2%

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

        \[\leadsto \sqrt{\frac{t}{\frac{a}{z}} \cdot \color{blue}{\frac{t}{\frac{a}{z}}}} \]
      12. sqrt-unprod0.9%

        \[\leadsto \color{blue}{\sqrt{\frac{t}{\frac{a}{z}}} \cdot \sqrt{\frac{t}{\frac{a}{z}}}} \]
      13. add-sqr-sqrt1.3%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{z}}} \]
      14. frac-2neg1.3%

        \[\leadsto \color{blue}{\frac{-t}{-\frac{a}{z}}} \]
      15. distribute-neg-frac1.3%

        \[\leadsto \frac{-t}{\color{blue}{\frac{-a}{z}}} \]
      16. add-sqr-sqrt0.9%

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}} \]
      17. sqrt-unprod24.5%

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{\sqrt{z \cdot z}}}} \]
      18. sqr-neg24.5%

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

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}} \]
      20. add-sqr-sqrt73.1%

        \[\leadsto \frac{-t}{\frac{-a}{\color{blue}{-z}}} \]
      21. frac-2neg73.1%

        \[\leadsto \frac{-t}{\color{blue}{\frac{a}{z}}} \]
    6. Applied egg-rr73.1%

      \[\leadsto \color{blue}{\frac{-t}{\frac{a}{z}}} \]

    if -9.9999999999999996e-39 < (*.f64 z t) < 4.99999999999999954e-22

    1. Initial program 97.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 83.8%

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

    if 4.99999999999999954e-22 < (*.f64 z t) < 4.00000000000000007e141

    1. Initial program 99.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 65.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. associate-*r/65.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot z\right)}{a}} \]
      2. mul-1-neg65.5%

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a} \]
      3. distribute-rgt-neg-in65.5%

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

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

    if 4.00000000000000007e141 < (*.f64 z t)

    1. Initial program 83.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 73.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg73.0%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative73.0%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative86.3%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      5. distribute-rgt-neg-in86.3%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg86.3%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified86.3%

      \[\leadsto \color{blue}{t \cdot \frac{-z}{a}} \]
    5. Step-by-step derivation
      1. distribute-frac-neg86.3%

        \[\leadsto t \cdot \color{blue}{\left(-\frac{z}{a}\right)} \]
      2. distribute-rgt-neg-out86.3%

        \[\leadsto \color{blue}{-t \cdot \frac{z}{a}} \]
      3. clear-num86.4%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      4. div-inv86.4%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/83.7%

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot z} \]
    6. Applied egg-rr83.7%

      \[\leadsto \color{blue}{-\frac{t}{a} \cdot z} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification78.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-38}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-22}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+141}:\\ \;\;\;\;-\frac{z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-t}{a}\\ \end{array} \]

Alternative 9: 73.2% accurate, 0.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.9999999999999999e-40

    1. Initial program 93.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 77.8%

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

    if -1.9999999999999999e-40 < (*.f64 x y) < 2.0000000000000001e47

    1. Initial program 96.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around 0 77.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a}} \]
    3. Step-by-step derivation
      1. mul-1-neg77.7%

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a}} \]
      2. *-commutative77.7%

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative72.9%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a}} \]
      5. distribute-rgt-neg-in72.9%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a}\right)} \]
      6. distribute-frac-neg72.9%

        \[\leadsto t \cdot \color{blue}{\frac{-z}{a}} \]
    4. Simplified72.9%

      \[\leadsto \color{blue}{t \cdot \frac{-z}{a}} \]
    5. Step-by-step derivation
      1. distribute-frac-neg72.9%

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

        \[\leadsto \color{blue}{-t \cdot \frac{z}{a}} \]
      3. clear-num72.2%

        \[\leadsto -t \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      4. div-inv72.7%

        \[\leadsto -\color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/70.3%

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot z} \]
    6. Applied egg-rr70.3%

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

    if 2.0000000000000001e47 < (*.f64 x y)

    1. Initial program 91.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 75.1%

      \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. associate-*l/79.4%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    4. Simplified79.4%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    5. Step-by-step derivation
      1. clear-num79.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x}}} \]
      3. *-un-lft-identity79.4%

        \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x}} \]
    6. Applied egg-rr79.4%

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

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

Alternative 10: 93.1% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < 5.00000000000000001e276

    1. Initial program 96.1%

      \[\frac{x \cdot y - z \cdot t}{a} \]

    if 5.00000000000000001e276 < (*.f64 x y)

    1. Initial program 74.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 74.8%

      \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    5. Step-by-step derivation
      1. clear-num99.8%

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

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x}}} \]
      3. *-un-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x}} \]
    6. Applied egg-rr99.8%

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

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

Alternative 11: 51.4% accurate, 1.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < 5.00000000000000001e276

    1. Initial program 96.1%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 52.0%

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

    if 5.00000000000000001e276 < (*.f64 x y)

    1. Initial program 74.6%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Taylor expanded in x around inf 74.8%

      \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
    3. Step-by-step derivation
      1. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    5. Step-by-step derivation
      1. clear-num99.8%

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

        \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x}}} \]
      3. *-un-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \end{array} \]

Alternative 12: 50.3% accurate, 1.8× speedup?

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

    \[\frac{x \cdot y - z \cdot t}{a} \]
  2. Taylor expanded in x around inf 53.7%

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
  4. Simplified50.7%

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

    \[\leadsto x \cdot \frac{y}{a} \]

Alternative 13: 50.2% accurate, 1.8× speedup?

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

    \[\frac{x \cdot y - z \cdot t}{a} \]
  2. Taylor expanded in x around inf 53.7%

    \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
  3. Step-by-step derivation
    1. associate-*l/52.3%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
  4. Simplified52.3%

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

    \[\leadsto y \cdot \frac{x}{a} \]

Alternative 14: 50.1% accurate, 1.8× speedup?

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

    \[\frac{x \cdot y - z \cdot t}{a} \]
  2. Taylor expanded in x around inf 53.7%

    \[\leadsto \color{blue}{\frac{x \cdot y}{a}} \]
  3. Step-by-step derivation
    1. associate-*l/52.3%

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
  4. Simplified52.3%

    \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
  5. Step-by-step derivation
    1. clear-num52.3%

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

      \[\leadsto \color{blue}{\frac{1 \cdot y}{\frac{a}{x}}} \]
    3. *-un-lft-identity52.4%

      \[\leadsto \frac{\color{blue}{y}}{\frac{a}{x}} \]
  6. Applied egg-rr52.4%

    \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
  7. Final simplification52.4%

    \[\leadsto \frac{y}{\frac{a}{x}} \]

Developer target: 92.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\ \mathbf{if}\;z < -2.468684968699548 \cdot 10^{+170}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z < 6.309831121978371 \cdot 10^{-71}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* (/ y a) x) (* (/ t a) z))))
   (if (< z -2.468684968699548e+170)
     t_1
     (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = ((y / a) * x) - ((t / a) * z);
	double tmp;
	if (z < -2.468684968699548e+170) {
		tmp = t_1;
	} else if (z < 6.309831121978371e-71) {
		tmp = ((x * y) - (z * t)) / a;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = ((y / a) * x) - ((t / a) * z)
    if (z < (-2.468684968699548d+170)) then
        tmp = t_1
    else if (z < 6.309831121978371d-71) then
        tmp = ((x * y) - (z * t)) / a
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((y / a) * x) - ((t / a) * z);
	double tmp;
	if (z < -2.468684968699548e+170) {
		tmp = t_1;
	} else if (z < 6.309831121978371e-71) {
		tmp = ((x * y) - (z * t)) / a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((y / a) * x) - ((t / a) * z)
	tmp = 0
	if z < -2.468684968699548e+170:
		tmp = t_1
	elif z < 6.309831121978371e-71:
		tmp = ((x * y) - (z * t)) / a
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(y / a) * x) - Float64(Float64(t / a) * z))
	tmp = 0.0
	if (z < -2.468684968699548e+170)
		tmp = t_1;
	elseif (z < 6.309831121978371e-71)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((y / a) * x) - ((t / a) * z);
	tmp = 0.0;
	if (z < -2.468684968699548e+170)
		tmp = t_1;
	elseif (z < 6.309831121978371e-71)
		tmp = ((x * y) - (z * t)) / a;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y / a), $MachinePrecision] * x), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.468684968699548e+170], t$95$1, If[Less[z, 6.309831121978371e-71], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot x - \frac{t}{a} \cdot z\\
\mathbf{if}\;z < -2.468684968699548 \cdot 10^{+170}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z < 6.309831121978371 \cdot 10^{-71}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023293 
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
  :precision binary64

  :herbie-target
  (if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

  (/ (- (* x y) (* z t)) a))