you may want to
1. check the Math class and see if there's anything in there that can help you
2. if it doesn't try to write a method yourself
3. if you can't figure out what the code should be: be a bit more clear about what you expect it to do

But if I'm correct f(x) = y is very vague and just means x=y because you are not actually giving us a function to apply to x.

For example: We will use this set of inputs for x , x = {1,2,3,4,5} for both of the following problems. f(x)=y
f(1)=1
f(2)=2
f(3)=3
f(4)=4
f(5)=5
The output(y) is the same as the input(x) because there is no defined function here.

Where as if it were something like this:

f(x+1)= y
f(1+1)=2
f(2+1)=3
f(3+1)=4
f(4+1)=5
f(5+1)=6

The output(y) has +1 added to each of the input(x).