simplifyAssertEq(#{x:eq(0):solve(x)}, 1)
${1} = {1}$
GOOD
time: 2.120000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(x:eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 4.769000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq(#{x:eq(1):solve(x)}, 1)
${1} = {1}$
GOOD
time: 1.372000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(x:eq(1):solve(x), x:eq(1))
${{x} = {1}} = {{x} = {1}}$
GOOD
time: 2.004000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq(#{(x+1):eq(0):solve(x)}, 1)
${1} = {1}$
GOOD
time: 1.342000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x+1):eq(0):solve(x), x:eq(-1))
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD
time: 2.464000ms
stack: size: 8
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy


simplifyAssertEq(#{(x^2):eq(1):solve(x)}, 2)
${2} = {2}$
GOOD
time: 5.448000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x^2):eq(1):solve(x), x:eq(1))
${{x} = {1}} = {{x} = {1}}$
GOOD
time: 4.545000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x^2):eq(1):solve(x)), x:eq(-1))
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD
time: 4.665000ms
stack: size: 8
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy


simplifyAssertEq(#{(x^2):eq(-1):solve(x)}, 2)
${2} = {2}$
GOOD
time: 6.932000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x^2):eq(-1):solve(x), x:eq(i))
${{x} = {i}} = {{x} = {i}}$
GOOD
time: 7.961000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x^2):eq(-1):solve(x)), x:eq(-i))
${{x} = {-{i}}} = {{x} = {-{i}}}$
GOOD
time: 6.267000ms
stack: size: 11
  • Init
  • unm:Prune:doubleNegative
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • *:Tidy:apply
  • *:Tidy:apply
  • Tidy


print((x^2):eq(0):solve(x))
${x} = {0}$ ${x} = {0}$ GOOD time: 3.547000ms
stack: size: 10
  • Init
  • unm:Prune:doubleNegative
  • ^:Prune:zeroToTheX
  • *:Prune:apply
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(#{(x^2):eq(0):solve(x)}, 2)
${2} = {2}$
GOOD
time: 4.407000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x^2):eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 3.714000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x^2):eq(0):solve(x)), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 5.663000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

same with 3 ...

print((x^3):eq(0):solve(x))
${x} = {0}$ ${x} = {0}$ ${x} = {0}$ GOOD time: 79.799000ms
stack: size: 13
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • *:Prune:factorDenominators
  • unm:Prune:doubleNegative
  • ^:Prune:zeroToTheX
  • *:Prune:apply
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(#{(x^3):eq(0):solve(x)}, 3)
${3} = {3}$
GOOD
time: 59.023000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x^3):eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 53.066000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x^3):eq(0):solve(x)), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 40.008000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(3, (x^3):eq(0):solve(x)), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 42.635000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

same with 4 ...

print((x^4):eq(0):solve(x))
${x} = {0}$ ${x} = {0}$ ${x} = {0}$ ${x} = {0}$ GOOD time: 12.748000ms
stack: size: 11
  • Init
  • unm:Prune:doubleNegative
  • ^:Prune:zeroToTheX
  • *:Prune:apply
  • *:Prune:flatten
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(#{(x^4):eq(0):solve(x)}, 4)
${4} = {4}$
GOOD
time: 10.702000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x^4):eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 15.122000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x^4):eq(0):solve(x)), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 8.790000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(3, (x^4):eq(0):solve(x)), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 9.503000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(4, (x^4):eq(0):solve(x)), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 7.400000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

Deterministic order of roots?
For quadratics it is plus sqrt(discr) first then minus
For x^n times P(x) it is the zeroes first (TODO how about instead of enumerating all roots, we provide multiplicity, so (x^n):eq(0):solve(x) can return (for n != 0, x=0 n-times)

distinguish between x*(x^2 + 2x + 1) and (x^3 + 2x^2 + x) , because the solver handles one but not the other

printbr( (x * (x^2 + 2*x + 1)):eq(0):solve(x) )
${x} = {0}$ ${x} = {-{1}}$ ${x} = {-{1}}$
GOOD
time: 7.286000ms
stack: size: 22
  • Init
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • ^:Prune:simplifyConstantPowers
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:zeroToTheX
  • sqrt:Prune:apply
  • +:Prune:combineConstants
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy

simplifyAssertEq(#{(x * (x^2 + 2*x + 1)):eq(0):solve(x)}, 3)
${3} = {3}$
GOOD
time: 8.288000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x * (x^2 + 2*x + 1)):eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 11.194000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x * (x^2 + 2*x + 1)):eq(0):solve(x)), x:eq(-1))
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD
time: 8.297000ms
stack: size: 8
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy

simplifyAssertEq(select(3, (x * (x^2 + 2*x + 1)):eq(0):solve(x)), x:eq(-1))
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD
time: 7.726000ms
stack: size: 8
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy


printbr( (x^3 + 2*x^2 + x):eq(0):solve(x) )
${x} = {0}$ ${x} = {-{1}}$ ${x} = {-{1}}$
GOOD
time: 7.388000ms
stack: size: 22
  • Init
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • ^:Prune:simplifyConstantPowers
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:zeroToTheX
  • sqrt:Prune:apply
  • +:Prune:combineConstants
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:xToTheZero
  • *:Prune:apply
  • /:Prune:divToPowSub
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy

simplifyAssertEq(#{(x^3 + 2*x^2 + x):eq(0):solve(x)}, 3)
${3} = {3}$
GOOD
time: 5.991000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x * (x^2 + 2*x + 1)):eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 7.452000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x * (x^2 + 2*x + 1)):eq(0):solve(x)), x:eq(-1))
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD
time: 4.661000ms
stack: size: 8
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy

simplifyAssertEq(select(3, (x * (x^2 + 2*x + 1)):eq(0):solve(x)), x:eq(-1))
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD
time: 8.502000ms
stack: size: 8
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Constant:Tidy:apply
  • Tidy

same with x^3 + x^2 - x

printbr( (x * (x^2 + x - 1)):eq(0):solve(x) )
${x} = {0}$ ${x} = {-{{\frac{1}{2}}{\left({{1} + {\sqrt{5}}}\right)}}}$ ${x} = {{\frac{1}{2}}{\left({{-{1}} + {\sqrt{5}}}\right)}}$
GOOD
time: 19.916000ms
stack: size: 16
  • Init
  • unm:Prune:doubleNegative
  • ^:Prune:simplifyConstantPowers
  • *:Prune:apply
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(#{(x * (x^2 + x - 1)):eq(0):solve(x)}, 3)
${3} = {3}$
GOOD
time: 18.572000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x * (x^2 + x - 1)):eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 28.155000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x * (x^2 + x - 1)):eq(0):solve(x)), x:eq( -(1 + sqrt(5))/2 ))
${{x} = {-{{\frac{1}{2}}{\left({{1} + {\sqrt{5}}}\right)}}}} = {{x} = {{\frac{1}{2}}{\left({-{\left({{1} + {\sqrt{5}}}\right)}}\right)}}}$
GOOD
time: 32.330000ms
stack: size: 13
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • Prune
  • *:Expand:apply
  • Expand
  • *:Prune:apply
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(3, (x * (x^2 + x - 1)):eq(0):solve(x)), x:eq( -(1 - sqrt(5))/2 ))
${{x} = {{\frac{1}{2}}{\left({{-{1}} + {\sqrt{5}}}\right)}}} = {{x} = {{\frac{1}{2}}{\left({-{\left({{1}{-{\sqrt{5}}}}\right)}}\right)}}}$
GOOD
time: 26.846000ms
stack: size: 23
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • 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


printbr( (x^3 + x^2 - x):eq(0):solve(x) )
${x} = {0}$ ${x} = {-{{\frac{1}{2}}{\left({{1} + {\sqrt{5}}}\right)}}}$ ${x} = {{\frac{1}{2}}{\left({{-{1}} + {\sqrt{5}}}\right)}}$
GOOD
time: 11.284000ms
stack: size: 16
  • Init
  • unm:Prune:doubleNegative
  • ^:Prune:simplifyConstantPowers
  • *:Prune:apply
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(#{(x^3 + x^2 - x):eq(0):solve(x)}, 3)
${3} = {3}$
GOOD
time: 15.441000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq((x * (x^2 + x - 1)):eq(0):solve(x), x:eq(0))
${{x} = {0}} = {{x} = {0}}$
GOOD
time: 13.090000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(2, (x * (x^2 + x - 1)):eq(0):solve(x)), x:eq( -(1 + sqrt(5))/2 ))
${{x} = {-{{\frac{1}{2}}{\left({{1} + {\sqrt{5}}}\right)}}}} = {{x} = {{\frac{1}{2}}{\left({-{\left({{1} + {\sqrt{5}}}\right)}}\right)}}}$
GOOD
time: 31.276000ms
stack: size: 13
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • Prune
  • *:Expand:apply
  • Expand
  • *:Prune:apply
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(select(3, (x * (x^2 + x - 1)):eq(0):solve(x)), x:eq( -(1 - sqrt(5))/2 ))
${{x} = {{\frac{1}{2}}{\left({{-{1}} + {\sqrt{5}}}\right)}}} = {{x} = {{\frac{1}{2}}{\left({-{\left({{1}{-{\sqrt{5}}}}\right)}}\right)}}}$
GOOD
time: 31.102000ms
stack: size: 23
  • Init
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • unm:Prune:doubleNegative
  • 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