fixed segmentation fault for denominator of zero rational function