← Graph

Neri–Schneider algorithm

concept 2 connections

Algorithm published in a white paper roughly two years before 2025 that computes civil dates from an epoch without any ifs, while loops, or memory lookups — only bit shifts, multiplications and magic constants exploiting integer overflow/underflow. Adopted in recent versions of GCC, Linux, and .NET 7, delivering about 4× speedup over the if-and-lookup-heavy .NET 6 implementation. Wójtowicz uses it as his headline example of rephrasing a problem (Zeller's March-starts-year trick + Euclidean a-functions + bit-shift division) so the CPU can solve it without branches.

category
practice
about
Neri–Schneider algorithm concept
Presented as the 4× faster branch-free epoch-to-date algorithm now in .NET 7 and GCC.
concept Neri–Schneider algorithm
related_to
Uses Zeller's March-starts-year reformulation as one of its building blocks.

Provenance

Read by
1 extraction