The cross product is a classic.
If you have zillion of such computation to do, try the following optimized version that requires half less multiplications:
area = 0;
for( i = 0; i < N; i += 2 )
area += x[i+1]*(y[i+2]-y[i]) + y[i+1]*(x[i]-x[i+2]);
area /= 2;
I use array subscript for clarity. It is more efficient to use pointers. Though good compilers will do it for you.
The polygon is assumed to be "closed", which means you copy the first point as point with subscript N. It also assume the polygon has an even number of points. Append an additional copy of the first point if N is not even.
The algorithm is obtained by unrolling and combining two successive iterations of the classic cross product algorithm.
I'm not so sure how the two algorithms compare regarding numerical precision. My impression is that the above algorithm is better than the classic one because the multiplication tend to restore the loss of precision of the subtraction. When constrained to use floats, as with GPU, this can make a significant difference.
EDIT: "Area of Triangles and Polygons 2D & 3D" describes an even more efficient method
// "close" polygon
x[N] = x[0];
x[N+1] = x[1];
y[N] = y[0];
y[N+1] = y[1];
// compute area
area = 0;
for( size_t i = 1; i <= N; ++i )
area += x[i]*( y[i+1] - y[i-1] );
area /= 2;