Ramanujan Machine: GPU-Accelerated Formula Discovery
Abstract
We extend the Ramanujan Machine framework (Raayoni et al., 2024) using GPU-accelerated polynomial CF evaluation on an 8× B200 cluster. Phase 1 exhaustively searched 586 billion equal-degree polynomial CFs through degree 8 — finding no new transcendental formulas and proving via 100-digit PSLQ that all 7,030 “transcendental hits” were double-precision false positives. Phase 2 identified the root cause (equal-degree CFs cannot produce transcendental formulas; a degree ratio of ~2 is required) and built an asymmetric-degree v2 kernel now being tested at productive configurations.
Background
A polynomial continued fraction (PCF) has the form:
where and are polynomials in . When such a CF converges to a known mathematical constant (or a simple algebraic expression involving known constants), we have discovered a formula.
Conservative Matrix Fields (CMF)
Raayoni et al. (PNAS 2024) discovered that many CF formulas arise from a unified mathematical structure called a Conservative Matrix Field — a matrix-valued function satisfying a discrete conservation law. Different “trajectories” through the CMF yield different CF formulas for the same constant, revealing deep connections between seemingly unrelated identities.
Prior Computational Frontier
| Work | Year | CFs Evaluated | Polynomial Degree | Constants Found |
|---|---|---|---|---|
| Raayoni et al. (Nature) | 2019 | ~500K | 1-2 | pi, e, Catalan |
| Raayoni et al. (PNAS) | 2024 | 1.77M | 2-3, asymmetric | pi, ln(2), Gauss, Lemniscate |
| This work (v1) | 2026 | 586 billion | 1-8, equal deg | None new (20 classical re-derived) |
| This work (v2) | 2026 | 816 million | asymmetric (2,4) | In progress |
Method
Phase 1: Polynomial CF Evaluation (GPU)
For each candidate polynomial pair with coefficients in a bounded range:
- Evaluate the CF to terms using the convergent recurrence (forward evaluation)
- Compute the limit to 100+ decimal digits using CGBN (CUDA Generic Big Numbers)
- Store the high-precision value
Each evaluation is independent — embarrassingly parallel across GPU threads.
Phase 2: PSLQ Matching (GPU)
For each evaluated CF value , run PSLQ (Integer Relation Algorithm) against a database of known constants:
where are small integers. If a relation is found with small coefficients, we have a formula.
PSLQ is parallelizable: each CF value can be matched independently.
Phase 3: Verification
Any discovered formula is verified by:
- Evaluating the CF to 1000+ digits
- Comparing against the constant computed independently (MPFR)
- If the match holds to 1000 digits, the formula is recorded
Hardware
Each B200 GPU runs ~10,000 independent CF evaluations in parallel (one per CUDA thread). With 8 GPUs and 100-term CF evaluations at 128-bit precision, we estimate ~10^8 evaluations per hour.
Results
Phase 1: Equal-Degree Search (v1 kernel, 2026-03-31 to 2026-04-07)
| Degree | Range | Candidates | Matched Hits | Transcendental? |
|---|---|---|---|---|
| 1 | [-3,3] | 2,401 | ~50 | No |
| 2 | [-40,40] | 282B | 100K+ | No |
| 3 | [-13,13] | 282B | 94K | No |
| 4 | [-7,7] | 577B | 560 | No |
| 5 | [-5,5] | 3.1T | 647 | No |
| 6 | [-4,4] | 22.9T | 1,507 | No |
| 7 | [-3,3] | 33.2T | 1,046 | No |
| 8 | [-2,2] | 3.8T | 201 | No |
| Total | 586B+ | Zero transcendental |
100-digit PSLQ verification (verify_hits.py) of ALL hits:
- 7,030 transcendental “hits” were double-precision false positives — none held at high precision
- 20 confirmed formulas — all classical: Euler’s e, Brouncker’s 4/pi, Leibniz pi/4, 1/ln(2)
- Zero new discoveries
Root Cause: Wrong Degree Regime
The v1 kernel forced . But every known CF formula for transcendental constants has :
| Famous Formula | Ratio | ||
|---|---|---|---|
| Apéry’s | 6 | 3 | 2.0 |
| Catalan’s constant | 4 | 2 | 2.0 |
| Brouncker’s | 2 | 1 | 2.0 |
Equal-degree CFs converge super-exponentially to algebraic numbers — the search space literally cannot contain new transcendental formulas. This explains why 586 billion candidates produced nothing new.
Phase 2: Asymmetric-Degree Search (v2 kernel, 2026-04-07)
Built ramanujan_v2.cu with independent and . Also saves all converged-but-unmatched CFs for offline multi-constant PSLQ scanning.
| Config | Candidates | Converged | Matched | Confirmed (100d) |
|---|---|---|---|---|
| (1,2) range 10 | 4.1M | 3M (73%) | 14,886 | 48 transcendental |
| (2,4) range 6 | 816M | 521M (64%) | 3 | In progress |
The (1,2) run confirmed known formulas for pi/4, 4/pi, 1/pi, Gauss’s constant, and 1/ln(2) at 120-200 digit precision — validating the kernel.
Next targets: (2,4) and (3,6) at larger coefficient ranges (15-20), where the Raayoni et al. team found their results.
Dataset: cahlen/ramanujan-machine-results on Hugging Face
References
- Raayoni, G. et al. (2019). “Generating conjectures on fundamental constants with the Ramanujan Machine.” Nature, 590, pp. 67–73.
- Raayoni, G. et al. (2024). “Algorithm-assisted discovery of an intrinsic order among mathematical constants.” PNAS, 121(25).
- David, H. et al. (2024). “The Ramanujan Library.” arXiv:2412.12361.
- Elimelech, R. et al. (2025). “From Euler to AI: Unifying Formulas for Mathematical Constants.” arXiv:2502.17533.
- Ferguson, H.R.P. and Bailey, D.H. (1999). “A Polynomial Time, Numerically Stable Integer Relation Algorithm.” NASA Technical Report.
This work was produced through human–AI collaboration (Cahlen Humphreys + Claude). Not independently peer-reviewed. All code and data open for verification at github.com/cahlen/idontknow.