Re: Rounding error

2021-09-08 Thread Torbjörn Granlund
Paul Zimmermann  writes:

  Of course you can add say 100 guard bits, then the probability to get an
  incorrect rounding is about 2^-100...

You're joking, but this was sort-of my thinking when designing mpf!

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: Rounding error

2021-09-08 Thread Paul Zimmermann
   Dear Frank,

> If I ever need correct rounding with GMP (I don't ATM), I think
> I could add 0.5e-P, then (like above) multiply by 1eP, convert to
> mpz_t and insert the decimal point manually.

since there is no documented error bound in the mpf computations,
there is no chance that this will (provably) work. The GMP manual says:

  Note that the 'mpf' functions are _not_ intended as a smooth
   extension to IEEE P754 arithmetic.  In particular results obtained on
   one computer often differ from the results on a computer with a
   different word size.

Of course you can add say 100 guard bits, then the probability to get an
incorrect rounding is about 2^-100...

Best regards,
Paul Zimmermann
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs