gradient of logZ now uses BP and passes spec