These algorithms were mentioned in a paper by Prof E J Weldon Jr (University of Hawaii) around 1987 for DAT tape drives that used RS(32,26) code. I created a document based on this in Jan 1988. I have the book Error Correcting Codes by Peterson and Weldon, second edition (1972, first edition 1961), but it doesn't include these algorithms. I'm looking for a currently available reference.
Note these methods only work for $GF(2^n)$, as they rely on cancellation of equal terms when summed.
Quadratic, $x^2 + ax + b$, with roots $R, S$ to be determined. Define $z$: $x = az$, this results in $z^2 + z + b/a^2$. For software, a $(2^n)$ entry table, or for hardware, a linear mapping using a $n$ row by $n$ bit matrix, except that only the non-zero bits are used for mapping in hardware, and invalid input is handled by separate circuitry. Either method produces one of the roots $R$, the other root is $S = R+a$.
Cubic $x^3 + ax^2 + bx + c$, with roots $R, S, T$ to be determined. The comments in the example code below include exception handling.
$x = t+a$ | leads to:
$t^3 + (aa+b)t + (ab+c)$.
$d = aa+b$, $e = ab+c$
$t^3 + dt + e$
$t = u + d/u$ | leads to:
$u^3 + e + d^3/u^3$ | multiply by $u^3$
$u^6 + eu^3 + d^3$
$u^3 = v$ | leads to:
$v^2 + ev + d^3$
$v = ew$
$w =$ root of $w^2 + w + d^3/e^2$ | table or map
$u = \sqrt[3]{ew}$ | table
$t = u + d/u$
$R = t + a$ | first root
$R^3 + aR^2 + bR + c = 0$ | divide by R
$R^2 + aR + b = c/R$
$(x^3 + ax^2 + bx + c) / (x + R)$
$x^2 + (R+a)x + (R^2+aR+b)$ | remainder $(R^3+aR^2+bR+c) = 0$
$x^2 + (R+a)x + c/R$
$t = (R+a)$, $g = c/R$
$x^2 + tx + g$
$x = ty$ | leads to:
$y^2 + y + g/t^2$
$y, y+1$ are roots of $y^2 + y + g/t^2$ | table or map
$S = ty$ | second root
$T = S+t$ | third root
The example working code below is from Jan 1988.
/*----------------------------------------------------------------------*/
/* Quad - solve x^2 + ax + b */
/* x = az: z^2 + z + (b/a^2) */
/*----------------------------------------------------------------------*/
static int Quad()
{
if(!b){ /* if zero root */
R = 0;
S = a;
return(1);}
if(!a){ /* if double root */
S = R = iz2[b];
if(!R)
return(0);
return(1);}
d = z2z[GFDiv(b,z2[a])]; /* d=root of z^2+z+(b/a^2) */
if(!d)
return(0);
R = GFMpy(a,d);
S = R^a;
return(1);
}
/----------------------------------------------------------------------/
/* Cube - solve x^3 + ax^2 + bx + c /
/----------------------------------------------------------------------/
static int Cube()
{
if(!c){ / if(c==0) use Quad() /
if(!Quad())
return(0);
T = S;
S = R;
R = 0;
return(1);
}
/ x = t + a /
/ t^3 + aa+b t + ab+c /
/ t^3 + d t + e /
e = GFMpy(a,b)^c; / e = (ab)+c /
if(!e){ / if double root /
R = a; / R = a /
T = S = iz2[b]; / S = T = sqrt(b) /
if(!S) / fail if no roots /
return(0);
return(1);}
d = z2[a]^b; / d = (aa)+b /
if(!d){ / if(d==0), t=e^(1/3) /
t = iz3[e];
if(!t) / fail if no roots /
return(0);
goto c0;}
/ t = u + d/u /
/ u^3 + e + d^3/u^3 /
/ u^6 + e u^3 + d^3 /
/ u^3 = v /
/ v^2 + e v + d^3 /
/ v = ew /
/ e^2 w^2 + e^2 w + d^3 /
/ w^2 + w + d^3/e^2 /
w = z2z[GFDiv(z3[d],z2[e])]; / w = root of w^2+w+(d^3/e^2) /
if(!w) / fail if no roots /
return(0);
u = iz3[GFMpy(e,w)]; / u = cube root of (ew) /
if(!u) / fail if no roots /
return(0);
t = u^GFDiv(d,u); / t = u + d/u = R + a /
c0: R = t^a; / R = 1st root /
/ (x^3 + ax^2 + bx + c) / (x + R) /
/ x^2 + (R+a)x + (R^2+aR+b) = 0 /
/ (R^3 + aR^2 + bR + c)/R = 0 /
/ (R^2 + aR + b) = c/R /
/ x^2 + (R+a)x + c/R = 0 /
/ x^2 + f x + g = 0 /
/ x^2 + t x + g = 0 /
/ x = ty /
/ y^2 + y + g/t^2 = 0 /
g = GFDiv(c,R); / g = c/R /
y = z2z[GFDiv(g,z2[t])]; / y, y+1 = root of z^2+z+(g/t^2) /
S = GFMpy(y,t); / S = 2nd root /
T = S^t; / T = 3rd root */
return(1);
}