6
$\begingroup$

I want it to be stable near $f(0) = 1$. Is there a nice function that does this already, like maybe a hyperbolic trig function or something like expm1, or should I just check if $x$ is near zero and then use a polynomial approximation?

  • 1
    Once you use `expm1` to compute $\exp(x)-1$, there's no further loss of significance in dividing $x$ by it, is there?2012-08-21
  • 1
    @Rahul: You are suggesting to use x/expm1(x) but with a single extra check for 0/0 when x is exactly 0?2012-08-21
  • 0
    Suggesting, yes, (though to be clear, not with a great deal of authority).2012-08-21
  • 1
    Why not Bernoulli numbers?2012-08-22
  • 0
    $$f(x)={e^{-x/2}\over{\rm sinc}(i x/2)}\ .$$2012-08-22

5 Answers 5