You shouldn't go to the doctor. Do not go to the toilet straight after having sex. Lay on the bed straight for about 10 minutes after sex. Because you go to toilet much earlier thats why the sperm goes out with the urine.
Well the reason might be you are not using appropriate position for intercourse or not getting the target. You have to use the missionary position for intercourse and ask your sex partner to take right position so this might be the reason for waste out of sperms. Check this website for further details.
After you sit up, gravity takes over. (Anyway, all of it didn't go out.)