A search program was given only basic math operations and told to find a good way to solve linear systems (Ax = b). On its own it came up with an algorithm that turned out to be conjugate gradient, a method that took people decades to figure out. Below it runs live in your browser against two older, simpler methods on the same problem.
Gray line = Jacobi method. Orange line = steepest descent. Blue line = the discovered algorithm (conjugate gradient).
It was built up from random pieces and then tuned. This is exactly conjugate gradient:
beta_k = (r . r) / (r . r)_prev alpha_k = (r . r) / (d . A d) d_k = r_k + beta_k * p_(k-1) x_(k+1) = x_k + alpha_k * d_k (r_k = b - A x_k)
The same program also finds GCR for nonsymmetric systems and discovers polynomial preconditioners. The full write-up and the honest results, including where it does not beat the best existing methods, are in the README.
Made by evina. Source code | README