map function to build equation and compute y to each input x