貌似发现一个Mathematica的神奇BUG
这个是去年暑假编程训练里的题目AC(指通过全部测试)的C++代码为
double f(double a, double b) {
return a == 0 ? 0.0 : (1.0 / 6.0) * pow(a, 3) * ((b * sqrt(a * a + b * b) / (a * a)) + log(abs(sqrt(a * a + b * b) / a + b / a)));
}
double integral(double lx, double rx, double ly, double ry) {
return f(rx, ry) - f(rx, ly) - f(lx, ry) + f(lx, ly) + f(ry, rx) - f(ry, lx) - f(ly, rx) + f(ly, lx);
}
(看不懂代码的看这个)
Mathematica花了一个半小时然后算错了[贴吧_喷]
Mathematica代码:Timing, {x, xl, xr}, {y, yl, yr}]]
水怪席:@Aurora_Feather @xiaopangju @星河皓月xyz @凌雨林 @开心的阿诺 @Su·東紅 @尸先peng @wsseieiei
坏了,我连数学式子都看不懂了(高中速通了,一点数学没学会)悲
页: [1]