In many math textbooks for secondary school you will find such passages. How do you value them?

In a city, the air temperature is recorded at regular intervals during the day.  The temperature (y) "depends" on the time (x) at which it is measured: it is a "function" of the time.  A function in which the link between x and y is not expressed with a mathematical formula is called "empirical function".
In the case of the cost of a pool (y) related to the months of frequency (x) according to the formula  y = 40 +30 ·x, , and in any case where the link between x and y can be calculated using a mathematical formula, the function is called a "mathematical function".

    These pieces are, unfortunately, testimonies of great ignorance (mathematics, it is understood) and of didactic insensitivity, and of the way in which, not infrequently, teaching builds misconceptions in the heads of the pupils, which then will be difficult to "disassemble".
    The function that inputs 1, 2, 3, and 4 associates outputs 3, 100, -7, and 2, respectively, is "empirical" or "mathematical"?  Just think of this example to understand that the distinction made by these manuals makes no sense.
    Then, reflecting on the nature of mathematics, what is the point of distinguishing the case of temperature from that of the cost of the pool?  In both cases, these are functions that bind two quantities that express real phenomena;  when I represent the quantities with numbers, in both cases the two functions are purely mathematical objects.  The difference is, possibly, in the fact that in one case I have a mathematical model that "describes" a phenomenon, in the other I have a mathematical model that "regulates" a phenomenon.
    With formulas I can then express only a "small" amount of functions (the four operations, the function that associates U with √U, the one that A and B associates A/(A+B), …):  the functions represent generic ways of associating output with input, not necessarily through a calculation!
    Then, why immediately construct the idea that inputs and outputs should be indicated with x and y?

    For a few more general considerations see HERE.