Пример #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)
Пример #2
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)
Пример #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)
Пример #4
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)