Numerically stable evaluation of sqrt(x+a) - sqrt(x)
问题 Is there an elegant way of numerically stable evaluating the following expression for the full parameter range x,a >= 0? f(x,a) = sqrt(x+a) - sqrt(x) Also is there any programming language or library that does provide this kind of function? If yes, under what name? I have no specific problem using the above expression right now, but encountered it many times in the past and always thought that this problem must have been solved before! 回答1: Yes, there is! Provided that at least one of x and a