ridiculousfish/libdivide
Official git repository for libdivide: optimized integer division observed · 2026-08-28
Health v2 · maintenance only
78/100
- Activity 98
- Release rhythm 39
- Longevity 100
Flags: no_license
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 386
- age_days: 5482
- days_rel: 198
- days_push: 12
- n_releases_24m: 2
Adoption not part of the score
1348 stars · 98 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
libdivide is a single-header C/C++ library that replaces expensive integer division instructions with precomputed multiply-and-shift sequences, speeding up division by a runtime constant by up to 10x. It also supports SIMD vector division (SSE2, AVX2, AVX512, NEON, SVE) and runs on 8-bit microcontrollers like AVR.
Use cases
- speed up dividing many integers by a runtime constant
- optimize hash table bucket index computation
- accelerate scaling algorithms with integer division
- fast integer division in an interpreter loop
- divide SIMD vectors by a constant since SIMD lacks integer division
- fast division on microcontrollers without a hardware divider
When to choose
- you divide many numerators by the same runtime divisor in a hot loop
- you need SIMD integer division that hardware doesn't provide
- you target embedded hardware lacking a hardware divider
- you want a dependency-free, permissively licensed header-only optimization
When to avoid
- the divisor changes on every division (precomputation overhead dominates)
- you only divide by compile-time constants (compilers already optimize this)
- divisions are rare and not performance-critical
Facets
library · maturity stable
math developer-tools performance developer-tools cpp c cross-platform embedded header-only integer-division simd optimization branchless algorithms gpu
3 sources
- readme: https://github.com/ridiculousfish/libdivide · fetched 2026-08-28 · 42953bd196eb
- homepage: http://libdivide.com · fetched 2026-08-29 · de69bc973f80
- site_page: http://libdivide.com/documentation.html · fetched 2026-08-29 · 520ad0ef9721
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| ridiculousfish/libdivide | main | 78 |
For agents
markdown · JSON · MCP: product_card(name="ridiculousfish/libdivide")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem