fixed accuracy problem when using very small thicknesses

moved to using expm1 and log1p whenever possible
had to use ISO_C_BINDING because these functions appear to be absent in
fortran for some reason...