Exemple #1
0
def test_halley_hard():
    """
    Harder test for halley method
    """
    true_fval = 0.408
    fval = newton_halley(func_two, 0.4, func_two_prime, func_two_prime2)
    assert_allclose(true_fval, fval.root, rtol=1e-5, atol=0.01)
def test_halley_hard():
    """
    Harder test for halley method
    """
    true_fval = 0.408
    fval = newton_halley(func_two, 0.4, func_two_prime, func_two_prime2)
    assert_allclose(true_fval, fval.root, rtol=1e-5, atol=0.01)
Exemple #3
0
def test_halley_basic():
    """
    Basic test for halley method
    """
    true_fval = 1.0
    fval = newton_halley(func, 5, func_prime, func_prime2)
    assert_almost_equal(true_fval, fval.root, decimal=4)
def test_halley_basic():
    """
    Basic test for halley method
    """
    true_fval = 1.0
    fval = newton_halley(func, 5, func_prime, func_prime2)
    assert_almost_equal(true_fval, fval.root, decimal=4)