Hi!
I tested my implementation of some math function for MAD 0.15 library. And I have found this:
function mad_fixed_t III_requantize(unsigned int value, signed int exp) in layer3.c file
input value=8 exp=-23;
that means 8^(4/3)*2(-5.75) correct?
result obtained by mad_f_todouble(requantized)is
0.297241
but calculator says
8^(4/3)*2^(-5.75)
ans = 0.29730177875068
for Q15 format its means ~2 bits difference.
(0.29730177875068-0.29724100000000)*32768
ans = 1.99159810228230
my Q15 arithmetics gives: 9743/32768=0.29733276367188
(0.29730177875068-0.29733276367188)*32768
ans = -1.01531389788215
-1 bit difference
And total difference between MAD math and my = 3 bits!
Maybe I have to compare my math not with MAD - but with some float point implementation?
On Dec 2, 2003, at 11:00 PM, Grigory A. wrote:
I tested my implementation of some math function for MAD 0.15 library. And I have found this:
function mad_fixed_t III_requantize(unsigned int value, signed int exp) in layer3.c file
input value=8 exp=-23;
that means 8^(4/3)*2(-5.75) correct?
Yes.
result obtained by mad_f_todouble(requantized)is
0.297241
but calculator says
8^(4/3)*2^(-5.75)
ans = 0.29730177875068
Which fixed-point math (FPM_* define) and optimization (OPT_*) settings are you using?
For FPM_INTEL with default optimization, I find III_requantize(8, -23) returns 0x04c1bf82 (0.29730177670717239).
Hello Rob,
Yes you are right. I have switched to FPM_INTEL and result is good. In past I used FPM_DEFAULT. ok - series of new tests are coming. and any way 16 bit - give me only limited accuracy - but calculation is very efficient ... So I going to make two modes: 16 bits calculation and 32 bit for gourmands :).
Thank You for answer.
Thursday, December 4, 2003, 12:26:21 AM, you wrote: RL> On Dec 2, 2003, at 11:00 PM, Grigory A. wrote:
I tested my implementation of some math function for MAD 0.15 library. And I have found this:
function mad_fixed_t III_requantize(unsigned int value, signed int exp) in layer3.c file
input value=8 exp=-23;
that means 8^(4/3)*2(-5.75) correct?
RL> Yes.
result obtained by mad_f_todouble(requantized)is
0.297241
but calculator says
8^(4/3)*2^(-5.75)
ans = 0.29730177875068
RL> Which fixed-point math (FPM_* define) and optimization (OPT_*) settings RL> are you using?
RL> For FPM_INTEL with default optimization, I find III_requantize(8, -23) RL> returns 0x04c1bf82 (0.29730177670717239).