A transform plan always has positive length.
Recover the executable power-of-two exponent used by the transform loop.
A valid transform length is strictly smaller than its prime modulus.
The transform length is nonzero as a prime-field residue.
The stored inverse-length scale cancels the transform length.
Read a forward twiddle, wrapping the requested exponent into the plan.
Equations
- plan.forwardTwiddle i = plan.forwardTwiddles[i % n]
Instances For
Read an inverse twiddle, wrapping the requested exponent into the plan.
Equations
- plan.inverseTwiddle i = plan.inverseTwiddles[i % n]
Instances For
A forward twiddle is the corresponding wrapped root power.
An inverse twiddle is the corresponding wrapped inverse-root power.
An exact-order transform root is nonzero.
At every recursive radix depth, the effective root raised to half the current transform length is minus one.
Interleave two frequency classes. Equal-length inputs produce the usual even/odd merge; the trailing clauses make the helper total.
Equations
- Hex.ZMod64.Ntt.interleave [] x✝ = x✝
- Hex.ZMod64.Ntt.interleave x✝ [] = x✝
- Hex.ZMod64.Ntt.interleave (x_2 :: xs) (y :: ys) = x_2 :: y :: Hex.ZMod64.Ntt.interleave xs ys
Instances For
Split a list into its even- and odd-indexed entries.
Equations
Instances For
One forward DIF stage over two equal-sized halves.
Equations
Instances For
One inverse DIT stage over two equal-sized recursive results.
Equations
Instances For
Canonical-residue specification of one forward DIF stage.
Equations
Instances For
Canonical-residue specification of one inverse DIT stage.
Equations
Instances For
Evaluating the sum half of a forward DIF stage adds the evaluations of the two input halves.
Evaluating the difference half of a forward DIF stage absorbs its coefficient twiddles into the evaluation point.
Normalizing a raw forward stage gives its residue-level specification.
Normalizing a raw inverse stage gives its residue-level specification.
Inverse stages commute with a common scalar on both halves.
Recursive DIF forward transform. fuel is the remaining radix-two
depth and stride is the root-power stride at this level.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ZMod64.Ntt.forwardGo plan stride 0 x✝ = x✝
Instances For
Recursive DIT inverse transform. Its input is in ordinary DFT order, so the even and odd frequency classes are separated before recursion.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ZMod64.Ntt.inverseGo plan stride 0 x✝ = x✝
Instances For
Residue-level recursive specification of the forward radix-two loop.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ZMod64.Ntt.forwardRadix plan stride 0 x✝ = x✝
Instances For
Residue-level recursive specification of the inverse radix-two loop.
Equations
- One or more equations did not get rendered due to their size.
- Hex.ZMod64.Ntt.inverseRadix plan stride 0 x✝ = x✝
Instances For
Interleaving preserves the combined input length.
The raw forward loop represents its residue-level radix specification at every recursive depth.
The raw inverse loop represents its residue-level radix specification at every recursive depth.
At every recursive depth, the residue-level forward recurrence is the coefficientwise DFT for the effective root at that depth.
The unscaled inverse radix recurrence cancels the forward recurrence and multiplies every coefficient by the transform length.
Residue-level forward result computed by the radix specification.
Equations
- Hex.ZMod64.Ntt.forwardRadixArray plan values = (Hex.ZMod64.Ntt.forwardRadix plan 1 n.log2 values.toList).toArray
Instances For
Residue-level inverse result, including the final n⁻¹ scaling.
Equations
- Hex.ZMod64.Ntt.inverseRadixArray plan values = Array.map (fun (value : Hex.ZMod64 p) => plan.invLength * value) (Hex.ZMod64.Ntt.inverseRadix plan 1 n.log2 values.toList).toArray
Instances For
The residue-level forward array is exactly the coefficientwise DFT.
The scaled residue-level inverse exactly cancels the forward transform on an array of the plan length.
Forward radix-two transform. A length mismatch is normal checked
failure; successful execution reuses every root power from plan.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Inverse radix-two transform, including multiplication by n⁻¹ after
the raw inverse loop.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Successful forward execution is exactly its residue-level radix specification.
Successful inverse execution is exactly its residue-level radix specification.
On an array of the plan length, public forward execution followed by public inverse execution returns the original array.