[libc-commits] [libc] [libc][math] Implement double precision sin correctly rounded to all rounding modes. (PR #95736)

via libc-commits libc-commits at lists.llvm.org
Sun Jun 16 22:20:03 PDT 2024


lntue wrote:

Performance tests with the CORE-MATH project for FMA version:

- **For inputs in `[-pi, pi]`**
Reciprocal Throughput
```
CORE_MATH_PERF_MODE (perf or rdtsc) environment variable is not set. The default is rdtsc.
LIBC-location: /usr/local/google/home/lntue/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.37
GNU libc release: stable
--- CORE-MATH reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 38.193 + 0.560 clc/call; Median-Min = 0.364 clc/call; Max = 40.305 clc/call;
--- System LIBC reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 24.891 + 1.007 clc/call; Median-Min = 0.888 clc/call; Max = 26.638 clc/call;
--- LIBC reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 22.702 + 0.400 clc/call; Median-Min = 0.270 clc/call; Max = 25.537 clc/call;
```
Latency:
```
CORE_MATH_PERF_MODE (perf or rdtsc) environment variable is not set. The default is rdtsc.
LIBC-location: /usr/local/google/home/lntue/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.37
GNU libc release: stable
--- CORE-MATH latency ---
[####################] 100 %
Ntrial = 20 ; Min = 73.839 + 0.949 clc/call; Median-Min = 0.807 clc/call; Max = 75.513 clc/call;
--- System LIBC latency ---
[####################] 100 %
Ntrial = 20 ; Min = 48.495 + 2.750 clc/call; Median-Min = 2.026 clc/call; Max = 53.403 clc/call;
--- LIBC reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 58.582 + 0.534 clc/call; Median-Min = 0.537 clc/call; Max = 59.231 clc/call;
```

- **For inputs ~ 2^100**
Reciprocal Throughput
```
CORE_MATH_PERF_MODE (perf or rdtsc) environment variable is not set. The default is rdtsc.
LIBC-location: /usr/local/google/home/lntue/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.37
GNU libc release: stable
--- CORE-MATH reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 78.974 + 0.237 clc/call; Median-Min = 0.214 clc/call; Max = 81.168 clc/call;
--- System LIBC reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 174.806 + 0.875 clc/call; Median-Min = 0.886 clc/call; Max = 176.161 clc/call;
--- LIBC reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 37.598 + 0.094 clc/call; Median-Min = 0.081 clc/call; Max = 38.052 clc/call;
```
Latency
```
CORE_MATH_PERF_MODE (perf or rdtsc) environment variable is not set. The default is rdtsc.
LIBC-location: /usr/local/google/home/lntue/experiment/llvm/llvm-project/build/projects/libc/lib/libllvmlibc.a
GNU libc version: 2.37
GNU libc release: stable
--- CORE-MATH latency ---
[####################] 100 %
Ntrial = 20 ; Min = 114.356 + 0.779 clc/call; Median-Min = 0.819 clc/call; Max = 115.353 clc/call;
--- System LIBC latency ---
[####################] 100 %
Ntrial = 20 ; Min = 187.295 + 0.258 clc/call; Median-Min = 0.250 clc/call; Max = 189.725 clc/call;
--- LIBC reciprocal throughput ---
[####################] 100 %
Ntrial = 20 ; Min = 85.237 + 0.507 clc/call; Median-Min = 0.521 clc/call; Max = 85.883 clc/call
```

https://github.com/llvm/llvm-project/pull/95736


More information about the libc-commits mailing list