I have the following function
f[s_]:=(11/10 + s) (-((50 (-(13/10) + (169 s)/100))/( 13 Sqrt[231] Sqrt[ 100/33 + s] (1/4 + (11 s)/10 + s^2))) - 1/( 4 (11/10 + s)^( 3/2) (s + 1/(4 (11/10 + s)))))^2 Which is continuous and well-defined for
-1<=s<=0 However, at s=sp, there is a very non-trivial cancellation of singularities, where :
sp=1/2 (-(11/10) + Sqrt[21]/10) This is a problem when manipulating the function numerically, as can be seen by plotting it for sp-0.0001<s<sp+0.0001, where we see huge oscillation due (I assume) to the rounding errors of cancelling two big factors.
This wouldn't be a problem, but I am using this function as a distribution density, and when using RandomVariate to generate points, it will slow down immensely when drawing close to sp. For this reason, I would like to smooth out this function around sp. Would there be an elegant way to do it ?
The only thing I could come up with is define a piecewise function and interpolate linearly between sp-0.0001 and sp+0.0001, but I was wondering if there was a better way to do this, maybe with a built-in function that I ignore.




(1690 (20-13 s)^2)/(100+33 s)*1/(20 Sqrt[77+70 s]-26 s Sqrt[77+70 s]+7 Sqrt[1000+330 s])^2if I did not make a mistake. In this way of writing it, there is no cancellation between -1 and 0. $\endgroup$