introduce THC_API and work around log1p issue.
3 files changed