We conjecture that the relative Gromov-Witten potentials of elliptic fibrations are (cycle-valued) lattice quasi-Jacobi forms and satisfy a holomorphic anomaly equation. We prove the conjecture for the rational elliptic surface in all genera and curve classes numerically. The generating series are quasi-Jacobi forms for the lattice E8. We also show the compatibility of the conjecture with the degeneration formula. As Corollary we deduce that the Gromov-Witten potentials of the Schoen Calabi-Yau threefold (relative to P 1 ) are E8 × E8 quasi-bi-Jacobi forms and satisfy a holomorphic anomaly equation. This yields a partial verification of the BCOV holomorphic anomaly equation for Calabi-Yau threefolds. For abelian surfaces the holomorphic anomaly equation is proven numerically in primitive classes. The theory of lattice quasi-Jacobi forms is reviewed.In the Appendix the conjectural holomorphic anomaly equation is expressed as a matrix action on the space of (generalized) cohomological field theories. The compatibility of the matrix action with the Jacobi Lie algebra is proven. Holomorphic anomaly equations for K3 fibrations are discussed in an example.Recently it became clear that we should expect properties (i, ii) not only for Calabi-Yau threefolds but also for varieties X (of arbitrary dimension) which are Calabi-Yau relative to a base B, i.e. those which admit a fibration π : X → B whose generic fiber has trivial canonical class. The potential F g (q) is replaced here by a π-relative Gromov-Witten potential which takes values in cycles on M g,n (B, k), the moduli space of stable maps to the base. In this paper we conjecture and develop such a theory for elliptic fibrations with section. Our main theoretical result is a conjectural link between the Gromov-Witten theory of elliptic fibrations and the theory of lattice quasi-Jacobi forms. This framework allows us to conjecture a holomorphic anomaly equation. 4 The elliptic curve (or more generally, trivial elliptic fibrations) is the simplest case of our conjecture and was proven in [33]. In this paper we prove the following new cases (see Section 5.3):(a) The P 1 -relative Gromov-Witten potentials of the rational elliptic surface are E 8 -quasi-Jacobi forms numerically 5 .(b) The holomorphic anomaly equation holds for the rational elliptic surface numerically.In particular, (a) solves the complete descendent Gromov-Witten theory of the rational elliptic surface in terms of E 8 -quasi-Jacobi forms. We also show:(c) The quasi-Jacobi form property and the holomorphic anomaly equation are compatible with the degeneration formula (Section 4.6).These results directly lead to a proof of Theorem 1 and 2 as follows. The Schoen Calabi-Yau X admits a degenerationwhere E i ⊂ R i are smooth elliptic fibers. By the degeneration formula [27] we are reduced to studying the case R i × E j . By the product formula [25] the claim then follows from the holomorphic anomaly equation for the rational elliptic surface and the elliptic curve [33]. For completeness we also prove the follo...