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

Percentage Accurate: 91.4% → 95.5%
Time: 9.2s
Alternatives: 11
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 11 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.5% 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 -2 \cdot 10^{+207} \lor \neg \left(t_1 \leq 5 \cdot 10^{+166}\right):\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\ \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 -2e+207) (not (<= t_1 5e+166)))
     (fma -1.0 (/ t (/ a z)) (/ y (/ a x)))
     (/ 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 <= -2e+207) || !(t_1 <= 5e+166)) {
		tmp = fma(-1.0, (t / (a / z)), (y / (a / x)));
	} 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 <= -2e+207) || !(t_1 <= 5e+166))
		tmp = fma(-1.0, Float64(t / Float64(a / z)), Float64(y / Float64(a / x)));
	else
		tmp = Float64(t_1 / a);
	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[Or[LessEqual[t$95$1, -2e+207], N[Not[LessEqual[t$95$1, 5e+166]], $MachinePrecision]], N[(-1.0 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(a / x), $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 -2 \cdot 10^{+207} \lor \neg \left(t_1 \leq 5 \cdot 10^{+166}\right):\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\

\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)) < -2.0000000000000001e207 or 5.0000000000000002e166 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 80.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot z}{a} + \frac{y \cdot x}{a}} \]
    3. Step-by-step derivation
      1. fma-def78.0%

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

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

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

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

    if -2.0000000000000001e207 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.0000000000000002e166

    1. Initial program 98.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -2 \cdot 10^{+207} \lor \neg \left(x \cdot y - z \cdot t \leq 5 \cdot 10^{+166}\right):\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \end{array} \]

Alternative 2: 96.8% 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 \lor \neg \left(t_1 \leq 2 \cdot 10^{+248}\right):\\ \;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, z \cdot \left(-t\right)\right)}{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 2e+248)))
     (- (/ x (/ a y)) (/ z (/ a t)))
     (/ (fma y x (* z (- t))) 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 <= 2e+248)) {
		tmp = (x / (a / y)) - (z / (a / t));
	} else {
		tmp = fma(y, x, (z * -t)) / 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 <= 2e+248))
		tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t)));
	else
		tmp = Float64(fma(y, x, Float64(z * Float64(-t))) / a);
	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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+248]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / 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 2 \cdot 10^{+248}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000009e248

    1. Initial program 98.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot x}{a} - \frac{t \cdot z}{a}} \]
      4. div-sub98.6%

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, -t \cdot z\right)}}{a} \]
      6. distribute-rgt-neg-out98.6%

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

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

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

Alternative 3: 96.8% 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 2 \cdot 10^{+248}\right):\\ \;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\ \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 2e+248)))
     (- (/ x (/ a y)) (/ z (/ a t)))
     (/ 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 <= 2e+248)) {
		tmp = (x / (a / y)) - (z / (a / t));
	} 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 <= 2e+248)) {
		tmp = (x / (a / y)) - (z / (a / t));
	} 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 <= 2e+248):
		tmp = (x / (a / y)) - (z / (a / t))
	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 <= 2e+248))
		tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t)));
	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 <= 2e+248)))
		tmp = (x / (a / y)) - (z / (a / t));
	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, 2e+248]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $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 2 \cdot 10^{+248}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\

\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 2.00000000000000009e248 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 70.3%

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000009e248

    1. Initial program 98.6%

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

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

Alternative 4: 68.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.95 \cdot 10^{-56}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+62}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 10^{+88}:\\ \;\;\;\;\frac{1}{\frac{\frac{a}{-t}}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \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 (<= y -2.95e-56)
   (/ y (/ a x))
   (if (<= y 4.3e+16)
     (* z (/ t (- a)))
     (if (<= y 3.4e+62)
       (* x (/ y a))
       (if (<= y 1e+88) (/ 1.0 (/ (/ a (- t)) z)) (/ x (/ a y)))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -2.95e-56) {
		tmp = y / (a / x);
	} else if (y <= 4.3e+16) {
		tmp = z * (t / -a);
	} else if (y <= 3.4e+62) {
		tmp = x * (y / a);
	} else if (y <= 1e+88) {
		tmp = 1.0 / ((a / -t) / z);
	} else {
		tmp = x / (a / y);
	}
	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 (y <= (-2.95d-56)) then
        tmp = y / (a / x)
    else if (y <= 4.3d+16) then
        tmp = z * (t / -a)
    else if (y <= 3.4d+62) then
        tmp = x * (y / a)
    else if (y <= 1d+88) then
        tmp = 1.0d0 / ((a / -t) / z)
    else
        tmp = x / (a / y)
    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 (y <= -2.95e-56) {
		tmp = y / (a / x);
	} else if (y <= 4.3e+16) {
		tmp = z * (t / -a);
	} else if (y <= 3.4e+62) {
		tmp = x * (y / a);
	} else if (y <= 1e+88) {
		tmp = 1.0 / ((a / -t) / z);
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if y <= -2.95e-56:
		tmp = y / (a / x)
	elif y <= 4.3e+16:
		tmp = z * (t / -a)
	elif y <= 3.4e+62:
		tmp = x * (y / a)
	elif y <= 1e+88:
		tmp = 1.0 / ((a / -t) / z)
	else:
		tmp = x / (a / y)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -2.95e-56)
		tmp = Float64(y / Float64(a / x));
	elseif (y <= 4.3e+16)
		tmp = Float64(z * Float64(t / Float64(-a)));
	elseif (y <= 3.4e+62)
		tmp = Float64(x * Float64(y / a));
	elseif (y <= 1e+88)
		tmp = Float64(1.0 / Float64(Float64(a / Float64(-t)) / z));
	else
		tmp = Float64(x / Float64(a / y));
	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 (y <= -2.95e-56)
		tmp = y / (a / x);
	elseif (y <= 4.3e+16)
		tmp = z * (t / -a);
	elseif (y <= 3.4e+62)
		tmp = x * (y / a);
	elseif (y <= 1e+88)
		tmp = 1.0 / ((a / -t) / z);
	else
		tmp = x / (a / y);
	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[y, -2.95e-56], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e+16], N[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e+62], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+88], N[(1.0 / N[(N[(a / (-t)), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.95 \cdot 10^{-56}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

\mathbf{elif}\;y \leq 4.3 \cdot 10^{+16}:\\
\;\;\;\;z \cdot \frac{t}{-a}\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 10^{+88}:\\
\;\;\;\;\frac{1}{\frac{\frac{a}{-t}}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.9499999999999999e-56

    1. Initial program 85.6%

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

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

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

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

    if -2.9499999999999999e-56 < y < 4.3e16

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-z\right)}{-a}} \]
      3. remove-double-neg70.1%

        \[\leadsto t \cdot \frac{\color{blue}{z}}{-a} \]
      4. associate-*r/69.1%

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

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

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

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

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

    if 4.3e16 < y < 3.40000000000000014e62

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, -t \cdot z\right)}}{a} \]
      6. distribute-rgt-neg-out99.2%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, t \cdot \left(-z\right)\right)}{a}} \]
    5. Taylor expanded in y around inf 72.2%

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

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

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

    if 3.40000000000000014e62 < y < 9.99999999999999959e87

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\frac{a}{t}} \]
      7. add-sqr-sqrt0.8%

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

      \[\leadsto \color{blue}{\frac{z}{\frac{a}{t}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity0.8%

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

        \[\leadsto \frac{1 \cdot z}{\color{blue}{a \cdot \frac{1}{t}}} \]
      3. times-frac0.7%

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

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\color{blue}{\frac{-1}{-t}}} \]
      5. metadata-eval0.7%

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{\color{blue}{-1}}{-t}} \]
      6. add-sqr-sqrt0.4%

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

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{-1}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      8. sqr-neg2.1%

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{-1}{\sqrt{\color{blue}{t \cdot t}}}} \]
      9. sqrt-unprod1.8%

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

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{-1}{\color{blue}{t}}} \]
    8. Applied egg-rr44.3%

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

        \[\leadsto \color{blue}{\frac{1 \cdot z}{a \cdot \frac{-1}{t}}} \]
      2. *-un-lft-identity71.6%

        \[\leadsto \frac{\color{blue}{z}}{a \cdot \frac{-1}{t}} \]
      3. clear-num71.6%

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{\frac{--1}{-t}}}{z}} \]
      5. metadata-eval71.6%

        \[\leadsto \frac{1}{\frac{a \cdot \frac{\color{blue}{1}}{-t}}{z}} \]
      6. un-div-inv71.6%

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

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

    if 9.99999999999999959e87 < y

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.95 \cdot 10^{-56}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+62}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 10^{+88}:\\ \;\;\;\;\frac{1}{\frac{\frac{a}{-t}}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 5: 68.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := z \cdot \frac{t}{-a}\\ \mathbf{if}\;y \leq -1.9 \cdot 10^{-55}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+61}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 1.28 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \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 (* z (/ t (- a)))))
   (if (<= y -1.9e-55)
     (/ y (/ a x))
     (if (<= y 4.4e+15)
       t_1
       (if (<= y 5e+61)
         (* x (/ y a))
         (if (<= y 1.28e+91) t_1 (/ x (/ a y))))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (t / -a);
	double tmp;
	if (y <= -1.9e-55) {
		tmp = y / (a / x);
	} else if (y <= 4.4e+15) {
		tmp = t_1;
	} else if (y <= 5e+61) {
		tmp = x * (y / a);
	} else if (y <= 1.28e+91) {
		tmp = t_1;
	} else {
		tmp = x / (a / y);
	}
	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 = z * (t / -a)
    if (y <= (-1.9d-55)) then
        tmp = y / (a / x)
    else if (y <= 4.4d+15) then
        tmp = t_1
    else if (y <= 5d+61) then
        tmp = x * (y / a)
    else if (y <= 1.28d+91) then
        tmp = t_1
    else
        tmp = x / (a / y)
    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 = z * (t / -a);
	double tmp;
	if (y <= -1.9e-55) {
		tmp = y / (a / x);
	} else if (y <= 4.4e+15) {
		tmp = t_1;
	} else if (y <= 5e+61) {
		tmp = x * (y / a);
	} else if (y <= 1.28e+91) {
		tmp = t_1;
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	t_1 = z * (t / -a)
	tmp = 0
	if y <= -1.9e-55:
		tmp = y / (a / x)
	elif y <= 4.4e+15:
		tmp = t_1
	elif y <= 5e+61:
		tmp = x * (y / a)
	elif y <= 1.28e+91:
		tmp = t_1
	else:
		tmp = x / (a / y)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	t_1 = Float64(z * Float64(t / Float64(-a)))
	tmp = 0.0
	if (y <= -1.9e-55)
		tmp = Float64(y / Float64(a / x));
	elseif (y <= 4.4e+15)
		tmp = t_1;
	elseif (y <= 5e+61)
		tmp = Float64(x * Float64(y / a));
	elseif (y <= 1.28e+91)
		tmp = t_1;
	else
		tmp = Float64(x / Float64(a / y));
	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 = z * (t / -a);
	tmp = 0.0;
	if (y <= -1.9e-55)
		tmp = y / (a / x);
	elseif (y <= 4.4e+15)
		tmp = t_1;
	elseif (y <= 5e+61)
		tmp = x * (y / a);
	elseif (y <= 1.28e+91)
		tmp = t_1;
	else
		tmp = x / (a / y);
	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[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e-55], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+15], t$95$1, If[LessEqual[y, 5e+61], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.28e+91], t$95$1, N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := z \cdot \frac{t}{-a}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-55}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

\mathbf{elif}\;y \leq 4.4 \cdot 10^{+15}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 1.28 \cdot 10^{+91}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.8999999999999998e-55

    1. Initial program 85.6%

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

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

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

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

    if -1.8999999999999998e-55 < y < 4.4e15 or 5.00000000000000018e61 < y < 1.27999999999999999e91

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-z\right)}{-a}} \]
      3. remove-double-neg70.2%

        \[\leadsto t \cdot \frac{\color{blue}{z}}{-a} \]
      4. associate-*r/67.7%

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

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

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

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

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

    if 4.4e15 < y < 5.00000000000000018e61

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, -t \cdot z\right)}}{a} \]
      6. distribute-rgt-neg-out99.2%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, t \cdot \left(-z\right)\right)}{a}} \]
    5. Taylor expanded in y around inf 72.2%

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

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

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

    if 1.27999999999999999e91 < y

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{-55}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{+15}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+61}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 1.28 \cdot 10^{+91}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 6: 68.6% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+61}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 10^{+88}:\\ \;\;\;\;t \cdot \left(-\frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \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 (<= y -1.2e-70)
   (/ y (/ a x))
   (if (<= y 1.05e+16)
     (* z (/ t (- a)))
     (if (<= y 5.1e+61)
       (* x (/ y a))
       (if (<= y 1e+88) (* t (- (/ z a))) (/ x (/ a y)))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.2e-70) {
		tmp = y / (a / x);
	} else if (y <= 1.05e+16) {
		tmp = z * (t / -a);
	} else if (y <= 5.1e+61) {
		tmp = x * (y / a);
	} else if (y <= 1e+88) {
		tmp = t * -(z / a);
	} else {
		tmp = x / (a / y);
	}
	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 (y <= (-1.2d-70)) then
        tmp = y / (a / x)
    else if (y <= 1.05d+16) then
        tmp = z * (t / -a)
    else if (y <= 5.1d+61) then
        tmp = x * (y / a)
    else if (y <= 1d+88) then
        tmp = t * -(z / a)
    else
        tmp = x / (a / y)
    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 (y <= -1.2e-70) {
		tmp = y / (a / x);
	} else if (y <= 1.05e+16) {
		tmp = z * (t / -a);
	} else if (y <= 5.1e+61) {
		tmp = x * (y / a);
	} else if (y <= 1e+88) {
		tmp = t * -(z / a);
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if y <= -1.2e-70:
		tmp = y / (a / x)
	elif y <= 1.05e+16:
		tmp = z * (t / -a)
	elif y <= 5.1e+61:
		tmp = x * (y / a)
	elif y <= 1e+88:
		tmp = t * -(z / a)
	else:
		tmp = x / (a / y)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -1.2e-70)
		tmp = Float64(y / Float64(a / x));
	elseif (y <= 1.05e+16)
		tmp = Float64(z * Float64(t / Float64(-a)));
	elseif (y <= 5.1e+61)
		tmp = Float64(x * Float64(y / a));
	elseif (y <= 1e+88)
		tmp = Float64(t * Float64(-Float64(z / a)));
	else
		tmp = Float64(x / Float64(a / y));
	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 (y <= -1.2e-70)
		tmp = y / (a / x);
	elseif (y <= 1.05e+16)
		tmp = z * (t / -a);
	elseif (y <= 5.1e+61)
		tmp = x * (y / a);
	elseif (y <= 1e+88)
		tmp = t * -(z / a);
	else
		tmp = x / (a / y);
	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[y, -1.2e-70], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+16], N[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e+61], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+88], N[(t * (-N[(z / a), $MachinePrecision])), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-70}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+16}:\\
\;\;\;\;z \cdot \frac{t}{-a}\\

\mathbf{elif}\;y \leq 5.1 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.2000000000000001e-70

    1. Initial program 86.0%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
    4. Simplified64.8%

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

    if -1.2000000000000001e-70 < y < 1.05e16

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-z\right)}{-a}} \]
      3. remove-double-neg71.3%

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

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

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

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

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

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

    if 1.05e16 < y < 5.1000000000000001e61

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, -t \cdot z\right)}}{a} \]
      6. distribute-rgt-neg-out99.2%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, t \cdot \left(-z\right)\right)}{a}} \]
    5. Taylor expanded in y around inf 72.2%

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

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

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

    if 5.1000000000000001e61 < y < 9.99999999999999959e87

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

    if 9.99999999999999959e87 < y

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{-70}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+61}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 10^{+88}:\\ \;\;\;\;t \cdot \left(-\frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 7: 68.5% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{-55}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+62}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{z}{\frac{-a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \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 (<= y -1.8e-55)
   (/ y (/ a x))
   (if (<= y 7.5e+16)
     (* z (/ t (- a)))
     (if (<= y 2.6e+62)
       (* x (/ y a))
       (if (<= y 2.8e+88) (/ z (/ (- a) t)) (/ x (/ a y)))))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.8e-55) {
		tmp = y / (a / x);
	} else if (y <= 7.5e+16) {
		tmp = z * (t / -a);
	} else if (y <= 2.6e+62) {
		tmp = x * (y / a);
	} else if (y <= 2.8e+88) {
		tmp = z / (-a / t);
	} else {
		tmp = x / (a / y);
	}
	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 (y <= (-1.8d-55)) then
        tmp = y / (a / x)
    else if (y <= 7.5d+16) then
        tmp = z * (t / -a)
    else if (y <= 2.6d+62) then
        tmp = x * (y / a)
    else if (y <= 2.8d+88) then
        tmp = z / (-a / t)
    else
        tmp = x / (a / y)
    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 (y <= -1.8e-55) {
		tmp = y / (a / x);
	} else if (y <= 7.5e+16) {
		tmp = z * (t / -a);
	} else if (y <= 2.6e+62) {
		tmp = x * (y / a);
	} else if (y <= 2.8e+88) {
		tmp = z / (-a / t);
	} else {
		tmp = x / (a / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if y <= -1.8e-55:
		tmp = y / (a / x)
	elif y <= 7.5e+16:
		tmp = z * (t / -a)
	elif y <= 2.6e+62:
		tmp = x * (y / a)
	elif y <= 2.8e+88:
		tmp = z / (-a / t)
	else:
		tmp = x / (a / y)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -1.8e-55)
		tmp = Float64(y / Float64(a / x));
	elseif (y <= 7.5e+16)
		tmp = Float64(z * Float64(t / Float64(-a)));
	elseif (y <= 2.6e+62)
		tmp = Float64(x * Float64(y / a));
	elseif (y <= 2.8e+88)
		tmp = Float64(z / Float64(Float64(-a) / t));
	else
		tmp = Float64(x / Float64(a / y));
	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 (y <= -1.8e-55)
		tmp = y / (a / x);
	elseif (y <= 7.5e+16)
		tmp = z * (t / -a);
	elseif (y <= 2.6e+62)
		tmp = x * (y / a);
	elseif (y <= 2.8e+88)
		tmp = z / (-a / t);
	else
		tmp = x / (a / y);
	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[y, -1.8e-55], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+16], N[(z * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+62], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+88], N[(z / N[((-a) / t), $MachinePrecision]), $MachinePrecision], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-55}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+16}:\\
\;\;\;\;z \cdot \frac{t}{-a}\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{+88}:\\
\;\;\;\;\frac{z}{\frac{-a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.8e-55

    1. Initial program 85.6%

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

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

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

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

    if -1.8e-55 < y < 7.5e16

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{-\left(-z\right)}{-a}} \]
      3. remove-double-neg70.1%

        \[\leadsto t \cdot \frac{\color{blue}{z}}{-a} \]
      4. associate-*r/69.1%

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

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

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

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

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

    if 7.5e16 < y < 2.59999999999999984e62

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, -t \cdot z\right)}}{a} \]
      6. distribute-rgt-neg-out99.2%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, t \cdot \left(-z\right)\right)}{a}} \]
    5. Taylor expanded in y around inf 72.2%

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

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

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

    if 2.59999999999999984e62 < y < 2.79999999999999989e88

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\frac{a}{t}} \]
      7. add-sqr-sqrt0.8%

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

      \[\leadsto \color{blue}{\frac{z}{\frac{a}{t}}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity0.8%

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

        \[\leadsto \frac{1 \cdot z}{\color{blue}{a \cdot \frac{1}{t}}} \]
      3. times-frac0.7%

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

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\color{blue}{\frac{-1}{-t}}} \]
      5. metadata-eval0.7%

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{\color{blue}{-1}}{-t}} \]
      6. add-sqr-sqrt0.4%

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

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{-1}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      8. sqr-neg2.1%

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{-1}{\sqrt{\color{blue}{t \cdot t}}}} \]
      9. sqrt-unprod1.8%

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

        \[\leadsto \frac{1}{a} \cdot \frac{z}{\frac{-1}{\color{blue}{t}}} \]
    8. Applied egg-rr44.3%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{1}}} \cdot \frac{z}{\frac{-1}{t}} \]
      2. frac-times71.6%

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

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

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

        \[\leadsto \frac{z}{\left(a \cdot \color{blue}{1}\right) \cdot \frac{-1}{t}} \]
    10. Applied egg-rr71.6%

      \[\leadsto \color{blue}{\frac{z}{\left(a \cdot 1\right) \cdot \frac{-1}{t}}} \]
    11. Step-by-step derivation
      1. *-rgt-identity71.6%

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

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

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

        \[\leadsto \frac{z}{\frac{\color{blue}{-a}}{t}} \]
    12. Simplified71.6%

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

    if 2.79999999999999989e88 < y

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{-55}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+16}:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+62}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{z}{\frac{-a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 8: 93.4% 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^{+248}:\\ \;\;\;\;\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+248) (/ (- (* 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+248) {
		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+248) 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+248) {
		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+248:
		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+248)
		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+248)
		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+248], 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^{+248}:\\
\;\;\;\;\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) < 4.9999999999999996e248

    1. Initial program 92.7%

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

    if 4.9999999999999996e248 < (*.f64 x y)

    1. Initial program 69.4%

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

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

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

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

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

Alternative 9: 52.1% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -8.4 \cdot 10^{+218}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{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 (<= x -8.4e+218) (* y (/ x a)) (* x (/ y a))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -8.4e+218) {
		tmp = y * (x / a);
	} else {
		tmp = x * (y / 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 (x <= (-8.4d+218)) then
        tmp = y * (x / a)
    else
        tmp = x * (y / 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 (x <= -8.4e+218) {
		tmp = y * (x / a);
	} else {
		tmp = x * (y / a);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if x <= -8.4e+218:
		tmp = y * (x / a)
	else:
		tmp = x * (y / a)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -8.4e+218)
		tmp = Float64(y * Float64(x / a));
	else
		tmp = Float64(x * Float64(y / 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 (x <= -8.4e+218)
		tmp = y * (x / a);
	else
		tmp = x * (y / 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[x, -8.4e+218], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{+218}:\\
\;\;\;\;y \cdot \frac{x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.3999999999999995e218

    1. Initial program 89.4%

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

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

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

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

    if -8.3999999999999995e218 < x

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, -t \cdot z\right)}}{a} \]
      6. distribute-rgt-neg-out90.2%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, t \cdot \left(-z\right)\right)}{a}} \]
    5. Taylor expanded in y around inf 47.4%

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

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

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

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

Alternative 10: 52.3% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+219}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{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 (<= x -1.35e+219) (/ y (/ a x)) (* x (/ y a))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -1.35e+219) {
		tmp = y / (a / x);
	} else {
		tmp = x * (y / 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 (x <= (-1.35d+219)) then
        tmp = y / (a / x)
    else
        tmp = x * (y / 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 (x <= -1.35e+219) {
		tmp = y / (a / x);
	} else {
		tmp = x * (y / a);
	}
	return tmp;
}
[x, y] = sort([x, y])
[z, t] = sort([z, t])
def code(x, y, z, t, a):
	tmp = 0
	if x <= -1.35e+219:
		tmp = y / (a / x)
	else:
		tmp = x * (y / a)
	return tmp
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -1.35e+219)
		tmp = Float64(y / Float64(a / x));
	else
		tmp = Float64(x * Float64(y / 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 (x <= -1.35e+219)
		tmp = y / (a / x);
	else
		tmp = x * (y / 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[x, -1.35e+219], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+219}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3499999999999999e219

    1. Initial program 89.4%

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

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

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

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

    if -1.3499999999999999e219 < x

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(y, x, -t \cdot z\right)}}{a} \]
      6. distribute-rgt-neg-out90.2%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, x, t \cdot \left(-z\right)\right)}{a}} \]
    5. Taylor expanded in y around inf 47.4%

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

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

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

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

Alternative 11: 51.8% 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 90.1%

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

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

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

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

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

Developer target: 91.5% 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 2023229 
(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))