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

Percentage Accurate: 91.7% → 96.7%
Time: 7.4s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 91.7% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 56.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000007e306 < (-.f64 (*.f64 x y) (*.f64 z t)) < 9.99999999999999945e193

    1. Initial program 99.1%

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

    if 9.99999999999999945e193 < (-.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 81.1%

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

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

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

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

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

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

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\frac{a}{y}} + \left(-z\right) \cdot \color{blue}{\frac{t}{a}} \]
      15. cancel-sign-sub-inv93.7%

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

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

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

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

    if -4.00000000000000007e306 < (-.f64 (*.f64 x y) (*.f64 z t)) < 4.9999999999999999e202

    1. Initial program 99.1%

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

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

Alternative 3: 74.9% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\ [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;x \cdot y \leq -0.1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 10^{-51}:\\ \;\;\;\;\frac{-t}{\frac{a}{z}}\\ \mathbf{elif}\;x \cdot y \leq 10^{+194}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \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) -0.1)
     t_1
     (if (<= (* x y) 1e-51)
       (/ (- t) (/ a z))
       (if (<= (* x y) 1e+194) (/ (* x y) a) 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) <= -0.1) {
		tmp = t_1;
	} else if ((x * y) <= 1e-51) {
		tmp = -t / (a / z);
	} else if ((x * y) <= 1e+194) {
		tmp = (x * y) / a;
	} 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) <= (-0.1d0)) then
        tmp = t_1
    else if ((x * y) <= 1d-51) then
        tmp = -t / (a / z)
    else if ((x * y) <= 1d+194) then
        tmp = (x * y) / a
    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) <= -0.1) {
		tmp = t_1;
	} else if ((x * y) <= 1e-51) {
		tmp = -t / (a / z);
	} else if ((x * y) <= 1e+194) {
		tmp = (x * y) / a;
	} 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) <= -0.1:
		tmp = t_1
	elif (x * y) <= 1e-51:
		tmp = -t / (a / z)
	elif (x * y) <= 1e+194:
		tmp = (x * y) / a
	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) <= -0.1)
		tmp = t_1;
	elseif (Float64(x * y) <= 1e-51)
		tmp = Float64(Float64(-t) / Float64(a / z));
	elseif (Float64(x * y) <= 1e+194)
		tmp = Float64(Float64(x * y) / a);
	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) <= -0.1)
		tmp = t_1;
	elseif ((x * y) <= 1e-51)
		tmp = -t / (a / z);
	elseif ((x * y) <= 1e+194)
		tmp = (x * y) / a;
	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], -0.1], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-51], N[((-t) / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+194], N[(N[(x * y), $MachinePrecision] / a), $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 -0.1:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 81.0%

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

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

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

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

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

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

    if -0.10000000000000001 < (*.f64 x y) < 1e-51

    1. Initial program 94.7%

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

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

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

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

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

    if 1e-51 < (*.f64 x y) < 9.99999999999999945e193

    1. Initial program 99.5%

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

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

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

Alternative 4: 74.6% 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 -0.1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 10^{-51}:\\ \;\;\;\;\frac{t}{a} \cdot \left(-z\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+194}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \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) -0.1)
     t_1
     (if (<= (* x y) 1e-51)
       (* (/ t a) (- z))
       (if (<= (* x y) 1e+194) (/ (* x y) a) 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) <= -0.1) {
		tmp = t_1;
	} else if ((x * y) <= 1e-51) {
		tmp = (t / a) * -z;
	} else if ((x * y) <= 1e+194) {
		tmp = (x * y) / a;
	} 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) <= (-0.1d0)) then
        tmp = t_1
    else if ((x * y) <= 1d-51) then
        tmp = (t / a) * -z
    else if ((x * y) <= 1d+194) then
        tmp = (x * y) / a
    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) <= -0.1) {
		tmp = t_1;
	} else if ((x * y) <= 1e-51) {
		tmp = (t / a) * -z;
	} else if ((x * y) <= 1e+194) {
		tmp = (x * y) / a;
	} 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) <= -0.1:
		tmp = t_1
	elif (x * y) <= 1e-51:
		tmp = (t / a) * -z
	elif (x * y) <= 1e+194:
		tmp = (x * y) / a
	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) <= -0.1)
		tmp = t_1;
	elseif (Float64(x * y) <= 1e-51)
		tmp = Float64(Float64(t / a) * Float64(-z));
	elseif (Float64(x * y) <= 1e+194)
		tmp = Float64(Float64(x * y) / a);
	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) <= -0.1)
		tmp = t_1;
	elseif ((x * y) <= 1e-51)
		tmp = (t / a) * -z;
	elseif ((x * y) <= 1e+194)
		tmp = (x * y) / a;
	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], -0.1], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-51], N[(N[(t / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+194], N[(N[(x * y), $MachinePrecision] / a), $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 -0.1:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 81.0%

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

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

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

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

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

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

    if -0.10000000000000001 < (*.f64 x y) < 1e-51

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot z}}{a} \]
      3. distribute-lft-neg-out80.5%

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

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

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

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

    if 1e-51 < (*.f64 x y) < 9.99999999999999945e193

    1. Initial program 99.5%

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

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

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

Alternative 5: 75.9% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\\\ [x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\ \\ \begin{array}{l} t_1 := \frac{x}{\frac{a}{y}}\\ \mathbf{if}\;x \cdot y \leq -0.1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 10^{-51}:\\ \;\;\;\;\frac{t \cdot \left(-z\right)}{a}\\ \mathbf{elif}\;x \cdot y \leq 10^{+194}:\\ \;\;\;\;\frac{x \cdot y}{a}\\ \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) -0.1)
     t_1
     (if (<= (* x y) 1e-51)
       (/ (* t (- z)) a)
       (if (<= (* x y) 1e+194) (/ (* x y) a) 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) <= -0.1) {
		tmp = t_1;
	} else if ((x * y) <= 1e-51) {
		tmp = (t * -z) / a;
	} else if ((x * y) <= 1e+194) {
		tmp = (x * y) / a;
	} 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) <= (-0.1d0)) then
        tmp = t_1
    else if ((x * y) <= 1d-51) then
        tmp = (t * -z) / a
    else if ((x * y) <= 1d+194) then
        tmp = (x * y) / a
    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) <= -0.1) {
		tmp = t_1;
	} else if ((x * y) <= 1e-51) {
		tmp = (t * -z) / a;
	} else if ((x * y) <= 1e+194) {
		tmp = (x * y) / a;
	} 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) <= -0.1:
		tmp = t_1
	elif (x * y) <= 1e-51:
		tmp = (t * -z) / a
	elif (x * y) <= 1e+194:
		tmp = (x * y) / a
	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) <= -0.1)
		tmp = t_1;
	elseif (Float64(x * y) <= 1e-51)
		tmp = Float64(Float64(t * Float64(-z)) / a);
	elseif (Float64(x * y) <= 1e+194)
		tmp = Float64(Float64(x * y) / a);
	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) <= -0.1)
		tmp = t_1;
	elseif ((x * y) <= 1e-51)
		tmp = (t * -z) / a;
	elseif ((x * y) <= 1e+194)
		tmp = (x * y) / a;
	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], -0.1], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-51], N[(N[(t * (-z)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+194], N[(N[(x * y), $MachinePrecision] / a), $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 -0.1:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 81.0%

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

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

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

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

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

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

    if -0.10000000000000001 < (*.f64 x y) < 1e-51

    1. Initial program 94.7%

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

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

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

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

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

    if 1e-51 < (*.f64 x y) < 9.99999999999999945e193

    1. Initial program 99.5%

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

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

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

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

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

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


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

    1. Initial program 71.6%

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

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

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

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

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

    if -5.00000000000000037e243 < (*.f64 x y) < 5.0000000000000002e205

    1. Initial program 94.8%

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

    if 5.0000000000000002e205 < (*.f64 x y)

    1. Initial program 75.4%

      \[\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/90.9%

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

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

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

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

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

Alternative 7: 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])\\ \\ 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 89.5%

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

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

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

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

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

Alternative 8: 50.7% accurate, 1.8× speedup?

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

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

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

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

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

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

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

Alternative 9: 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])\\ \\ \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 89.5%

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

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

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

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

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

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

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

Developer target: 91.9% 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 2024036 
(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))