Let be a cubic form. This algorithm outputstrueorfalseaccording to whetherFcorresponds to the image of a cubic field by the Davenport-Heilbronn map.

- If
Fis not irreducible, returnfalse.- If
Fis not primitive, returnfalse.- Compute the Hessian by the formulas given. Set , (so ). Using Proposition 3.3, check that and , otherwise return
false.- If for some
p>3, returnfalse.- Set . Remove all powers of 2 and 3 from
t(in fact at most and ), and let againtbe the result. If returnfalse.- If
tis squarefree returntrue, otherwise returnfalse.

Steps 1, 2 and 3 are clear since is irreducible, primitive and belongs to for allp.If , then . If and , we have . It follows in both cases that if

p>3, we have so by Proposition 3.3, thus Steps 4 and 5.Assume that for every prime

p>3, we have and , which is the situation at the beginning of Step 6. Then iftis not squarefree, there existsp>3such that and hence . Sincep>3, it follows that , hence that , denoting by what we called ``f'' in the preceding sections, such that for a fundamental discriminant . But by Proposition 3.4, this means that either , or elseFhas a double root modulopsuch that . Since , by Propostion 3.3 (2), is not of the form , hence must be of the second form which means that as we have seen.On the other hand if

tis squarefree, then for everyp>3we have either , and since and , so , or else , but then by Proposition 3.3 (2), and since we have hence since we have so by Proposition 3.3 (3).This terminates the proof of the algorithm.