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

Percentage Accurate: 91.7% → 97.4%
Time: 8.8s
Alternatives: 11
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 91.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.4% accurate, 0.1× 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\\ t_2 := \frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+304}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+273}:\\ \;\;\;\;\frac{t_1}{a}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{a} \cdot \left(z \cdot \mathsf{fma}\left(\frac{x}{t}, \frac{y}{z}, -1\right)\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))) (t_2 (- (/ x (/ a y)) (/ z (/ a t)))))
   (if (<= t_1 -2e+304)
     t_2
     (if (<= t_1 2e+273)
       (/ t_1 a)
       (if (<= t_1 INFINITY)
         t_2
         (* (/ t a) (* z (fma (/ x t) (/ y z) -1.0))))))))
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 t_2 = (x / (a / y)) - (z / (a / t));
	double tmp;
	if (t_1 <= -2e+304) {
		tmp = t_2;
	} else if (t_1 <= 2e+273) {
		tmp = t_1 / a;
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = t_2;
	} else {
		tmp = (t / a) * (z * fma((x / t), (y / z), -1.0));
	}
	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))
	t_2 = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t)))
	tmp = 0.0
	if (t_1 <= -2e+304)
		tmp = t_2;
	elseif (t_1 <= 2e+273)
		tmp = Float64(t_1 / a);
	elseif (t_1 <= Inf)
		tmp = t_2;
	else
		tmp = Float64(Float64(t / a) * Float64(z * fma(Float64(x / t), Float64(y / z), -1.0)));
	end
	return 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]}, Block[{t$95$2 = N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+304], t$95$2, If[LessEqual[t$95$1, 2e+273], N[(t$95$1 / a), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(t / a), $MachinePrecision] * N[(z * N[(N[(x / t), $MachinePrecision] * N[(y / z), $MachinePrecision] + -1.0), $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\\
t_2 := \frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+304}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;\frac{t_1}{a}\\

\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 68.7%

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

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

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

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

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

    if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.99999999999999989e273

    1. Initial program 98.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(x \cdot y\right) \cdot \frac{a}{z \cdot t} - a}{a \cdot \color{blue}{\frac{a}{z \cdot t}}} \]
    6. Applied egg-rr0.0%

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

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

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

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

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

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

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

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

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

Alternative 2: 97.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 -2 \cdot 10^{+304} \lor \neg \left(t_1 \leq 2 \cdot 10^{+273}\right):\\ \;\;\;\;\frac{x}{\frac{a}{y}} - 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 -2e+304) (not (<= t_1 2e+273)))
     (- (/ x (/ a y)) (* 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 <= -2e+304) || !(t_1 <= 2e+273)) {
		tmp = (x / (a / y)) - (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 <= (-2d+304)) .or. (.not. (t_1 <= 2d+273))) then
        tmp = (x / (a / y)) - (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 <= -2e+304) || !(t_1 <= 2e+273)) {
		tmp = (x / (a / y)) - (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 <= -2e+304) or not (t_1 <= 2e+273):
		tmp = (x / (a / y)) - (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 <= -2e+304) || !(t_1 <= 2e+273))
		tmp = Float64(Float64(x / Float64(a / y)) - 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 <= -2e+304) || ~((t_1 <= 2e+273)))
		tmp = (x / (a / y)) - (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, -2e+304], N[Not[LessEqual[t$95$1, 2e+273]], $MachinePrecision]], N[(N[(x / N[(a / y), $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 -2 \cdot 10^{+304} \lor \neg \left(t_1 \leq 2 \cdot 10^{+273}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - 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.9999999999999999e304 or 1.99999999999999989e273 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 62.1%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}} \]
    5. Step-by-step derivation
      1. div-inv91.6%

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

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

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

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

    if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.99999999999999989e273

    1. Initial program 98.8%

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

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

Alternative 3: 97.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 -2 \cdot 10^{+304} \lor \neg \left(t_1 \leq 2 \cdot 10^{+273}\right):\\ \;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\ \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 -2e+304) (not (<= t_1 2e+273)))
     (- (/ x (/ a y)) (/ z (/ a t)))
     (/ 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 <= -2e+304) || !(t_1 <= 2e+273)) {
		tmp = (x / (a / y)) - (z / (a / t));
	} 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 <= (-2d+304)) .or. (.not. (t_1 <= 2d+273))) then
        tmp = (x / (a / y)) - (z / (a / t))
    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 <= -2e+304) || !(t_1 <= 2e+273)) {
		tmp = (x / (a / y)) - (z / (a / t));
	} 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 <= -2e+304) or not (t_1 <= 2e+273):
		tmp = (x / (a / y)) - (z / (a / t))
	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 <= -2e+304) || !(t_1 <= 2e+273))
		tmp = Float64(Float64(x / Float64(a / y)) - Float64(z / Float64(a / t)));
	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 <= -2e+304) || ~((t_1 <= 2e+273)))
		tmp = (x / (a / y)) - (z / (a / t));
	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, -2e+304], N[Not[LessEqual[t$95$1, 2e+273]], $MachinePrecision]], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]
\begin{array}{l}
[x, y, 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 -2 \cdot 10^{+304} \lor \neg \left(t_1 \leq 2 \cdot 10^{+273}\right):\\
\;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\frac{a}{t}}\\

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


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

    1. Initial program 62.1%

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

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

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

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

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

    if -1.9999999999999999e304 < (-.f64 (*.f64 x y) (*.f64 z t)) < 1.99999999999999989e273

    1. Initial program 98.8%

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

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

Alternative 4: 72.4% 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{t}{a} \cdot \left(-z\right)\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+107}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-25}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\ \;\;\;\;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 a) (- z))))
   (if (<= (* x y) -2e+107)
     (/ x (/ a y))
     (if (<= (* x y) -2e-8)
       t_1
       (if (<= (* x y) -2e-25)
         (/ (* x y) a)
         (if (<= (* x y) 0.0)
           (/ (- t) (/ a z))
           (if (<= (* x y) 5e+62) 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 / a) * -z;
	double tmp;
	if ((x * y) <= -2e+107) {
		tmp = x / (a / y);
	} else if ((x * y) <= -2e-8) {
		tmp = t_1;
	} else if ((x * y) <= -2e-25) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 0.0) {
		tmp = -t / (a / z);
	} else if ((x * y) <= 5e+62) {
		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 / a) * -z
    if ((x * y) <= (-2d+107)) then
        tmp = x / (a / y)
    else if ((x * y) <= (-2d-8)) then
        tmp = t_1
    else if ((x * y) <= (-2d-25)) then
        tmp = (x * y) / a
    else if ((x * y) <= 0.0d0) then
        tmp = -t / (a / z)
    else if ((x * y) <= 5d+62) 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 / a) * -z;
	double tmp;
	if ((x * y) <= -2e+107) {
		tmp = x / (a / y);
	} else if ((x * y) <= -2e-8) {
		tmp = t_1;
	} else if ((x * y) <= -2e-25) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 0.0) {
		tmp = -t / (a / z);
	} else if ((x * y) <= 5e+62) {
		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 / a) * -z
	tmp = 0
	if (x * y) <= -2e+107:
		tmp = x / (a / y)
	elif (x * y) <= -2e-8:
		tmp = t_1
	elif (x * y) <= -2e-25:
		tmp = (x * y) / a
	elif (x * y) <= 0.0:
		tmp = -t / (a / z)
	elif (x * y) <= 5e+62:
		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(Float64(t / a) * Float64(-z))
	tmp = 0.0
	if (Float64(x * y) <= -2e+107)
		tmp = Float64(x / Float64(a / y));
	elseif (Float64(x * y) <= -2e-8)
		tmp = t_1;
	elseif (Float64(x * y) <= -2e-25)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(x * y) <= 0.0)
		tmp = Float64(Float64(-t) / Float64(a / z));
	elseif (Float64(x * y) <= 5e+62)
		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 / a) * -z;
	tmp = 0.0;
	if ((x * y) <= -2e+107)
		tmp = x / (a / y);
	elseif ((x * y) <= -2e-8)
		tmp = t_1;
	elseif ((x * y) <= -2e-25)
		tmp = (x * y) / a;
	elseif ((x * y) <= 0.0)
		tmp = -t / (a / z);
	elseif ((x * y) <= 5e+62)
		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[(N[(t / a), $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+107], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-8], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-25], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+62], 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 := \frac{t}{a} \cdot \left(-z\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+107}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-8}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 76.0%

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

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

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

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

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

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

    if -1.9999999999999999e107 < (*.f64 x y) < -2e-8 or 0.0 < (*.f64 x y) < 5.00000000000000029e62

    1. Initial program 94.5%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{{\left(\frac{\frac{a}{t}}{z}\right)}^{-1}} \]
      3. associate-/l/85.5%

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{1}{\color{blue}{\frac{\frac{a}{t}}{z}}} \]
    8. Simplified87.0%

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-out69.0%

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

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

    if -2e-8 < (*.f64 x y) < -2.00000000000000008e-25

    1. Initial program 100.0%

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

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

    if -2.00000000000000008e-25 < (*.f64 x y) < 0.0

    1. Initial program 93.8%

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

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

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

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

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

    if 5.00000000000000029e62 < (*.f64 x y)

    1. Initial program 78.0%

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

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

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

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

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

Alternative 5: 72.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 := \frac{t}{a} \cdot \left(-z\right)\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+107}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-8}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-25}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\ \;\;\;\;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 a) (- z))))
   (if (<= (* x y) -2e+107)
     (/ x (/ a y))
     (if (<= (* x y) -2e-8)
       t_1
       (if (<= (* x y) -2e-25)
         (/ (* x y) a)
         (if (<= (* x y) 0.0)
           (* t (/ (- z) a))
           (if (<= (* x y) 5e+62) 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 / a) * -z;
	double tmp;
	if ((x * y) <= -2e+107) {
		tmp = x / (a / y);
	} else if ((x * y) <= -2e-8) {
		tmp = t_1;
	} else if ((x * y) <= -2e-25) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 0.0) {
		tmp = t * (-z / a);
	} else if ((x * y) <= 5e+62) {
		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 / a) * -z
    if ((x * y) <= (-2d+107)) then
        tmp = x / (a / y)
    else if ((x * y) <= (-2d-8)) then
        tmp = t_1
    else if ((x * y) <= (-2d-25)) then
        tmp = (x * y) / a
    else if ((x * y) <= 0.0d0) then
        tmp = t * (-z / a)
    else if ((x * y) <= 5d+62) 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 / a) * -z;
	double tmp;
	if ((x * y) <= -2e+107) {
		tmp = x / (a / y);
	} else if ((x * y) <= -2e-8) {
		tmp = t_1;
	} else if ((x * y) <= -2e-25) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 0.0) {
		tmp = t * (-z / a);
	} else if ((x * y) <= 5e+62) {
		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 / a) * -z
	tmp = 0
	if (x * y) <= -2e+107:
		tmp = x / (a / y)
	elif (x * y) <= -2e-8:
		tmp = t_1
	elif (x * y) <= -2e-25:
		tmp = (x * y) / a
	elif (x * y) <= 0.0:
		tmp = t * (-z / a)
	elif (x * y) <= 5e+62:
		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(Float64(t / a) * Float64(-z))
	tmp = 0.0
	if (Float64(x * y) <= -2e+107)
		tmp = Float64(x / Float64(a / y));
	elseif (Float64(x * y) <= -2e-8)
		tmp = t_1;
	elseif (Float64(x * y) <= -2e-25)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(x * y) <= 0.0)
		tmp = Float64(t * Float64(Float64(-z) / a));
	elseif (Float64(x * y) <= 5e+62)
		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 / a) * -z;
	tmp = 0.0;
	if ((x * y) <= -2e+107)
		tmp = x / (a / y);
	elseif ((x * y) <= -2e-8)
		tmp = t_1;
	elseif ((x * y) <= -2e-25)
		tmp = (x * y) / a;
	elseif ((x * y) <= 0.0)
		tmp = t * (-z / a);
	elseif ((x * y) <= 5e+62)
		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[(N[(t / a), $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+107], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-8], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-25], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+62], 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 := \frac{t}{a} \cdot \left(-z\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+107}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-8}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 76.0%

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

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

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

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

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

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

    if -1.9999999999999999e107 < (*.f64 x y) < -2e-8 or 0.0 < (*.f64 x y) < 5.00000000000000029e62

    1. Initial program 94.5%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{{\left(\frac{\frac{a}{t}}{z}\right)}^{-1}} \]
      3. associate-/l/85.5%

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{1}{\color{blue}{\frac{\frac{a}{t}}{z}}} \]
    8. Simplified87.0%

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{t}{a}} \]
      4. distribute-lft-neg-out69.0%

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

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

    if -2e-8 < (*.f64 x y) < -2.00000000000000008e-25

    1. Initial program 100.0%

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

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

    if -2.00000000000000008e-25 < (*.f64 x y) < 0.0

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

    if 5.00000000000000029e62 < (*.f64 x y)

    1. Initial program 78.0%

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

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

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

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

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

Alternative 6: 73.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} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+107}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-8}:\\ \;\;\;\;\frac{t}{a} \cdot \left(-z\right)\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-38}:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\ \;\;\;\;\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) -2e+107)
   (/ x (/ a y))
   (if (<= (* x y) -2e-8)
     (* (/ t a) (- z))
     (if (<= (* x y) -5e-38)
       (/ y (/ a x))
       (if (<= (* x y) 5e+62) (/ (* 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) <= -2e+107) {
		tmp = x / (a / y);
	} else if ((x * y) <= -2e-8) {
		tmp = (t / a) * -z;
	} else if ((x * y) <= -5e-38) {
		tmp = y / (a / x);
	} else if ((x * y) <= 5e+62) {
		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) <= (-2d+107)) then
        tmp = x / (a / y)
    else if ((x * y) <= (-2d-8)) then
        tmp = (t / a) * -z
    else if ((x * y) <= (-5d-38)) then
        tmp = y / (a / x)
    else if ((x * y) <= 5d+62) 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) <= -2e+107) {
		tmp = x / (a / y);
	} else if ((x * y) <= -2e-8) {
		tmp = (t / a) * -z;
	} else if ((x * y) <= -5e-38) {
		tmp = y / (a / x);
	} else if ((x * y) <= 5e+62) {
		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) <= -2e+107:
		tmp = x / (a / y)
	elif (x * y) <= -2e-8:
		tmp = (t / a) * -z
	elif (x * y) <= -5e-38:
		tmp = y / (a / x)
	elif (x * y) <= 5e+62:
		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) <= -2e+107)
		tmp = Float64(x / Float64(a / y));
	elseif (Float64(x * y) <= -2e-8)
		tmp = Float64(Float64(t / a) * Float64(-z));
	elseif (Float64(x * y) <= -5e-38)
		tmp = Float64(y / Float64(a / x));
	elseif (Float64(x * y) <= 5e+62)
		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) <= -2e+107)
		tmp = x / (a / y);
	elseif ((x * y) <= -2e-8)
		tmp = (t / a) * -z;
	elseif ((x * y) <= -5e-38)
		tmp = y / (a / x);
	elseif ((x * y) <= 5e+62)
		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], -2e+107], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-8], N[(N[(t / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5e-38], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+62], 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 -2 \cdot 10^{+107}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;\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) < -1.9999999999999999e107

    1. Initial program 76.0%

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

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

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

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

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

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

    if -1.9999999999999999e107 < (*.f64 x y) < -2e-8

    1. Initial program 88.8%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{{\left(\frac{\frac{a}{t}}{z}\right)}^{-1}} \]
      3. associate-/l/77.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e-8 < (*.f64 x y) < -5.00000000000000033e-38

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

    if -5.00000000000000033e-38 < (*.f64 x y) < 5.00000000000000029e62

    1. Initial program 95.4%

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

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

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

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

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

    if 5.00000000000000029e62 < (*.f64 x y)

    1. Initial program 78.0%

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

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

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

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

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

Alternative 7: 95.1% accurate, 0.5× 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 -2 \cdot 10^{+304}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq 10^{+202}:\\ \;\;\;\;\frac{x \cdot y - z \cdot t}{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) -2e+304)
   (/ x (/ a y))
   (if (<= (* x y) 1e+202) (/ (- (* x y) (* 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) <= -2e+304) {
		tmp = x / (a / y);
	} else if ((x * y) <= 1e+202) {
		tmp = ((x * y) - (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) <= (-2d+304)) then
        tmp = x / (a / y)
    else if ((x * y) <= 1d+202) then
        tmp = ((x * y) - (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) <= -2e+304) {
		tmp = x / (a / y);
	} else if ((x * y) <= 1e+202) {
		tmp = ((x * y) - (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) <= -2e+304:
		tmp = x / (a / y)
	elif (x * y) <= 1e+202:
		tmp = ((x * y) - (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) <= -2e+304)
		tmp = Float64(x / Float64(a / y));
	elseif (Float64(x * y) <= 1e+202)
		tmp = Float64(Float64(Float64(x * y) - Float64(z * 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) <= -2e+304)
		tmp = x / (a / y);
	elseif ((x * y) <= 1e+202)
		tmp = ((x * y) - (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], -2e+304], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+202], N[(N[(N[(x * y), $MachinePrecision] - N[(z * t), $MachinePrecision]), $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 -2 \cdot 10^{+304}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\

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

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


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

    1. Initial program 56.9%

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

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

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

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

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

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

    if -1.9999999999999999e304 < (*.f64 x y) < 9.999999999999999e201

    1. Initial program 94.6%

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

    if 9.999999999999999e201 < (*.f64 x y)

    1. Initial program 59.7%

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

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

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

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

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

Alternative 8: 72.7% accurate, 0.6× 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^{+58}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+62}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \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+58)
   (/ x (/ a y))
   (if (<= (* x y) 5e+62) (/ (- t) (/ a z)) (* 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+58) {
		tmp = x / (a / y);
	} else if ((x * y) <= 5e+62) {
		tmp = -t / (a / z);
	} 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+58)) then
        tmp = x / (a / y)
    else if ((x * y) <= 5d+62) then
        tmp = -t / (a / z)
    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+58) {
		tmp = x / (a / y);
	} else if ((x * y) <= 5e+62) {
		tmp = -t / (a / z);
	} 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+58:
		tmp = x / (a / y)
	elif (x * y) <= 5e+62:
		tmp = -t / (a / z)
	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+58)
		tmp = Float64(x / Float64(a / y));
	elseif (Float64(x * y) <= 5e+62)
		tmp = Float64(Float64(-t) / Float64(a / z));
	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+58)
		tmp = x / (a / y);
	elseif ((x * y) <= 5e+62)
		tmp = -t / (a / z);
	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+58], N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+62], N[((-t) / N[(a / z), $MachinePrecision]), $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^{+58}:\\
\;\;\;\;\frac{x}{\frac{a}{y}}\\

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

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


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

    1. Initial program 78.8%

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

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

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

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

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

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

    if -3.99999999999999978e58 < (*.f64 x y) < 5.00000000000000029e62

    1. Initial program 94.1%

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

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

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

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

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

    if 5.00000000000000029e62 < (*.f64 x y)

    1. Initial program 78.0%

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

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

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

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

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

Alternative 9: 51.3% accurate, 1.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}\;a \leq 1.12 \cdot 10^{-123}:\\ \;\;\;\;\frac{x \cdot y}{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 (<= a 1.12e-123) (/ (* x y) 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 (a <= 1.12e-123) {
		tmp = (x * y) / 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 (a <= 1.12d-123) then
        tmp = (x * y) / 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 (a <= 1.12e-123) {
		tmp = (x * y) / 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 a <= 1.12e-123:
		tmp = (x * y) / 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 (a <= 1.12e-123)
		tmp = Float64(Float64(x * y) / 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 (a <= 1.12e-123)
		tmp = (x * y) / 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[a, 1.12e-123], N[(N[(x * y), $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}\;a \leq 1.12 \cdot 10^{-123}:\\
\;\;\;\;\frac{x \cdot y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.11999999999999999e-123

    1. Initial program 91.0%

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

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

    if 1.11999999999999999e-123 < a

    1. Initial program 83.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.12 \cdot 10^{-123}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{a}\\ \end{array} \]
  5. 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])\\ \\ 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 88.4%

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

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

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

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

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

Alternative 11: 51.4% 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 88.4%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{x}}} \]
    3. associate-/r/46.5%

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

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

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

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

Developer target: 92.3% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))

  (/ (- (* x y) (* z t)) a))