Commit 0dd7b3b2 authored by Gordian Edenhofer's avatar Gordian Edenhofer

correlated_fields.py: Minor numerical improvements

parent 47cbdda4
......@@ -61,7 +61,7 @@ def _lognormal_moments(mean, sig, N=0):
if not np.all(sig > 0):
raise ValueError("sig must be greater 0; got {!r}".format(sig))
logsig = np.sqrt(np.log((sig/mean)**2 + 1))
logsig = np.sqrt(np.log1p((sig/mean)**2))
logmean = np.log(mean) - logsig**2/2
return logmean, logsig
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment