Marshall Lochbaum wrote: > I have: > > 4&o. -:@((* 4&o.) - 5&o.) > 8&o. -:@((* - 7&o.@%) 8&o.) > _8&o. -:@((* -~ 7&o.@%) 8&o.) > > using Mathematica. I haven't checked these in J, so there's a chance I > mistranslated. _4&o. comes out the same. Or, yours could be rewritten as: > > 4&o. -:@((* + ^.@+) 4&o.) > 8&o. j.@-:@((* + ^.@+) 4&o.) > _4&o. -:@((* - ^.@+) _4&o.) > _8&o. -@j.@-:@((* + ^.@+) 4&o.) > > if that computes faster--these only require one computation of 4&o. or > _4&o.
4&o. -:@((* 4&o.) - 5&o.) I think you mean -:@((* 4&o.) + _5&o.) I agree this is better. 8&o. -:@((* - 7&o.@%) 8&o.) This seems to not check out. x10=:_10+20*50 ?@$ 0 if8=:-:@((* - 7&o.@%) 8&o.) >./|(if8 D. 1 - 8&o.)"0 x1 0.0431979 Now that I have read Paul Penfield's paper "Principal Values and Branch Cuts in Complex APL" (thanks, Roger!) I would treat 8&o. a bit more seriously. Using the result from Wolfram Alpha I get if8=:-:@((* 8&o.) - _3&o.@(% 8&o.)) >./|(if8 D. 1 - 8&o.)"0 x1 3.13664e_8 Since _8&o. -: -8&o. I would go with -@if8 as the integral. I am not totally convinced that optimizing these indefinite integrals for speed is helpful. After all, if we want a numerical answer we could start with a numerical technique and not mess around doing symbolic integration. Best wishes, John ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
