[FAST486]

Due to some kind of mixup, I thought the series for log(x) was actually for log10(x).
Fix Fast486FpuCalculateLogBase2 by dividing the result with log(2) and not log10(2).


svn path=/trunk/; revision=67841
This commit is contained in:
Aleksandar Andrejevic 2015-05-21 17:27:47 +00:00
parent 1e5d331ec6
commit fe362794c6

View file

@ -1085,8 +1085,8 @@ Fast486FpuCalculateTwoPowerMinusOne(PFAST486_STATE State,
/*
* Calculates using the identities:
* log2(x) = log10(x) / log10(2)
* log10(x)= sum { -1^(n+1) * x^n / n!, n >= 1 }
* log2(x) = ln(x) / ln(2)
* ln(x)= sum { -1^(n+1) * x^n / n!, n >= 1 }
*/
static inline BOOLEAN FASTCALL
Fast486FpuCalculateLogBase2(PFAST486_STATE State,
@ -1144,7 +1144,7 @@ Fast486FpuCalculateLogBase2(PFAST486_STATE State,
/* Subtract one from the value */
if (!Fast486FpuSubtract(State, &Value, &FpuOne, &Value)) return FALSE;
/* Calculate the base 10 logarithm */
/* Calculate the natural logarithm */
SeriesElement = TempResult = Value;
for (i = 2; i < INVERSE_NUMBERS_COUNT / 2; i++)
@ -1173,8 +1173,8 @@ Fast486FpuCalculateLogBase2(PFAST486_STATE State,
}
}
/* Now convert the base 10 logarithm into a base 2 logarithm */
if (!Fast486FpuDivide(State, &TempResult, &FpuLgTwo, &TempResult)) return FALSE;
/* Now convert the natural logarithm into a base 2 logarithm */
if (!Fast486FpuDivide(State, &TempResult, &FpuLnTwo, &TempResult)) return FALSE;
/*
* Add the exponent to the result