uutzinger / fastmath

fast inverse square root, example for C to Python bindings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fastmath

This was implemented to learn C bindings for python and to experiment with the fast inverse square root function

The fast inverse square root implementation in C is slower than value**-0.5 in Python. There is no speed increase from regular inverse square root to fast inverse square root.

Built with pybind11. This requires Python 3.7+.

Urs Utzinger 2023

Installation

  • clone this repository
  • pip install . or add -e switch to create symbolic links

Test

python
import fastmath
fastmath.invSqrt_fast(4.321)

Also check the tests folder.

About

fast inverse square root, example for C to Python bindings

License:Other


Languages

Language:Python 62.2%Language:C++ 37.8%