Wow, this is amazing. Many thanks, Brad. I will be taking a look on the changes and see if they can be incorporated in the next release.
I have some questions, though. I see you have created a MaxRealNumber constant representing the value of 1e300. In the original Cephes library, I believe this value was set to 1.7976931348623158E308, which is about the same as Double.MaxValue. Was there any specific reason for not using Double.MaxValue? (I still haven't tested it with Double.MaxValue instead, perhaps you have found something I am not currently aware, hence the question).
I also see you have replaced the equality comparisons on Moshier's code by "within tolerance" comparisons. I am aware that in most occasions floating-point numbers shouldn't be compared by equality, and I know why you did that. However, I also know that Moshier is very good on writing numeric precise code, and I couldn't find those checks on his code. Did you find a case in which those tolerance margins were indeed necessary? I am only asking so I can write some better suited unit tests for those.
Again, many thanks for your contribution!
Best regards,
César