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


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


simplifyAssertEq(#{(x+1):eq(0):solve(x)}, 1)
${1} = {1}$
GOOD
time: 0.246000ms
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.642000ms
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.710000ms
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.658000ms
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.442000ms
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.310000ms
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.424000ms
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.563000ms
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.937000ms
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: 1.038000ms
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.977000ms
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: 1.255000ms
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: 18.839000ms
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: 11.227000ms
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: 12.060000ms
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: 9.122000ms
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: 12.589000ms
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: 2.189000ms
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: 1.767000ms
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: 2.169000ms
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: 1.939000ms
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.106000ms
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: 2.069000ms
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: 1.322000ms
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: 1.782000ms
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.885000ms
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.996000ms
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.403000ms
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: 10.969000ms
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: 6.347000ms
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.024000ms
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: 0.943000ms
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: 0.908000ms
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.186000ms
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: 3.467000ms
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: 3.947000ms
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: 9.795000ms
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: 5.141000ms
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.428000ms
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: 6.143000ms
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: 3.565000ms
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: 8.129000ms
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: 5.242000ms
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