Bill Allombert on Wed, 26 May 2010 00:50:06 +0200

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

Re: setseriesprecision in library mode

On Tue, May 25, 2010 at 06:22:05PM -0400, Mike McLendon wrote:
> Hi,
> I'm using the PARI library and would like to increase the series
> precision.  I see that there is a prototype of a function called
> "setseriesprecision" in the paridecl.h header file under the
> /*default.c*/ comment.  However, the "default.c" source code file does
> not implement the "setseriesprecision" function.  (Though it does
> implement the "getrealprecision" and "setrealprecision" functions,
> both of which I can use in my code.)  I'm using pari-2.3.5 (stable).

Yes, you can change the global variable precdl.
This is more or less documented in the file
(If you compile default(seriesprecision,30); with GP2C, you get
precdl = 30;)

I recorded this error in paridecl.h, thanks.

> I would like to increase the series precision so that functions like
> tan(x) are more accurate when using the "gtopoly" function to convert
> the series to a poly and then the "gsubstr" function to evalute the
> poly at specific values.  Perhaps the is also another way to do this?
> Any help would be appreciated.  Thanks!

Well, another way would be to convert your polynomial to a series with
the right precision before calling gtan(x), for example:
gtan(poltoser(x,varn(x),n)) where is the precision you want.