General Formula for Error Propagation