Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perazz/fastmath
A Modern Fortran library for fast, approximate math functions
https://github.com/perazz/fastmath
exponential fast-math fortran logarithm rsqrt
Last synced: about 4 hours ago
JSON representation
A Modern Fortran library for fast, approximate math functions
- Host: GitHub
- URL: https://github.com/perazz/fastmath
- Owner: perazz
- License: mit
- Created: 2022-10-25T08:10:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-22T10:04:15.000Z (about 2 years ago)
- Last Synced: 2024-01-29T14:18:10.449Z (12 months ago)
- Topics: exponential, fast-math, fortran, logarithm, rsqrt
- Language: Fortran
- Homepage:
- Size: 12.7 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastmath
This is a Modern Fortran library for fast, approximate math functions: `exp`, `log`, `1/sqrt`.
These functions provide fast, approximate evaluations of the exponential, logarithm and normalization functions in 64-bit precision.
A detailed explanation of the underlying math with the IEEE-754 representation is reported in ref [1].
For each function, a module is provided; the interface has both simple functions and a programmable object-oriented wrapper.
References
==========This code is released under MIT license; please cite the following reference whenever using it.
[1] F. Perini, R.D. Reitz, "Fast approximations of exponential and logarithm functions combined with efficient storage/retrieval for combustion kinetics calculations" Combustion and Flame 194(2018), 37-51.
Building, using
===============An automated build is not available yet.
- `src/fast_exp.f90` contains the exponential routines
- `src/fast_log.f90` contains the logarithm routines
- `src/fast_rsqrt.f90` contains the 1/sqrt(x) routines.
- `test/test.f90` is the test driver programEach module has no external dependencies, they can also be used individually.
A simple command line build script is:
```
gfortran src/fast_exp.f90 src/fast_log.f90 src/fast_rsqrt.f90 test/test.f90 -o fastmath_test.exe
```A simple makefile for the GNU compiler suite is provided in folder `project`; to run it:
```
cd project/
make -f makefile.gcc
```The testing executable compares performance and accuracy wrt the compiler's intrinsics functions.