• Home
Name Date Size #Lines LOC

..--

include/03-May-2024-10180

test/03-May-2024-58,46056,672

tools/03-May-2024-1,8121,102

Dir.mkD03-May-20243.5 KiB11679

README.contributorsD03-May-20243.9 KiB7961

cosf.cD03-May-20241.4 KiB6439

erf.cD03-May-20246.1 KiB245205

erf_data.cD03-May-20243.4 KiB8667

erff.cD03-May-20242.6 KiB10566

erff_data.cD03-May-2024517 2312

exp.cD03-May-20245.6 KiB177123

exp2.cD03-May-20244.7 KiB14499

exp2f.cD03-May-20241.8 KiB8153

exp2f_data.cD03-May-20243.7 KiB7966

exp_data.cD03-May-202441.5 KiB1,1211,061

expf.cD03-May-20242.2 KiB9260

log.cD03-May-20244.5 KiB163123

log2.cD03-May-20243.9 KiB142106

log2_data.cD03-May-20247.9 KiB210168

log2f.cD03-May-20242 KiB8150

log2f_data.cD03-May-20241.1 KiB3425

log_data.cD03-May-202420.8 KiB512461

logf.cD03-May-20241.9 KiB8049

logf_data.cD03-May-20241.1 KiB3425

math_config.hD03-May-202411.3 KiB463357

math_err.cD03-May-20241.5 KiB8157

math_errf.cD03-May-20241.5 KiB8157

pow.cD03-May-202411.6 KiB381279

pow_log_data.cD03-May-202410.3 KiB185150

powf.cD03-May-20246 KiB222165

powf_log2_data.cD03-May-20241.4 KiB3526

s_cos.cD03-May-2024145 72

s_cosf.cD03-May-2024146 72

s_exp.cD03-May-2024145 72

s_exp2f.cD03-May-2024147 72

s_exp2f_1u.cD03-May-2024150 72

s_expf.cD03-May-2024146 72

s_expf_1u.cD03-May-2024149 72

s_log.cD03-May-2024145 72

s_logf.cD03-May-2024146 72

s_pow.cD03-May-2024145 72

s_powf.cD03-May-2024146 72

s_sin.cD03-May-2024145 72

s_sinf.cD03-May-2024146 72

sincosf.cD03-May-20241.9 KiB8050

sincosf.hD03-May-20244.2 KiB15496

sincosf_data.cD03-May-20241.6 KiB6450

sinf.cD03-May-20241.5 KiB6842

v_cos.cD03-May-20242.3 KiB9667

v_cosf.cD03-May-20242 KiB8558

v_exp.cD03-May-20243.4 KiB12986

v_exp.hD03-May-2024305 155

v_exp2f.cD03-May-20242.9 KiB11885

v_exp2f_1u.cD03-May-20242 KiB7659

v_exp_data.cD03-May-20247.8 KiB404393

v_expf.cD03-May-20243.2 KiB12390

v_expf_1u.cD03-May-20242.1 KiB8164

v_log.cD03-May-20242.4 KiB10577

v_log.hD03-May-2024352 199

v_log_data.cD03-May-20246.6 KiB159134

v_logf.cD03-May-20241.7 KiB7453

v_math.hD03-May-202411.5 KiB662607

v_pow.cD03-May-2024513 2819

v_powf.cD03-May-20247.3 KiB236200

v_sin.cD03-May-20242.5 KiB10474

v_sinf.cD03-May-20242.1 KiB8962

vn_cos.cD03-May-2024287 136

vn_cosf.cD03-May-2024291 136

vn_exp.cD03-May-2024287 136

vn_exp2f.cD03-May-2024295 136

vn_exp2f_1u.cD03-May-2024240 125

vn_expf.cD03-May-2024291 136

vn_expf_1u.cD03-May-2024238 125

vn_log.cD03-May-2024287 136

vn_logf.cD03-May-2024291 136

vn_pow.cD03-May-2024288 136

vn_powf.cD03-May-2024292 136

vn_sin.cD03-May-2024287 136

vn_sinf.cD03-May-2024291 136

README.contributors

1STYLE REQUIREMENTS
2==================
3
41. Most code in this sub-directory is expected to be upstreamed into glibc so
5   the GNU Coding Standard and glibc specific conventions should be followed
6   to ease upstreaming.
7
82. ABI and symbols: the code should be written so it is suitable for inclusion
9   into a libc with minimal changes. This e.g. means that internal symbols
10   should be hidden and in the implementation reserved namespace according to
11   ISO C and POSIX rules. If possible the built shared libraries and static
12   library archives should be usable to override libc symbols at link time (or
13   at runtime via LD_PRELOAD). This requires the symbols to follow the glibc ABI
14   (other than symbol versioning), this cannot be done reliably for static
15   linking so this is a best effort requirement.
16
173. API: include headers should be suitable for benchmarking and testing code
18   and should not conflict with libc headers.
19
20
21CONTRIBUTION GUIDELINES FOR math SUB-DIRECTORY
22==============================================
23
241. Math functions have quality and performance requirements.
25
262. Quality:
27   - Worst-case ULP error should be small in the entire input domain (for most
28     common double precision scalar functions the target is < 0.66 ULP error,
29     and < 1 ULP for single precision, even performance optimized function
30     variant should not have > 5 ULP error if the goal is to be a drop in
31     replacement for a standard math function), this should be tested
32     statistically (or on all inputs if possible in reasonable amount of time).
33     The ulp tool is for this and runulp.sh should be updated for new functions.
34
35   - All standard rounding modes need to be supported but in non-default rounding
36     modes the quality requirement can be relaxed. (Non-nearest rounded
37     computation can be slow and inaccurate but has to be correct for conformance
38     reasons.)
39
40   - Special cases and error handling need to follow ISO C Annex F requirements,
41     POSIX requirements, IEEE 754-2008 requirements and Glibc requiremnts:
42     https://www.gnu.org/software/libc/manual/html_mono/libc.html#Errors-in-Math-Functions
43     this should be tested by direct tests (glibc test system may be used for it).
44
45   - Error handling code should be decoupled from the approximation code as much
46     as possible. (There are helper functions, these take care of errno as well
47     as exception raising.)
48
49   - Vector math code does not need to work in non-nearest rounding mode and error
50     handling side effects need not happen (fenv exceptions and errno), but the
51     result should be correct (within quality requirements, which are lower for
52     vector code than for scalar code).
53
54   - Error bounds of the approximation should be clearly documented.
55
56   - The code should build and pass tests on arm, aarch64 and x86_64 GNU linux
57     systems. (Routines and features can be disabled on specific targets, but
58     the build must complete). On aarch64, both little- and big-endian targets
59     are supported as well as valid combinations of architecture extensions.
60     The configurations that should be tested depend on the contribution.
61
623. Performance:
63   - Common math code should be benchmarked on modern aarch64 microarchitectures
64     over typical inputs.
65
66   - Performance improvements should be documented (relative numbers can be
67     published; it is enough to use the mathbench microbenchmark tool which should
68     be updated for new functions).
69
70   - Attention should be paid to the compilation flags: for aarch64 fma
71     contraction should be on and math errno turned off so some builtins can be
72     inlined.
73
74   - The code should be reasonably performant on x86_64 too, e.g. some rounding
75     instructions and fma may not be available on x86_64, such builtins turn into
76     libc calls with slow code. Such slowdown is not acceptable, a faster fallback
77     should be present: glibc and bionic use the same code on all targets. (This
78     does not apply to vector math code).
79