Update quadratic approximation code