John Cremona on Mon, 19 Jul 2010 14:34:23 +0200


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

precision issue


Dear pari-dev,

Consider the following (using a recent svn on a 64-bit machine):

? D = -37*4
%1 = -148
? tau = (2+sqrt(D))/4
%2 = 1/2 + 3.0413812651491098444998421226010335310*I
? ellj(tau)
%3 = -199147904.00096667436353951991474362130 + 4.733165431326070833 E-30*I
? real(ellj(tau))
%4 = -199147904.00096667436353951991474362130
? precision(real(ellj(tau)))
%5 = 38
? precision(imag(ellj(tau)))
%6 = 19
? real(tau)
%7 = 1/2
? precision(real(tau))
%8 = 9223372036854775807
? precision(imag(tau))
%9 = 38

I don't like the way that j(tau)'s imaginary part only has half the
precision of the real part.  Since tau is known to have real part
*exactly* 1/2 we know that j(tau) is real, so could we not set the
imaginary par of the returned value to exact 0?  (similarly when
Re(tau)=0).  This must be quite a common special case.

And secondly, why that bizarre value for precision(real(tau))?  I even get

? precision(0)
%12 = 9223372036854775807

while looks like a bug since I thought that exact objects had precision 0.

John