Thanks Devon, that does speed it up a bit. I'll have to check on what
setting c and n to globals does to the rest of my code.

Bob

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Devon McCormick
Sent: March 30, 2008 2:02 PM
To: Programming forum
Subject: Re: [Jprogramming] finding roots

Bob - you'll probably get a little speedup by making your constants all
globals like this:

FVPA0=: 3 : 0
   (C*y+M)%N*1-^-y+M
)

where C=: c, N=: n, and M=: m (sticking to the convention that global names
are all-caps).

This also simplifies the invocation to:

   FVPA0^:_]0.3

Regards,

Devon

On 3/30/08, Robert O'Boyle <[EMAIL PROTECTED]> wrote:
>
> Hi, Raul
>
> Thanks for this. I had actually tried this formulation and found that it
> was
> significantly slower than the original one. I am not sure why. Perhaps it
> is
> the work that the interpreter has to do in the stitching.
>
> Anyway, thanks for your efforts on this. I think that I'll go with the
> original unless another approach comes up that is faster.
>
>
> Bob
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Raul Miller
>
> Sent: March 29, 2008 11:07 PM
> To: Programming forum
> Subject: Re: [Jprogramming] finding roots
>
>
> On Sat, Mar 29, 2008 at 5:30 PM, Robert O'Boyle <[EMAIL PROTECTED]>
> wrote:
> > (c,: n) FVPA ^:_"_1 (0.3) gives a length error
>
> Oops, my mistake.
>
>    (c,. n) FVPA ^:_"_1 (0.3)
> 0.12 0.164 0.304 0.36 0.4 0.4 0.4 0.4 0.4
>
> Thanks,
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to