{"id":27949226,"url":"https://github.com/skailasa/pyinvsqrt","last_synced_at":"2026-05-03T05:41:35.855Z","repository":{"id":53769217,"uuid":"347617383","full_name":"skailasa/pyinvsqrt","owner":"skailasa","description":"Quake 3 Fast Inverse Square Root in Python","archived":false,"fork":false,"pushed_at":"2021-03-15T09:12:44.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T15:28:43.579Z","etag":null,"topics":["bit-manipulation","fast-inverse-square-root","hpc","python3","quake-3"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skailasa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-14T11:26:19.000Z","updated_at":"2024-08-04T22:17:56.000Z","dependencies_parsed_at":"2022-09-03T00:02:12.654Z","dependency_job_id":null,"html_url":"https://github.com/skailasa/pyinvsqrt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/skailasa/pyinvsqrt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skailasa%2Fpyinvsqrt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skailasa%2Fpyinvsqrt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skailasa%2Fpyinvsqrt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skailasa%2Fpyinvsqrt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skailasa","download_url":"https://codeload.github.com/skailasa/pyinvsqrt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skailasa%2Fpyinvsqrt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32559716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T03:21:47.309Z","status":"ssl_error","status_checked_at":"2026-05-03T03:21:43.884Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bit-manipulation","fast-inverse-square-root","hpc","python3","quake-3"],"created_at":"2025-05-07T15:20:40.867Z","updated_at":"2026-05-03T05:41:35.841Z","avatar_url":"https://github.com/skailasa.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align='center'\u003e Fast Inverse Square Root in Python \u003c/h1\u003e\n\n[![Anaconda-Server Badge](https://img.shields.io/conda/v/skailasa/pyinvsqrt.svg)](https://anaconda.org/skailasa/pyinvsqrt) [![Anaconda-Server Badge](https://anaconda.org/skailasa/pyinvsqrt/badges/platforms.svg)](https://anaconda.org/skailasa/pyinvsqrt) [![Anaconda-Server Badge](https://anaconda.org/skailasa/pyinvsqrt/badges/latest_release_date.svg)](https://anaconda.org/skailasa/pyinvsqrt)\n\nMade (in)famous by the original implementation in the Quake 3 Arena source code, where fast inverse square roots are vital for perfoming vector operations for game physics, the Fast Inverse Square Root is an extremely clever bit/memory hack, that avoids using slow division instructions, and replaces everything with rapid bit-shifts to calculate an approximation to, f(x) =  \\frac{1}/{\\sqrt{x}}.\n\n## Requirements\n\n- gcc\n- conda/miniconda\n\n## Install\n\n```bash\nconda install -c skailasa pyinvsqrt\n```\n\n## Usage\n\n```python\nimport numpy as np\n\nfrom pyinvsqrt import invsqrt\n\n# Only 32 Bit compatible\nx = np.float32(10)\n\n# Compute inverse square root\ny = invsqrt(x)\n```\n\n## Benchmark\n\nCompared with a pure Numpy (BLAS backend) inverse square root, pyinvqrt is almost 400% faster, and almost 25% compared to a Numba-fied implementation.\n\n![](static/benchmark.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskailasa%2Fpyinvsqrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskailasa%2Fpyinvsqrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskailasa%2Fpyinvsqrt/lists"}