Branch-locking AD techniques for nonsmooth composite functions and nonsmooth implicit functions. (2nd November 2018)