<jupyter_start><jupyter_text>Minta input<jupyter_code>e = 2.7182818248590452
a = float(input("Masukan batas bawah : "))
b = float(input("Masukan batas atas  : "))<jupyter_output>Masukan batas bawah : 2
Masukan batas atas  : 3<jupyter_text>Lakukan iterasi terus menerus selagi nilai fx tidak sama dengan 0<jupyter_code>while True:
    x = (a+b)/2
    fa = (a**2)-(e**a)+8   # BISA DIGANTI DENGAN FUNGSI YANG LAIN
    fx = (x**2)-(e**x)+8   # BISA DIGANTI DENGAN FUNGSI YANG LAIN
    fb = (b**2)-(e**b)+8   # BISA DIGANTI DENGAN FUNGSI YANG LAIN
    
    print("\nNilai a ",a)
    print("Nilai x ",x)
    print("Nilai b ",b)
    print("Nilai fa ",fa)
    print("Nilai fx ",fx)
    print("Nilai fb ",fb)
    
    if (fa*fx > 0):
        a,b=x,b
    else:
        a,b=a,x
        
    if (fx == 0):
        break<jupyter_output>Nilai a  2.0
Nilai x  2.5
Nilai b  3.0
Nilai fa  4.610943920640979
Nilai fx  2.0675060796317286
Nilai fb  -3.0855368433858636

Nilai a  2.5
Nilai x  2.75
Nilai b  3.0
Nilai fa  2.0675060796317286
Nilai fx  -0.08013182721760437
Nilai fb  -3.0855368433858636

Nilai a  2.5
Nilai x  2.625
Nilai b  2.75
Nilai fa  2.0675060796317286
Nilai fx  1.0860508619239653
Nilai fb  -0.08013182721760437

Nilai a  2.625
Nilai x  2.6875
Nilai b  2.75
Nilai fa  1.0860508619239653
Nilai fx  0.5277635735136137
Nilai fb  -0.08013182721760437

Nilai a  2.6875
Nilai x  2.71875
Nilai b  2.75
Nilai fa  0.5277635735136137
Nilai fx  0.23024292025580095
Nilai fb  -0.08013182721760437

Nilai a  2.71875
Nilai x  2.734375
Nilai b  2.75
Nilai fa  0.23024292025580095
Nilai fx  0.07669134102318864
Nilai fb  -0.08013182721760437

Nilai a  2.734375
Nilai x  2.7421875
Nilai b  2.75
Nilai fa  0.07669134102318864
Nilai fx  -0.001307615570256715
Nilai fb  -0.08013182721760437

Nilai a  2.734375
Nilai x  2.73828125
Nilai b  2.7[...]<jupyter_text>Cetak nilai taksiran dari x<jupyter_code>print("\nNilai x nya : ", x)<jupyter_output>Nilai x nya :  2.742057202874789
{'fraction_non_alphanumeric': 0.10107197549770292, 'fraction_numerical': 0.26186830015313933, 'mean_word_length': 3.1791044776119404, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '553487', 'license': 'MIT', 'n_tokens_mistral': 1244, 'n_tokens_neox': 957, 'n_words': 228, 'path': 'Metode Numerik/2. Metode Bagi Dua.ipynb', 'repo_name': 'rakhid16/Ngampus-', 'size': '1959'}