Bifunctional enzyme. Involved in de novo dTMP biosynthesis. Key enzyme in folate metabolism. Can play two different roles depending on the source of dihydrofolate: de novo synthesis of tetrahydrofolate or recycling of the dihydrofolate released as one of the end products of the TS catalyzed reaction. Catalyzes an essential reaction for de novo glycine and purine synthesis, DNA precursor synthesis, and for the conversion of dUMP to dTMP (By similarity). (6S)-5,6,7,8-tetrahydrofolate + NADP(+) = 7,8-dihydrofolate + H(+) + NADPH (6R)-5,10-methylene-5,6,7,8-tetrahydrofolate + dUMP = 7,8-dihydrofolate + dTMP Cofactor biosynthesis; tetrahydrofolate biosynthesis; 5,6,7,8-tetrahydrofolate from 7,8-dihydrofolate: step 1/1. In the N-terminal section; belongs to the dihydrofolate reductase family. In the C-terminal section; belongs to the thymidylate synthase family.