Adding C code version using GSL