There is drill field performance and combat performance. The Prussian army under Frederick the Great trained to six rounds per minute in peace time because that translated to the desired 3 rounds under combat conditions. From what I can find the ratio was similiar for archers: a training standard of 12 arrows per minute translated into a sustained rate of fire of 6 on a battlefield (although Baranbe Rich, author and professional soldier in the 16th century gave more an RoF ratio of 5 to 8, but with higher accuracy to the musket). Equally with range for archers: yes there are reports of effective fire over 300 yards, but there are also writings that warn not to expect more than 10% of mustered men to exceed 200 paces (170 yards). For muskets the range does not change with the quality of men: everyone can shoot 300 paces and everyone has an even chance to hit something at a 100 paces.A well trained musketman shot 3 rounds a minute, not 5.
Smoothbore muskets only hit their targets 50% of the time at 100 yards. Rifled muskets were rare in Europe.
Longbows had an effective range of 300 yards and a rate of fire of 10-15 shots a minute.
You are wrong about effectiveness.
Guns beat out bows because they were simply cheaper and cannons made better artillery.
Then there is the frontage. A Prussian 7yw batallion had a frontage of 75cm per musketeer so a full batallion with some 540 musketeers took a width of about 130 meters on the battlefield and including the NCOs, officers etc. behind the three lines is a bit over 6m deep. You maybe can put 60% as a many archers into the same space.
Both archers and musketeers tended to carry about 60 rounds, that is at the assumed RoFs 10 minutes for an archer and 20 for a musketeer.
Now how does that look on a battlefield? Let´s assume two average units facing each other on said 130m front. Individual archers start to fire at 300m, scoring a few hits in the next 80 seconds at a normal advance speed. The Prussian batallion opens fire by Peleton at about 200m while advancing, even if for the next five minutes (advance by peloton is 10-12m per minute) until they reach a hundred meters, chances to hit something are minimal (a test done in Prussia in 1755 had 13% hits on a 6,60x2,60 target at 200m). At about 150m the archers can finally fire back as a full unit. Until that point the musketeers have fired in excess 4000 rounds, the 30 long ranged archers about 650 rounds. Over the next 2,5 minutes until the muskets reach 100m, truly effective range, the muskets could in theory fire another 4000 something rounds, the archers could fire back about 4500 rounds. So in the case that all these shots go wild and cause no losses, in the first 6 minutes of combat the archers pour out 5150 rounds, the musketeers 8000 rounds. At that point, assuming that both sides had an equal percentage of losses so far (which is a stretch), the archers will start to move ahead, but thank to the greater numbers per frontage the musketeers will still put about 90% the rounds of the archers downrange. And even at the slow pace of a peleton advance the musketeers are only 5 minutes from bayonet range, shorter if they call the charge at some point. Now I assume elite units of archers can beat the average of 6rounds at least in bursts (just like some musket units occasionally exceeded the 3 rpm in combat) and have a higher percentage of archers that can actually use the full range of long bows, but in any army most units will be average.