Inverses are jtinv() in ai.c.  It's pretty fast.

I have other fish to fry, but if anyone wanted to add inverses to jtinv, that would be a nice self-contained project that would be of general value.


On 9/18/2016 4:16 PM, Raul Miller wrote:
Related, though, is how much time it takes to find if g contains names.

If this can be significant, it might be worth going to the extra effort to
delay examining it for names until the point where you are prepared to use
its inverse. (And, having an "inverse that contains names" be a different
result than "inverse which does not contain names.)

Or, another approach might be to spread out the cost of determining that
and putting the information in the verb definition.

(Purely performance based changes should probably include a test against
the full test suite of unrelated operations just to make sure that they are
not imposing a significant cost on the general case?)

Meanwhile, as an aside, I noticed this:

    1 2 1&p. inv 16 25
|domain error

It looks like we are not supporting some potential inverses (or, ok,
obverses...) which we could be supporting. (And, yes, I know, two choices
here... but we do ok with things like arccosine despite a multiplicity of
choices.) But, of course, that is probably another project....

For information about J forums see

Reply via email to