When mapping a function to a texture map, rather than a texture, the range covered by the texture coordinates should be from 1/size to 1/size + coord*(size-1)/size of the texture, half a pixel in from each edge. This makes the value at the edge of the rectangle map to the value stored in that texel, rather than spreading that same value over the last half texel's range on the geometry.
When mapping a function to a texture map, rather than a texture, the range covered by the texture coordinates should be from 1/size to 1/size + coord*(size-1)/size of the texture, half a pixel in from each edge. This makes the value at the edge of the rectangle map to the value stored in that texel, rather than spreading that same value over the last half texel's range on the geometry.