Fix math error in C++ entropy code
Fix entropy_py bug; add entropy_cpp test