print(sqrt(-1)())
i GOOD time: 0.817000ms
stack: size: 9
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(sqrt(-1), i)
1=i
GOOD
time: 0.674000ms
stack: size: 9
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

make sure, when distributing sqrt()'s, that the negative signs on the inside are simplified in advance

simplifyAssertEq( ((((-x*a - x*b)))^frac(1,2)), i * (sqrt(x) * sqrt(a+b)) )
(xaxb)12=ixa+b
GOOD
time: 10.220000ms
stack: size: 16
  • Init
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • Expand
  • Prune
  • +:Factor:apply
  • *:Factor:combineMulOfLikePow
  • Factor
  • ^:Prune:expandMulOfLikePow
  • *:Prune:flatten
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • Tidy

simplifyAssertEq( (-(((-x*a - x*b)))^frac(1,2)), -i * (sqrt(x) * sqrt(a+b)) )
(xaxb)12=ixa+b
GOOD
time: 9.515000ms
stack: size: 21
  • Init
  • unm:Prune:doubleNegative
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • *:Prune:flatten
  • Prune
  • Expand
  • Prune
  • +:Factor:apply
  • *:Factor:combineMulOfLikePow
  • Factor
  • ^:Prune:expandMulOfLikePow
  • *:Prune:flatten
  • Prune
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • *:Tidy:apply
  • *:Tidy:apply
  • Tidy


simplifyAssertEq( ((((-x*a - x*b)*-1))^frac(1,2)), (sqrt(x) * sqrt(a+b)) )
((xaxb)1)12=xa+b
GOOD
time: 5.549000ms
stack: size: 15
  • Init
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • Expand
  • Prune
  • +:Factor:apply
  • *:Factor:combineMulOfLikePow
  • Factor
  • ^:Prune:expandMulOfLikePow
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • Tidy

simplifyAssertEq( (-(((-x*a - x*b)*-1))^frac(1,2)), -(sqrt(x) * sqrt(a+b)) )
((xaxb)1)12=xa+b
GOOD
time: 5.671000ms
stack: size: 20
  • Init
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • Prune
  • Expand
  • Prune
  • +:Factor:apply
  • *:Factor:combineMulOfLikePow
  • Factor
  • ^:Prune:expandMulOfLikePow
  • *:Prune:flatten
  • Prune
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • *:Tidy:apply
  • *:Tidy:apply
  • Tidy
If sqrt, -1, and mul factor run out of order then -sqrt(-x) and sqrt(-x) will end up equal. And that isn't good for things like solve() on quadratics.

simplifyAssertEq( ((((-x*a - x*b)/-1)/y)^frac(1,2)), (sqrt(x) * sqrt(a+b)) / sqrt(y) )
(1y11(xaxb))12=xa+by
GOOD
time: 14.229000ms
stack: size: 35
  • Init
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • Expand
  • Prune
  • +:Factor:apply
  • *:Factor:combineMulOfLikePow
  • /:Factor:polydiv
  • Factor
  • ^:Prune:expandMulOfLikePow
  • *:Prune:flatten
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • Tidy

simplifyAssertEq( (-(((-x*a - x*b)/-1)/y)^frac(1,2)), -(sqrt(x) * sqrt(a+b)) / sqrt(y) )
(1y11(xaxb))12=xa+by
GOOD
time: 13.795000ms
stack: size: 41
  • Init
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • sqrt:Prune:apply
  • Prune
  • Expand
  • Prune
  • +:Factor:apply
  • *:Factor:combineMulOfLikePow
  • /:Factor:polydiv
  • Factor
  • ^:Prune:expandMulOfLikePow
  • *:Prune:flatten
  • *:Prune:flatten
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • Prune
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • *:Tidy:apply
  • *:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • /:Tidy:apply
  • Tidy


simplifying expressions with sqrts in them

simplifyAssertEq( 2^frac(-1,2) + 2^frac(1,2), frac(3, sqrt(2)) )
212+212=32
GOOD
time: 3.861000ms
stack: size: 12
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • Tidy

simplifyAssertEq( 2*2^frac(-1,2) + 2^frac(1,2), 2 * sqrt(2) )
2212+212=22
GOOD
time: 1.912000ms
stack: size: 13
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • *:Prune:combinePows
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • Tidy

simplifyAssertEq( 4*2^frac(-1,2) + 2^frac(1,2), 3 * sqrt(2) )
4212+212=32
GOOD
time: 1.976000ms
stack: size: 13
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • Tidy


simplifyAssertEq( (1 + sqrt(3))^2 + (1 - sqrt(3))^2, 8 )
(1+3)2+(13)2=8
GOOD
time: 6.228000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( (frac(1,2)*sqrt(3))*(frac(sqrt(2),sqrt(3))) + (-frac(1,2))*(frac(1,3)*-sqrt(2)) , 2 * sqrt(2) / 3)
12323+12132=1322
GOOD
time: 9.600000ms
stack: size: 13
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • *:Prune:combinePows
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • Tidy


simplifyAssertEq( -frac(1,3)*-frac(1+sqrt(3),3) + -frac(2,3)*frac(1,3) + -frac(2,3) * frac(1-sqrt(3),3), -frac(1 - sqrt(3), 3))
1313(1+3)+2313+2313(13)=13(13)
GOOD
time: 13.015000ms
stack: size: 24
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • Prune
  • *:Expand:apply
  • Expand
  • *:Prune:apply
  • ^:Prune:sqrtFix4
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • *:Prune:flatten
  • Prune
  • Factor
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( -sqrt(3)*sqrt(2)/(2*sqrt(3)) + sqrt(2)/6, -sqrt(2)/3 )
3223+162=13(2)
GOOD
time: 4.790000ms
stack: size: 17
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • Prune
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • *:Tidy:apply
  • /:Tidy:apply
  • Tidy


simplifyAssertEq( 1 + 5*sqrt(5) + sqrt(5), 1 + 6*sqrt(5) )
1+55+5=1+65
GOOD
time: 2.171000ms
stack: size: 10
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy
powers of the sqrt sometimes get caught simplifying as merging the exponents, and don't add.
simplifyAssertEq( 1 + 25*sqrt(5) + sqrt(5), 1 + 26*sqrt(5) )
1+255+5=1+265
GOOD
time: 2.123000ms
stack: size: 10
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq( 1 + 5*sqrt(5) - 5*sqrt(5), 1 )
1+5555=1
GOOD
time: 1.132000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( -(1 + sqrt(5))/(2*sqrt(3)) , frac(1,2)*(-frac(1,sqrt(3)))*(1 + sqrt(5)) )
(1+5)23=1213(1+5)
GOOD
time: 17.324000ms
stack: size: 83
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • *:Prune:factorDenominators
  • Prune
  • *:Expand:apply
  • Expand
  • *:Prune:apply
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • Constant:Tidy:apply
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • *:Tidy:apply
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( (-(1-sqrt(3))/3)*(frac(1,3)) + ((2+sqrt(3))/6)*(-(1-sqrt(3))/3) + (-(1+2*sqrt(3))/6)*(-(1+sqrt(3))/3) , (1 + sqrt(3))/3 )
13((13))13+16(2+3)13((13))+16((1+23))13((1+3))=13(1+3)
GOOD
time: 14.257000ms
stack: size: 10
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( (-sqrt(sqrt(5) + 1) * (1 - sqrt(5))) / (4 * sqrt(sqrt(5) - 1)) , frac(1,2))
5+1(15)451=12
GOOD
time: 10.615000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

ok this is hard to explain ..
simplifyAssertNe( 6 + 6 * sqrt(3), 12)
6+6312
GOOD
time: 2.935000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( (sqrt(5) + 1) * (sqrt(5) - 1), 4)
(5+1)(51)=4
GOOD
time: 2.051000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq( sqrt((sqrt(5) + 1) * (sqrt(5) - 1)), 2)
(5+1)(51)=2
GOOD
time: 2.512000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( (1 + 2 / sqrt(3)) / (2 * sqrt(3)), (2 + sqrt(3)) / 6 )
1+2323=16(2+3)
GOOD
time: 6.311000ms
stack: size: 10
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( (frac(1,3)*(-(1-sqrt(3)))) * (frac(1,3)*(-(1-sqrt(3)))) + (frac(1,6)*(2+sqrt(3))) * (frac(1,3)*(1+sqrt(3))) + (frac(1,6)*-(1+2*sqrt(3))) * frac(1,3), (4 - sqrt(3))/6 )
13(13)13(13)+16(2+3)13(1+3)+16(1+23)13=16(43)
GOOD
time: 13.332000ms
stack: size: 11
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( 1/sqrt(6) + 1/sqrt(6), 2/sqrt(6) )
16+16=26
GOOD
time: 2.362000ms
stack: size: 23
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • /:Prune:divToPowSub
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • Tidy


simplifyAssertEq( (32 * sqrt(3) + 32 * sqrt(15)) / 384, (sqrt(3) + sqrt(15)) / 12 )
1384(323+3215)=112(3+15)
GOOD
time: 31.563000ms
stack: size: 17
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( sqrt(5)/(2*sqrt(3)), sqrt(15)/6 )
523=1615
GOOD
time: 6.134000ms
stack: size: 111
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • ^:Prune:sqrtFix4
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • ^:Prune:sqrtFix4
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • *:Prune:combineMulOfLikePow_constants
  • *:Prune:apply
  • ^:Prune:sqrtFix4
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • ^:Prune:sqrtFix4
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • *:Prune:combineMulOfLikePow_constants
  • *:Prune:apply
  • ^:Prune:sqrtFix4
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • ^:Prune:sqrtFix4
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • Tidy


simplifyAssertEq( -1/(2*sqrt(3)), -sqrt(frac(1,12)) )
123=112
GOOD
time: 5.803000ms
stack: size: 98
  • Init
  • sqrt:Prune:apply
  • ^:Prune:oneToTheX
  • *:Prune:apply
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • /:Tidy:apply
  • Tidy

simplifyAssertNe( -sqrt(frac(1,12)), sqrt(frac(1,12)) )
112112
GOOD
time: 6.492000ms
stack: size: 137
  • Init
  • sqrt:Prune:apply
  • Prune
  • ^:Expand:frac
  • Expand
  • ^:Prune:oneToTheX
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • Tidy


simplifyAssertEq( (sqrt(2)*sqrt(frac(1,3))) * -frac(1,3) + (-frac(1,2)) * (sqrt(2)/sqrt(3)) + (frac(1,2)*1/sqrt(3)) * (-sqrt(2)/3), -sqrt(2) / sqrt(3) )
21313+1223+12313(2)=23
GOOD
time: 20.320000ms
stack: size: 22
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • Prune
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • *:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • /:Tidy:apply
  • Tidy


simplifyAssertEq( 1 + ( -(7 - 3*sqrt(5)) / (3*(3 - sqrt(5))) )*(1 + frac(1,2)), (1 + sqrt(5))/4 )
1+(735)3(35)(1+12)=14(1+5)
GOOD
time: 5.219000ms
stack: size: 10
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq( (-(sqrt(5)-1)/2)/sqrt((-(sqrt(5)-1)/2)^2 + 1), -sqrt( (sqrt(5) - 1) / (2 * sqrt(5)) ))
12((51))(12((51)))2+1=5125
GOOD
time: 35.123000ms
stack: size: 120
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • +:Prune:combineConstants
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • Constant:Tidy:apply
  • ^:Tidy:replacePowerOfFractionWithRoots
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:apply
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • sqrt:Prune:apply
  • ^:Prune:sqrtFix4
  • +:Prune:combineConstants
  • *:Prune:combinePows
  • ^:Prune:distributePow
  • ^:Prune:expandMulOfLikePow
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • Prune
  • ^:Expand:integerPower
  • ^:Expand:integerPower
  • ^:Expand:frac
  • Expand
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • *:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • *:Prune:factorDenominators
  • +:Prune:combineConstants
  • /:Prune:zeroOverX
  • +:Prune:factorOutDivs
  • ^:Prune:xToTheZero
  • *:Prune:combinePows
  • *:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:sqrtFix4
  • /:Prune:prodOfSqrtOverProdOfSqrt
  • /:Prune:divToPowSub
  • /:Prune:mulBySqrtConj
  • Prune
  • Factor
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq(sqrt(frac(15,16)) * sqrt(frac(2,3)), sqrt(5)/(2*sqrt(2)))
151623=522
GOOD
time: 3.974000ms
stack: size: 18
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • *:Prune:combinePows
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • Tidy


simplify() was introducing an unflattened mul where there originally was none
TODO NOTICE - if there's just sqrt(2)*sqrt(3) then the sqrts will merge ... so should they merge if that extra 2 is out front?

local expr = 2*sqrt(2)*sqrt(3) local sexpr = expr() printbr(Verbose(expr), '=', Verbose(sexpr)) simplifyAssertEq(expr,sexpr)
*[2, sqrt[2], sqrt[3]] = *[2, sqrt[2], sqrt[3]]
223=223
GOOD
time: 1.748000ms
stack: size: 20
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • ^:Prune:sqrtFix4
  • *:Prune:combinePows
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • ^:Prune:sqrtFix4
  • Prune
  • ^:Tidy:replacePowerOfFractionWithRoots
  • ^:Tidy:replacePowerOfFractionWithRoots
  • *:Tidy:apply
  • Tidy


these go bad when I don't have mul/Prune/combineMulOfLikePow_mulPowAdd

simplifyAssertEq( ( sqrt(f) * (g + f * sqrt(g)) )() , sqrt(f) * sqrt(g) * (sqrt(g) + f))
fg(g+f)=fg(g+f)
GOOD
time: 9.469000ms
stack: size: 21
  • Init
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • *:Expand:apply
  • Expand
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:flattenAddMul
  • ^:Prune:xToTheOne
  • *:Prune:combinePows
  • +:Prune:combineConstants
  • +:Prune:factorOutDivs
  • +:Prune:combineConstants
  • *:Prune:combinePows
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq( ( sqrt(f) * (g + sqrt(g)) )() , sqrt(f) * sqrt(g) * (sqrt(g) + 1))
fg+gf=fg(g+1)
GOOD
time: 5.059000ms
stack: size: 23
  • Init
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • +:Prune:combineConstants
  • Prune
  • *:Expand:apply
  • Expand
  • *:Prune:apply
  • /:Prune:xOverX
  • *:Prune:factorDenominators
  • +:Prune:flattenAddMul
  • ^:Prune:xToTheOne
  • *:Prune:combinePows
  • Prune
  • *:Factor:combineMulOfLikePow
  • Factor
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


hmm having constant factor and sqrt/pow simplification problems
works
simplifyAssertEq( sqrt(15) - sqrt(15), 0)
1515=0
GOOD
time: 0.666000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy
works
simplifyAssertEq( sqrt(6) - sqrt(Constant(2)*3), 0)
623=0
GOOD
time: 0.486000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq( sqrt(6) - sqrt(2)*sqrt(3), 0)
623=0
GOOD
time: 0.525000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq( sqrt(15)/2 - sqrt(15)/2, 0)
12151215=0
GOOD
time: 1.504000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq( sqrt(6*x) - sqrt(2)*sqrt(3)*sqrt(x), 0)
6x23x=0
GOOD
time: 0.700000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


without the extra product our difference-of-squares picks up fine ...
simplifyAssertEq( (3+sqrt(5)) * (3 - sqrt(5)), 4 )
(3+5)(35)=4
GOOD
time: 1.742000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy
and it does recognize without the sqrts as a simplified form ...
assertEq( (4 * sqrt(3+sqrt(5)))(), 4 * sqrt(3+sqrt(5)) )
43+5=43+5
GOOD
time: 1.101000ms
stack: size: 11
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy
but with and extra product of a sqrt of a sum ... it doesn't ... in fact specifically because the sqrt(3+sqrt(5)) matches the non-sqrt (3+sqrt(5)), so the powers combine, and then we can't merge all the sqrts into one as we did before
simplifyAssertEq( (3+sqrt(5)) * (3 - sqrt(5)) * sqrt(3+sqrt(5)) , 4 * sqrt(3+sqrt(5)))
(3+5)(35)3+5=43+5
expected (3+5)(35)3+5 to equal 43+5
found (3+5)3+5(35) vs 43+5
lhs stack
Init (3+5)(35)3+5
	*[+[3, sqrt[5]], +[3, unm(sqrt[5])], sqrt[+[3, sqrt[5]]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

unm:Prune:doubleNegative 1512
	*[-1, ^[5, /[1, 2]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

sqrt:Prune:apply (3+512)12
	^[+[3, ^[5, /[1, 2]]], /[1, 2]]	

+:Prune:combineConstants 3
	3	

+:Prune:factorOutDivs 32
	/[3, 2]	

+:Prune:combineConstants 32
	/[3, 2]	

*:Prune:combinePows (3+512)32(3+1512)
	*[^[+[3, ^[5, /[1, 2]]], /[3, 2]], +[3, *[-1, ^[5, /[1, 2]]]]]	

Prune (3+512)32(3+1512)
	*[^[+[3, ^[5, /[1, 2]]], /[3, 2]], +[3, *[-1, ^[5, /[1, 2]]]]]	

*:Expand:apply (3+512)323+(3+512)321512
	+[*[^[+[3, ^[5, /[1, 2]]], /[3, 2]], 3], *[^[+[3, ^[5, /[1, 2]]], /[3, 2]], *[-1, ^[5, /[1, 2]]]]]	

Expand (3+512)323+(3+512)321512
	+[*[^[+[3, ^[5, /[1, 2]]], /[3, 2]], 3], *[^[+[3, ^[5, /[1, 2]]], /[3, 2]], *[-1, ^[5, /[1, 2]]]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

*:Prune:flatten 1512(3+512)32
	*[-1, ^[5, /[1, 2]], ^[+[3, ^[5, /[1, 2]]], /[3, 2]]]	

Prune 3(3+512)32+1512(3+512)32
	+[*[3, ^[+[3, ^[5, /[1, 2]]], /[3, 2]]], *[-1, ^[5, /[1, 2]], ^[+[3, ^[5, /[1, 2]]], /[3, 2]]]]	

Factor (3+512)32(3+1512)
	*[^[+[3, ^[5, /[1, 2]]], /[3, 2]], +[3, *[-1, ^[5, /[1, 2]]]]]	

Prune (3+512)32(3+1512)
	*[^[+[3, ^[5, /[1, 2]]], /[3, 2]], +[3, *[-1, ^[5, /[1, 2]]]]]	

Tidy (3+5)3+5(35)
	*[+[3, sqrt[5]], sqrt[+[3, sqrt[5]]], +[3, unm(sqrt[5])]]	

rhs stack
Init 43+5
	*[4, sqrt[+[3, sqrt[5]]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

sqrt:Prune:apply (3+512)12
	^[+[3, ^[5, /[1, 2]]], /[1, 2]]	

Prune 4(3+512)12
	*[4, ^[+[3, ^[5, /[1, 2]]], /[1, 2]]]	

Expand 4(3+512)12
	*[4, ^[+[3, ^[5, /[1, 2]]], /[1, 2]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

Prune 4(3+512)12
	*[4, ^[+[3, ^[5, /[1, 2]]], /[1, 2]]]	

Factor 4(3+512)12
	*[4, ^[+[3, ^[5, /[1, 2]]], /[1, 2]]]	

Prune 4(3+512)12
	*[4, ^[+[3, ^[5, /[1, 2]]], /[1, 2]]]	

Tidy 43+5
	*[4, sqrt[+[3, sqrt[5]]]]	

BAD
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:125: failed
stack traceback:
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:246: in function
[C]: in function 'error'
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:125: in function 'simplifyAssertEq'
[string "simplifyAssertEq( (3+sqrt(5)) * (3 - sqrt(5))..."]:1: in main chunk
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:238: in function
[C]: in function 'xpcall'
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:237: in function 'exec'
sqrt.lua:120: in function 'cb'
/home/chris/Projects/lua/ext/timer.lua:58: in function 'timer'
sqrt.lua:9: in main chunk
[C]: at 0x5cbe028e2380
time: 7.440000ms
stack: size: 11
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy
see
simplifyAssertEq( (3+sqrt(5)) * (3 - sqrt(5)) * sqrt(2+sqrt(5)) , 4 * sqrt(2+sqrt(5)))
(3+5)(35)2+5=42+5
GOOD
time: 8.075000ms
stack: size: 11
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy
so I need to merge powers if the power is a fraction *and* the denominator matches

these are in simplification loops

start with -1 / ( (√√5 √(√5 - 1)) / √2 ) ... what mine gets now vs what mathematica gets

simplifyAssertEq( -1 / ( sqrt(sqrt(5) * (sqrt(5) - 1)) / sqrt(2) ), sqrt((5 + sqrt(5)) / 10))
15(51)2=110(5+5)
expected 15(51)2 to equal 110(5+5)
found 21+5+101+54514 vs 1+52514
lhs stack
Init 15(51)2
	/[-1, /[sqrt[*[sqrt[5], +[sqrt[5], unm(1)]]], sqrt[2]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

unm:Prune:doubleNegative 1
	-1	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

+:Prune:combineConstants 1+512
	+[-1, ^[5, /[1, 2]]]	

+:Prune:combineConstants 2
	2	

*:Prune:combinePows (12)2
	^[/[1, 2], 2]	

^:Prune:distributePow 5(12)2
	^[5, ^[/[1, 2], 2]]	

^:Prune:expandMulOfLikePow 5(12)2(1+512)12
	*[^[5, ^[/[1, 2], 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

sqrt:Prune:apply 5(12)2(1+512)12
	*[^[5, ^[/[1, 2], 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

^:Prune:sqrtFix4 212
	^[2, /[1, 2]]	

sqrt:Prune:apply 212
	^[2, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

unm:Prune:doubleNegative 1512
	*[-1, ^[5, /[1, 2]]]	

^:Prune:simplifyConstantPowers 1
	1	

^:Prune:simplifyConstantPowers 1
	1	

*:Prune:apply 5
	5	

*:Prune:apply 5
	-5	

unm:Prune:doubleNegative 5
	-5	

+:Prune:combineConstants 4
	-4	

unm:Prune:doubleNegative 212(1+512)12(1+1512)
	*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], +[-1, *[-1, ^[5, /[1, 2]]]]]	

unm:Prune:doubleNegative 45(12)2
	*[4, ^[5, ^[/[1, 2], 2]]]	

/:Prune:negOverNeg 212(1+512)12(1+1512)45(12)2
	/[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], +[-1, *[-1, ^[5, /[1, 2]]]]], *[4, ^[5, ^[/[1, 2], 2]]]]	

/:Prune:conjOfSqrtInDenom 212(1+512)12(1+1512)45(12)2
	/[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], +[-1, *[-1, ^[5, /[1, 2]]]]], *[4, ^[5, ^[/[1, 2], 2]]]]	

/:Prune:mulBySqrtConj 212(1+512)12(1+1512)45(12)2
	/[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], +[-1, *[-1, ^[5, /[1, 2]]]]], *[4, ^[5, ^[/[1, 2], 2]]]]	

/:Prune:qIsDiv 212(1+512)12(1+1512)45(12)2
	/[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], +[-1, *[-1, ^[5, /[1, 2]]]]], *[4, ^[5, ^[/[1, 2], 2]]]]	

Prune 212(1+512)12(1+1512)45(12)2
	/[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], +[-1, *[-1, ^[5, /[1, 2]]]]], *[4, ^[5, ^[/[1, 2], 2]]]]	

*:Expand:apply 212(1+512)121+212(1+512)121512
	+[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], -1], *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], *[-1, ^[5, /[1, 2]]]]]	

^:Expand:integerPower 11
	*[1, 1]	

^:Expand:integerPower 22
	*[2, 2]	

^:Expand:frac 1122
	/[*[1, 1], *[2, 2]]	

Expand 212(1+512)121+212(1+512)121512451122
	/[+[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], -1], *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]], *[-1, ^[5, /[1, 2]]]]], *[4, ^[5, /[*[1, 1], *[2, 2]]]]]	

^:Prune:sqrtFix4 212
	^[2, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 212
	^[2, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

*:Prune:apply 10
	10	

*:Prune:combineMulOfLikePow_constants 11012(1+512)12
	*[-1, ^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

*:Prune:flatten 11012(1+512)12
	*[-1, ^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

*:Prune:apply 1
	1	

*:Prune:apply 4
	4	

Prune 1212(1+512)12+11012(1+512)124514
	/[+[*[-1, ^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[-1, ^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[4, ^[5, /[1, 4]]]]	

Factor 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Prune 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Expand 1212(1+512)12+11012(1+512)124514
	/[+[*[-1, *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[-1, *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Prune 1212(1+512)12+11012(1+512)124514
	/[+[*[-1, ^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[-1, ^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[4, ^[5, /[1, 4]]]]	

Factor 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Prune 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Tidy 21+5+101+54514
	unm(/[+[*[sqrt[2], sqrt[+[unm(1), sqrt[5]]]], *[sqrt[10], sqrt[+[unm(1), sqrt[5]]]]], *[4, ^[5, /[1, 4]]]])	

rhs stack
Init 110(5+5)
	sqrt[/[+[5, sqrt[5]], 10]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

sqrt:Prune:apply (110(5+512))12
	^[/[+[5, ^[5, /[1, 2]]], 10], /[1, 2]]	

Prune (110(5+512))12
	^[/[+[5, ^[5, /[1, 2]]], 10], /[1, 2]]	

^:Expand:frac (5+512)121012
	/[^[+[5, ^[5, /[1, 2]]], /[1, 2]], ^[10, /[1, 2]]]	

Expand (5+512)121012
	/[^[+[5, ^[5, /[1, 2]]], /[1, 2]], ^[10, /[1, 2]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 1012
	^[10, /[1, 2]]	

Prune (5+512)121012
	/[^[+[5, ^[5, /[1, 2]]], /[1, 2]], ^[10, /[1, 2]]]	

Factor 51212(1+512)121012
	/[*[^[^[5, /[1, 2]], /[1, 2]], ^[+[1, ^[5, /[1, 2]]], /[1, 2]]], ^[10, /[1, 2]]]	

Prune (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Expand (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Prune (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Factor (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Prune (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Tidy 1+52514
	/[sqrt[+[1, sqrt[5]]], *[sqrt[2], ^[5, /[1, 4]]]]	

BAD
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:125: failed
stack traceback:
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:246: in function
[C]: in function 'error'
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:125: in function 'simplifyAssertEq'
[string "simplifyAssertEq( -1 / ( sqrt(sqrt(5) * (sqrt..."]:1: in main chunk
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:238: in function
[C]: in function 'xpcall'
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:237: in function 'exec'
sqrt.lua:120: in function 'cb'
/home/chris/Projects/lua/ext/timer.lua:58: in function 'timer'
sqrt.lua:9: in main chunk
[C]: at 0x5cbe028e2380
time: 20.274000ms
stack: size: 17
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • ^:Expand:frac
  • Expand
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq( -(sqrt( 10 * (sqrt(5) - 1) ) + sqrt(2 * (sqrt(5) - 1))) / (4 * sqrt(sqrt(5))), sqrt((5 + sqrt(5)) / 10))
(10(51)+2(51))45=110(5+5)
expected (10(51)+2(51))45 to equal 110(5+5)
found 21+5+101+54514 vs 1+52514
lhs stack
Init (10(51)+2(51))45
	/[unm(+[sqrt[*[10, +[sqrt[5], unm(1)]]], sqrt[*[2, +[sqrt[5], unm(1)]]]]), *[4, sqrt[sqrt[5]]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

unm:Prune:doubleNegative 1
	-1	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

+:Prune:combineConstants 1+512
	+[-1, ^[5, /[1, 2]]]	

^:Prune:sqrtFix4 1012
	^[10, /[1, 2]]	

^:Prune:expandMulOfLikePow 1012(1+512)12
	*[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

sqrt:Prune:apply 1012(1+512)12
	*[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

unm:Prune:doubleNegative 1
	-1	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

+:Prune:combineConstants 1+512
	+[-1, ^[5, /[1, 2]]]	

^:Prune:sqrtFix4 212
	^[2, /[1, 2]]	

^:Prune:expandMulOfLikePow 212(1+512)12
	*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

sqrt:Prune:apply 212(1+512)12
	*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

unm:Prune:doubleNegative 1(1012(1+512)12+212(1+512)12)
	*[-1, +[*[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

+:Prune:combineConstants 2
	2	

*:Prune:combinePows (12)2
	^[/[1, 2], 2]	

^:Prune:distributePow 5(12)2
	^[5, ^[/[1, 2], 2]]	

sqrt:Prune:apply 5(12)2
	^[5, ^[/[1, 2], 2]]	

Prune 1(1012(1+512)12+212(1+512)12)45(12)2
	/[*[-1, +[*[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, ^[/[1, 2], 2]]]]	

*:Expand:apply 11012(1+512)12+1212(1+512)12
	+[*[-1, *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[-1, *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]]	

^:Expand:integerPower 11
	*[1, 1]	

^:Expand:integerPower 22
	*[2, 2]	

^:Expand:frac 1122
	/[*[1, 1], *[2, 2]]	

Expand 11012(1+512)12+1212(1+512)12451122
	/[+[*[-1, *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[-1, *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[*[1, 1], *[2, 2]]]]]	

^:Prune:sqrtFix4 1012
	^[10, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

*:Prune:flatten 11012(1+512)12
	*[-1, ^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

^:Prune:sqrtFix4 212
	^[2, /[1, 2]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

*:Prune:flatten 1212(1+512)12
	*[-1, ^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]	

*:Prune:apply 1
	1	

*:Prune:apply 4
	4	

Prune 11012(1+512)12+1212(1+512)124514
	/[+[*[-1, ^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[-1, ^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[4, ^[5, /[1, 4]]]]	

Factor 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Prune 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Expand 1212(1+512)12+11012(1+512)124514
	/[+[*[-1, *[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[-1, *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Prune 1212(1+512)12+11012(1+512)124514
	/[+[*[-1, ^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[-1, ^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]], *[4, ^[5, /[1, 4]]]]	

Factor 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Prune 1(212(1+512)12+1012(1+512)12)4514
	/[*[-1, +[*[^[2, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]], *[^[10, /[1, 2]], ^[+[-1, ^[5, /[1, 2]]], /[1, 2]]]]], *[4, ^[5, /[1, 4]]]]	

Tidy 21+5+101+54514
	unm(/[+[*[sqrt[2], sqrt[+[unm(1), sqrt[5]]]], *[sqrt[10], sqrt[+[unm(1), sqrt[5]]]]], *[4, ^[5, /[1, 4]]]])	

rhs stack
Init 110(5+5)
	sqrt[/[+[5, sqrt[5]], 10]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

sqrt:Prune:apply 512
	^[5, /[1, 2]]	

sqrt:Prune:apply (110(5+512))12
	^[/[+[5, ^[5, /[1, 2]]], 10], /[1, 2]]	

Prune (110(5+512))12
	^[/[+[5, ^[5, /[1, 2]]], 10], /[1, 2]]	

^:Expand:frac (5+512)121012
	/[^[+[5, ^[5, /[1, 2]]], /[1, 2]], ^[10, /[1, 2]]]	

Expand (5+512)121012
	/[^[+[5, ^[5, /[1, 2]]], /[1, 2]], ^[10, /[1, 2]]]	

^:Prune:sqrtFix4 512
	^[5, /[1, 2]]	

^:Prune:sqrtFix4 1012
	^[10, /[1, 2]]	

Prune (5+512)121012
	/[^[+[5, ^[5, /[1, 2]]], /[1, 2]], ^[10, /[1, 2]]]	

Factor 51212(1+512)121012
	/[*[^[^[5, /[1, 2]], /[1, 2]], ^[+[1, ^[5, /[1, 2]]], /[1, 2]]], ^[10, /[1, 2]]]	

Prune (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Expand (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Prune (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Factor (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Prune (1+512)12212514
	/[^[+[1, ^[5, /[1, 2]]], /[1, 2]], *[^[2, /[1, 2]], ^[5, /[1, 4]]]]	

Tidy 1+52514
	/[sqrt[+[1, sqrt[5]]], *[sqrt[2], ^[5, /[1, 4]]]]	

BAD
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:125: failed
stack traceback:
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:246: in function
[C]: in function 'error'
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:125: in function 'simplifyAssertEq'
[string "simplifyAssertEq( -(sqrt( 10 * (sqrt(5) - 1) ..."]:1: in main chunk
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:238: in function
[C]: in function 'xpcall'
/home/chris/Projects/lua/symmath/tests/unit/unit.lua:237: in function 'exec'
sqrt.lua:120: in function 'cb'
/home/chris/Projects/lua/ext/timer.lua:58: in function 'timer'
sqrt.lua:9: in main chunk
[C]: at 0x5cbe028e2380
time: 23.423000ms
stack: size: 17
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • sqrt:Prune:apply
  • Prune
  • ^:Expand:frac
  • Expand
  • ^:Prune:sqrtFix4
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy