public function complexDiv(ComplexType $a, ComplexType $b)
    {
        if ($b->isZero()) {
            throw new \BadMethodCallException('Cannot divide complex number by zero complex number');
        }
        //div = br^2 + bi^2
        $div = $this->rationalAdd(
            $this->rationalMul($b->r(), $b->r()),
            $this->rationalMul($b->i(), $b->i())
        );
        //r = ((ar * br) + (ai * bi))/div
        $r = $this->rationalDiv(
            $this->rationalAdd(
                $this->rationalMul($a->r(), $b->r()),
                $this->rationalMul($a->i(), $b->i())
            ),
            $div
        );
        //i = ((ai * br) - (ar * bi)) / div
        $i = $this->rationalDiv(
            $this->rationalSub(
                $this->rationalMul($a->i(), $b->r()),
                $this->rationalMul($a->r(), $b->i())
            ),
            $div
        );

        return ComplexTypeFactory::create($r, $i);
    }