1/dist(); anyway
little hack,
distance calculation between two point with dist() function is bad too. you can replace it with this
float dx = pos.x - target.x;
float dy = pos.y - target.y;
float d = sqrt(sq(dx) + sq(dy)); //simple euclidean distance formula
it do the same, but faster