updated error function in arithmetic