simplifyAssertEq(#{x:eq(0):solve(x)}, 1)
${1} = {1}$
GOOD
time: 0.467000ms
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: 0.890000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq(#{x:eq(1):solve(x)}, 1)
${1} = {1}$
GOOD
time: 0.508000ms
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: 0.481000ms
stack: size: 7
  • Init
  • Prune
  • Expand
  • Prune
  • Factor
  • Prune
  • Tidy


simplifyAssertEq(#{(x+1):eq(0):solve(x)}, 1)
${1} = {1}$
GOOD
time: 0.397000ms
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: 0.874000ms
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: 3.052000ms
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: 1.523000ms
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: 1.588000ms
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: 1.247000ms
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: 1.590000ms
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: 1.485000ms
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: 0.783000ms
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: 0.745000ms
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: 0.999000ms
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: 0.692000ms
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: 15.618000ms
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: 13.154000ms
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: 9.149000ms
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: 12.478000ms
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: 7.516000ms
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: 1.781000ms
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: 2.131000ms
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: 1.708000ms
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: 2.380000ms
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: 2.693000ms
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: 3.347000ms
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: 2.804000ms
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: 2.092000ms
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: 1.097000ms
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: 1.119000ms
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: 1.032000ms
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} = {-{{\frac{1}{2}}{\left({{1} + {{{i}} {{\sqrt{3}}}}}\right)}}}$ ${x} = {{\frac{1}{2}}{\left({{-{1}} + {{{i}} {{\sqrt{3}}}}}\right)}}$
GOOD
time: 7.315000ms
stack: size: 15
  • Init
  • unm:Prune:doubleNegative
  • ^:Prune:simplifyConstantPowers
  • *:Prune:apply
  • unm:Prune:doubleNegative
  • +:Prune:combineConstants
  • ^:Prune:sqrtFix4
  • sqrt:Prune:apply
  • Prune
  • Expand
  • ^:Prune:sqrtFix4
  • Prune
  • Factor
  • Prune
  • Tidy

simplifyAssertEq(#{(x^3 + 2*x^2 + x):eq(0):solve(x)}, 3)
${3} = {3}$
GOOD
time: 7.572000ms
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: 0.889000ms
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: 1.091000ms
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: 1.276000ms
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: 3.995000ms
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: 5.880000ms
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: 4.511000ms
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: 5.725000ms
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: 4.932000ms
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} + {{{i}} {{\sqrt{3}}}}}\right)}}}$ ${x} = {{\frac{1}{2}}{\left({{-{1}} + {{{i}} {{\sqrt{3}}}}}\right)}}$
GOOD
time: 6.948000ms
stack: size: 15
  • Init
  • unm:Prune:doubleNegative
  • ^:Prune:simplifyConstantPowers
  • *: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: 8.614000ms
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: 2.784000ms
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: 5.042000ms
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: 6.568000ms
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