Bug 15676 - Benchtest inputs are not representative
Summary: Benchtest inputs are not representative
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: build (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 05:28 UTC by Ondrej Bilka
Modified: 2015-08-27 22:16 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Bilka 2013-06-25 05:28:54 UTC
Now benchtest inputs vary only five values. These inputs are 0.1 0.2 0.3 0.4 0.5. and five worstcase ones.

When we look to math function implementation we see that this is nearly not enough to cover all paths, from  sysdeps/x86_64/fpu/s_sinf.S below there are following cases and as there are no inputs for cases 3 and 5 there may be regression that benchtests cannot catch.

 *  1) if |x| == 0: return x.
 *  2) if |x| <  2^-27: return x-x*DP_SMALL, raise underflow only when needed.
 *  3) if |x| <  2^-5 : return x+x^3*DP_SIN2_0+x^5*DP_SIN2_1.
 *  4) if |x| <   Pi/4: return x+x^3*(S0+x^2*(S1+x^2*(S2+x^2*(S3+x^2*S4)))).
 *  5) if |x| < 9*Pi/4:

A proper way is use randomized inputs to ensure we cover all cases now and everytime when case analysis changes.