"Source: Text/Basics/RngPol.text";
"Line: 920";
"Date: Fri Sep 26 14:29:19 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Basics/RngPol.text, line: 920
// Example: H24E5 ()
print "Example: H24E5";
ei := GetEchoInput();
SetEchoInput(true);
SetSeed(1);
F<x> := PolynomialRing (Integers());
length := 1024; 
p:=NextPrime (2^(Round(length/2)): Proof:=false);
pi:=Pi(RealField());
q:=NextPrime (Round (pi*p): Proof:=false);
N := p*q;
hidden:=220; 
approxq := q+Random(2^hidden-1);
A:=x-approxq;
time perturb:=SmallRoots (A, N, hidden : Bits, Beta:=0.5)[1];
q eq approxq-perturb;
assert $1;
SetEchoInput(ei);
