Square root of a polynomial

Use single point evaluation to transform the polynomial square root problem into the integer square root problem. Then find the integer square root and use [Maple Math] to reconstruct the polynomial .

Create a problem from its solution.

> ans := randpoly(x,degree=9,dense,coeffs=rand(10^8));

[Maple Math]
[Maple Math]

> que := sort(expand(ans^2));

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

Bound the coefficients in the answer.

> L := length(maxnorm(que));

[Maple Math]

> M := 10^(iquo(L,2)+1);

[Maple Math]

Convert the polynomial problem to an integer problem.

> queM := subs(x=M,que);

[Maple Math]
[Maple Math]
[Maple Math]

Compute the integer square root. Note that both the input number and the output number to the integer square root procedure contain numbers with more than 16 digits.

> ansM := isqrt(queM);

[Maple Math]
[Maple Math]

Check the integer square root.

> check1 := queM-ansM^2;

[Maple Math]

Convert the integer to a polynomial.

> ans1 := sort(genpoly(ansM,M,x));

[Maple Math]
[Maple Math]

Check the answer.

> check2 := ans-ans1;

[Maple Math]