def _quadmin(a, fa, fpa, b, fb):
    """
    Finds the minimizer for a quadratic polynomial that goes through
    the points (a,fa), (b,fb) with derivative at a of fpa,

    """
    D = fa
    C = fpa
    db = b - a * 1.0
    if db == 0:
        return None
    B = (fb - D - C * db) / (db * db)
    if B <= 0:
        return None
    xmin = a - C / (2.0 * B)
    return xmin
