Bug#888459: flint-arb's tests fail on 32bit archs using mpfr 4.0.0

2018-02-04 Thread Vincent Lefevre
On 2018-01-26 15:13:53 +0100, Vincent Lefevre wrote:
> It may be a bug in MPFR 4.

This was due to a bug in mpfr_div_ui, fixed in MPFR 4.0.1-rc2.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#888459: flint-arb's tests fail on 32bit archs using mpfr 4.0.0

2018-01-26 Thread Vincent Lefevre
On 2018-01-25 23:43:14 +0100, Matthias Klose wrote:
> the testsuite fails on all 32bit architectures.
[...]
> divFAIL (aliasing 4)!
> prec = 352, rnd = 4
> 
> x =
> (4586997233048136541430758450064474100387735230759824291973833691816938709832156080645343570059119116156929
> * 2^-154742412678922490659733883)
> 
> y =
> (51814976846671518298238808760042830604686502339620382299366747655022166929406808804341858227567903870767891933265103849315791036770763130077955430384829058539908460614800988509303528381975119100503701824233100229972596599113543202092890645352456600459286399836135725531911334505568114757105479020098464557517116791851426250751
> * 2^-154742431125385089392575577)
> 
> v =
> (2135987036418233318920600437589210504846524088997312026086185915310372929010612927677735486095361
> * 2^-154742412678922490659733852)
> 
> r1 = 1, r2 = 1

It may be a bug in MPFR 4.

I've built a 32-bit version on my machine, after adding a few
flint_printf because above, one just has one input and two outputs.

default:
flint_printf("x = "); arf_print(x); flint_printf("\n");
flint_printf("y = "); arf_print(y); flint_printf("\n");
r2 = arf_div_naive(v, y, x, prec, rnd);
flint_printf("v = "); arf_print(v); flint_printf("\n");
r1 = arf_div(x, y, x, prec, rnd);
flint_printf("x = "); arf_print(x); flint_printf("\n\n");
if (!arf_equal(x, v) || r1 != r2)
{
flint_printf("FAIL (aliasing 4)!\n");
flint_printf("prec = %wd, rnd = %d\n\n", prec, rnd);
flint_printf("x = "); arf_print(x); flint_printf("\n\n");
flint_printf("y = "); arf_print(y); flint_printf("\n\n");
flint_printf("v = "); arf_print(v); flint_printf("\n\n");
flint_printf("r1 = %wd, r2 = %wd\n", r1, r2);
flint_abort();
}
break;

I can reproduce the failure:

x = (4294967295 * 2^-18446462598732840995)
y = 
(51814976846671518298238808760042830604686502339620382299366747655022166929406808804341858227567903870767891933265103849315791036770763130077955430384829058539908460614800988509303528381975119100503701824233100229972596599113543202092890645352456600459286399836135725531911334505568114757105479020098464557517116791851426250751
 * 2^-154742431125385089392575577)
v = 
(2135987036418233318920600437589210504846524088997312026086185915310372929010612927677735486095361
 * 2^-154742412678922490659733852)
x = 
(4586997233048136541430758450064474100387735230759824291973833691816938709832156080645343570059119116156929
 * 2^-154742412678922490659733883)

FAIL (aliasing 4)!
prec = 352, rnd = 4

x = 
(4586997233048136541430758450064474100387735230759824291973833691816938709832156080645343570059119116156929
 * 2^-154742412678922490659733883)

y = 
(51814976846671518298238808760042830604686502339620382299366747655022166929406808804341858227567903870767891933265103849315791036770763130077955430384829058539908460614800988509303528381975119100503701824233100229972596599113543202092890645352456600459286399836135725531911334505568114757105479020098464557517116791851426250751
 * 2^-154742431125385089392575577)

v = 
(2135987036418233318920600437589210504846524088997312026086185915310372929010612927677735486095361
 * 2^-154742412678922490659733852)

r1 = 1, r2 = 1

I'm going to look at it more closely.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#888459: flint-arb's tests fail on 32bit archs using mpfr 4.0.0

2018-01-25 Thread Matthias Klose
Package: src:flint-arb
Version: 2.11.1-2
Severity: serious
Tags: sid buster

as seen on
https://release.debian.org/transitions/html/auto-mpfr4.html
https://buildd.debian.org/status/package.php?p=flint-arb

the testsuite fails on all 32bit architectures.

cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/<>=.
-fstack-protector-strong -Wformat -Werror=format-security -I/<>
-I/usr/local/include -I/usr/local/include -I/usr/include test/t-sqrt.c -o
../build/arf/test/t-sqrt -L/<> -L/usr/local/lib -L/usr/local/lib
-L/usr/lib -lflint-arb -lflint -lmpfr -lgmp -lm -lpthread  -MMD -MP -MF
../build/arf/test/t-sqrt.d -MT "../build/arf/test/t-sqrt" -MT
"../build/arf/test/t-sqrt.d"
flooraddmul_uiPASS
cmpabs_2exp_siPASS
addset_round_uirootPASS
add_siPASS
mulPASS
set_fmpqPASS
submul_uiPASS
mul_siPASS
abs_bound_lt_2exp_siPASS
sub_siPASS
get_dPASS
addmul_fmpzPASS
add_uiPASS
frexpPASS
rsqrtPASS
subPASS
cmpabsPASS
set_fmprPASS
set_round_fmpzPASS
mul_uiPASS
abs_bound_lt_2exp_fmpzPASS
sub_uiPASS
set_fmpz_2expPASS
complex_sqrPASS
complex_mulPASS
abs_bound_le_2exp_fmpzPASS
submul_fmpzPASS
divFAIL (aliasing 4)!
prec = 352, rnd = 4

x =
(4586997233048136541430758450064474100387735230759824291973833691816938709832156080645343570059119116156929
* 2^-154742412678922490659733883)

y =
(51814976846671518298238808760042830604686502339620382299366747655022166929406808804341858227567903870767891933265103849315791036770763130077955430384829058539908460614800988509303528381975119100503701824233100229972596599113543202092890645352456600459286399836135725531911334505568114757105479020098464557517116791851426250751
* 2^-154742431125385089392575577)

v =
(2135987036418233318920600437589210504846524088997312026086185915310372929010612927677735486095361
* 2^-154742412678922490659733852)

r1 = 1, r2 = 1
../Makefile.subdirs:84: recipe for target '../build/arf/test/t-div_RUN' failed
make[3]: *** [../build/arf/test/t-div_RUN] Aborted
make[3]: *** Waiting for unfinished jobs
PASS
PASS
PASS
make[3]: Leaving directory '/<>/arf'
Makefile:179: recipe for target 'check' failed
make[2]: *** [check] Error 2
make[2]: Leaving directory '/<>'