C++ code to calculate error ranges in X-Ray Polarimetry