Short Answer
It would be preferable to say
fit the formula to the data.
Long Answer
In English, the relevant definition of "to fit" is
fit, verb:
(2) fix or put (something) into place.
"they fitted smoke alarms to their home"
The dictionary that Google uses further suggests that similar words (in this context) might be "to position" or "to place". This is, more or less, how the word is used in mathematics, particularly in the context of statistics, where one might want to "fit" a curve to a dataset (e.g. to place a curve so that it matches the dataset).
More anecdotally, as a native English speaker, my "gut feeling" is that when we fit $A$ to $B$, this means that we are modifying a flexible or changeable object $A$ so that it better conforms to fixed object $B$. For example, we
- fit a pair of pants to a person—the person is the size that they are, which we can think of as constant; the pants can be altered so that they conform to the shape of the person;
- fit a glove to a hand—again, the hand does not change shape or size, so the glove must be altered in order to match the hand; or
- fit a person to a job—the goal of job interviews is to find the person who best characterizes the skills and personality for performing a certain fixed job.
In the context of the question asked, the discrete data are fixed and unchanging, and we desire to find the parameters such that the given formula best matches the fixed data. Hence it would be correct to say
We fit the formula to the discrete data.
It may also be worth noting that this is fairly standard language. For example, see the language used in the Wikipedia article on curve fitting. In particular, note that a couple of the subheadings in the articles table of contents are "fitting lines and polynomial functions to data points," and "fitting other functions to data points".