@Test
public void testDivide() {

    // divideByDouble
    assertCoefficientsEquals(new double[]{A / 2, B / 2, C / 2}, valueOf(A, B, C).divide(2));
    assertCoefficientsEquals(new double[]{Double.POSITIVE_INFINITY}, valueOf(A).divide(0));
    assertCoefficientsEquals(new double[]{Double.NEGATIVE_INFINITY}, valueOf(-A).divide(0));
    // divideByPolynomial
    assertCoefficientsEquals(new double[]{-1, 1}, valueOf(1, 0, -1, 1).divide(valueOf(0, 0, 1)));
    assertCoefficientsEquals(new double[]{Double.POSITIVE_INFINITY}, valueOf(A).divide(valueOf(0)));
    assertCoefficientsEquals(new double[]{Double.NEGATIVE_INFINITY}, valueOf(-A).divide(valueOf(0)));
}