Skip to content

Commit 32676a3

Browse files
Update README.md
1 parent c7c94fd commit 32676a3

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
# fath
2-
SIMD-Capable fast approximate math library written in Rust
2+
### Fa(st ma)th library written in Rust, built for speed.
3+
--------------------
4+
5+
Most of the functions in here are faster than equivalent functions in sleef, at the expense of safety. This library heavily relies on unsafe and nightly features. Use at your own risk.
6+
When using SIMD functions in this package, compile with LTO and `opt-level=3` to ensure that auto-vectorization takes place. All SIMD functions have a feature cap at AVX2, and nothing in this library utilizes anything from AVX512. If certain functions vectorize on lower requirements, that's a bonus.
7+
8+
(TODO: add comparison to sleef_rs)
9+
10+
## Currently Implemented Functions
11+
**Approximate `f32` Functions:**
12+
13+
Allows setting a variable precision level as a `const` generic.
14+
* `sin` and `cos`
15+
* Does include wrapping with a range reduction, but will become less accurate as the input gets larger.
16+
* `log` (`const` base and variable base)
17+
* This is based on a log base 2 approximation, and is scaled for other bases. The fastest version of this is `const` base 2.0.
18+
19+
**Exact Unsigned Integer Functions:**
20+
* `ilog` with `const` base
21+
* Has multiple implementations depending on the base to achieve maximum performance. The fastest impl is for log base 2.
22+
23+
## Contributing
24+
Any help on the library is greatly appreciated. If you'd like to contribute, just submit a PR and I'll respond to it as soon as I can.
25+
For development, I'd recommend looking at the genertated assembly often. For development of individual functions, I would recommend using a tool like [Compiler Explorer](https://rust.godbolt.org/), and using something like llvm-mca (available in CE under "tools") often to get an idea of performance on different platforms.

0 commit comments

Comments
 (0)