Peter Bruin on Tue, 01 Apr 2014 14:15:55 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

precision in roots()


Hello,

It seems that the PARI library function corresponding to polroots(),

GEN roots(GEN pol, long prec)

uses a mix of the parameter prec and the current GP precision:

gp > f = x^2 + 1;
gp > install(roots, "GL")
gp > roots(f, 2)
%3 = [0.E-19 - 1.0000000000000000000*I, 0.E-19 + 1.0000000000000000000*I]~
gp > roots(f, 4)
%4 = [0.E-38 - 1.0000000000000000000000000000000000000*I, 0.E-38 + 1.0000000000000000000000000000000000000*I]~
gp > roots(f, 8)
%5 = [0.E-115 - 1.0000000000000000000000000000000000000*I, 0.E-115 + 1.0000000000000000000000000000000000000*I]~
gp > \p96
   realprecision = 96 significant digits
gp > roots(f, 8)
%6 = [0.E-115 - 1.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*I, 0.E-115 + 1.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*I]~

In result %5, the real part does reflect the precision parameter, but
the imaginary part seems to be limited by the GP precision.  Is this
intended?  (It also affects nfinit(), bnfinit() etc.)

Thanks,

Peter