Separate c-implementation of interaction strength to another function