Suppose I have a function that returns a polynomial in
but it is quite slow, so I memoize this.
GetPoly[params,2y] or similar do not utilize the memoized data, it does the same computation now with
What is the best way to reuse the existing computation?
The solution I can cook up is to use an auxiliary function that computes the polynomial symbolically, and then substitute with the actual symbol/value:
Is this the best solution to my problem? What is the convention to do this in a package?