See Problem 6.18
exr:babystep-giantstep
