Implement fma and mad

I've implemented fma(x,y,z) and mad(x,y,z), as a follow-up to #6330. I'd be happy to receive comments.