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

Percentage Accurate: 91.8% → 96.8%
Time: 8.6s
Alternatives: 10
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 10 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.8% 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: 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 10^{+252}\right):\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, -z \cdot t\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 1e+252)))
     (fma -1.0 (/ t (/ a z)) (/ y (/ a x)))
     (/ (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 <= 1e+252)) {
		tmp = fma(-1.0, (t / (a / z)), (y / (a / x)));
	} 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 <= 1e+252))
		tmp = fma(-1.0, Float64(t / Float64(a / z)), Float64(y / Float64(a / x)));
	else
		tmp = Float64(fma(y, x, Float64(-Float64(z * 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, 1e+252]], $MachinePrecision]], N[(-1.0 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision] + N[(y / N[(a / x), $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 10^{+252}\right):\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, -z \cdot t\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 1.0000000000000001e252 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 70.1%

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

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

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

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

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

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

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

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

      \[\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 simplification98.2%

    \[\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^{+252}\right):\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{t}{\frac{a}{z}}, \frac{y}{\frac{a}{x}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, -z \cdot t\right)}{a}\\ \end{array} \]

Alternative 2: 96.6% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{\frac{a}{y}}\\ t_2 := x \cdot y - z \cdot t\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+286}:\\ \;\;\;\;t_1 - t \cdot \frac{z}{a}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+257}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y, x, -z \cdot t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1 - \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 (/ a y))) (t_2 (- (* x y) (* z t))))
   (if (<= t_2 -5e+286)
     (- t_1 (* t (/ z a)))
     (if (<= t_2 5e+257) (/ (fma y x (- (* z t))) a) (- t_1 (/ 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 / (a / y);
	double t_2 = (x * y) - (z * t);
	double tmp;
	if (t_2 <= -5e+286) {
		tmp = t_1 - (t * (z / a));
	} else if (t_2 <= 5e+257) {
		tmp = fma(y, x, -(z * t)) / a;
	} else {
		tmp = t_1 - (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(x / Float64(a / y))
	t_2 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_2 <= -5e+286)
		tmp = Float64(t_1 - Float64(t * Float64(z / a)));
	elseif (t_2 <= 5e+257)
		tmp = Float64(fma(y, x, Float64(-Float64(z * t))) / a);
	else
		tmp = Float64(t_1 - 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[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+286], N[(t$95$1 - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+257], N[(N[(y * x + (-N[(z * t), $MachinePrecision])), $MachinePrecision] / a), $MachinePrecision], N[(t$95$1 - 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 := \frac{x}{\frac{a}{y}}\\
t_2 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+286}:\\
\;\;\;\;t_1 - t \cdot \frac{z}{a}\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+257}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y, x, -z \cdot t\right)}{a}\\

\mathbf{else}:\\
\;\;\;\;t_1 - \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)) < -5.0000000000000004e286

    1. Initial program 65.6%

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

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

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

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

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

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

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

    if -5.0000000000000004e286 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000028e257

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

    if 5.00000000000000028e257 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 79.8%

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

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

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

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

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

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

Alternative 3: 96.6% 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 -5 \cdot 10^{+286} \lor \neg \left(t_1 \leq 5 \cdot 10^{+257}\right):\\ \;\;\;\;\frac{x}{\frac{a}{y}} - t \cdot \frac{z}{a}\\ \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 -5e+286) (not (<= t_1 5e+257)))
     (- (/ x (/ a y)) (* t (/ z a)))
     (/ 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 <= -5e+286) || !(t_1 <= 5e+257)) {
		tmp = (x / (a / y)) - (t * (z / a));
	} else {
		tmp = t_1 / 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) :: t_1
    real(8) :: tmp
    t_1 = (x * y) - (z * t)
    if ((t_1 <= (-5d+286)) .or. (.not. (t_1 <= 5d+257))) then
        tmp = (x / (a / y)) - (t * (z / a))
    else
        tmp = t_1 / 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 t_1 = (x * y) - (z * t);
	double tmp;
	if ((t_1 <= -5e+286) || !(t_1 <= 5e+257)) {
		tmp = (x / (a / y)) - (t * (z / a));
	} 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 <= -5e+286) or not (t_1 <= 5e+257):
		tmp = (x / (a / y)) - (t * (z / a))
	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 <= -5e+286) || !(t_1 <= 5e+257))
		tmp = Float64(Float64(x / Float64(a / y)) - Float64(t * Float64(z / a)));
	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 <= -5e+286) || ~((t_1 <= 5e+257)))
		tmp = (x / (a / y)) - (t * (z / a));
	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, -5e+286], N[Not[LessEqual[t$95$1, 5e+257]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(t * N[(z / a), $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 -5 \cdot 10^{+286} \lor \neg \left(t_1 \leq 5 \cdot 10^{+257}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - t \cdot \frac{z}{a}\\

\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)) < -5.0000000000000004e286 or 5.00000000000000028e257 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 72.7%

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

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

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

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

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

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

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

    if -5.0000000000000004e286 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000028e257

    1. Initial program 98.7%

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

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

Alternative 4: 96.6% 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{x}{\frac{a}{y}}\\ t_2 := x \cdot y - z \cdot t\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+286}:\\ \;\;\;\;t_1 - t \cdot \frac{z}{a}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+257}:\\ \;\;\;\;\frac{t_2}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1 - \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 (/ a y))) (t_2 (- (* x y) (* z t))))
   (if (<= t_2 -5e+286)
     (- t_1 (* t (/ z a)))
     (if (<= t_2 5e+257) (/ t_2 a) (- t_1 (/ 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 / (a / y);
	double t_2 = (x * y) - (z * t);
	double tmp;
	if (t_2 <= -5e+286) {
		tmp = t_1 - (t * (z / a));
	} else if (t_2 <= 5e+257) {
		tmp = t_2 / a;
	} else {
		tmp = t_1 - (z / (a / t));
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x / (a / y)
    t_2 = (x * y) - (z * t)
    if (t_2 <= (-5d+286)) then
        tmp = t_1 - (t * (z / a))
    else if (t_2 <= 5d+257) then
        tmp = t_2 / a
    else
        tmp = t_1 - (z / (a / t))
    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 = x / (a / y);
	double t_2 = (x * y) - (z * t);
	double tmp;
	if (t_2 <= -5e+286) {
		tmp = t_1 - (t * (z / a));
	} else if (t_2 <= 5e+257) {
		tmp = t_2 / a;
	} else {
		tmp = t_1 - (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 / (a / y)
	t_2 = (x * y) - (z * t)
	tmp = 0
	if t_2 <= -5e+286:
		tmp = t_1 - (t * (z / a))
	elif t_2 <= 5e+257:
		tmp = t_2 / a
	else:
		tmp = t_1 - (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(x / Float64(a / y))
	t_2 = Float64(Float64(x * y) - Float64(z * t))
	tmp = 0.0
	if (t_2 <= -5e+286)
		tmp = Float64(t_1 - Float64(t * Float64(z / a)));
	elseif (t_2 <= 5e+257)
		tmp = Float64(t_2 / a);
	else
		tmp = Float64(t_1 - 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 / (a / y);
	t_2 = (x * y) - (z * t);
	tmp = 0.0;
	if (t_2 <= -5e+286)
		tmp = t_1 - (t * (z / a));
	elseif (t_2 <= 5e+257)
		tmp = t_2 / a;
	else
		tmp = t_1 - (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[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+286], N[(t$95$1 - N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+257], N[(t$95$2 / a), $MachinePrecision], N[(t$95$1 - 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 := \frac{x}{\frac{a}{y}}\\
t_2 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+286}:\\
\;\;\;\;t_1 - t \cdot \frac{z}{a}\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+257}:\\
\;\;\;\;\frac{t_2}{a}\\

\mathbf{else}:\\
\;\;\;\;t_1 - \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)) < -5.0000000000000004e286

    1. Initial program 65.6%

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

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

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

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

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

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

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

    if -5.0000000000000004e286 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.00000000000000028e257

    1. Initial program 98.7%

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

    if 5.00000000000000028e257 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 79.8%

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

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

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

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

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

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

Alternative 5: 68.4% 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 \leq -1.65 \cdot 10^{+252}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{+135}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{+56}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{-33}:\\ \;\;\;\;\left(-z\right) \cdot \frac{t}{a}\\ \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 (<= x -1.65e+252)
   (* y (/ x a))
   (if (<= x -2.6e+135)
     (* x (/ y a))
     (if (<= x -1.65e+56)
       (/ y (/ a x))
       (if (<= x 1.85e-33) (* (- z) (/ t 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 (x <= -1.65e+252) {
		tmp = y * (x / a);
	} else if (x <= -2.6e+135) {
		tmp = x * (y / a);
	} else if (x <= -1.65e+56) {
		tmp = y / (a / x);
	} else if (x <= 1.85e-33) {
		tmp = -z * (t / 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 (x <= (-1.65d+252)) then
        tmp = y * (x / a)
    else if (x <= (-2.6d+135)) then
        tmp = x * (y / a)
    else if (x <= (-1.65d+56)) then
        tmp = y / (a / x)
    else if (x <= 1.85d-33) then
        tmp = -z * (t / 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 (x <= -1.65e+252) {
		tmp = y * (x / a);
	} else if (x <= -2.6e+135) {
		tmp = x * (y / a);
	} else if (x <= -1.65e+56) {
		tmp = y / (a / x);
	} else if (x <= 1.85e-33) {
		tmp = -z * (t / 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 x <= -1.65e+252:
		tmp = y * (x / a)
	elif x <= -2.6e+135:
		tmp = x * (y / a)
	elif x <= -1.65e+56:
		tmp = y / (a / x)
	elif x <= 1.85e-33:
		tmp = -z * (t / 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 (x <= -1.65e+252)
		tmp = Float64(y * Float64(x / a));
	elseif (x <= -2.6e+135)
		tmp = Float64(x * Float64(y / a));
	elseif (x <= -1.65e+56)
		tmp = Float64(y / Float64(a / x));
	elseif (x <= 1.85e-33)
		tmp = Float64(Float64(-z) * Float64(t / 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 (x <= -1.65e+252)
		tmp = y * (x / a);
	elseif (x <= -2.6e+135)
		tmp = x * (y / a);
	elseif (x <= -1.65e+56)
		tmp = y / (a / x);
	elseif (x <= 1.85e-33)
		tmp = -z * (t / 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[x, -1.65e+252], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.6e+135], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.65e+56], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-33], N[((-z) * N[(t / 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}\;x \leq -1.65 \cdot 10^{+252}:\\
\;\;\;\;y \cdot \frac{x}{a}\\

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

\mathbf{elif}\;x \leq -1.65 \cdot 10^{+56}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.65e252

    1. Initial program 85.7%

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

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

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

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

    if -1.65e252 < x < -2.6e135

    1. Initial program 91.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
      2. associate-/r/86.7%

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

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

    if -2.6e135 < x < -1.65000000000000001e56

    1. Initial program 74.6%

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

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

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

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

    if -1.65000000000000001e56 < x < 1.85000000000000007e-33

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85000000000000007e-33 < x

    1. Initial program 92.3%

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

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

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

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

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

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

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

      \[\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}\;x \leq -1.65 \cdot 10^{+252}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{+135}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{+56}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{-33}:\\ \;\;\;\;\left(-z\right) \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 6: 68.9% 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 \leq -2.3 \cdot 10^{+251}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \mathbf{elif}\;x \leq -3.05 \cdot 10^{+134}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq -3.9 \cdot 10^{+54}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq 3.05 \cdot 10^{-33}:\\ \;\;\;\;\frac{-z \cdot t}{a}\\ \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 (<= x -2.3e+251)
   (* y (/ x a))
   (if (<= x -3.05e+134)
     (* x (/ y a))
     (if (<= x -3.9e+54)
       (/ y (/ a x))
       (if (<= x 3.05e-33) (/ (- (* z t)) 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 (x <= -2.3e+251) {
		tmp = y * (x / a);
	} else if (x <= -3.05e+134) {
		tmp = x * (y / a);
	} else if (x <= -3.9e+54) {
		tmp = y / (a / x);
	} else if (x <= 3.05e-33) {
		tmp = -(z * t) / 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 (x <= (-2.3d+251)) then
        tmp = y * (x / a)
    else if (x <= (-3.05d+134)) then
        tmp = x * (y / a)
    else if (x <= (-3.9d+54)) then
        tmp = y / (a / x)
    else if (x <= 3.05d-33) then
        tmp = -(z * t) / 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 (x <= -2.3e+251) {
		tmp = y * (x / a);
	} else if (x <= -3.05e+134) {
		tmp = x * (y / a);
	} else if (x <= -3.9e+54) {
		tmp = y / (a / x);
	} else if (x <= 3.05e-33) {
		tmp = -(z * t) / 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 x <= -2.3e+251:
		tmp = y * (x / a)
	elif x <= -3.05e+134:
		tmp = x * (y / a)
	elif x <= -3.9e+54:
		tmp = y / (a / x)
	elif x <= 3.05e-33:
		tmp = -(z * t) / 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 (x <= -2.3e+251)
		tmp = Float64(y * Float64(x / a));
	elseif (x <= -3.05e+134)
		tmp = Float64(x * Float64(y / a));
	elseif (x <= -3.9e+54)
		tmp = Float64(y / Float64(a / x));
	elseif (x <= 3.05e-33)
		tmp = Float64(Float64(-Float64(z * t)) / 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 (x <= -2.3e+251)
		tmp = y * (x / a);
	elseif (x <= -3.05e+134)
		tmp = x * (y / a);
	elseif (x <= -3.9e+54)
		tmp = y / (a / x);
	elseif (x <= 3.05e-33)
		tmp = -(z * t) / 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[x, -2.3e+251], N[(y * N[(x / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.05e+134], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.9e+54], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.05e-33], N[((-N[(z * t), $MachinePrecision]) / a), $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}\;x \leq -2.3 \cdot 10^{+251}:\\
\;\;\;\;y \cdot \frac{x}{a}\\

\mathbf{elif}\;x \leq -3.05 \cdot 10^{+134}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

\mathbf{elif}\;x \leq -3.9 \cdot 10^{+54}:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

\mathbf{elif}\;x \leq 3.05 \cdot 10^{-33}:\\
\;\;\;\;\frac{-z \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -2.29999999999999988e251

    1. Initial program 85.7%

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

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

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

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

    if -2.29999999999999988e251 < x < -3.04999999999999989e134

    1. Initial program 91.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
      2. associate-/r/86.7%

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

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

    if -3.04999999999999989e134 < x < -3.9000000000000003e54

    1. Initial program 74.6%

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

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

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

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

    if -3.9000000000000003e54 < x < 3.0500000000000001e-33

    1. Initial program 94.9%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot z\right)}{a}} \]
      2. associate-*r*70.0%

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

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

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

    if 3.0500000000000001e-33 < x

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+251}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \mathbf{elif}\;x \leq -3.05 \cdot 10^{+134}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;x \leq -3.9 \cdot 10^{+54}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;x \leq 3.05 \cdot 10^{-33}:\\ \;\;\;\;\frac{-z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 7: 93.5% 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^{+286}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot 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 (<= (* x y) -5e+286) (* x (/ y a)) (/ (- (* x y) (* z t)) a)))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x * y) <= -5e+286) {
		tmp = x * (y / a);
	} else {
		tmp = ((x * y) - (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 ((x * y) <= (-5d+286)) then
        tmp = x * (y / a)
    else
        tmp = ((x * y) - (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 ((x * y) <= -5e+286) {
		tmp = x * (y / a);
	} else {
		tmp = ((x * y) - (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 (x * y) <= -5e+286:
		tmp = x * (y / a)
	else:
		tmp = ((x * y) - (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(x * y) <= -5e+286)
		tmp = Float64(x * Float64(y / a));
	else
		tmp = Float64(Float64(Float64(x * y) - Float64(z * 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 ((x * y) <= -5e+286)
		tmp = x * (y / a);
	else
		tmp = ((x * y) - (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[(x * y), $MachinePrecision], -5e+286], N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - 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}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+286}:\\
\;\;\;\;x \cdot \frac{y}{a}\\

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


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

    1. Initial program 66.9%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
      2. associate-/r/96.0%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot x} \]
    4. Applied egg-rr96.0%

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

    if -5.0000000000000004e286 < (*.f64 x y)

    1. Initial program 94.8%

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

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

Alternative 8: 51.5% 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 -2.5 \cdot 10^{+250}:\\ \;\;\;\;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 -2.5e+250) (* 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 <= -2.5e+250) {
		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 <= (-2.5d+250)) 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 <= -2.5e+250) {
		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 <= -2.5e+250:
		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 <= -2.5e+250)
		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 <= -2.5e+250)
		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, -2.5e+250], 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 -2.5 \cdot 10^{+250}:\\
\;\;\;\;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 < -2.5000000000000001e250

    1. Initial program 85.7%

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

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

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

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

    if -2.5000000000000001e250 < x

    1. Initial program 92.3%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{x}}} \]
      2. associate-/r/51.8%

        \[\leadsto \color{blue}{\frac{y}{a} \cdot x} \]
    4. Applied egg-rr51.8%

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

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

Alternative 9: 51.5% 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 -7.5 \cdot 10^{+248}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \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 (<= x -7.5e+248) (* y (/ x 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 (x <= -7.5e+248) {
		tmp = y * (x / 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 (x <= (-7.5d+248)) then
        tmp = y * (x / 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 (x <= -7.5e+248) {
		tmp = y * (x / 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 x <= -7.5e+248:
		tmp = y * (x / 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 (x <= -7.5e+248)
		tmp = Float64(y * Float64(x / 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 (x <= -7.5e+248)
		tmp = y * (x / 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[x, -7.5e+248], N[(y * N[(x / 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}\;x \leq -7.5 \cdot 10^{+248}:\\
\;\;\;\;y \cdot \frac{x}{a}\\

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


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

    1. Initial program 80.4%

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

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

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

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

    if -7.5000000000000004e248 < x

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

Alternative 10: 51.4% 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 92.0%

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

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

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

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

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

Developer target: 91.9% 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 2023257 
(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))