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

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

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

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


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

    1. Initial program 80.8%

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

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

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

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

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

    if -4.99999999999999995e238 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000003e306

    1. Initial program 98.4%

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

    if 2.00000000000000003e306 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 62.4%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. add-sqr-sqrt30.5%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{z \cdot z}} \cdot t}{a} \]
      5. sqr-neg60.4%

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\left(-z\right)} \cdot t}{a} \]
      8. add-sqr-sqrt16.7%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\left(-\color{blue}{\sqrt{z \cdot z}}\right) \cdot t}{a} \]
      10. sqr-neg50.9%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right) \cdot t}{a} \]
      12. add-sqr-sqrt71.4%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\left(-\color{blue}{\left(-z\right)}\right) \cdot t}{a} \]
      13. distribute-lft-neg-in71.4%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{-\color{blue}{t \cdot \left(-z\right)}}{a} \]
      15. distribute-rgt-neg-out71.4%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{-\color{blue}{\left(-t \cdot z\right)}}{a} \]
      16. remove-double-neg71.4%

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

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

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

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

Alternative 2: 93.2% accurate, 0.0× 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 7.2 \cdot 10^{-61}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\sqrt{a}} \cdot \frac{t}{\sqrt{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 7.2e-61)
   (/ (fma x y (* z (- t))) a)
   (- (/ x (/ a y)) (* (/ z (sqrt a)) (/ t (sqrt 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 <= 7.2e-61) {
		tmp = fma(x, y, (z * -t)) / a;
	} else {
		tmp = (x / (a / y)) - ((z / sqrt(a)) * (t / sqrt(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 <= 7.2e-61)
		tmp = Float64(fma(x, y, Float64(z * Float64(-t))) / a);
	else
		tmp = Float64(Float64(x / Float64(a / y)) - Float64(Float64(z / sqrt(a)) * Float64(t / sqrt(a))));
	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_] := If[LessEqual[a, 7.2e-61], N[(N[(x * y + N[(z * (-t)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision] - N[(N[(z / N[Sqrt[a], $MachinePrecision]), $MachinePrecision] * N[(t / N[Sqrt[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\

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


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

    1. Initial program 92.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot y - t \cdot z}{a}} \]
      4. fma-neg92.7%

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

        \[\leadsto \frac{\mathsf{fma}\left(x, y, -\color{blue}{z \cdot t}\right)}{a} \]
      6. distribute-rgt-neg-out92.7%

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

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

    if 7.20000000000000028e-61 < a

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{-z}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}}} \]
      15. add-sqr-sqrt26.5%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      16. sqrt-unprod52.0%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      17. sqr-neg52.0%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\sqrt{\color{blue}{z \cdot z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      18. sqrt-unprod37.5%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      19. add-sqr-sqrt94.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 7.2 \cdot 10^{-61}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(-t\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a}{y}} - \frac{z}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 70.7% 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}{\frac{a}{z}}\\ t_2 := \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+67}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-113}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+99}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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))) (t_2 (/ x (/ a y))))
   (if (<= (* x y) -1e+67)
     t_2
     (if (<= (* x y) 5e-113)
       t_1
       (if (<= (* x y) 2e+15)
         (/ (* x y) a)
         (if (<= (* x y) 7e+99) t_1 t_2))))))
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 t_2 = x / (a / y);
	double tmp;
	if ((x * y) <= -1e+67) {
		tmp = t_2;
	} else if ((x * y) <= 5e-113) {
		tmp = t_1;
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = -t / (a / z)
    t_2 = x / (a / y)
    if ((x * y) <= (-1d+67)) then
        tmp = t_2
    else if ((x * y) <= 5d-113) then
        tmp = t_1
    else if ((x * y) <= 2d+15) then
        tmp = (x * y) / a
    else if ((x * y) <= 7d+99) then
        tmp = t_1
    else
        tmp = t_2
    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 t_2 = x / (a / y);
	double tmp;
	if ((x * y) <= -1e+67) {
		tmp = t_2;
	} else if ((x * y) <= 5e-113) {
		tmp = t_1;
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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)
	t_2 = x / (a / y)
	tmp = 0
	if (x * y) <= -1e+67:
		tmp = t_2
	elif (x * y) <= 5e-113:
		tmp = t_1
	elif (x * y) <= 2e+15:
		tmp = (x * y) / a
	elif (x * y) <= 7e+99:
		tmp = t_1
	else:
		tmp = t_2
	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) / Float64(a / z))
	t_2 = Float64(x / Float64(a / y))
	tmp = 0.0
	if (Float64(x * y) <= -1e+67)
		tmp = t_2;
	elseif (Float64(x * y) <= 5e-113)
		tmp = t_1;
	elseif (Float64(x * y) <= 2e+15)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(x * y) <= 7e+99)
		tmp = t_1;
	else
		tmp = t_2;
	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);
	t_2 = x / (a / y);
	tmp = 0.0;
	if ((x * y) <= -1e+67)
		tmp = t_2;
	elseif ((x * y) <= 5e-113)
		tmp = t_1;
	elseif ((x * y) <= 2e+15)
		tmp = (x * y) / a;
	elseif ((x * y) <= 7e+99)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+67], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e-113], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+15], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7e+99], t$95$1, t$95$2]]]]]]
\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}{\frac{a}{z}}\\
t_2 := \frac{x}{\frac{a}{y}}\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+67}:\\
\;\;\;\;t\_2\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.99999999999999983e66 or 6.9999999999999995e99 < (*.f64 x y)

    1. Initial program 84.9%

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

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

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

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

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

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

    if -9.99999999999999983e66 < (*.f64 x y) < 4.9999999999999997e-113 or 2e15 < (*.f64 x y) < 6.9999999999999995e99

    1. Initial program 94.7%

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

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

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

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

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

    if 4.9999999999999997e-113 < (*.f64 x y) < 2e15

    1. Initial program 99.5%

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

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

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

Alternative 4: 70.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} t_1 := \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-113}:\\ \;\;\;\;z \cdot \frac{-t}{a}\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+99}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (/ a y))))
   (if (<= (* x y) -1e-28)
     t_1
     (if (<= (* x y) 5e-113)
       (* z (/ (- t) a))
       (if (<= (* x y) 2e+15)
         (/ (* x y) a)
         (if (<= (* x y) 7e+99) (/ (- t) (/ a z)) t_1))))))
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 / (a / y);
	double tmp;
	if ((x * y) <= -1e-28) {
		tmp = t_1;
	} else if ((x * y) <= 5e-113) {
		tmp = z * (-t / a);
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = -t / (a / z);
	} else {
		tmp = t_1;
	}
	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 / (a / y)
    if ((x * y) <= (-1d-28)) then
        tmp = t_1
    else if ((x * y) <= 5d-113) then
        tmp = z * (-t / a)
    else if ((x * y) <= 2d+15) then
        tmp = (x * y) / a
    else if ((x * y) <= 7d+99) then
        tmp = -t / (a / z)
    else
        tmp = t_1
    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 / (a / y);
	double tmp;
	if ((x * y) <= -1e-28) {
		tmp = t_1;
	} else if ((x * y) <= 5e-113) {
		tmp = z * (-t / a);
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = -t / (a / z);
	} else {
		tmp = t_1;
	}
	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 / (a / y)
	tmp = 0
	if (x * y) <= -1e-28:
		tmp = t_1
	elif (x * y) <= 5e-113:
		tmp = z * (-t / a)
	elif (x * y) <= 2e+15:
		tmp = (x * y) / a
	elif (x * y) <= 7e+99:
		tmp = -t / (a / z)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a = sort([x, y, z, t, a])
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(a / y))
	tmp = 0.0
	if (Float64(x * y) <= -1e-28)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-113)
		tmp = Float64(z * Float64(Float64(-t) / a));
	elseif (Float64(x * y) <= 2e+15)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(x * y) <= 7e+99)
		tmp = Float64(Float64(-t) / Float64(a / z));
	else
		tmp = t_1;
	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 / (a / y);
	tmp = 0.0;
	if ((x * y) <= -1e-28)
		tmp = t_1;
	elseif ((x * y) <= 5e-113)
		tmp = z * (-t / a);
	elseif ((x * y) <= 2e+15)
		tmp = (x * y) / a;
	elseif ((x * y) <= 7e+99)
		tmp = -t / (a / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e-28], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-113], N[(z * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+15], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7e+99], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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{x}{\frac{a}{y}}\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -9.99999999999999971e-29 or 6.9999999999999995e99 < (*.f64 x y)

    1. Initial program 87.7%

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

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

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

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

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

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

    if -9.99999999999999971e-29 < (*.f64 x y) < 4.9999999999999997e-113

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{t \cdot \left(-z\right)}{a}} \]
      12. add-sqr-sqrt12.4%

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{-z}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}}} \]
      15. add-sqr-sqrt6.8%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      16. sqrt-unprod21.9%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      17. sqr-neg21.9%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\sqrt{\color{blue}{z \cdot z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      18. sqrt-unprod16.1%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      19. add-sqr-sqrt41.8%

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

      \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{z}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}}} \]
    7. Taylor expanded in x around 0 81.6%

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

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

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

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

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

    if 4.9999999999999997e-113 < (*.f64 x y) < 2e15

    1. Initial program 99.5%

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

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

    if 2e15 < (*.f64 x y) < 6.9999999999999995e99

    1. Initial program 92.7%

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

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

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

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

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

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

Alternative 5: 70.7% 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{x}{\frac{a}{y}}\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-113}:\\ \;\;\;\;t \cdot \frac{-z}{a}\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+99}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (/ a y))))
   (if (<= (* x y) -1e+67)
     t_1
     (if (<= (* x y) 5e-113)
       (* t (/ (- z) a))
       (if (<= (* x y) 2e+15)
         (/ (* x y) a)
         (if (<= (* x y) 7e+99) (/ (- t) (/ a z)) t_1))))))
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 / (a / y);
	double tmp;
	if ((x * y) <= -1e+67) {
		tmp = t_1;
	} else if ((x * y) <= 5e-113) {
		tmp = t * (-z / a);
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = -t / (a / z);
	} else {
		tmp = t_1;
	}
	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 / (a / y)
    if ((x * y) <= (-1d+67)) then
        tmp = t_1
    else if ((x * y) <= 5d-113) then
        tmp = t * (-z / a)
    else if ((x * y) <= 2d+15) then
        tmp = (x * y) / a
    else if ((x * y) <= 7d+99) then
        tmp = -t / (a / z)
    else
        tmp = t_1
    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 / (a / y);
	double tmp;
	if ((x * y) <= -1e+67) {
		tmp = t_1;
	} else if ((x * y) <= 5e-113) {
		tmp = t * (-z / a);
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = -t / (a / z);
	} else {
		tmp = t_1;
	}
	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 / (a / y)
	tmp = 0
	if (x * y) <= -1e+67:
		tmp = t_1
	elif (x * y) <= 5e-113:
		tmp = t * (-z / a)
	elif (x * y) <= 2e+15:
		tmp = (x * y) / a
	elif (x * y) <= 7e+99:
		tmp = -t / (a / z)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a = sort([x, y, z, t, a])
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(a / y))
	tmp = 0.0
	if (Float64(x * y) <= -1e+67)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-113)
		tmp = Float64(t * Float64(Float64(-z) / a));
	elseif (Float64(x * y) <= 2e+15)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(x * y) <= 7e+99)
		tmp = Float64(Float64(-t) / Float64(a / z));
	else
		tmp = t_1;
	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 / (a / y);
	tmp = 0.0;
	if ((x * y) <= -1e+67)
		tmp = t_1;
	elseif ((x * y) <= 5e-113)
		tmp = t * (-z / a);
	elseif ((x * y) <= 2e+15)
		tmp = (x * y) / a;
	elseif ((x * y) <= 7e+99)
		tmp = -t / (a / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+67], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-113], N[(t * N[((-z) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+15], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7e+99], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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{x}{\frac{a}{y}}\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -9.99999999999999983e66 or 6.9999999999999995e99 < (*.f64 x y)

    1. Initial program 84.9%

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

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

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

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

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

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

    if -9.99999999999999983e66 < (*.f64 x y) < 4.9999999999999997e-113

    1. Initial program 95.0%

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

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

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

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

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

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

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

    if 4.9999999999999997e-113 < (*.f64 x y) < 2e15

    1. Initial program 99.5%

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

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

    if 2e15 < (*.f64 x y) < 6.9999999999999995e99

    1. Initial program 92.7%

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

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

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

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

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

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

Alternative 6: 71.7% 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{x}{\frac{a}{y}}\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-113}:\\ \;\;\;\;\frac{z \cdot \left(-t\right)}{a}\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+15}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+99}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (/ a y))))
   (if (<= (* x y) -2e+17)
     t_1
     (if (<= (* x y) 5e-113)
       (/ (* z (- t)) a)
       (if (<= (* x y) 2e+15)
         (/ (* x y) a)
         (if (<= (* x y) 7e+99) (/ (- t) (/ a z)) t_1))))))
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 / (a / y);
	double tmp;
	if ((x * y) <= -2e+17) {
		tmp = t_1;
	} else if ((x * y) <= 5e-113) {
		tmp = (z * -t) / a;
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = -t / (a / z);
	} else {
		tmp = t_1;
	}
	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 / (a / y)
    if ((x * y) <= (-2d+17)) then
        tmp = t_1
    else if ((x * y) <= 5d-113) then
        tmp = (z * -t) / a
    else if ((x * y) <= 2d+15) then
        tmp = (x * y) / a
    else if ((x * y) <= 7d+99) then
        tmp = -t / (a / z)
    else
        tmp = t_1
    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 / (a / y);
	double tmp;
	if ((x * y) <= -2e+17) {
		tmp = t_1;
	} else if ((x * y) <= 5e-113) {
		tmp = (z * -t) / a;
	} else if ((x * y) <= 2e+15) {
		tmp = (x * y) / a;
	} else if ((x * y) <= 7e+99) {
		tmp = -t / (a / z);
	} else {
		tmp = t_1;
	}
	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 / (a / y)
	tmp = 0
	if (x * y) <= -2e+17:
		tmp = t_1
	elif (x * y) <= 5e-113:
		tmp = (z * -t) / a
	elif (x * y) <= 2e+15:
		tmp = (x * y) / a
	elif (x * y) <= 7e+99:
		tmp = -t / (a / z)
	else:
		tmp = t_1
	return tmp
x, y, z, t, a = sort([x, y, z, t, a])
x, y, z, t, a = sort([x, y, z, t, a])
function code(x, y, z, t, a)
	t_1 = Float64(x / Float64(a / y))
	tmp = 0.0
	if (Float64(x * y) <= -2e+17)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-113)
		tmp = Float64(Float64(z * Float64(-t)) / a);
	elseif (Float64(x * y) <= 2e+15)
		tmp = Float64(Float64(x * y) / a);
	elseif (Float64(x * y) <= 7e+99)
		tmp = Float64(Float64(-t) / Float64(a / z));
	else
		tmp = t_1;
	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 / (a / y);
	tmp = 0.0;
	if ((x * y) <= -2e+17)
		tmp = t_1;
	elseif ((x * y) <= 5e-113)
		tmp = (z * -t) / a;
	elseif ((x * y) <= 2e+15)
		tmp = (x * y) / a;
	elseif ((x * y) <= 7e+99)
		tmp = -t / (a / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+17], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-113], N[(N[(z * (-t)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+15], N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7e+99], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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{x}{\frac{a}{y}}\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -2e17 or 6.9999999999999995e99 < (*.f64 x y)

    1. Initial program 86.1%

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

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

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

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

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

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

    if -2e17 < (*.f64 x y) < 4.9999999999999997e-113

    1. Initial program 95.2%

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

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

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

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

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

    if 4.9999999999999997e-113 < (*.f64 x y) < 2e15

    1. Initial program 99.5%

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

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

    if 2e15 < (*.f64 x y) < 6.9999999999999995e99

    1. Initial program 92.7%

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

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

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

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

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

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

Alternative 7: 97.2% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\ [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := x \cdot y - z \cdot t\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\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 (- INFINITY)) (not (<= t_1 2e+306)))
     (- (/ 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 <= -((double) INFINITY)) || !(t_1 <= 2e+306)) {
		tmp = (x / (a / y)) - (z * (t / a));
	} else {
		tmp = t_1 / a;
	}
	return tmp;
}
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) - (z * t);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+306)) {
		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 <= -math.inf) or not (t_1 <= 2e+306):
		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 <= Float64(-Inf)) || !(t_1 <= 2e+306))
		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 <= -Inf) || ~((t_1 <= 2e+306)))
		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, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+306]], $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 -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\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)) < -inf.0 or 2.00000000000000003e306 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{z \cdot z}} \cdot t}{a} \]
      5. sqr-neg50.5%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot t}{a} \]
      7. add-sqr-sqrt45.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{-\color{blue}{\left(-t \cdot z\right)}}{a} \]
      16. remove-double-neg76.2%

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

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

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

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

    1. Initial program 98.5%

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

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

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

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


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

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\sqrt{z \cdot z}} \cdot \frac{t}{a} \]
      5. sqr-neg40.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{-z}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}}} \]
      15. add-sqr-sqrt14.0%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      16. sqrt-unprod21.6%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\sqrt{\color{blue}{z \cdot z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      18. sqrt-unprod15.9%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt{a}} \cdot \frac{t}{\sqrt{a}} \]
      19. add-sqr-sqrt50.9%

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{t \cdot z}}{\sqrt{a} \cdot \sqrt{a}} \]
      3. add-sqr-sqrt89.9%

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

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

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

    if -1e180 < (-.f64 (*.f64 x y) (*.f64 z t)) < 2.00000000000000003e306

    1. Initial program 98.3%

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

    if 2.00000000000000003e306 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 62.4%

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \color{blue}{\frac{z \cdot t}{a}} \]
      3. add-sqr-sqrt30.5%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\sqrt{z \cdot z}} \cdot t}{a} \]
      5. sqr-neg60.4%

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\color{blue}{\left(-z\right)} \cdot t}{a} \]
      8. add-sqr-sqrt16.7%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\left(-\color{blue}{\sqrt{z \cdot z}}\right) \cdot t}{a} \]
      10. sqr-neg50.9%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right) \cdot t}{a} \]
      12. add-sqr-sqrt71.4%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{\left(-\color{blue}{\left(-z\right)}\right) \cdot t}{a} \]
      13. distribute-lft-neg-in71.4%

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

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{-\color{blue}{t \cdot \left(-z\right)}}{a} \]
      15. distribute-rgt-neg-out71.4%

        \[\leadsto \frac{x}{\frac{a}{y}} - \frac{-\color{blue}{\left(-t \cdot z\right)}}{a} \]
      16. remove-double-neg71.4%

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

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

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

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

Alternative 9: 94.7% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\ [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -\infty:\\ \;\;\;\;\frac{y}{\frac{a}{x}}\\ \mathbf{elif}\;x \cdot y \leq 10^{+273}:\\ \;\;\;\;\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) (- INFINITY))
   (/ y (/ a x))
   (if (<= (* x y) 1e+273) (/ (- (* 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) <= -((double) INFINITY)) {
		tmp = y / (a / x);
	} else if ((x * y) <= 1e+273) {
		tmp = ((x * y) - (z * t)) / a;
	} else {
		tmp = y * (x / a);
	}
	return tmp;
}
assert x < y && y < z && z < t && t < a;
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((x * y) <= -Double.POSITIVE_INFINITY) {
		tmp = y / (a / x);
	} else if ((x * y) <= 1e+273) {
		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) <= -math.inf:
		tmp = y / (a / x)
	elif (x * y) <= 1e+273:
		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) <= Float64(-Inf))
		tmp = Float64(y / Float64(a / x));
	elseif (Float64(x * y) <= 1e+273)
		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) <= -Inf)
		tmp = y / (a / x);
	elseif ((x * y) <= 1e+273)
		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], (-Infinity)], N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+273], 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 -\infty:\\
\;\;\;\;\frac{y}{\frac{a}{x}}\\

\mathbf{elif}\;x \cdot y \leq 10^{+273}:\\
\;\;\;\;\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) < -inf.0

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 x y) < 9.99999999999999945e272

    1. Initial program 94.9%

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

    if 9.99999999999999945e272 < (*.f64 x y)

    1. Initial program 70.1%

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.25000000000000012e216

    1. Initial program 91.8%

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

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

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

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

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

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

    if -2.25000000000000012e216 < x

    1. Initial program 91.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{+216}:\\ \;\;\;\;\frac{x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 50.6% 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 91.2%

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

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

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

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

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

Alternative 12: 50.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])\\ \\ 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 91.2%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{a}{y}}} \]
    3. *-commutative49.8%

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

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

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

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

Alternative 13: 50.3% 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 91.2%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{\frac{a}{y}}} \]
  8. Final simplification50.2%

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

Developer target: 91.5% 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 2024027 
(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))