I'm not entirely certain about when it is most appropriate to use with and by, respectively. An example should clarify my problem:
We describe the input with an exponential function.
or
We describe the input by an exponential function.
My understanding is that in this type of situation, with is used if the object is more like a tool and by if it is the active agent. This would suggest that with is more appropriate in the above example but in the following example, by is better:
The input is best described by an exponential function.
Is this usage correct? Is there a clear grammatical or stylistic rule?