MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Inconsistent behaviour of Integrate

Andreas Maier wrote:
> Dear Andrzej Kozlowski,
> Andrzej Kozlowski wrote:
>> This depends on the speed on your computer. On my MacBook PRI I get: 
>> In[1]:= Integrate[
>>  Sqrt[(x - 1/2)^2 + (y - 1/2)^2], {x, 0, 1}, {y, 0, 1}]
>> Out[1]= (1/24)*(4*Sqrt[2] + Log[17 + 12*Sqrt[2]])
>> However, if I use Maxim Rytin's trick to reduce performance thus:
>> Dynamic[Pause[.5], UpdateInterval -> 1]
>> ClearSystemCache[]
> Thank you for that hint. On the computers I tested your solution it wasn't even
> necessary to reduce the performance. A single call of
> ClearSystemCache[]
> before using Integrate[] seemed to be enough to consistently produce the
> same results. Still for me it is very surprising, that a computer algebra program
> like mathematica doesn't produce predictable results by default.
> Maybe some general commands for the beginning of a notebook, like
> SystemCache[Off]
> SystemPerformance[50]
> would be useful for Mathematica, so that one can be sure all the commands
> always produce the same results, independent of the machine they are running on.
> Regards,
> Andreas Maier

To get that sort of independence would require some internal capability 
to compute an operation count and then to deply it in some sensible way 
in place of time constraints. These are a hard and a very hard project, 
respectively. So long as time constraints are used it will be 
effectively impossible to normalize across all hardware and software. 
Increasing parallelization will make this even impossibler.

> P.S.: I still wonder why Factor[17 + 12 Sqrt[2]] doesn't come up with
> (1 + Sqrt[2])^4. Can Factor[] only work with expressions involving variables
> like x, y...?
> [...]

I'm not sure how one might make this algorithmic, or to what class of 
algebraics it might apply. But you can get at the factor in this case by 
  finding a fundamental unit for the quadratic field.

In[100]:= RootReduce[NumberFieldFundamentalUnits[17 + 12*Sqrt[2]]]
Out[100]= {1 + Sqrt[2]}

Daniel Lichtblau
Wolfram Research

  • Prev by Date: Re: Why Row does not format 2 plots in one row when ImageSize->Full?
  • Next by Date: A little help with sort
  • Previous by thread: Re: Inconsistent behaviour of Integrate
  • Next by thread: Re: Inconsistent behaviour of Integrate