  The cosmic formation rate of long Gamma Ray Bursts (LGRBs) encodes the
evolution, across cosmic times, of their progenitors' properties and of their
environment. The LGRB formation rate and the luminosity function, with its
redshift evolution, are derived by reproducing the largest set of observations
collected in the last four decades, namely the observer-frame prompt emission
properties of GRB samples detected by the Fermi and Compton Gamma Ray
Observatory (CGRO) satellites and the redshift, luminosity and energy
distributions of flux-limited, redshift complete, samples of GRBs detected by
Swift. The model that best reproduces all these constraints consists of a GRB
formation rate increasing with redshift $\propto (1+z)^{3.2}$, i.e. steeper
than the star formation rate, up to $z\sim3$ followed by a decrease
$\propto(1+z)^{-3}$. On top of this, our model predicts also a moderate
evolution of the characteristic luminosity function break $\propto(1+z)^{0.6}$.
Models with only luminosity or rate evolution are excluded at $>5\sigma$
significance. The cosmic rate evolution of LGRBs is interpreted as their
preference to occur in environments with metallicity $12+\log(\rm O/H)<8.6$,
consistently with theoretical models and host galaxy observations. The LGRB
rate at $z=0$, accounting for their collimation, is $\rho_0=79^{+57}_{-33}$
Gpc$^{-3}$ yr$^{-1}$ (68% confidence interval). This corresponds to $\sim$1\%
of broad-line Ibc supernovae producing a successful jet in the local Universe.
This fraction increases up to $\sim$7% at $z\ge3$. Finally, we estimate that at
least $\approx0.2-0.7$ yr$^{-1}$ of Swift and Fermi detected bursts at $z<0.5$
are jets observed slightly off-axis.
