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

Percentage Accurate: 91.4% → 96.1%
Time: 7.5s
Alternatives: 10
Speedup: 0.4×

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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 96.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 83.6%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{a} - z \cdot \frac{t}{a}} \]
    5. Step-by-step derivation
      1. clear-num94.8%

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

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

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

    if -1.00000000000000007e244 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.0000000000000001e272

    1. Initial program 99.6%

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

    if 2.0000000000000001e272 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 71.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{\sqrt{a}}, \frac{x \cdot y}{\sqrt{a}}, -z \cdot \frac{t}{a}\right)} \]
    5. Step-by-step derivation
      1. fma-undefine44.8%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{a}} \cdot \frac{x \cdot y}{\sqrt{a}} + \left(-z \cdot \frac{t}{a}\right)} \]
      2. distribute-lft-neg-in44.8%

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

        \[\leadsto \color{blue}{\frac{1}{\sqrt{a}} \cdot \frac{x \cdot y}{\sqrt{a}} - z \cdot \frac{t}{a}} \]
      4. associate-/l*53.2%

        \[\leadsto \frac{1}{\sqrt{a}} \cdot \color{blue}{\left(x \cdot \frac{y}{\sqrt{a}}\right)} - z \cdot \frac{t}{a} \]
      5. associate-*r/47.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.9% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 83.6%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{a} - z \cdot \frac{t}{a}} \]
    5. Step-by-step derivation
      1. clear-num94.8%

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

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

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

    if -1.00000000000000007e244 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.0000000000000001e272

    1. Initial program 99.6%

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

    if 2.0000000000000001e272 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 71.7%

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

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

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

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

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

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

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

Alternative 3: 74.1% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 83.1%

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

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

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

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

    if -4.00000000000000032e91 < (*.f64 x y) < -5.00000000000000024e25

    1. Initial program 91.0%

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

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

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

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

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

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

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

    if -5.00000000000000024e25 < (*.f64 x y) < -5e-80

    1. Initial program 99.6%

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

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

    if -5e-80 < (*.f64 x y) < 9.99999999999999914e28

    1. Initial program 96.5%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(t \cdot z\right)}}{a} \]
    4. Step-by-step derivation
      1. associate-*r*80.0%

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

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

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

    if 9.99999999999999914e28 < (*.f64 x y)

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.3% accurate, 0.3× speedup?

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

\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \cdot y \leq 10^{+29}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 83.1%

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

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

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

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

    if -4.00000000000000032e91 < (*.f64 x y) < -5.00000000000000024e25 or -5e-80 < (*.f64 x y) < 9.99999999999999914e28

    1. Initial program 96.1%

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

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

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

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

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

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

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

    if -5.00000000000000024e25 < (*.f64 x y) < -5e-80

    1. Initial program 99.6%

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

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

    if 9.99999999999999914e28 < (*.f64 x y)

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+91}:\\ \;\;\;\;x \cdot \frac{y}{a}\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+25}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-80}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{+29}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 96.2% accurate, 0.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 x y) (*.f64 z t)) < -1.00000000000000007e244 or 5.0000000000000003e240 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 79.8%

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

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

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

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

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

    if -1.00000000000000007e244 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.0000000000000003e240

    1. Initial program 99.6%

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

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

Alternative 6: 96.3% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+240}:\\
\;\;\;\;\frac{t\_2}{a}\\

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


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

    1. Initial program 83.6%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{a} - z \cdot \frac{t}{a}} \]
    5. Step-by-step derivation
      1. clear-num94.8%

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

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

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

    if -1.00000000000000007e244 < (-.f64 (*.f64 x y) (*.f64 z t)) < 5.0000000000000003e240

    1. Initial program 99.6%

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

    if 5.0000000000000003e240 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 76.0%

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

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

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

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

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

Alternative 7: 95.6% accurate, 0.4× speedup?

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{x \cdot y - z \cdot t}{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 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 x y) < 5.00000000000000001e276

    1. Initial program 97.6%

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

    if 5.00000000000000001e276 < (*.f64 x y)

    1. Initial program 66.4%

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

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

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

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

Alternative 8: 51.8% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 51.8% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 10: 52.0% accurate, 1.8× speedup?

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

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

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

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

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

Developer target: 91.7% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024101 
(FPCore (x y z t a)
  :name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
  :precision binary64

  :alt
  (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))