The calculation
How this estimate works
All four entry points resolve to a due date first, then subtract 266 days to reach fertilization, so they can never disagree with each other. A last period date adds your cycle length minus your luteal phase to find ovulation. An ultrasound date subtracts the gestational age it reported to find day one.
The intercourse window then runs from five days before fertilization to the day itself, covering how long sperm can survive while waiting for an egg.