Did residual using pythagoras theorem properly

Duh!  That was stupid.  Change to Value is to add setDerivative
method