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

Percentage Accurate: 91.0% → 97.5%
Time: 7.1s
Alternatives: 9
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 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.0% 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.5% 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^{+304}\right):\\ \;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{a}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (* x y) (* z t))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+304)))
     (- (/ x (/ a y)) (/ 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+304)) {
		tmp = (x / (a / y)) - (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+304)) {
		tmp = (x / (a / y)) - (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+304):
		tmp = (x / (a / y)) - (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+304))
		tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t)));
	else
		tmp = Float64(t_1 / a);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
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+304)))
		tmp = (x / (a / y)) - (z / (a / t));
	else
		tmp = t_1 / a;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
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+304]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\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^{+304}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\

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


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

    1. Initial program 67.7%

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999997e304

    1. Initial program 98.8%

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

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

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

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

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


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

    1. Initial program 91.7%

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

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

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

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

    if -1e15 < (*.f64 x y) < 1.99999999999999989e-20

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(-\frac{t}{a}\right)} \]
      5. distribute-rgt-neg-in76.8%

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

        \[\leadsto -\color{blue}{\frac{t}{a} \cdot z} \]
      7. clear-num76.7%

        \[\leadsto -\color{blue}{\frac{1}{\frac{a}{t}}} \cdot z \]
      8. associate-/r/76.5%

        \[\leadsto -\color{blue}{\frac{1}{\frac{\frac{a}{t}}{z}}} \]
      9. clear-num76.8%

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

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

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

    if 1.99999999999999989e-20 < (*.f64 x y)

    1. Initial program 89.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot \frac{1}{a}\right)} \cdot y \]
      5. associate-*l*81.7%

        \[\leadsto \color{blue}{x \cdot \left(\frac{1}{a} \cdot y\right)} \]
    6. Applied egg-rr81.7%

      \[\leadsto \color{blue}{x \cdot \left(\frac{1}{a} \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.1%

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

Alternative 3: 65.9% accurate, 0.6× speedup?

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

\mathbf{elif}\;y \leq 1.1 \cdot 10^{-43}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 29000000000000:\\
\;\;\;\;\frac{x \cdot y}{a}\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+138}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 91.7%

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

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

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

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

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

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

    if -4.59999999999999987e-119 < y < 1.09999999999999999e-43 or 2.9e13 < y < 5.80000000000000019e138

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

    if 1.09999999999999999e-43 < y < 2.9e13

    1. Initial program 99.9%

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

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

    if 5.80000000000000019e138 < y

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{-119}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{elif}\;y \leq 29000000000000:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+138}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 4: 66.5% accurate, 0.6× speedup?

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

\mathbf{elif}\;y \leq 0.0255:\\
\;\;\;\;z \cdot \frac{t}{-a}\\

\mathbf{elif}\;y \leq 31000000000000:\\
\;\;\;\;\frac{x \cdot y}{a}\\

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

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


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

    1. Initial program 91.7%

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

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

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

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

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

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

    if -3.70000000000000014e-118 < y < 0.0254999999999999984

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0254999999999999984 < y < 3.1e13

    1. Initial program 100.0%

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

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

    if 3.1e13 < y < 1.6000000000000001e138

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

    if 1.6000000000000001e138 < y

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{-118}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 0.0255:\\ \;\;\;\;z \cdot \frac{t}{-a}\\ \mathbf{elif}\;y \leq 31000000000000:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+138}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 5: 66.3% accurate, 0.6× speedup?

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

\mathbf{elif}\;y \leq 1.1 \cdot 10^{-43}:\\
\;\;\;\;\frac{-z}{\frac{a}{t}}\\

\mathbf{elif}\;y \leq 29000000000000:\\
\;\;\;\;\frac{x \cdot y}{a}\\

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

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


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

    1. Initial program 91.3%

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

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

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

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

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

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

    if -4.80000000000000032e-89 < y < 1.09999999999999999e-43

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{a}{t}}} \cdot z \]
      8. associate-/r/73.0%

        \[\leadsto -\color{blue}{\frac{1}{\frac{\frac{a}{t}}{z}}} \]
      9. clear-num73.1%

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

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

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

    if 1.09999999999999999e-43 < y < 2.9e13

    1. Initial program 99.9%

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

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

    if 2.9e13 < y < 1.9499999999999999e138

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

    if 1.9499999999999999e138 < y

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-43}:\\ \;\;\;\;\frac{-z}{\frac{a}{t}}\\ \mathbf{elif}\;y \leq 29000000000000:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+138}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \end{array} \]

Alternative 6: 92.8% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < 4.0000000000000004e252

    1. Initial program 95.1%

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

    if 4.0000000000000004e252 < (*.f64 z t)

    1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(-\frac{t}{a}\right)} \]
      5. distribute-rgt-neg-in99.8%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{a}{t}}} \cdot z \]
      8. associate-/r/99.8%

        \[\leadsto -\color{blue}{\frac{1}{\frac{\frac{a}{t}}{z}}} \]
      9. clear-num100.0%

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

        \[\leadsto \color{blue}{\frac{-z}{\frac{a}{t}}} \]
    10. Applied egg-rr100.0%

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

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

Alternative 7: 50.4% accurate, 1.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.4999999999999998e-256

    1. Initial program 89.9%

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

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

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

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

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

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

    if -5.4999999999999998e-256 < z

    1. Initial program 94.1%

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

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

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

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

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

Alternative 8: 50.4% accurate, 1.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.07999999999999998e-257

    1. Initial program 89.9%

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

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

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

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

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

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

    if -1.07999999999999998e-257 < z

    1. Initial program 94.1%

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

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

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

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

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

Alternative 9: 50.6% 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 92.1%

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

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

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

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

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

Developer target: 91.1% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023252 
(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))