Fast sine/cosine/tangent approximation using fourth degree polynomials
Project description
fasttrig
Requires Numba for optimal performance.
A fast and lightweight approximation of sin, cos, and tan using 4th-degree polynomials.
Unit: radian
Accuracy: Error < 0.001
Important: Numba is required for fasttrig to achieve high performance. Without Numba, performance will be even slower than NumPy. With Numba, the efficiency can be 1.5 to 3.0 times NumPy.
Example
import fasttrig
import numpy as np
x = np.linspace(-np.pi, np.pi, 1000000)
y = fasttrig.sin(x)
c = fasttrig.cos(x)
t = fasttrig.tan(x)
#Scalar
z = fasttrig.sin(1902.0808)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fasttrig-0.1.6.tar.gz.
File metadata
- Download URL: fasttrig-0.1.6.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fd82cfeec86f42da26b60ef885b20d7abb9aca8c3ad507b564043552d5c9d2c
|
|
| MD5 |
4bb604f55a4577257d40fbc4404c72d3
|
|
| BLAKE2b-256 |
201828ba0b785b544c1dd33a38c595e59fc4892701d8d9befbd090243223d9ce
|
File details
Details for the file fasttrig-0.1.6-py3-none-any.whl.
File metadata
- Download URL: fasttrig-0.1.6-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d549b25d1a6d1b6c67549d42df869f2cffafd66a8955a65cc9ca03436036c9d4
|
|
| MD5 |
be3972218ad108cead2019630b0d51c4
|
|
| BLAKE2b-256 |
be150f13e4a1f5b608d7ba3700ae7b5318cdfad27a80c92ee73ddec0d501f2e3
|