<jupyter_start><jupyter_text>Define a function for which we'd like to find the roots<jupyter_code>def function_for_roots(x):
    a = 1.01
    b = -3.04
    c= 2.07
    return a*x**2 + b*x + c #get the roots of ax^2 +bx + c
def check_initial_values(f,x_min,x_max,tol):
    
    y_min = f(x_min)
    y_max = f(x_max)
    
    if(y_min*y_max>=0.0):
        print("No zero crossing found in the range =",x_min,x_max)
        s = "f(%f) = %f, f(%f) = %f" % (x_min,y_min,x_max,y_max)
        print(s)
        return 0
    
    # if x_min is a root, then return flag == 1
    if(np.fabs(y_min)<tol):
        return 1
    
    #if x_max is a root, then return flag == 2
    if(np.fabs(y_max)<tol):
        return 2
    
    #if we reach this point, the bracket is valid
    #and we will return 3
    return 3<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12530120481927712, 'fraction_numerical': 0.024096385542168676, 'mean_word_length': 2.419753086419753, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '6950', 'license': 'MIT', 'n_tokens_mistral': 359, 'n_tokens_neox': 339, 'n_words': 93, 'path': 'Bisection Search.ipynb', 'repo_name': 'Merlin1908/asrt119_session_7', 'size': '830'}