You can do reduction by specifying more than one variable separated by a comma, i.e. a list:
#pragma omp parallel for default(shared) reduction(+:sum,result) ...
Private thread variables will be created for
result that will be combined using
+ and assigned to the original global variables at the end of the thread block.
y should be marked private.