Function fit
Some points come from a secret function. Find a function that passes as close to them as possible, by moving sliders or typing your own formula. The red lines show how far off you are at each point.
Error: 17.1 %
0 of 3 stars
How to play
- Pick a level. The first ones are lines; then come parabolas, exponentials, sines and functions you’ll have to write yourself.
- Move each parameter’s sliders and watch the blue curve change.
- The red lines go from each point to your curve: the shorter, the better.
- With an error below 6% you get 3 stars and the original function is revealed.
- Switch to Formula to type the function by hand. Your slider curve is copied into the box so you can refine it.
Function types
Line
f(x) = a·x + b. a is the slope (how much it rises per step to the right) and b is where it crosses the vertical axis.
Parabola
f(x) = a·x² + b·x + c. a opens or narrows the parabola (and flips it if negative); b and c move it around.
Exponential
f(x) = a·e^(b·x). It grows (or shrinks, if b is negative) faster and faster. a is its value at x = 0.
Sine
f(x) = a·sin(b·x + c) + d. a is the wave’s height, b how many waves fit, c shifts it sideways and d up or down.
Scoring
Error
The average distance from the points to your curve (root mean square error), as a percentage of the height the points span. That way every level is measured the same way.
Stars
3 stars below 6% error, 2 below 15% and 1 below 30%. The points have a little noise, like real data, so you’ll never reach exactly zero error.
Golf
In formula mode, if you get 3 stars with a formula as short as the original, you earn the golf badge.
Tips
Start with the big picture
Adjust the parameter that changes the shape most first (the slope, the opening, the wave height) and leave the shifts for last.
Look where it crosses
If the points cross the vertical axis near some value, that’s usually your constant term (the b of the line or the c of the parabola).
Watch the red lines
If they all point up, move the curve up. If some point up and others down, the problem is the shape, not the position.
FAQ
What can I type in the formula?
x, numbers, + − * / ^, parentheses, the functions sin, cos, tan, exp, ln, log, sqrt and abs, and the constants pi and e. You can leave out the multiplication sign: 2x, 3(x+1) or 2sin(x).
What is free mode for?
To draw any function without points or scoring, like a simple graphing calculator.
Are my stars saved?
Yes, in your browser. You can replay any level to improve your result.