expm c implementation