e1e2e3 function

Calculate e1, e2, e3 from the invariants