Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/4s4v1n/math
Implementation of some functions from the standard library <math.h>
https://github.com/4s4v1n/math
c math
Last synced: 4 days ago
JSON representation
Implementation of some functions from the standard library <math.h>
- Host: GitHub
- URL: https://github.com/4s4v1n/math
- Owner: 4s4v1n
- License: gpl-3.0
- Created: 2022-04-21T13:56:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-21T17:13:45.000Z (over 2 years ago)
- Last Synced: 2023-10-21T16:21:34.214Z (about 1 year ago)
- Topics: c, math
- Language: C
- Homepage:
- Size: 1.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Math
![math png](./images/math_formuls.png)
This project presents the implementation of some functions of the standard library . Most are implemented using Taylor series and the least squares method. A balance has been chosen regarding the accuracy of the obtained values and the speed of the functions.
## Contents of the library
1) `long double my_sin(double x)` - returns sin(x).
2) `long double my_cos(double x)` - returns cos(x).
3) `long double my_tan(double x)` - returns tan(x).
4) `long int my_abs(int abs)` - returns |x| for long int.
5) `long double my_fabs(double x)` - returns |x| for long doubles.
6) `long double my_atan(double x)` - returns atan(x).
7) `long double my_asin(double x)` - returns asin(x).
8) `long double my_acos(double x)` - returns acos(x).
9) `long double my_floor(double x)` - returns the nearest integer <= x.
10) `long double my_sqrt(double x)` - returns the square root of x.
11) `long double my_log(double x)` - returns ln(x).
12) `long double my_pow(double x, double y)` - returns x^y.
13) `long double my_ceil(double x)` - returns the nearest integer greater than x.
14) `long double my_fmod(double x, double y)` - returns the remainder after dividing x by y.
15) `long double my_exp(double x)` - returns e^x.Additionally, common constants for calculations are set, such as ln2, pi/2, pi, etc.
All source files and makefile are in the src folder. Building is done with gcc version 9.4.0 using a makefile on Linux.