#NEWLINE# def test_antiderivative_simple( self ) : #NEWLINE# #INDENT# x = [ 0 , 1 , 3 ] #NEWLINE# c = [ [ 0 , 0 ] , [ 1 , 1 ] ] #NEWLINE# bp = BPoly ( c , x ) #NEWLINE# bi = bp . antiderivative ( ) #NEWLINE# xx = np . linspace ( 0 , 3 , 11 ) #NEWLINE# assert_allclose ( bi ( xx ) , np . where ( ( xx < 1 ) , ( ( xx ** 2 ) / 2.0 ) , ( ( ( 0.5 * xx ) * ( ( xx / 2.0 ) - 1 ) ) + ( 3.0 / 4 ) ) ) , atol = 1e-12 , rtol = 1e-12 )