that is not a y=f(x) equation, simply because there are x-values which lead to different y-values. besides that, why are you are using the fragment shader ? a better way is to compute the xyz value...