獲取 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"]) &)]

相關文章
相關標籤/搜索