I tried to look at https://en.wikipedia.org/wiki/Function_(mathematics) but couldn't see anything.
The reason why I was curious to ask is because this word just doesn't make any sense for what it does.
If we were to reinvent all the words that don't make sense, and they become normal in a given culture, communication would be far more efficient and clear.
I'm sure that the linguists has plenty of examples (which they've already given examples for) of the structure of words just not making any sense.