Bill Allombert on Fri, 03 Feb 2023 20:17:42 +0100


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

Re: Fortran Pari precision


On Fri, Feb 03, 2023 at 11:48:05AM +0000, Brereton, Ashley wrote:
> Hi there,
> 
> I was hoping to get some clarification for the precision argument used for pari variables. For the following code snippet:
> 
> ***************
> 
>   use ISO_C_BINDING, only : C_PTR
>   use PARI
> 
> type(C_PTR)        :: u
> integer(kind=C_LONG) :: prec   = 5
> 
> CALL pari_init(10000000_8, 2_8)
> u = Pi2n(1_8, prec)
> 
> *****************
> 
> As far as I can tell, 'prec = 5' gives me precision to higher than quad
> precision. Now I'm limited to prec >=3 , and I'd like to use lower precision
> in some cases.
> 
> Is there a workaround to do lower precision calculations? The reason is there
> are some handy functions that I'd like to use that don't require high
> precision calculations, e.g. complementary error function with complex input.

Alas, the minimal precision is 3, which correspond to 64bit.

Cheers,
Bill