获取 NIntegrate 中的偏差

f[x_] := 1 + Sin[x];
exact = Integrate[f[x], {x, 0, 2 Pi}];
res = NIntegrate[f[x], {x, 0, 2 Pi}, IntegrationMonitor :> ((error = Through[#1@"Error"]) &)]

相关文章
相关标签/搜索