Open EgorBu opened 1 month ago
After examination I think I found the problematic function that doesn't wrap variable in brackets when needed:
def bracketed(child, parent, bracket_if_same_precedence):
"""Returns string representation of `child`, possibly bracketed.
Args:
child: Instance of `Op` or a valid value for `ConstantOp`.
parent: Instance of `Op`. Used to determine whether `child` needs to be
bracketed first before appearing in the parent op's expression.
bracket_if_same_precedence: Whether to bracket if the child has the same
operator precedence as the parent.
Returns:
String representation of `child`.
"""
extrapolate/arithmetic__mixed_longer
17/((-1360)/25540) + (258/(-688))/(7/((-210)/9)) - -1*7
<class 'mathematics_dataset.sample.ops.Sub'>
17/((-1360)/25540) + (258/(-688))/(7/((-210)/9)) - -1*7 -311
((137760/175)/(-12) - -24 - (12/9)/(1/(-1 + 4))) + 5 + 189/(-35)
<class 'mathematics_dataset.sample.ops.Add'>
((137760/175)/(-12) - -24 - (12/9)/(1/(-1 + 4))) + 5 + 189/(-35) -46
(9/(324/(-66)) + -3*4/(-12))/(3553/(-17490) - ((-18)/(-10))/(-9))
<class 'mathematics_dataset.sample.ops.Div'>
extrapolate/arithmetic__add_sub_multiple_longer
4 + -39 - (-10 - (5 + -18) - (-6 - (9 - 16) - (-1 - -6))) - -6
<class 'mathematics_dataset.sample.ops.Sub'>
interpolate/numbers__round_number_composed
Пусть f = 2 + -128.02. Округли f до десятков. -130
Пусть j = -0.18788 + 102.07788. Пусть y = -101 + j. Округли y до ближайшего
целого. 1
Пусть y = -11.467 + 0.167. Пусть s = y - -11.300167. Округли s до 5 десятичных
знаков. 0.00017
Main problem looks like this:
5 + - 3
Examples: