diff options
author | Gregory Maxwell <greg@xiph.org> | 2013-07-15 15:51:24 -0700 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2013-07-15 15:51:24 -0700 |
commit | 5280c71883e4a2d072d6f69ab7c9b6dc7ace66dc (patch) | |
tree | 71052cb37fb1bcc0d9778131f21b836e0acbcb55 /celt/tests | |
parent | 4effd308828dd6bbbd1ad210c63d6518161b640d (diff) | |
download | opus-5280c71883e4a2d072d6f69ab7c9b6dc7ace66dc.tar.gz |
Revert "Fixes a number of double promotions and missing casts."
This reverts commit 43279728cd39947f95dbf77557a0a698f164fdd1.
Diffstat (limited to 'celt/tests')
-rw-r--r-- | celt/tests/test_unit_mathops.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/celt/tests/test_unit_mathops.c b/celt/tests/test_unit_mathops.c index cdc201a1..4bb780e6 100644 --- a/celt/tests/test_unit_mathops.c +++ b/celt/tests/test_unit_mathops.c @@ -65,11 +65,11 @@ void testdiv(void) opus_val32 val; val = celt_rcp(i); #ifdef FIXED_POINT - prod = (1.f/32768.f/65526.f)*val*i; + prod = (1./32768./65526.)*val*i; #else prod = val*i; #endif - if (fabs(prod-1) > .00025f) + if (fabs(prod-1) > .00025) { fprintf (stderr, "div failed: 1/%d="WORD" (product = %f)\n", i, val, prod); ret = 1; @@ -86,7 +86,7 @@ void testsqrt(void) opus_val16 val; val = celt_sqrt(i); ratio = val/sqrt(i); - if (fabs(ratio - 1) > .0005f && fabs(val-sqrt(i)) > 2) + if (fabs(ratio - 1) > .0005 && fabs(val-sqrt(i)) > 2) { fprintf (stderr, "sqrt failed: sqrt(%d)="WORD" (ratio = %f)\n", i, val, ratio); ret = 1; @@ -152,10 +152,10 @@ void testbitexactlog2tan(void) void testlog2(void) { float x; - for (x=0.001f;x<1677700.0f;x+=(x/8.0f)) + for (x=0.001;x<1677700.0;x+=(x/8.0)) { float error = fabs((1.442695040888963387*log(x))-celt_log2(x)); - if (error>0.0009f) + if (error>0.0009) { fprintf (stderr, "celt_log2 failed: fabs((1.442695040888963387*log(x))-celt_log2(x))>0.001 (x = %f, error = %f)\n", x,error); ret = 1; @@ -166,10 +166,10 @@ void testlog2(void) void testexp2(void) { float x; - for (x=-11.0f;x<24.0f;x+=0.0007f) + for (x=-11.0;x<24.0;x+=0.0007) { float error = fabs(x-(1.442695040888963387*log(celt_exp2(x)))); - if (error>0.0002f) + if (error>0.0002) { fprintf (stderr, "celt_exp2 failed: fabs(x-(1.442695040888963387*log(celt_exp2(x))))>0.0005 (x = %f, error = %f)\n", x,error); ret = 1; @@ -180,10 +180,10 @@ void testexp2(void) void testexp2log2(void) { float x; - for (x=-11.0f;x<24.0f;x+=0.0007f) + for (x=-11.0;x<24.0;x+=0.0007) { float error = fabs(x-(celt_log2(celt_exp2(x)))); - if (error>0.001f) + if (error>0.001) { fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_log2(celt_exp2(x))))>0.001 (x = %f, error = %f)\n", x,error); ret = 1; @@ -196,8 +196,8 @@ void testlog2(void) opus_val32 x; for (x=8;x<1073741824;x+=(x>>3)) { - float error = fabs((1.442695040888963387*log(x/16384.0f))-celt_log2(x)/1024.0f); - if (error>0.003f) + float error = fabs((1.442695040888963387*log(x/16384.0))-celt_log2(x)/1024.0); + if (error>0.003) { fprintf (stderr, "celt_log2 failed: x = %ld, error = %f\n", (long)x,error); ret = 1; @@ -210,9 +210,9 @@ void testexp2(void) opus_val16 x; for (x=-32768;x<15360;x++) { - float error1 = fabs(x/1024.0f-(1.442695040888963387*log(celt_exp2(x)/65536.0f))); - float error2 = fabs(exp(0.6931471805599453094f*x/1024.0f)-celt_exp2(x)/65536.0f); - if (error1>0.0002f&&error2>0.00004f) + 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); ret = 1; @@ -225,8 +225,8 @@ void testexp2log2(void) opus_val32 x; for (x=8;x<65536;x+=(x>>3)) { - float error = fabs(x-0.25f*celt_exp2(celt_log2(x)))/16384; - if (error>0.004f) + float error = fabs(x-0.25*celt_exp2(celt_log2(x)))/16384; + if (error>0.004) { fprintf (stderr, "celt_log2/celt_exp2 failed: fabs(x-(celt_exp2(celt_log2(x))))>0.001 (x = %ld, error = %f)\n", (long)x,error); ret = 1; |