Atom interferometer in a double-well potential