Use the C library version of log10() instead of the inaccurate formula
log10(x) = log10e * log(x). The formula would work if the RHS were evaluated in extended precision with an extended precision log(). This actually happened with the i387 log() because it returns excess precision. Found by: ucbtest
This commit is contained in:
parent
72d8d94d6f
commit
799e5901b3
@ -1,7 +1,5 @@
|
||||
#include "f2c.h"
|
||||
|
||||
#define log10e 0.43429448190325182765
|
||||
|
||||
#ifdef KR_headers
|
||||
double log();
|
||||
double r_lg10(x) real *x;
|
||||
@ -11,5 +9,5 @@ double r_lg10(x) real *x;
|
||||
double r_lg10(real *x)
|
||||
#endif
|
||||
{
|
||||
return( log10e * log(*x) );
|
||||
return( log10(*x) );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user