1
|
BlockStmt([CommentStmt('Solves Func(x)=0 on the interval [a, b]'), AssignStmt(IdentifierNode('Func'), LambdaNode(['x'], BinOpNode(BinOpNode(IdentifierNode('x'), NumberNode(1), '-'), BinOpNode(NumberNode(1), IdentifierNode('x'), '/'), '-'))), AssignStmt(IdentifierNode('prec'), NumberNode(1e-08)), InputStmt(IdentifierNode('a'), None), InputStmt(IdentifierNode('b'), None), WhileStmt(BinOpNode(BinOpNode(IdentifierNode('b'), IdentifierNode('a'), '-'), IdentifierNode('prec'), '>'), [AssignStmt(IdentifierNode('m'), BinOpNode(BinOpNode(IdentifierNode('a'), IdentifierNode('b'), '+'), NumberNode(2), '/')), IfStmt(BinOpNode(BinOpNode(CallNode(IdentifierNode('Func'), [IdentifierNode('m')]), CallNode(IdentifierNode('Func'), [IdentifierNode('b')]), '*'), NumberNode(0), '>'), [AssignStmt(IdentifierNode('b'), IdentifierNode('m'))]), ElseStmt([AssignStmt(IdentifierNode('a'), IdentifierNode('m'))])]), DisplayStmt(CallNode(IdentifierNode('round'), [IdentifierNode('a'), IdentifierNode('prec')]), False), DisplayStmt(StringNode(' < x < '), False), DisplayStmt(CallNode(IdentifierNode('round'), [IdentifierNode('b'), IdentifierNode('prec')]), True)])
|