Ghost numbers when using ARB

Maybe a very naive question, but when I code something like:

RDD=RealBallField(256)
RDD(3.1)*RDD(2.1)


I obtain:

[6.510000000000000461852778244065128704839826135899304117285652827862296732064351 +/- 9.03e-80]


as the output. Where does all the noise after the 15th digit come from and how could I get rid of it?

Or am I not allowed to increase the accuracy above 53 when using ARB in SageMath?

edit retag close merge delete

Sort by ยป oldest newest most voted

Note that number 3.1 has precision of 53 bits as an element of RDF and this precision is inherited by RDD object. Try this instead:

RDD("3.1")*RDD("2.1")

more

Super! That does the trick :-)

( 2024-02-18 23:17:21 +0200 )edit

Alternative :

sage: RDD(QQ(3.1))*RDD(QQ(2.1))
[6.510000000000000000000000000000000000000000000000000000000000000000000000000 +/- 3.82e-76]


HTH,

( 2024-02-19 10:48:48 +0200 )edit

This is not an answer, but a possible clue that it is a problem of ARB and not the SageMath wrapper.

When I run this code in my IDE:

#include "flint/arb.h"

int main(int argc, char **argv)
{
arb_t a;
arb_init(a);

slong prec;
prec = 256;

arb_set_d(a, 1.1);
arb_printd(a, 40);
printf("  WRONG \n");

arb_set_str(a, "1.1", prec);
arb_printd(a, 40);
printf("  FINE \n");

arb_set_d(a, 1);
arb_printd(a, 40);
printf("  FINE \n");

arb_clear(a);
return 0;
}


I obtain:

1.100000000000000088817841970012523233891 +/- 0  WRONG
1.100000000000000000000000000000000000000 +/- 1.7272e-77  FINE
1.000000000000000000000000000000000000000 +/- 0  FINE


This clearly shows that the issue originates from the "arb_det_d" function when fed with a non-integer value. I will ask about this on the FLINT GitHub issue list.

EDIT: Here is the ARB/Flint thread adequately explaining the observed phenomenon and showing my lack of understanding of what "inexactness" implies: https://github.com/flintlib/flint/iss...

more

1

( 2024-02-18 23:08:48 +0200 )edit