performance issues in simple arithmetic code