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

Percentage Accurate: 91.7% → 97.3%
Time: 8.9s
Alternatives: 11
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 91.7% 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: 97.3% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{z}{\frac{a}{t}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+292}:\\ \;\;\;\;\frac{t_1}{a}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y}{a}, \frac{-z}{\frac{a}{t}}\right)\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* x y) (* z t))))
   (if (<= t_1 (- INFINITY))
     (- (* x (/ y a)) (/ z (/ a t)))
     (if (<= t_1 5e+292) (/ t_1 a) (fma x (/ y a) (/ (- z) (/ a t)))))))
assert(x < y);
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 / (a / t));
	} else if (t_1 <= 5e+292) {
		tmp = t_1 / a;
	} else {
		tmp = fma(x, (y / a), (-z / (a / t)));
	}
	return tmp;
}
x, y = sort([x, y])
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(a / t)));
	elseif (t_1 <= 5e+292)
		tmp = Float64(t_1 / a);
	else
		tmp = fma(x, Float64(y / a), Float64(Float64(-z) / Float64(a / t)));
	end
	return tmp
end
NOTE: x and y should be sorted in increasing order before calling this function.
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[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+292], N[(t$95$1 / a), $MachinePrecision], N[(x * N[(y / a), $MachinePrecision] + N[((-z) / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot y - z \cdot t\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x \cdot \frac{y}{a} - \frac{z}{\frac{a}{t}}\\

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

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


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

    1. Initial program 60.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{x}}} - \frac{z}{\frac{a}{t}} \]
      2. associate-/r/95.5%

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999996e292

    1. Initial program 97.7%

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

    if 4.9999999999999996e292 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

Alternative 2: 97.1% accurate, 0.3× speedup?

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

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


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

    1. Initial program 64.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{x}}} - \frac{z}{\frac{a}{t}} \]
      2. associate-/r/92.0%

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999996e292

    1. Initial program 97.7%

      \[\frac{x \cdot y - z \cdot t}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.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 5 \cdot 10^{+292}\right):\\ \;\;\;\;x \cdot \frac{y}{a} - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \end{array} \]

Alternative 3: 97.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 60.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{x}}} - \frac{z}{\frac{a}{t}} \]
      2. associate-/r/95.5%

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999996e292

    1. Initial program 97.7%

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

    if 4.9999999999999996e292 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 66.6%

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

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

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

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

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

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

Alternative 4: 75.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \cdot t \leq 50000000000:\\
\;\;\;\;\frac{x \cdot y}{a}\\

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


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

    1. Initial program 80.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-t}{a} \cdot z} \]
      3. add-sqr-sqrt40.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-z}{-\frac{a}{t}}} \]
      5. add-sqr-sqrt3.1%

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

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

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

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

        \[\leadsto \frac{\color{blue}{z}}{-\frac{a}{t}} \]
      10. distribute-neg-frac88.7%

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

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

    if -2.00000000000000012e140 < (*.f64 z t) < -4.00000000000000012e-53

    1. Initial program 94.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-t}{a} \cdot z} \]
      3. add-sqr-sqrt29.8%

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{a}{t}}} \]
      3. div-inv2.0%

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

        \[\leadsto \color{blue}{\frac{-z}{-\frac{a}{t}}} \]
      5. neg-mul-12.0%

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

        \[\leadsto \color{blue}{\frac{-1}{\frac{-\frac{a}{t}}{z}}} \]
      7. add-sqr-sqrt1.1%

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

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

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

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

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

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

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

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

    if -4.00000000000000012e-53 < (*.f64 z t) < 5e10

    1. Initial program 94.2%

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

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

    if 5e10 < (*.f64 z t)

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+140}:\\ \;\;\;\;\frac{z}{-\frac{a}{t}}\\ \mathbf{elif}\;z \cdot t \leq -4 \cdot 10^{-53}:\\ \;\;\;\;\frac{-1}{\frac{a}{z \cdot t}}\\ \mathbf{elif}\;z \cdot t \leq 50000000000:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \frac{z}{a}\\ \end{array} \]

Alternative 5: 95.3% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 71.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-t}{a} \cdot z} \]
      3. add-sqr-sqrt34.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-z}{-\frac{a}{t}}} \]
      5. add-sqr-sqrt5.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{z}}{-\frac{a}{t}} \]
      10. distribute-neg-frac94.9%

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

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

    if -inf.0 < (*.f64 z t) < 1.00000000000000002e306

    1. Initial program 94.1%

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

    if 1.00000000000000002e306 < (*.f64 z t)

    1. Initial program 52.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 73.5% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 89.0%

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

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

    if -9.99999999999999999e-15 < (*.f64 x y) < 4.0000000000000002e-26

    1. Initial program 91.8%

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

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

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

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

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

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

    if 4.0000000000000002e-26 < (*.f64 x y)

    1. Initial program 84.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-14}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-26}:\\ \;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \end{array} \]

Alternative 7: 66.8% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.50000000000000019e-84 or 1.6999999999999999e103 < y

    1. Initial program 88.4%

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

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

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

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

    if -5.50000000000000019e-84 < y < 1.6999999999999999e103

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 66.5% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.60000000000000023e-23 or 4.7999999999999997e103 < y

    1. Initial program 87.8%

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

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

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

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

    if -7.60000000000000023e-23 < y < 4.7999999999999997e103

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 51.8% accurate, 1.8× speedup?

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

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

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

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

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

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

Alternative 10: 51.9% accurate, 1.8× speedup?

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

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

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

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

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

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

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

Alternative 11: 51.9% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

Developer target: 91.0% 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 2023176 
(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))