I tried CDF(x).log().real() for fun but of course want to test RDF(x).log(), thats my fault.

The whole branch calling gsl_sf_log_1plusx(self._value - 1) for values close to 1 nonsense. Sure the gsl_sf_log_1plusx function is more accurate, but now all the error comes from the numerically unstable self._value - 1.

Also the doctests fail for me, and I need to set the bound at 2*ulp for it to pass.

Finally, you must doctest check_error(x) and not check_error(RDF(x)). Otherwise, the exact log value (for the comparison) is computed at the wrong value:

We have to use check_error(RDF(x)) and not check_error(x) so that the arbitrary-precision floating point value is the same as the double precision floating point number, not the other way round. I fixed this in the updated patch.