This paper presents a new algorithm for calculating the reliability of the binary coherent and non-coherent network by the subproduct inversion. The virtue of the HHL91 algorithm lies in it ability to express the Boolean function by subproduct inversion, reducing the number of SDP terms to the nearly smallest by choosing the most appropriate ordering. While the Abraham algorithm and its successors obtain relatively short SDP forms of the Boolean functions, this new algorithm generates shorter disjoint product terms than any other known SDP method. This algorithm applies not only coherent system but also noncoherent system. Ten examples illustrate how the HHL91 algorithm fares better than other methods in terms of the number of SDP terms and the computation process.