cached inverse implementation