I have a function similar to this:


when I evaluate it at very small arguments, it will become 0, i.e.


Looks like this transition to zero happens when the output is smaller than 10^-16 (zero threshold). As I need to integrate this func multiplied by something that can range up to 10^90, I'd like to make the zero threshold to be atleast at 10^-100. How to accomplish this?

(Currently, func[1.0*10^-20]*10^90 outputs 0, but the real value is 10^70)

  • $\begingroup$ Have you seen this? $\endgroup$ – J. M.'s ennui Jun 13 '15 at 12:36
  • $\begingroup$ @Guesswhoitis. Seems like the second answer from there, which gave log1p[x_Real] := With[{w = 1 + x}, If[w-1 == 0, x, x*Log@w/(w-1)]] works just as I wanted + is more accurate. Thanks. $\endgroup$ – eimrek Jun 13 '15 at 12:53

Browse other questions tagged or ask your own question.