cell: combine eval_z(), eval_w() functions