Keplearn recovers exact physics laws from raw data in milliseconds

Keplearn: Extract Equations from Data in Seconds

Keplearn is a deterministic symbolic regression engine written in Rust that reads a CSV or TSV from stdin and outputs candidate equations as JSON. It uses best-first recursive reduction to find compact closed-form laws, snapping fitted constants to rationals and multiples of pi, e, and sqrt(2). On the Feynman benchmark it achieves a 64.7% exact symbolic solution rate at zero noise, beating AIFeynman's 55.8% with far less compute. Solved cases often finish in under a second.

Keplearn is named after Johannes Kepler, who deduced his laws of planetary motion by studying tables of astronomical observations taken by Tycho Brahe. That is what this program attempts to do: given columns of measurements, find the compact law that relates them.
  1. seanhunter

    Named after Kepler, who went from Tycho Brahe’s observational data to the laws of planetary motion (as mentioned in the article). But one really inspiring thing about Kepler is not mentioned there is that he started with a different theory and then changed his mind when the observational data showed he was wrong. We have the laws of planetary motion because of a feat of tremendous intellectual humility where a really smart person was prepared to admit that the theory they had invested a huge amount of time and effort into formulating didn’t match the observational data, _so they changed their mind_.

    Kepler’s original theory was that the orbits in the solar system were defined by polygons and their inscribed/circumscribed spheres. This seemed very attractive because at that time they knew of 6 planetary bodies and this fitted in somehow (I don’t remember exactly) into this model with nested platonic solids and the spheres around them. Then Kepler realised that the predictions of this very elegant model were worse than the heliocentric model.

    So when Brahe’s observations became available he basically threw all that out and started again, to develop his wonderfully elegant laws of planetary motion based around elliptical orbits which also have the significant benefits of predicting planetary motion beautifully and were later found to be entirely derivable from Newton’s laws of motion using calculus (there is a wonderful presentation of this derivation in Spivak for anyone wh […]

  2. joshmarlow

    I bet this was fun to think about and build. Thank you for sharing!

  3. kamilstaszewski

    Looks like it was written by human. Crazy

More from this day

2026-10-29