Fix generate_eq with irrational versions

Fixes #595.