llvm-project/libc/docs
Tue Ly 463dcc8749 [libc][math] Implement acosf function correctly rounded for all rounding modes.
Implement acosf function correctly rounded for all rounding modes.

We perform range reduction as follows:

- When `|x| < 2^(-10)`, we use cubic Taylor polynomial:
```
  acos(x) = pi/2 - asin(x) ~ pi/2 - x - x^3 / 6.
```
- When `2^(-10) <= |x| <= 0.5`, we use the same approximation that is used for `asinf(x)` when `|x| <= 0.5`:
```
  acos(x) = pi/2 - asin(x) ~ pi/2 - x - x^3 * P(x^2).
```
- When `0.5 < x <= 1`, we use the double angle formula: `cos(2y) = 1 - 2 * sin^2 (y)` to reduce to:
```
  acos(x) = 2 * asin( sqrt( (1 - x)/2 ) )
```
- When `-1 <= x < -0.5`, we reduce to the positive case above using the formula:
```
  acos(x) = pi - acos(-x)
```

Performance benchmark using perf tool from the CORE-MATH project on Ryzen 1700:
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh acosf
GNU libc version: 2.35
GNU libc release: stable
CORE-MATH reciprocal throughput   : 28.613
System LIBC reciprocal throughput : 29.204
LIBC reciprocal throughput        : 24.271

$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh asinf --latency
GNU libc version: 2.35
GNU libc release: stable
CORE-MATH latency   : 55.554
System LIBC latency : 76.879
LIBC latency        : 62.118
```

Reviewed By: orex, zimmermann6

Differential Revision: https://reviews.llvm.org/D133550
2022-09-09 09:55:30 -04:00
..
_static [libc] Website fixes (sidebar and mobile) 2022-08-08 18:38:01 +00:00
CMakeLists.txt Move LLVM Proposal to doc directory, create index 2022-01-29 00:29:31 +00:00
README.txt Move LLVM Proposal to doc directory, create index 2022-01-29 00:29:31 +00:00
api_test.rst [libc] Rename libc-integration-test to libc-api-test. 2022-03-23 20:25:34 +00:00
build_system.rst
clang_tidy_checks.rst
conf.py [libc] Update look and feel of libc.llvm.org 2022-08-05 18:18:40 +00:00
entrypoints.rst
fuzzing.rst [libc][docs] Update the fuzzing doc to better reflect the current state. 2022-04-20 15:33:20 +00:00
ground_truth_specification.rst
header_gen_scheme.svg
header_generation.rst
implementation_standard.rst
index.rst [libc] Add Buildbot to External Links 2022-09-02 14:11:09 +00:00
layering.rst Rewrite much of the index page for libc 2022-02-16 03:46:20 +00:00
math.rst [libc][math] Implement acosf function correctly rounded for all rounding modes. 2022-09-09 09:55:30 -04:00
mechanics_of_public_api.rst
redirectors.rst Move LLVM Proposal to doc directory, create index 2022-01-29 00:29:31 +00:00
redirectors_schematic.svg
runtimes_build.rst [libc] Add a doc describing the current status of libc runtimes build. 2022-04-18 06:48:43 +00:00
source_layout.rst [libc][docs] Use same formatting for headers in source_layout 2022-05-23 21:47:22 +00:00
stdio.rst [libc][docs] Add doc for libc stdio functions 2022-05-12 13:02:23 -07:00
strings.rst [libc][docs] Add doc for libc stdio functions 2022-05-12 13:02:23 -07:00

README.txt

libc Documentation
==================

The libc documentation is written using the Sphinx documentation generator. It is
currently tested with Sphinx 1.1.3.

To build the documents into html configure libc with the following cmake options:

  * -DLLVM_ENABLE_SPHINX=ON
  * -DLIBC_INCLUDE_DOCS=ON

After configuring libc with these options the make rule `docs-libc-html`
should be available.