using jit.expr to calculate distortion