Shouldn't this be `ferror = abs $ f a - f a'`?