# Claude Code builds an FFT library that beats FFTW in most tests

Guided by one expert, a coding agent built a fast Fourier transform library in about 60 hours of active work. On most measured cases it outran FFTW and the vendor libraries. The author's record of the work shows which part the human still had to play.

- Category: Code
- Readiness level: III (Open source) on Science Underway's four-step scale, as proposed
- Published: 2026-12-03
- Editor: Stefan Perdal
- URL: https://scienceunderway.com/articles/claude-code-builds-an-fft-library-that-beats-fftw-in-most-tests

## The study

Faster than the West: agentic engineering of a portable fast Fourier transform (preprint, not peer reviewed). arXiv 2612.00427. https://arxiv.org/abs/2612.00427

## At a glance

- What it shows: An AI coding assistant, steered by one specialist, wrote a library for a core maths routine used in signal processing and imaging. On four kinds of computer chip it matched or beat the best existing libraries in most of the tests.
- What it does not show: It does not show that anyone could repeat this without deep expertise, or that the library will hold up over years of use. It is one case, measured by its own author, in a preprint that has not been peer reviewed.
- Why it matters: Fast maths libraries usually take experts years to build. This suggests an agent can now do most of the engineering, while the human's main job becomes choosing fair tests and checking claims.

## What the study shows

The fast Fourier transform, or FFT, is the routine that turns a signal into its frequencies. It sits inside audio processing, medical imaging and physics simulations. For more than two decades the reference library has been FFTW, the 'Fastest Fourier Transform in the West'. Chip makers add their own libraries, such as NVIDIA's cuFFT and Apple's vDSP.

Tobias Knopp, a researcher in Fourier methods at the University of Lübeck, asked Claude Code, Anthropic's coding agent, to build a rival from an empty folder. His opening rules were three: a permissive MIT licence, no reading of FFTW's source code, and the goal of being faster than FFTW. The result, called FFTL, was written in the Julia programming language. It took about 60 hours of active work across 7 days up to public release.

One package runs on ARM and x86 processors, on Apple and NVIDIA graphics chips, and as a C library with FFTW's interface. That means programs written for FFTW can switch to it without changes. It also offers cosine and sine transforms on graphics chips, which cuFFT and Apple's library lack.

The author measured version 0.2.0, released 9 days later with 8 contributions from outside developers. Each test case was compared with the fastest other library on the same machine. On the two processors, an Apple M1 Max and an AMD EPYC server chip, FFTL won 76 to 85% of cases. On the Apple graphics chip it won 73%. On an NVIDIA RTX A6000 it was level with VkFFT, a widely used open-source GPU library: ahead in double precision, behind in single precision.

To answer the worry that FFTL was tuned to its own test set, the author drew new sizes at random after release. On the processors these did about as well as the tuned sizes. On the graphics chips they did worse, which the author says shows the GPU tuning rules generalise less well. Accuracy held up: errors stayed within a few rounding steps of the most precise result.

The author kept every message, tool call and code change. The agent designed the architecture, found most performance gaps through its own benchmarks, and closed or narrowed 28 of 34 gaps against rival libraries. The author's most common message type was checking: asking why a case was slow or questioning a claim. Choosing what to compare against was rare, but the author reports that these few choices decided where the agent spent its effort. Model use up to release would have cost about 450 to 500 US dollars at list prices.

## Our reading

In our reading, the striking result is less the speed than the record of how it happened. One episode stands out. A weakness in the GPU code sat untouched for 30 hours because no rival library in the test set offered those transforms. Once the author added VkFFT, which does, the agent started work on it 4 minutes later. The agent chased whatever the benchmark showed. It rarely looked beyond it.

The same pattern returned after release. Outside developers found lengths that FFTL handled at about two thirds of the best speed, a kind of size missing from the author's test set. The fix came the same day. Finding the gap took someone outside. This fits the author's own conclusion: the comparison set acted as the real specification.

On readiness, we place FFTL at level III, open source available. It has a systematic benchmark with public raw data, and the code is released under the MIT licence and registered as a Julia package. It is not yet at level IV: no named organisation documents using it in production.

The rest of the article (what it means, limits, what to watch) is free for members: https://scienceunderway.com/articles/claude-code-builds-an-fft-library-that-beats-fftw-in-most-tests

## How this was made

An AI model read the study and wrote this article in the structure Science Underway uses. An editor reviewed it and approved it for publication. Check the original study before you rely on the details.

---
Source: Science Underway, https://scienceunderway.com/. Please link to the article when you cite it.
