Diagnostic procedure
WARNING: This page is about a different car, the 2004 Mazda 6. However, it is still accessible from the selected car via links, so may be relevant.
Fig 1: Symptom No.11 Engine Stalls/Quits, Engine Runs Rough, Misses, Buck/Jerk, Hesitation/Stumble, Surges - Diagnostic Procedure Chart (Step 1)