← Înapoi la Urmăritori

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 12
  1. The following incredibly small sorting algorithm has an $O(n^{4/3})$ worst-case runtime: def fibonacci_sort(v): a, b = 1, 1 while a * b < len(v): a, b = b, a + b while a > 0: a, b = b - a, a g = a * b for i in…

  2. Why Bad AI Is Here to Stay

    It seems that in 2025 a lot of people fall into one of two camps when it comes to AI: skeptic or fanatic.

  3. Hash functions are incredibly neat mathematical objects.

  4. Taming Floating-Point Sums

    Suppose you have an array of floating-point numbers, and wish to sum them.

  5. Extracting and Depositing Bits

    Suppose you have a 64-bit word and wish to extract a couple bits from it.

  6. When Random Isn't

    This post is an anecdote from over a decade ago, of which I lost the actual code.

  7. Branchless Lomuto Partitioning

    A partition function accepts as input an array of elements, and a function returning a bool (a predicate) which indicates if an element should be in the first, or second partition.

  8. Subtraction Is Functionally Complete

    To be precise, IEEE-754 floating point subtraction is functionally complete.

  9. Bitwise Binary Search: Elegant and Fast

    I recently read the article Beautiful Branchless Binary Search by Malte Skarupke.

  10. The World's Smallest Hash Table

    This December I once again did the Advent of Code, in Rust.

  11. Magical Fibonacci Formulae

    The following Python function computes the Fibonacci sequence, without loops, recursion or floating point arithmetic: f=lambda n:(b:=2<<n)**n*b//(b*b-b-1)%b It really does: >>> [f(n) for n in range(10)] [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] How does it work?

  12. Ordering Numbers, How Hard Can It Be?

    This article is not about deciding whether two floating point numbers are ‘close enough’.