cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

24-Ruby III

## Bug in Prime?

At n=1000 all is OK. At n=5000 - Prime has an error!

What is it?

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:ValeryOchkov)
 Valery Ochkov wrote: Thanks, Werner! But without Fred's function we have a bug in Prime! In Mathcad 16 all is OK at n=10^5

Yes, its a bug. I could reproduce it.

Not sure what the reason for it could be.

First thought was that it might be a confusion between local X and global X, but using X <-- X in the program first did not change anything.

11 REPLIES 11
23-Emerald I
(To:ValeryOchkov)

Work around:

23-Emerald II
(To:Fred_Kohlhepp)

Yep, I find the same Fred, but in Mathcad 11!

I suppose that Mathcad 15 is the exception here and

Once more, they've managed to bring some functionality of Mathcad 11 into Prime. That .... is.... an.... improvement....?

Here's the fun stuf (I stripped the program somewhat):

Notice that you loose array elements. With every run I get between 90 and 99 elements for each of the two elements of Z.

And notice how all the other, non-NaN elements are 0. (I can't check what Prime does here, I'm limited to Express = no programming).

But when I make Z a function of X and Y, I consistently get two arrays of 100 elements back, and the in-between numbers are (mostly) non-zero:

Luc

23-Emerald II
(To:LucMeekes)

When n=10, I (also) loose about 1 to 10 elements, so am sometimes left with zero elements in the two parts of Z, but sometimes:

I get them all.

So do I loose 0 to 10 elements consistently...

What if n=1000:

OK, it's possible to loose more than 10 elements, but it's rare. The worst I've seen in about 50 runs is 15 elements lost.

Luc

23-Emerald II
(To:LucMeekes)

Oh, and:

50k points is no problem, neither is 500k:

24-Ruby III
(To:LucMeekes)

In Mathcad 15 - all OK. Problems in Prime by a big n.

24-Ruby III
(To:Fred_Kohlhepp)
 Fred Kohlhepp написал(а): Work around:

n - ?

24-Ruby V
(To:ValeryOchkov)
 Valery Ochkov wrote: Fred Kohlhepp написал(а): Work around: n - ?

Higher values of n are no problem with Freds function!

Unfortunately Primes Plot is limited to 500001 points.

24-Ruby III
(To:Werner_E)

Thanks, Werner!

But without Fred's function we have a bug in Prime! In Mathcad 16 all is OK at n=10^5

24-Ruby V
(To:ValeryOchkov)
 Valery Ochkov wrote: Thanks, Werner! But without Fred's function we have a bug in Prime! In Mathcad 16 all is OK at n=10^5

Yes, its a bug. I could reproduce it.

Not sure what the reason for it could be.

First thought was that it might be a confusion between local X and global X, but using X <-- X in the program first did not change anything.

24-Ruby III
(To:ValeryOchkov)

Is it a center of mass (gravity)?

The converted sheet from Mathcad 15 to Prime 3.1 gives an error. See two sheets in attach.

24-Ruby III
(To:ValeryOchkov)

One verify:

Announcements