Update functions.c

WIP. Changing coefficients to double