[Beignet] pow(n), erf(c), tgamma give wrong results

Rebecca N. Palmer rebecca_palmer at zoho.com
Tue Nov 4 14:42:48 PST 2014


In current beignet (commit 4caba11ce88b3c1ec80ee119ceaf4bf778b96471):
-pow/pown ignore the sign of their first argument (e.g. pow(-2,3) gives
8 instead of -8)
-erf/erfc diverge (instead of converging to 1 or 0) for arguments above
about 2
-tgamma is actually lgamma, a related but very different function

The test suite doesn't detect these problems because the erf/erfc and 
pow tests are disabled by default (in the case of pow, due to an 
unrelated bug in the test), and the tgamma test checks it against libc's 
gammaf, which is also lgamma, instead of tgammaf.

My patch against 0.9.3, fixing all the above and re-enabling the tests, 
is at 
https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=Fix-pow-erf-tgamma.patch;att=3;bug=768090 
but will need some adjustment for HEAD (the relevant parts of 
backend/src/ocl_stdlib.tmpl.h are now in 
backend/src/libocl/tmpl/ocl_math.tmpl.cl).

This patch contains LGPL2.1+ code from glibc ( 
http://sources.debian.net/src/glibc/2.19-12/sysdeps/ieee754/flt-32/s_erff.c/ 
); is that permitted here?  (Beignet's COPYING file is LGPL2.1 , the 
project website says LGPL2+, and the file headers say "Lesser GPL v2+" 
(2.1 was the first version to be called Lesser, rather than Library, GPL).)



More information about the Beignet mailing list