code: def _golden(self, triplet, fun):
          
          self.num_golden = 0
          (qa, fa), (qb, fb), (qc, fc) = triplet
          while True:
              self.num_golden += 1
              qd = qa + (qb-qa)*phi/(1+phi)
              fd = fun(qd)
              if fd < fb:
                  #print "golden d"
                  (qa, fa), (qb, fb) = (qb, fb), (qd, fd)
              else:
                  #print "golden b"
                  (qa, fa), (qc, fc) = (qd, fd), (qa, fa)
              if abs(qa-qb) < self.qtol:
                  return qc, fc
docs: Reduce the size of the bracket until the minimum is found