Skip to content
Snippets Groups Projects
Commit dac77d13 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Fixes the celt_exp2() test (not the function, the test itself)

Was previously testing only far on the negative side and using
the wrong scaling factor
parent bf6a4e01
No related branches found
No related tags found
No related merge requests found
......@@ -117,13 +117,13 @@ void testlog2(void)
void testexp2(void)
{
opus_val16 x;
for (x=-32768;x<-30720;x++)
for (x=-32768;x<15360;x++)
{
float error1 = fabs(x/2048.0-(1.442695040888963387*log(celt_exp2(x)/65536.0)));
float error2 = fabs(exp(0.6931471805599453094*x/2048.0)-celt_exp2(x)/65536.0);
float error1 = fabs(x/1024.0-(1.442695040888963387*log(celt_exp2(x)/65536.0)));
float error2 = fabs(exp(0.6931471805599453094*x/1024.0)-celt_exp2(x)/65536.0);
if (error1>0.0002&&error2>0.00004)
{
fprintf (stderr, "celt_exp2 failed: x = "WORD", error1 = %f, error2 = %f\n", x,error1,error2);
fprintf (stderr, "celt_exp2 failed: x = "WORD", error1 = %f, error2 = %f\n", x,error1,error2);
ret = 1;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment