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

Percentage Accurate: 91.7% → 96.3%
Time: 7.6s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 91.7% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;t\_1 \leq 10^{+266}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


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

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e266

    1. Initial program 99.2%

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

    if 1e266 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 66.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{\frac{x \cdot y}{t} - z}{a}} \]
      8. associate-*r/95.1%

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

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

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

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

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

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

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

Alternative 2: 72.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 10^{-97}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{a}\\

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

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


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

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

    if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126

    1. Initial program 92.4%

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

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

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

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

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

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

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

    if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97

    1. Initial program 99.0%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \left(x \cdot y\right)} \]
    5. Applied egg-rr99.2%

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

    if 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

    if 4.9999999999999998e-8 < (*.f64 x y)

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

Alternative 3: 72.5% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

    if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126

    1. Initial program 92.4%

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

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

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

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

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

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

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

    if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97

    1. Initial program 99.0%

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

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

    if 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

    if 4.9999999999999998e-8 < (*.f64 x y)

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

Alternative 4: 72.5% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

    if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126

    1. Initial program 92.4%

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

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

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

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

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

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

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

    if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97

    1. Initial program 99.0%

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

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

    if 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -z \cdot \color{blue}{\frac{1}{\frac{a}{-t}}} \]
      9. un-div-inv2.6%

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

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

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

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

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

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

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

    if 4.9999999999999998e-8 < (*.f64 x y)

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

    if -5.0000000000000001e29 < (*.f64 x y) < 1.9999999999999999e-126 or 1.00000000000000004e-97 < (*.f64 x y) < 4.9999999999999998e-8

    1. Initial program 91.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \frac{-t}{a}} \]
    6. Step-by-step derivation
      1. distribute-frac-neg82.8%

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

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

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

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

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

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

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

        \[\leadsto -z \cdot \color{blue}{\frac{1}{\frac{a}{-t}}} \]
      9. un-div-inv9.5%

        \[\leadsto -\color{blue}{\frac{z}{\frac{a}{-t}}} \]
      10. add-sqr-sqrt4.3%

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

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

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

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

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

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

    if 1.9999999999999999e-126 < (*.f64 x y) < 1.00000000000000004e-97

    1. Initial program 99.0%

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

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

    if 4.9999999999999998e-8 < (*.f64 x y)

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_1 \leq 10^{+266}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


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

    1. Initial program 67.6%

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

      \[\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. +-commutative80.4%

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

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

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

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

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

    if -inf.0 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1e266

    1. Initial program 99.2%

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

    if 1e266 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 66.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{\frac{x \cdot y}{t} - z}{a}} \]
      8. associate-*r/95.1%

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

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

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

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

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

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

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

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

Alternative 7: 95.0% 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}\;z \cdot t \leq -\infty:\\ \;\;\;\;z \cdot \frac{-t}{a}\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+218}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{a} \cdot \left(-t\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
 (if (<= (* z t) (- INFINITY))
   (* z (/ (- t) a))
   (if (<= (* z t) 2e+218) (/ (- (* x y) (* z t)) a) (* (/ z a) (- t)))))
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 ((z * t) <= -((double) INFINITY)) {
		tmp = z * (-t / a);
	} else if ((z * t) <= 2e+218) {
		tmp = ((x * y) - (z * t)) / a;
	} else {
		tmp = (z / a) * -t;
	}
	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 ((z * t) <= -Double.POSITIVE_INFINITY) {
		tmp = z * (-t / a);
	} else if ((z * t) <= 2e+218) {
		tmp = ((x * y) - (z * t)) / a;
	} else {
		tmp = (z / a) * -t;
	}
	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 (z * t) <= -math.inf:
		tmp = z * (-t / a)
	elif (z * t) <= 2e+218:
		tmp = ((x * y) - (z * t)) / a
	else:
		tmp = (z / a) * -t
	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(z * t) <= Float64(-Inf))
		tmp = Float64(z * Float64(Float64(-t) / a));
	elseif (Float64(z * t) <= 2e+218)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * t)) / a);
	else
		tmp = Float64(Float64(z / a) * Float64(-t));
	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 ((z * t) <= -Inf)
		tmp = z * (-t / a);
	elseif ((z * t) <= 2e+218)
		tmp = ((x * y) - (z * t)) / a;
	else
		tmp = (z / a) * -t;
	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[(z * t), $MachinePrecision], (-Infinity)], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+218], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * (-t)), $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}\;z \cdot t \leq -\infty:\\
\;\;\;\;z \cdot \frac{-t}{a}\\

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

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


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

    1. Initial program 42.4%

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 z t) < 2.00000000000000017e218

    1. Initial program 96.3%

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

    if 2.00000000000000017e218 < (*.f64 z t)

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

Alternative 8: 94.4% 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} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_1 \leq 10^{+266}:\\ \;\;\;\;\frac{t\_1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{a} \cdot \left(x \cdot \frac{y}{t} - z\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+266) (/ t_1 a) (* (/ t a) (- (* x (/ y t)) z)))))
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+266) {
		tmp = t_1 / a;
	} else {
		tmp = (t / a) * ((x * (y / t)) - z);
	}
	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+266) then
        tmp = t_1 / a
    else
        tmp = (t / a) * ((x * (y / t)) - z)
    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+266) {
		tmp = t_1 / a;
	} else {
		tmp = (t / a) * ((x * (y / t)) - z);
	}
	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+266:
		tmp = t_1 / a
	else:
		tmp = (t / a) * ((x * (y / t)) - z)
	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+266)
		tmp = Float64(t_1 / a);
	else
		tmp = Float64(Float64(t / a) * Float64(Float64(x * Float64(y / t)) - z));
	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+266)
		tmp = t_1 / a;
	else
		tmp = (t / a) * ((x * (y / t)) - z);
	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+266], N[(t$95$1 / a), $MachinePrecision], N[(N[(t / a), $MachinePrecision] * N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] - z), $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 10^{+266}:\\
\;\;\;\;\frac{t\_1}{a}\\

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


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

    1. Initial program 95.0%

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

    if 1e266 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 66.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{\frac{x \cdot y}{t} - z}{a}} \]
      8. associate-*r/95.1%

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

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

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

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

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

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

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

Alternative 9: 51.5% accurate, 1.8× speedup?

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

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

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

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

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

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

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

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

Alternative 10: 51.7% 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 90.6%

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

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

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

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

Alternative 11: 8.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])\\ \\ t \cdot \frac{z}{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 (* 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) {
	return t * (z / 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 = t * (z / 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 t * (z / 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 t * (z / 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(t * Float64(z / 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 = t * (z / 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[(t * N[(z / 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])\\
\\
t \cdot \frac{z}{a}
\end{array}
Derivation
  1. Initial program 90.6%

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

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

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

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

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

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

      \[\leadsto \left(x \cdot y + z \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}\right) \cdot \frac{1}{a} \]
    7. sqr-neg58.4%

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

      \[\leadsto \left(x \cdot y + z \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}\right) \cdot \frac{1}{a} \]
    9. add-sqr-sqrt44.6%

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

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

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

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

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

    \[\leadsto \color{blue}{t \cdot \frac{z}{a}} \]
  8. Add Preprocessing

Developer target: 92.6% 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 2024108 
(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))