10 Reputation

9 years, 112 days

Evalf precision incorrect...

In the following code, the evalf prints -32.16...

restart; S := 8;

sigma := 8/sqrt(2*Pi);

iprec := 151;

evalf(log[2](-(sum(log(round(2^iprec*exp(-j^2/(2*sigma^2)))/2^iprec*exp(-j^2/(2*sigma^2))))*round(2^iprec*exp(-j^2/(2*sigma^2)))/2^iprec, j = 0 .. 7))));

Change the last line to evalf[20](log[2](....)), and re-run *just that line*. It now prints -66.67...

Change the last line to evalf[200](log[2](...)) and re-run *just that line* again. It now prints -151.24... (I have strong evidence to support that the true value is near -151, so I believe this answer.)

Now remove the precision indicator from the command completely and re-run just the last line. It *still* prints -151.24...!

My two questions are: why do I need evalf[200] to get the first three digits of the answer to be correct? and why does setting the evalf precision and then removing it cause the previous precision to persist?

Broken Summation Notation...

Below is a Maple ws describing the problem. I have some fixed values pr0 and pr1, and a four variations of a function "pdf". The problem is that when I use the function in a sum (either the "sum" function or the sigma notation), the result is different than if I write out the sum explicitly. It's very puzzling as to why they woudl be different in the first place, but even more strange is that the different versions have *different* deltas. Even version 3, with a delta of 10^-100 is too much for my application (moreover the delta gets larger when I sum over more terms).

In the worksheet below, I compare "sum(f(x),x=3..3)" to "f(3)". I expect this should always be identically 0, but that is not true for any of the four versions of my function. (The same is true for "Sum(f(x),x=3..3)".) However, "sum(f(3),x=3..3)" *is* (blessedly) identically "f(3)". What gives?

 >
 >
 >
 >
 >
 >

Maple doesn't always like subscripted variables. Is that the problem?

 >

Maybe it's the binary expansion that's the issue

 >

No procedures, no arrays

 >
 >
 (1)
 >
 >
 (2)
 >
 (3)
 >
 (4)
 >
 >
 >
 >

How get numerical result when evalf fail...

In the following worksheet, I can evaluate , but not . As a result, I can't use any value that depends on  (or any ), for example, the graph is incomplete. How can I get Maple to evaluate ?

 >
 >
 >
 >
 >
 (1)
 >
 (2)

Expected result of :

 >
 (3)
 >
 >

All told, S(i) fails for i in [0..31], i = 115,116, and 221. S(i) succeeds for all other i < 3500.