Computation of the butterfly