Approximate (non-interval) arithmetic in Nemo

26 views
Skip to first unread message

David Berghaus

unread,
Jan 20, 2020, 6:21:08 AM1/20/20
to nemo-devel
Hi all,

is it possible to use non-interval arithmetic in Nemo in order to avoid too pessimistic rounding?
It is of course possible to always convert arbs to BigFloats if non-rounding operations should be performed. This approach however feels not so convenient and the performance of BigFloats is not that great due to the allocations...

One idea I had was to set the error bounds to zero, however I am unable to achieve this, as "ball(:arb,:arb)" only seems to be working when increasing the error-bounds:
RR = ArbField(precision(BigFloat));
ball
(RR(pi),RR(0))
[3.1415926535897932384626433832795028841971693993751058209749445923078164062862 +/- 1.93e-77]

I also tried the ArbFloats package but I cannot apply this to my problem since it does not contain complex arithmetic and I have to compute Bessel functions.

Best and thanks in advance,
David

Tommy Hofmann

unread,
Jan 20, 2020, 7:09:11 AM1/20/20
to nemo-devel
Hi David,

could you specify what you want to do in Nemo with the non-interval arithmetic? Do you just want to compute Bessel functions using something like Complex{Float64}?

Best wishes,
Tommy

David Berghaus

unread,
Jan 20, 2020, 7:30:56 AM1/20/20
to nemo-devel
Hi Tommy,

Do you just want to compute Bessel functions using something like Complex{Float64}?
No, I actually need the arbitrary precision functionality to get a result with hundreds of digits precision. But I don't need the "guaranteed" correct precision, instead some approximate results (like for example how BigFloats work) would be enough for my application.

I will give you a small summary of what I currently do:

1) I use Nemo for computing several special functions (bessel, sine, ...) at given precision (since Nemo is the fastest library for doing this that I found and mpfr for example is only working for integer bessel functions).

2) I then perform several operations with the computed variables of 1) (like addition, division, etc.). I noticed that during these operations too much precision is lost (i.e. Nemo truncates the terms stricter than it has to, since it has guaranteed error-bounds). For that reason I convert my variables to BigFloats before applying the arithmetic operations in order to keep more precision.

3) I store the results of step 2) as a system of equations which I then solve using the "approx_solve" function of Arblib (i.e. I have to transform the BigFloats back to being arbs).

So what I would like to achieve is to avoid having to convert back to BigFloats in step 2 and instead always keep using arbs but without truncating the results due to their error bounds.

Best,
David

David Berghaus

unread,
Jan 20, 2020, 8:09:28 AM1/20/20
to nemo-devel
Small update:

While I was scrolling the forum I noticed that ArbFloats have been replaced by ArbNumerics which also contain complex arithmetic.
i.e. instead of converting between arbs and BigFloats in step 2), I could perform step 1)+2) using ArbNumerics but I would still have to convert to arbs for step 3) to make use of the faster approx_solve of Arblib, so maybe there is a way to avoid this.

Best,
David

Tommy Hofmann

unread,
Jan 20, 2020, 8:24:16 AM1/20/20
to nemo-devel
I am afraid I cannot help with you that. Maybe Fredrik has an idea on how to do this.

Best,
Tommy
Reply all
Reply to author
Forward
0 new messages