A recurrent problem with jpm has reasserted itself. I thought we'd
chased it away in earlier
beta versions of J903, but it's been around in earlier releases of J9
and earlier as far as I
recall. (Checking back-correspondence just now, since typing the
earlier pair of sentences, I'm
not sure it was cured after all, but it's still worth observing there
is a problem somewhere in jpm! )
I can vouch for jpm working for a similar test earlier today analysing
essentially the same function,
Sav, in J7.01 on my iPad.
I've corresponded with Henry previously concerning jpm, thought of
sending privately to him
only, but there might be other J-users who wish to comment.
I've been working on Euler Problem 579, solved by many but not yet by
me. As often is the
case, it's easy for small problems, but the required size is 10^12 !
Please avoid the listing further
below if you wish to solve it without misleading distractions!
Here's a mini-session, somewhat contrived for this email:
JVERSION
Engine: j903/j64avx2/windows
Beta-l: commercial/2021-06-17T13:00:27
Library: 9.03.05
Qt IDE: 1.9.2/5.12.10(5.12.10)
Platform: Win 64
Installer: J903 install
InstallPath: c:/d/j903-beta
Contact: www.jsoftware.com
clear'' NB. to do with sending in a self-contained mini-script,
further below.
load'jpm'
start_jpm_ 100000000
1785713
Sava <.1e6
309358254 1
showdetail_jpm_ 'Sava'
recorded all lines
used and max record count: 64 1,785,713
|index error: getdetail1
| lns=.sort(len#replno) {~(;repsno)i.stm
NB. end of session clip
NB. and here's a copy of a temporary self-contained (I hope) mini-script
NB. edited from the working script for the purposes of this enquiry
M =: 1000000007
NB. look-up table
sum4sq =: (M&|@:+/\) 4 (M&|@^) i.55 NB. cum sum of powers of 4 mod M
Sava =: 3 : 0
10000000 Sava y
:
n =. y NB. problem size
b =. (- 2&|) x NB. block/buffer size must be even
e =. _1 NB. previous block end
t =. 0 NB. total mod M
m =. 0 NB. loop counter (diagnostic only)
NB. define finite arithmetic fns modulo M
by =. M&|@:* NB.
bysq =. by~ @ by NB. square of x * y
add =. M&|@+
sum =. M&|@:+/ NB. total
NB. ====================================
g =. +/"1@:#: NB. sum of base-2 rep
logn =. 2 ^. n
while. n >: s =. e + 2 do.
e =. n <. s + b
r =. range s, e, 2 NB. define next block of odd
elements 2i+1, i e. [s, e]%2
m =. >: m NB. increment loop counter
rgr2 =. (bysq g) r NB. square r * g (r)
max2r=. logn <.@- 2 ^. r NB. indices into look-up table
tr =. rgr2 by max2r { sum4sq NB. rgr2 * sum 4^...
t =. sum tr, t NB. accumulate total
end.
t, m NB. return total and number of loops done
)
Thanks for any help,
MIke
--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm