A genetic algorithm approach to curve fitting