FLINT3.7.0-dev

dlog_bsgs_init

Synopsis#include <flint/dlog.h>
ulong dlog_bsgs_init(dlog_bsgs_t t, ulong a, ulong mod, ulong n, ulong m)source

Initialises tt with the mm baby steps a0,…,am−1a^0, \ldots, a^{m-1} (or nn if m>nm > n), sorted by value, for a base of order nn. Returns the number of giant steps ⌊n/m⌋+1\lfloor n/m \rfloor + 1, the worst-case cost of one logarithm. For kk logarithms, m≈knm \approx \sqrt{kn} minimises the total cost.

Cite this page

The FLINT team, “dlog_bsgs_init (dlog.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dlog/dlog_bsgs_init.html (generated 2026-11-02).