Fitness Function 
I'm trying to create a fitness function, where I can calculate the score of a value. The closer it gets to x, the higher the value. Yes it could be linear, but I'd prefer to have it exponential. I just don't know what term to even google for anymore...
Basically the idea is the same as a 100 meter dash runner going from 23 seconds to 22 seconds is not a big deal, but going from 9.9 to 9.8 is a dramatic difference. Except that in this case, instead of just above a min value, I want it to be as close as possible. So for example cutting a board in half, the closer to the middle on either side, the better the score.
So in the graph above, y is the max score I want to assign, it could be say 100, 1000, etc. pts. In terms of ideal value, I'd like to be able to say the ideal is maybe 12 and they managed to achieve 11. What score (y) do they get? 
They should also be able to score anywhere from 0 to infinity, but as it gets closer to 0 and as it goes to infinity (or a max value), how do I determine the score?
In other words, what would the equation be?
 A: You could try
$$
f(x) = \frac{h}{(x-a)^2+1}
$$
Where $a$ is the target value, and $h$ is the maximum score.
To get a narrower/wider peak, you can introduce a third parameter, $b$.
$$
f(x) = \frac{h}{b(x-a)^2+1}
$$
This has the advantage of being algebraically simple.
If you want to have $f(0)=0$, you could use
$$
f(x) = \frac{hx}{b(x-a)^2+1}
$$
Notice, though, that the maximum for this function is no longer at $x=a$. You can use some basic calculus to find that information.
A: If you want to let the score go to ∞ you can use a function like 1/(x-a) where I changed the name of your target value to "a" so as to eliminate confusion with the x axis. This has the advantage of being easy to compute for any x.
If you want to assign a maximum y, an easy way to write the function is still as  f(x) = 1/(x-a) if 1/(x-a) ≤ y (that's your maximum y); and f(x) = y for 1/(x-a) > y.  This means that you assign a maximum score if they get really close to a.
The term really close is kind of vague, but you can define it as any given distance you like from a (say 1/10 or 1/100) and then adjust coefficients in f(x) to force it to reach y within that interval.
