0
$\begingroup$

This question already has an answer here:

I have a function similar to this:

func[x_]:=Log[1+x]

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

func[1.0*10^-20]
0.

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)

$\endgroup$

marked as duplicate by J. M. will be back soon Jun 13 '15 at 13:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Have you seen this? $\endgroup$ – J. M. will be back soon 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.