Thank you so much for taking the time to review the patch and for taking the time again to sort things out with me this evening.
I see that in dtanh() you set errno to 0 before calling tanh(), but 1) you don't check for it afterwards (seems like you should be checking for ERANGE, as well as checking the return value for isinf()), and 2) you don't do that in dsinh() and dcosh() and I'm not quite sure I see why. What's up with that?
At the time I wrote that patch, I tried to include errno testing.Then, I think again and came back with the wrong idea everything would be fine.
By re-reading math.h documentation, it is now clear that the three functions can raise a ERANGE error.
There are two cases : - range error due to overflow occurs. - range error occurs due to underflow. In that case, the correct result (after rounding) is returned. So I assume we can ignore that case.
For sinh and cosh, we can have both cases and we added support for overflow.
For tanh, the only possible case is underflow and then, the result is correct.
We included comments to explain errno handling in those functions.