c++ port of plmgen working for float and double but long double has issues