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

Percentage Accurate: 91.1% → 94.6%
Time: 7.2s
Alternatives: 10
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 91.1% 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: 94.6% accurate, 0.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \frac{t}{a} \cdot z\\ \mathbf{if}\;a \leq -1.32 \cdot 10^{+38}:\\ \;\;\;\;\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - t_1\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+114}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t \cdot \left(-z\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{x}} - t_1\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ t a) z)))
   (if (<= a -1.32e+38)
     (- (* (/ y (pow (cbrt a) 2.0)) (/ x (cbrt a))) t_1)
     (if (<= a 2.2e+114) (/ (fma x y (* t (- z))) a) (- (/ y (/ a x)) t_1)))))
assert(x < y);
assert(z < t);
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t / a) * z;
	double tmp;
	if (a <= -1.32e+38) {
		tmp = ((y / pow(cbrt(a), 2.0)) * (x / cbrt(a))) - t_1;
	} else if (a <= 2.2e+114) {
		tmp = fma(x, y, (t * -z)) / a;
	} else {
		tmp = (y / (a / x)) - t_1;
	}
	return tmp;
}
x, y = sort([x, y])
z, t = sort([z, t])
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t / a) * z)
	tmp = 0.0
	if (a <= -1.32e+38)
		tmp = Float64(Float64(Float64(y / (cbrt(a) ^ 2.0)) * Float64(x / cbrt(a))) - t_1);
	elseif (a <= 2.2e+114)
		tmp = Float64(fma(x, y, Float64(t * Float64(-z))) / a);
	else
		tmp = Float64(Float64(y / Float64(a / x)) - t_1);
	end
	return tmp
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[a, -1.32e+38], N[(N[(N[(y / N[Power[N[Power[a, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(x / N[Power[a, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[a, 2.2e+114], N[(N[(x * y + N[(t * (-z)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \frac{t}{a} \cdot z\\
\mathbf{if}\;a \leq -1.32 \cdot 10^{+38}:\\
\;\;\;\;\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.32e38

    1. Initial program 79.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a} - \frac{z \cdot t}{a} \]
      3. add-cube-cbrt79.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{x}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg92.3%

        \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{z}{\frac{a}{t}}} \]
      2. associate-/l*90.7%

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. *-commutative90.7%

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

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/93.7%

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

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

    if -1.32e38 < a < 2.2e114

    1. Initial program 99.2%

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

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

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

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

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

    if 2.2e114 < a

    1. Initial program 76.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a} - \frac{z \cdot t}{a} \]
      3. add-cube-cbrt76.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{x}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg90.0%

        \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{z}{\frac{a}{t}}} \]
      2. associate-/l*91.8%

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. *-commutative91.8%

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

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/91.2%

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

      \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{t}{a} \cdot z} \]
    6. Step-by-step derivation
      1. frac-times75.6%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)} \cdot \sqrt[3]{a}} - \frac{t}{a} \cdot z \]
      3. add-cube-cbrt76.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{a}} - \frac{t}{a} \cdot z \]
      4. *-un-lft-identity76.1%

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{x}{a}} - \frac{t}{a} \cdot z \]
      6. /-rgt-identity90.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.32 \cdot 10^{+38}:\\ \;\;\;\;\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{t}{a} \cdot z\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+114}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, t \cdot \left(-z\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{x}} - \frac{t}{a} \cdot z\\ \end{array} \]

Alternative 2: 94.3% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.69999999999999987e-58 or 9.0000000000000005e110 < a

    1. Initial program 80.2%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a} - \frac{z \cdot t}{a} \]
      3. add-cube-cbrt79.6%

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{x}{\sqrt[3]{a}}} - \frac{z \cdot t}{a} \]
      5. fma-neg92.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{x}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg91.9%

        \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{z}{\frac{a}{t}}} \]
      2. associate-/l*92.0%

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. *-commutative92.0%

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

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/93.1%

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

      \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{t}{a} \cdot z} \]
    6. Step-by-step derivation
      1. frac-times80.7%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)} \cdot \sqrt[3]{a}} - \frac{t}{a} \cdot z \]
      3. add-cube-cbrt81.3%

        \[\leadsto \frac{y \cdot x}{\color{blue}{a}} - \frac{t}{a} \cdot z \]
      4. *-un-lft-identity81.3%

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{x}{a}} - \frac{t}{a} \cdot z \]
      6. /-rgt-identity91.7%

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

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

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

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

    if -1.69999999999999987e-58 < a < 9.0000000000000005e110

    1. Initial program 99.1%

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

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

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

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

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

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

Alternative 3: 72.9% accurate, 0.4× speedup?

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

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

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

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

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


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

    1. Initial program 87.0%

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

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

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

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

    if -2e30 < (*.f64 x y) < 4.99999999999999979e-75

    1. Initial program 92.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a} - \frac{z \cdot t}{a} \]
      3. add-cube-cbrt92.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{x}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg88.9%

        \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{z}{\frac{a}{t}}} \]
      2. associate-/l*91.6%

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. *-commutative91.6%

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

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/90.1%

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

      \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{t}{a} \cdot z} \]
    6. Taylor expanded in y around 0 79.3%

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

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

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

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

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

    if 4.99999999999999979e-75 < (*.f64 x y) < 0.050000000000000003

    1. Initial program 99.8%

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

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

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

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

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

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

    if 0.050000000000000003 < (*.f64 x y) < 1.99999999999999992e28

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{a} \cdot t} \]
      4. *-commutative78.0%

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

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

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

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

    if 1.99999999999999992e28 < (*.f64 x y)

    1. Initial program 87.3%

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

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

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

      \[\leadsto \color{blue}{\frac{x}{a} \cdot y} \]
    5. Step-by-step derivation
      1. *-commutative80.8%

        \[\leadsto \color{blue}{y \cdot \frac{x}{a}} \]
      2. clear-num80.8%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a}{x}}} \]
      3. un-div-inv81.1%

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

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

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

Alternative 4: 93.0% accurate, 0.4× speedup?

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

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


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

    1. Initial program 71.6%

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

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

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

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

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

    if -1e303 < (/.f64 (-.f64 (*.f64 x y) (*.f64 z t)) a)

    1. Initial program 95.6%

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

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

Alternative 5: 95.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 67.4%

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

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

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

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

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

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

    if -inf.0 < (*.f64 x y) < 9.9999999999999994e304

    1. Initial program 95.8%

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

    if 9.9999999999999994e304 < (*.f64 x y)

    1. Initial program 57.7%

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

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

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

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

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

Alternative 6: 94.1% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.80000000000000005e-58 or 1.5e113 < a

    1. Initial program 80.2%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a} - \frac{z \cdot t}{a} \]
      3. add-cube-cbrt79.6%

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

        \[\leadsto \color{blue}{\frac{y}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{x}{\sqrt[3]{a}}} - \frac{z \cdot t}{a} \]
      5. fma-neg92.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{x}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg91.9%

        \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{z}{\frac{a}{t}}} \]
      2. associate-/l*92.0%

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. *-commutative92.0%

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

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/93.1%

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

      \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{t}{a} \cdot z} \]
    6. Step-by-step derivation
      1. frac-times80.7%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)} \cdot \sqrt[3]{a}} - \frac{t}{a} \cdot z \]
      3. add-cube-cbrt81.3%

        \[\leadsto \frac{y \cdot x}{\color{blue}{a}} - \frac{t}{a} \cdot z \]
      4. *-un-lft-identity81.3%

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

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{x}{a}} - \frac{t}{a} \cdot z \]
      6. /-rgt-identity91.7%

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

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

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

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

    if -1.80000000000000005e-58 < a < 1.5e113

    1. Initial program 99.1%

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

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

Alternative 7: 72.7% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 87.0%

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

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

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

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

    if -2e30 < (*.f64 x y) < 4.99999999999999979e-75

    1. Initial program 92.7%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{a} - \frac{z \cdot t}{a} \]
      3. add-cube-cbrt92.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}}, \frac{x}{\sqrt[3]{a}}, -\frac{z}{\frac{a}{t}}\right)} \]
    4. Step-by-step derivation
      1. fma-neg88.9%

        \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{z}{\frac{a}{t}}} \]
      2. associate-/l*91.6%

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. *-commutative91.6%

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

        \[\leadsto \frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \color{blue}{\frac{t}{\frac{a}{z}}} \]
      5. associate-/r/90.1%

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

      \[\leadsto \color{blue}{\frac{y}{{\left(\sqrt[3]{a}\right)}^{2}} \cdot \frac{x}{\sqrt[3]{a}} - \frac{t}{a} \cdot z} \]
    6. Taylor expanded in y around 0 79.3%

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

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

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

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

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

    if 4.99999999999999979e-75 < (*.f64 x y)

    1. Initial program 90.6%

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

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

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

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

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

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

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

Alternative 8: 51.8% accurate, 1.3× speedup?

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

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


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

    1. Initial program 89.5%

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

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

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

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

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

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

    if -2.20000000000000006e-144 < z

    1. Initial program 91.4%

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

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

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

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

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

Alternative 9: 52.1% accurate, 1.8× speedup?

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

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

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

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

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

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

Alternative 10: 52.1% accurate, 1.8× speedup?

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

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

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

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

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

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

Developer target: 91.5% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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