Currently the precision of the C++ version for long double is rather low, because it is using acos(-1) for getting pi. acos() however is the C double-precision version. Instead, std::acos() should be used which will be long double if the argument is long double (and also will be float if the argument is float).
Currently the precision of the C++ version for long double is rather low, because it is using acos(-1) for getting pi. acos() however is the C double-precision version. Instead, std::acos() should be used which will be long double if the argument is long double (and also will be float if the argument is float).