Evolving equations…
Symbolic Learning
A genetic algorithm evolves equations to fit your target curve.
target evolved

Equation to learn

Functions  sin, cos, tan, arctan/atan, sqrt, log/ln, exp, abs
Operators  +, -, *, /, ** (or ^)
Constants  pi, e  ·  Variable  x

Results

R² score
N/A
Mean absolute error
N/A
Discovered equation
No prediction made yet...
population 300 generations 30 training 90.0%
How symbolic regression works

This demo uses symbolic regression via genetic programming. Each candidate formula is a tree of operators and operands — exactly the shape drawn in the mark above.

A population of 300 candidate equations is scored against your target, and the fittest are selected, crossed, and mutated to breed the next generation. Over 30 generations the population converges toward formulas that match the target curve.

R² score measures how much of the variance the prediction explains (1.0 = perfect fit). MAE is the average absolute gap between predicted and actual values.

Visualization

Enter a function and press Evolve to watch the population fit your target curve.