For several satellite instruments (Landsat, MERIS, OLCI, MSI) the computation of water reflectance from atmosphere path reflectance and transmittance is wrong. The wrong code found for all these instruments is
log_rw[i] = r_tosa[i] - rpath_nn[i] / (transu_nn[i] * transd_nn[i]);
The correct computation is
rwa[i] = (r_tosa[i] - rpath_nn[i]) / (transu_nn[i] * transd_nn[i]);
Besides the missing brackets, the right hand side of the equation yields water reflectance (but not the logarithm of water reflectance).