I'm looking at
   load'math/calculus'
   coinsert'jcalculus'
   sin=:1&o.
   sin deriv 3
2&o. * _1"0@(1&o.)

And the only benefit I can see to this approach is that it preserves
hypothetical domain restrictions in the base function.

In math contexts, such issues are highlighted or ignored, depending on
the whims the mathematicians.

But here, I sort of suspect that we should assume that the constant
part of the expression does not need to detect domain errors.

This means that I think noun"rank@verb should be pruned to noun"rank.

That said, going all the way to -@(2&o.) would be an improvement.

Thanks,

-- 
Raul

On Fri, Jan 24, 2020 at 10:28 AM Henry Rich <[email protected]> wrote:
>
> To make the higher derivatives more compact, see what you can do with
> the function towards the top of calculus.ijs,
>
> NB. x and y are linear reps of functions
> NB. Result is linear rep of their product
> NB. Someday we may combine polynomials etc
> ftymes =: 4 : 0
> '((',x,')*(',y,'))'
> )
>
> It's probably combining - and -@(2&o.) and not recognizing that it could
> produce 2&o. .
>
> I will look into the crash, which is a stack error but the question is
> why it wasn't detected before it overwrote the stack.
>
> Henry Rich
>
>
>
> On 1/24/2020 9:23 AM, Arnab Chakraborty wrote:
> > Dear all,
> >
> > sin deriv 1
> >
> > works fine. So do
> >
> > sin deriv 9
> >
> > though the output is horrendously complex.
> >
> > sin deriv 40
> >
> > gives domain error.  Last, but not the least,
> >
> > sin deriv 10
> >
> > crashes after some delay.
> >
> > JVERSION
> > Engine: j901/j32/android
> > Release-c: commercial/2020-01-12T21:36:27
> > Library: 9.01.19
> > J Android: 1.4.03/7.0/24
> > Platform: Android 32 (armeabi-v7a)
> > Installer: unknown
> > InstallPath: /storage/emulated/0/Android/data/com.jsoftware.j.android/files
> > Contact: www.jsoftware.com
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> 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