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

Percentage Accurate: 91.5% → 95.5%
Time: 8.5s
Alternatives: 8
Speedup: 0.6×

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 8 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.5% 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.3× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+262}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


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

    1. Initial program 67.5%

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

      \[\leadsto \color{blue}{z \cdot \left(-1 \cdot \frac{t}{a} + \frac{x \cdot y}{a \cdot z}\right)} \]
    4. Step-by-step derivation
      1. +-commutative79.4%

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2e262

    1. Initial program 97.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing

    if 2e262 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 68.5%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t \cdot z}{a \cdot y} + \frac{x}{a}\right)} \]
    4. Step-by-step derivation
      1. +-commutative87.0%

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{a} - \frac{t}{a} \cdot \frac{z}{y}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot t \leq -\infty:\\ \;\;\;\;z \cdot \left(x \cdot \frac{y}{a \cdot z} - \frac{t}{a}\right)\\ \mathbf{elif}\;x \cdot y - z \cdot t \leq 2 \cdot 10^{+262}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{x}{a} - \frac{t}{a} \cdot \frac{z}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 93.7% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.5e-11

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

    if 1.5e-11 < a

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

Alternative 3: 96.2% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+262}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


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

    1. Initial program 67.5%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-sub67.5%

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2e262

    1. Initial program 97.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing

    if 2e262 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 68.5%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t \cdot z}{a \cdot y} + \frac{x}{a}\right)} \]
    4. Step-by-step derivation
      1. +-commutative87.0%

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{a} - \frac{t}{a} \cdot \frac{z}{y}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 71.6% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 90.7%

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t \cdot z}{a \cdot y} + \frac{x}{a}\right)} \]
    4. Step-by-step derivation
      1. +-commutative85.4%

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a}{x}}} \]
      2. un-div-inv80.9%

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

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

    if -2e15 < (*.f64 x y) < 2.00000000000000006e-139

    1. Initial program 92.6%

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

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

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

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

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

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

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

    if 2.00000000000000006e-139 < (*.f64 x y)

    1. Initial program 85.4%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified69.0%

      \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    6. Step-by-step derivation
      1. clear-num68.9%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      2. un-div-inv69.7%

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

      \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 93.4% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.99999999999999988e-11

    1. Initial program 92.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing

    if 1.99999999999999988e-11 < a

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

Alternative 6: 93.5% accurate, 0.6× speedup?

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

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


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

    1. Initial program 93.4%

      \[\frac{x \cdot y - z \cdot t}{a} \]
    2. Add Preprocessing

    if 5e302 < (*.f64 x y)

    1. Initial program 54.5%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
    5. Simplified91.8%

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

Alternative 7: 51.8% accurate, 1.8× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
  6. Step-by-step derivation
    1. clear-num57.0%

      \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
    2. un-div-inv57.4%

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

    \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
  8. Add Preprocessing

Alternative 8: 52.0% accurate, 1.8× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{y}{a}} \]
  6. Add Preprocessing

Developer Target 1: 92.0% accurate, 0.4× 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 2024170 
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -246868496869954800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6309831121978371/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z)))))

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