simplifyAssertEq(#{x:eq(0):solve(x)}, 1)
|
${1} = {1}$
GOOD |
time: 0.326000ms stack: size: 7
|
simplifyAssertEq(x:eq(0):solve(x), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 0.563000ms stack: size: 7
|
| ||
simplifyAssertEq(#{x:eq(1):solve(x)}, 1)
|
${1} = {1}$
GOOD |
time: 0.303000ms stack: size: 7
|
simplifyAssertEq(x:eq(1):solve(x), x:eq(1))
|
${{x} = {1}} = {{x} = {1}}$
GOOD |
time: 0.369000ms stack: size: 7
|
| ||
simplifyAssertEq(#{(x+1):eq(0):solve(x)}, 1)
|
${1} = {1}$
GOOD |
time: 0.246000ms stack: size: 7
|
simplifyAssertEq((x+1):eq(0):solve(x), x:eq(-1))
|
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD |
time: 0.642000ms stack: size: 8
|
| ||
simplifyAssertEq(#{(x^2):eq(1):solve(x)}, 2)
|
${2} = {2}$
GOOD |
time: 1.710000ms stack: size: 7
|
simplifyAssertEq((x^2):eq(1):solve(x), x:eq(1))
|
${{x} = {1}} = {{x} = {1}}$
GOOD |
time: 1.658000ms stack: size: 7
|
simplifyAssertEq(select(2, (x^2):eq(1):solve(x)), x:eq(-1))
|
${{x} = {-{1}}} = {{x} = {-1}}$
GOOD |
time: 1.442000ms stack: size: 8
|
| ||
simplifyAssertEq(#{(x^2):eq(-1):solve(x)}, 2)
|
${2} = {2}$
GOOD |
time: 1.310000ms stack: size: 7
|
simplifyAssertEq((x^2):eq(-1):solve(x), x:eq(i))
|
${{x} = {i}} = {{x} = {i}}$
GOOD |
time: 1.424000ms stack: size: 7
|
simplifyAssertEq(select(2, (x^2):eq(-1):solve(x)), x:eq(-i))
|
${{x} = {-{i}}} = {{x} = {-{i}}}$
GOOD |
time: 1.563000ms stack: size: 11
|
| ||
print((x^2):eq(0):solve(x))
| ${x} = {0}$ ${x} = {0}$ GOOD |
time: 0.937000ms stack: size: 10
|
simplifyAssertEq(#{(x^2):eq(0):solve(x)}, 2)
|
${2} = {2}$
GOOD |
time: 1.038000ms stack: size: 7
|
simplifyAssertEq((x^2):eq(0):solve(x), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 0.977000ms stack: size: 7
|
simplifyAssertEq(select(2, (x^2):eq(0):solve(x)), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 1.255000ms stack: size: 7
|
| ||
same with 3 ...
| ||
print((x^3):eq(0):solve(x))
| ${x} = {0}$ ${x} = {0}$ ${x} = {0}$ GOOD |
time: 18.839000ms stack: size: 13
|
simplifyAssertEq(#{(x^3):eq(0):solve(x)}, 3)
|
${3} = {3}$
GOOD |
time: 11.227000ms stack: size: 7
|
simplifyAssertEq((x^3):eq(0):solve(x), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 12.060000ms stack: size: 7
|
simplifyAssertEq(select(2, (x^3):eq(0):solve(x)), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 9.122000ms stack: size: 7
|
simplifyAssertEq(select(3, (x^3):eq(0):solve(x)), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 12.589000ms stack: size: 7
|
| ||
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
|
simplifyAssertEq(#{(x^4):eq(0):solve(x)}, 4)
|
${4} = {4}$
GOOD |
time: 1.767000ms stack: size: 7
|
simplifyAssertEq((x^4):eq(0):solve(x), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 2.169000ms stack: size: 7
|
simplifyAssertEq(select(2, (x^4):eq(0):solve(x)), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 1.939000ms stack: size: 7
|
simplifyAssertEq(select(3, (x^4):eq(0):solve(x)), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 2.106000ms stack: size: 7
|
simplifyAssertEq(select(4, (x^4):eq(0):solve(x)), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 2.069000ms stack: size: 7
|
| ||
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
|
simplifyAssertEq(#{(x * (x^2 + 2*x + 1)):eq(0):solve(x)}, 3)
|
${3} = {3}$
GOOD |
time: 1.782000ms stack: size: 7
|
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
|
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
|
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
|
| ||
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
|
simplifyAssertEq(#{(x^3 + 2*x^2 + x):eq(0):solve(x)}, 3)
|
${3} = {3}$
GOOD |
time: 6.347000ms stack: size: 7
|
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
|
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
|
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
|
| ||
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
|
simplifyAssertEq(#{(x * (x^2 + x - 1)):eq(0):solve(x)}, 3)
|
${3} = {3}$
GOOD |
time: 3.467000ms stack: size: 7
|
simplifyAssertEq((x * (x^2 + x - 1)):eq(0):solve(x), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 3.947000ms stack: size: 7
|
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
|
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
|
| ||
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
|
simplifyAssertEq(#{(x^3 + x^2 - x):eq(0):solve(x)}, 3)
|
${3} = {3}$
GOOD |
time: 6.143000ms stack: size: 7
|
simplifyAssertEq((x * (x^2 + x - 1)):eq(0):solve(x), x:eq(0))
|
${{x} = {0}} = {{x} = {0}}$
GOOD |
time: 3.565000ms stack: size: 7
|
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
|
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
|