Hey welcome to the forums. I have replied to a post like this just a day ago lol, but i'll be more than happy to tell it to you. I had a problem just like this with my bmw e39 528i 99', and by the sounds of it you will need to replace either your ignition coils ( if not done so already) or your intake elbow ( that's connected directly between the throttle body elbow which is connected to the engine and the MAF sensor which is connected to the intake box. Also, do you experience any loss of power at earlier rpm's say from 0-3000? Does the car feel like it's holding back tremendously? these are signs of cylinder misfires in more than one cylinder, and will need a certified technician to run the car's computer management control system through a computer to pull up the codes, in which the computer will read engine misfires, and the respective cylinders. I would firstly double check for vacumm seal leaks, and the intake elbow connection. I'll post a picture of what it'll look like. There are usually tears in the intake elbows which cause that rough idle and exhaust pattern.
I spend at least 2 hours a day cleaning my car