cacheing compiled integrand in quadpack functions



>
> the quadpack functions (quad_qags etc) call COMPILE on the
> integrand. i'm working on a problem in which i'd like to evaluate
> the integrand repeatedly for different limits of integration,
> so it seems like the integrand only needs to be compiled once.
> does it seem reasonable and practical to put the compiled
> integrand into a hash table with the integrand as the key?


Sounds like a very sensible idea for your own uses.

It might be more problematic to have it as part of the standard library,
because the user may have redefined macros or changed translator or compiler
flags between one call and the next.  Perhaps a reasonable compromise
between getting the semantics exactly right and not worrying about unusual
or rare cases would be to use the translated-to-Lisp (Translate) version of
the integrand as the key instead of the source form.  Translation-to-Lisp
should be several orders of magnitude faster than full compilation, which
starts an external process, etc.