Bugfixes and addition of IEEE-754 lgamma function (port of SunPro code)