Bug 31426 - log10( 10^n ) poor accuracy in bin80 datatype, log10l( 1E+07l ) -> 7.000000000000000000434...
Summary: log10( 10^n ) poor accuracy in bin80 datatype, log10l( 1E+07l ) -> 7.00000000...
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-28 11:32 UTC by b.
Modified: 2024-02-28 12:49 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Snippet demonstrating log10l imprecision. (276 bytes, text/x-csrc)
2024-02-28 11:32 UTC, b.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description b. 2024-02-28 11:32:09 UTC
Created attachment 15381 [details]
Snippet demonstrating log10l imprecision.

hello @all,  
 
quite sure you'll tell me it's not a bug but the 'feature of imprecision' in bin-FP-math :-( 
 
log10l( 1E+07l ) produces 7.000000000000000000434..., while 
logl( 1E+07l ) / logl( 10.0l ) would hold with 7.0, 
 
Same as with pow10s, having them exact at integral powers of ten 
would help to form a reliable grid of stable points, and 
find better ways for correct rounding, which 
would help for better math. 
 
Thus if possible to improve without messing other points I'd 
appreciate, if not I'd like some explanation why and which 
calculation path is taken / preferred, and a code pointer to 
have a look myself. 
 
'Me bad' is always an option, tried to evaluate and present 
with best intention and skills available. 
 
If 'notabug' pls. leave open or unconfirmed as hook for others 
who at some time in the future might have a good idea.
Comment 1 Andreas Schwab 2024-02-28 11:49:18 UTC
7.000000000000000000434 is still within 1 ULP.
Comment 2 b. 2024-02-28 12:49:38 UTC
@Andreas Schwab: 
 
thanks for the hint, it's 1 ULP off! 
 
add. observations: 
for 4933 positive integral powers of ten 
log10l has 1 ULP devia in 1730 cases, 
logl( 10^n ) / logl( 10 ) has 1 ULP devia in 486 cases, 
for 4950 negative integral powers of ten 
log10l has 1 ULP devia in 1745 cases, 
logl( 10^n ) / logl( 10 ) has 1 ULP devia in 501 cases, 
all these devias can be neutralized with simple recheck 
calculations, if! integral powers of ten are exact. #28474.