From: Alexandros Droseltis on
Hello!

Thanks for all answers. No I understand what's wrong with the code (and
the rewritten code in Fortran 95 in [1] that I used).

The rewritten code translates

HX=HINF+HM*X RANF(-1)

of Fortran IV in

CALL RANDOM_NUMBER(TEMP)
HX=HINF+HM*X TEMP

of Fortran 95. This compiled with g95 does simply HX=HINF, as there is
not a variable XTEMP in the source, except this point (that is, XTEMP
has the value 0 for the assignment of HX). So XTEMP is a "problem" of
the translated code.

Now, the original

HX=HINF+HM*X RANF(-1)

must be a typo. I have reasons to believe that the correct should be

HX=HINF+HM*RANF(-1)

Thank you all for your very valuable comments and excuse me for
bothering you with this probable typo of this "ancient" source. ;)

Best Regards

Alexandros

[1] http://users.on.net/~parisdownes/code/FORTRAN/XENAKIS.FOR
From: Alexandros Droseltis on
On 2009-11-04, Alexandros Droseltis <usenet-1(a)alex-droseltis.com> wrote:
> Hello!
>
> Thanks for all answers. No I understand what's wrong with the code (and

I meant: "Now I understand [...]"
From: nmm1 on
In article <hcsknv$p5l$2(a)naig.caltech.edu>,
glen herrmannsfeldt <gah(a)ugcs.caltech.edu> wrote:
>
>>>Still my favorite are those for OS/360 which can be declared
>>>either REAL or INTEGER and return the appropriate value.
>
>> You could do that for DOUBLE PRECISION and COMPLEX as well :-)
>
>Well, not for a 31 or 32 bit generator. If you don't care
>about wasting bits you might as well go for COMPLEX*16 and REAL*16,
>or even COMPLEX*32.

Why not? I did it. I hope that you aren't assuming that a
pseudo-random number generator returns its state as the result.
All sane ones use hidden state, and separate initialisation (and,
if supported, saving and restoring calls).

>For those not following the discussion, the OS/360 calling
>convention returns INTEGER values in general register 0, REAL
>in floating point register 0, COMPLEX*8 in F0 and F2.
>Also, REAL*16 also in F0 and F2, and finally COMPLEX*32
>in all four floating point registers.

And the top half of a REAL*8 number was the REAL*4 value, with
least significant bits lost.


Regards,
Nick Maclaren.
From: Colin Watters on

"Alexandros Droseltis" <usenet-1(a)alex-droseltis.com> wrote in message
news:7le3q0F3dp0c3U1(a)mid.individual.net...
> Hello!
>
> Thanks for all answers. No I understand what's wrong with the code (and
> the rewritten code in Fortran 95 in [1] that I used).
>
> The rewritten code translates
>
> HX=HINF+HM*X RANF(-1)
>
> of Fortran IV in
>
> CALL RANDOM_NUMBER(TEMP)
> HX=HINF+HM*X TEMP
>
> of Fortran 95. This compiled with g95 does simply HX=HINF, as there is
> not a variable XTEMP in the source, except this point (that is, XTEMP
> has the value 0 for the assignment of HX). So XTEMP is a "problem" of
> the translated code.
>
> Now, the original
>
> HX=HINF+HM*X RANF(-1)
>
> must be a typo. I have reasons to believe that the correct should be
>
> HX=HINF+HM*RANF(-1)
>
> Thank you all for your very valuable comments and excuse me for
> bothering you with this probable typo of this "ancient" source. ;)
>
> Best Regards
>
> Alexandros
>
> [1] http://users.on.net/~parisdownes/code/FORTRAN/XENAKIS.FOR


The above url is clearly the code AFTER you changed it to use TEMP. I for
one am very curious to see original.

--
Qolin

Email: my qname at domain dot com
Domain: qomputing


From: Alexandros Droseltis on
On 2009-11-04, Colin Watters <qolin.see_signature(a)nowhere.co.uk> wrote:
>
> "Alexandros Droseltis" <usenet-1(a)alex-droseltis.com> wrote in message
> news:7le3q0F3dp0c3U1(a)mid.individual.net...
>> Hello!
>>
>> [1] http://users.on.net/~parisdownes/code/FORTRAN/XENAKIS.FOR
>
>
> The above url is clearly the code AFTER you changed it to use TEMP. I for
> one am very curious to see original.

Exactly, this is the tranlsation of the original (Fortran IV) in Fortran
95 (not by me, I just experimented with it). Unfortunately I have the
original only in paper form.

Alexandros