Phi in sixteen bits

You will learn

How a spec checks that GF16 keeps phi, phi^2 = phi + 1 and phi^2 + 1/phi^2 = 3 within a stated tolerance.

A format is only as good as the identities it keeps. gf_competitive.t27 holds five checks: phi stored in GF16 against its true value, phi^2 against phi + 1, the sum phi^2 + 1/phi^2 against 3, a round trip, and a sum of 1000 terms. Read them as they are: the values in each test are written into the test, not produced by an encoder in this spec. The spec checks the arithmetic of the error, with tolerances of 1e-4 and 5e-3.

Open the interactive lesson →