I dont see these as rivals but Leftlanenews posted a comparison:
Having driven the M3 only a few weeks ago, we couldn’t help drawing some comparisons. On the whole, these cars both get their owners to the same fun-driving goals, but they accomplish that in very different ways.
The M3 is slightly more attractive on the exterior, but the interior colors and style of the S5 are definitely more pleasing. It makes you feel good just to sit in this car, even though the BMW engineers would argue that all those colors and textures will take your mind off your driving.
The M3 can get you from zero to sixty a few tenths of a tick faster than the S5, but the M3 does it at higher rpm, so you always seem to be working harder for the same reward. On corners, especially on the track, the M3’s technology will get an average driver around the corner as fast as a better driver can do it in an S5, but when with a little practice, you can make the Audi perform just as well, the achievement feels more satisfying.
To put the comparison into perspective, if we were offered a choice between the two cars, we’d have to flip a coin to make our choice, and wouldn’t be unhappy with heads or tails. On the other hand, in the real world of real buyers, where we’re hearing reports of dealers adding as much as $30,000 of “market adjustment fees” to the price of the M3, the choice may be easier.