Vlad,
Some experimentation with your sample code showed that the function is called for everytime it appears in the select. If you remove one of them you get two firings, with two of them you get 6 firings (I can't account for the extra two firings).
However, it always produces the correct results in the resulting cursor, which reinforces something that I have said in my classes for a long time; "The only thing that you can depend on about how SQL SELECT will produce its result is that it will produce its result." IOW, you cannot depend on anything about number of functions calls, selected work areas, table alias names, record pointer positions, or anything else about the internal behavior of a SELECT query.
This is the reason that using UDF's in SELECTs is cautioned in the docs.