scipy.integrate.quad precision on big numbers
问题 I try to compute such an integral (actually cdf of exponential distribution with its pdf) via scipy.integrate.quad() : import numpy as np from scipy.integrate import quad def g(x): return .5 * np.exp(-.5 * x) print quad(g, a=0., b=np.inf) print quad(g, a=0., b=10**6) print quad(g, a=0., b=10**5) print quad(g, a=0., b=10**4) And the result is as follows: (1.0, 3.5807346295637055e-11) (0.0, 0.0) (3.881683817604194e-22, 7.717972744764185e-22) (1.0, 1.6059202674761255e-14) All the attempts to use