New method for fast computation of gravity and magnetic anomalies from arbitrary polyhedra