operation construction
| ||
| ||
assert flattening construction works:
| ||
local expr = a + b + c simplifyAssertAllEq(expr, {a,b,c})
|
${3} = {3}$
${a} = {a}$ ${a} = {a}$ ${b} = {b}$ ${b} = {b}$ ${c} = {c}$ ${c} = {c}$ GOOD |
time: 0.657000ms stack: size: 7
|
local expr = a * b * c simplifyAssertAllEq(expr, {a,b,c})
|
${3} = {3}$
${a} = {a}$ ${a} = {a}$ ${b} = {b}$ ${b} = {b}$ ${c} = {c}$ ${c} = {c}$ GOOD |
time: 0.523000ms stack: size: 7
|
| ||
assert flattening after replace() works
| ||
local expr = (a + d):replace(d, b + c) simplifyAssertAllEq(expr, {a,b,c})
|
${3} = {3}$
${a} = {a}$ ${a} = {a}$ ${b} = {b}$ ${b} = {b}$ ${c} = {c}$ ${c} = {c}$ GOOD |
time: 0.466000ms stack: size: 7
|
local expr = (a * d):replace(d, b * c) simplifyAssertAllEq(expr, {a,b,c})
|
${3} = {3}$
${a} = {a}$ ${a} = {a}$ ${b} = {b}$ ${b} = {b}$ ${c} = {c}$ ${c} = {c}$ GOOD |
time: 0.585000ms stack: size: 7
|
| ||
assert flatten of add after mul works
| ||
local expr = (f * (a + d)):replace(d, b + c):flatten() print(Verbose(expr)) assertEq(#expr[2], 3)
|
*[f, +[a, b, c]]
${3} = {3}$
GOOD |
time: 0.222000ms stack: size: 0 |
| ||
TODO just call all this simplify()
| ||
| ||
constant simplificaiton
| ||
multiply by 1simplifyAssertEq(1, (Constant(1)*Constant(1))())
|
${1} = {1}$
GOOD |
time: 0.212000ms stack: size: 7
|
divide by 1simplifyAssertEq(1, (Constant(1)/Constant(1))())
|
${1} = {1}$
GOOD |
time: 0.161000ms stack: size: 7
|
divide by -1simplifyAssertEq(-1, (-Constant(1)/Constant(1))())
|
${-1} = {-{1}}$
GOOD |
time: 0.351000ms stack: size: 8
|
multiply and divide by 1simplifyAssertEq(1, (Constant(1)/(Constant(1)*Constant(1)))())
|
${1} = {1}$
GOOD |
time: 0.158000ms stack: size: 7
|
| ||
commutativity
| ||
add commutativesimplifyAssertEq(x+y, y+x)
|
${{x} + {y}} = {{y} + {x}}$
GOOD |
time: 1.938000ms stack: size: 8
|
mul commutativesimplifyAssertEq(x*y, y*x)
|
${{{x}} {{y}}} = {{{y}} {{x}}}$
GOOD |
time: 0.789000ms stack: size: 8
|
| ||
pruning operations
| ||
prune 1*simplifyAssertEq(x, (1*x)())
|
${x} = {x}$
GOOD |
time: 0.055000ms stack: size: 7
|
prune *1simplifyAssertEq(x, (x*1)())
|
${x} = {x}$
GOOD |
time: 0.020000ms stack: size: 0 |
prune *0simplifyAssertEq(0, (0*x)())
|
${0} = {0}$
GOOD |
time: 0.280000ms stack: size: 7
|
simplifyAssertEq((x/x)(), 1)
|
${1} = {1}$
GOOD |
time: 0.179000ms stack: size: 7
|
| ||
simplifyAssertEq(x^2, (x*x)())
|
${{x}^{2}} = {{x}^{2}}$
GOOD |
time: 1.691000ms stack: size: 10
|
| ||
simplify(): div add mul
| ||
simplifyAssertEq(((x+1)*y)(), (x*y + y)())
|
${{{y}} {{\left({{1} + {x}}\right)}}} = {{{y}} {{\left({{1} + {x}}\right)}}}$
GOOD |
time: 2.400000ms stack: size: 24
|
simplifyAssertEq(((x+1)*(y+1))(), (x*y + x + y + 1)())
|
${{1} + {x} + {y} + {{{x}} {{y}}}} = {{1} + {x} + {y} + {{{x}} {{y}}}}$
GOOD |
time: 3.212000ms stack: size: 10
|
simplifyAssertEq((2/(2*x*y))(), (1/(x*y))())
|
${\frac{1}{{{x}} {{y}}}} = {\frac{1}{{{x}} {{y}}}}$
GOOD |
time: 3.125000ms stack: size: 9
|
simplifyAssertEq((1-(1-x))(), x)
|
${x} = {x}$
GOOD |
time: 0.353000ms stack: size: 19
|
simplifyAssertEq(((1-(1-x))/x)(), 1)
|
${1} = {1}$
GOOD |
time: 1.199000ms stack: size: 7
|
simplifyAssertEq((1 + 1/x + 1/x)(), (1 + 2/x)())
|
${{\frac{1}{x}}{\left({{2} + {x}}\right)}} = {{\frac{1}{x}}{\left({{2} + {x}}\right)}}$
GOOD |
time: 5.713000ms stack: size: 10
|
simplifyAssertEq((1 + 1/x + 2/x)(), (1 + 3/x)())
|
${{\frac{1}{x}}{\left({{3} + {x}}\right)}} = {{\frac{1}{x}}{\left({{3} + {x}}\right)}}$
GOOD |
time: 5.806000ms stack: size: 10
|
| ||
factoring integers
| ||
simplifyAssertEq((Constant(2)/Constant(2))(), Constant(1))
|
${1} = {1}$
GOOD |
time: 0.128000ms stack: size: 7
|
simplifyAssertEq((Constant(2)/Constant(4))(), (Constant(1)/Constant(2))())
|
${\frac{1}{2}} = {\frac{1}{2}}$
GOOD |
time: 1.510000ms stack: size: 7
|
| ||
simplifyAssertEq(((2*x + 2*y)/2)(), (x+y)())
|
${{x} + {y}} = {{x} + {y}}$
GOOD |
time: 2.589000ms stack: size: 8
|
simplifyAssertEq(((-2*x + 2*y)/2)(), (-x+y)())
|
${{-{x}} + {y}} = {{-{x}} + {y}}$
GOOD |
time: 3.128000ms stack: size: 12
|
| ||
simplifyAssertEq(-1-x, -(1+x))
|
${{-1}{-{x}}} = {-{\left({{1} + {x}}\right)}}$
GOOD |
time: 2.016000ms stack: size: 18
|
| ||
simplifyAssertEq((-x)/x, -1)
|
${{\frac{1}{x}}{\left({-{x}}\right)}} = {-1}$
GOOD |
time: 0.682000ms stack: size: 8
|
simplifyAssertEq((x/(-x)), -1)
|
${\frac{x}{-{x}}} = {-1}$
GOOD |
time: 0.849000ms stack: size: 8
|
simplifyAssertEq((-x-1)/(x+1), -1)
|
${\frac{{-{x}}{-{1}}}{{x} + {1}}} = {-1}$
GOOD |
time: 2.075000ms stack: size: 8
|
simplifyAssertEq((x-1)/(1-x), -1)
|
${\frac{{x}{-{1}}}{{1}{-{x}}}} = {-1}$
GOOD |
time: 2.363000ms stack: size: 8
|
| ||
simplifyAssertEq( (x*y)/(x*y)^2, 1/(x*y) )
|
${\frac{{{x}} {{y}}}{{\left({{{x}} {{y}}}\right)}^{2}}} = {\frac{1}{{{x}} {{y}}}}$
GOOD |
time: 2.085000ms stack: size: 9
|
| ||
origin of the error:
| ||
simplifyAssertEq( 1/(1-x), -1/(x-1) )
|
${\frac{1}{{1}{-{x}}}} = {\frac{-1}{{x}{-{1}}}}$
GOOD |
time: 2.794000ms stack: size: 26
|
without needing to factor the polynomial
| ||
simplifyAssertEq(((x-1)*(x+1))/(x+1), x-1)
|
${\frac{{{\left({{x}{-{1}}}\right)}} {{\left({{x} + {1}}\right)}}}{{x} + {1}}} = {{x}{-{1}}}$
GOOD |
time: 1.504000ms stack: size: 11
|
simplifyAssertEq(((x-1)*(x+1))/(x-1), x+1)
|
${\frac{{{\left({{x}{-{1}}}\right)}} {{\left({{x} + {1}}\right)}}}{{x}{-{1}}}} = {{x} + {1}}$
GOOD |
time: 1.458000ms stack: size: 9
|
simplifyAssertEq((x-1)/((x+1)*(x-1)), 1/(x+1))
|
${\frac{{x}{-{1}}}{{{\left({{x} + {1}}\right)}} {{\left({{x}{-{1}}}\right)}}}} = {\frac{1}{{x} + {1}}}$
GOOD |
time: 1.635000ms stack: size: 10
|
simplifyAssertEq((x+1)/((x+1)*(x-1)), 1/(x-1))
|
${\frac{{x} + {1}}{{{\left({{x} + {1}}\right)}} {{\left({{x}{-{1}}}\right)}}}} = {\frac{1}{{x}{-{1}}}}$
GOOD |
time: 1.745000ms stack: size: 12
|
with needing to factor the polynomial
| ||
simplifyAssertEq((x^2-1)/(x+1), x-1)
|
${\frac{{{x}^{2}}{-{1}}}{{x} + {1}}} = {{x}{-{1}}}$
GOOD |
time: 4.910000ms stack: size: 11
|
simplifyAssertEq((x^2-1)/(x-1), x+1)
|
${\frac{{{x}^{2}}{-{1}}}{{x}{-{1}}}} = {{x} + {1}}$
GOOD |
time: 4.917000ms stack: size: 9
|
simplifyAssertEq((x-1)/(x^2-1), 1/(x+1))
|
${\frac{{x}{-{1}}}{{{x}^{2}}{-{1}}}} = {\frac{1}{{x} + {1}}}$
GOOD |
time: 9.222000ms stack: size: 10
|
simplifyAssertEq((x+1)/(x^2-1), 1/(x-1))
|
${\frac{{x} + {1}}{{{x}^{2}}{-{1}}}} = {\frac{1}{{x}{-{1}}}}$
GOOD |
time: 5.377000ms stack: size: 12
|
... and with signs flipped
| ||
simplifyAssertEq((1-x^2)/(x+1), -(x-1))
|
${\frac{{1}{-{{x}^{2}}}}{{x} + {1}}} = {-{\left({{x}{-{1}}}\right)}}$
GOOD |
time: 3.887000ms stack: size: 21
|
simplifyAssertEq((1-x^2)/(x-1), -(x+1))
|
${\frac{{1}{-{{x}^{2}}}}{{x}{-{1}}}} = {-{\left({{x} + {1}}\right)}}$
GOOD |
time: 3.350000ms stack: size: 19
|
simplifyAssertEq((x-1)/(1-x^2), -1/(x+1))
|
${\frac{{x}{-{1}}}{{1}{-{{x}^{2}}}}} = {\frac{-1}{{x} + {1}}}$
GOOD |
time: 3.388000ms stack: size: 15
|
simplifyAssertEq((x+1)/(1-x^2), -1/(x-1))
|
${\frac{{x} + {1}}{{1}{-{{x}^{2}}}}} = {\frac{-1}{{x}{-{1}}}}$
GOOD |
time: 4.662000ms stack: size: 26
|
| ||
make sure sorting of expression terms works
| ||
simplifyAssertEq(y-a, -a+y)
|
${{y}{-{a}}} = {{-{a}} + {y}}$
GOOD |
time: 0.925000ms stack: size: 12
|
simplifyAssertEq( (y-a)/(b-a) , y/(b-a) - a/(b-a) )
|
${\frac{{y}{-{a}}}{{b}{-{a}}}} = {{\frac{y}{{b}{-{a}}}}{-{\frac{a}{{b}{-{a}}}}}}$
GOOD |
time: 14.513000ms stack: size: 90
|
| ||
just printing this, i was getting simplification loopsprint((a^2 * x^2 - a^2)())
| ${-{{a}^{2}}} + {{{{a}^{2}}} {{{x}^{2}}}}$ GOOD |
time: 4.532000ms stack: size: 69
|
| ||
this won't simplify correctly unless you negative , simplify, negative again ...simplifyAssertEq( (t - r) / (-r^2 - t^2 + 2 * r * t), -1 / (t - r))
|
${\frac{{t}{-{r}}}{{-{{r}^{2}}}{-{{t}^{2}}} + {{{2}} {{r}} {{t}}}}} = {\frac{-1}{{t}{-{r}}}}$
GOOD |
time: 9.673000ms stack: size: 42
|
| ||
simplifyAssertEq( (-128 + 64*sqrt(5))/(64*sqrt(5)), -2 / sqrt(5) + 1 )
|
${\frac{{-128} + {{{64}} {{\sqrt{5}}}}}{{{64}} {{\sqrt{5}}}}} = {{\frac{-2}{\sqrt{5}}} + {1}}$
GOOD |
time: 41.732000ms stack: size: 16
|
| ||
expand(): add div mul
| ||
| ||
factor(): mul add div
| ||
| ||
trigonometry
| ||
| ||
simplifyAssertEq((sin(x)^2+cos(x)^2)(), 1)
|
${1} = {1}$
GOOD |
time: 0.994000ms stack: size: 7
|
simplifyAssertEq((y*sin(x)^2+y*cos(x)^2)(), y)
|
${y} = {y}$
GOOD |
time: 1.700000ms stack: size: 17
|
simplifyAssertEq((y+y*sin(x)^2+y*cos(x)^2)(), 2*y)
|
${{{2}} {{y}}} = {{{2}} {{y}}}$
GOOD |
time: 2.191000ms stack: size: 8
|
simplifyAssertEq((1+y*sin(x)^2+y*cos(x)^2)(), 1+y)
|
${{1} + {y}} = {{1} + {y}}$
GOOD |
time: 1.483000ms stack: size: 8
|
| ||
simplifyAssertEq(1+cos(x)^2+cos(x)^2, 1+2*cos(x)^2)
|
${{1} + {{\cos\left( x\right)}^{2}} + {{\cos\left( x\right)}^{2}}} = {{1} + {{{2}} {{{\cos\left( x\right)}^{2}}}}}$
GOOD |
time: 3.246000ms stack: size: 10
|
simplifyAssertEq(-1+cos(x)^2+cos(x)^2, -1+2*cos(x)^2)
|
${{-1} + {{\cos\left( x\right)}^{2}} + {{\cos\left( x\right)}^{2}}} = {{-1} + {{{2}} {{{\cos\left( x\right)}^{2}}}}}$
GOOD |
time: 4.166000ms stack: size: 10
|
| ||
simplifyAssertEq( cos(x)^2 + sin(x)^2, 1)
|
${{{\cos\left( x\right)}^{2}} + {{\sin\left( x\right)}^{2}}} = {1}$
GOOD |
time: 0.854000ms stack: size: 7
|
simplifyAssertEq( (cos(x)*y)^2 + (sin(x)*y)^2, y^2)
|
${{{\left({{{\cos\left( x\right)}} {{y}}}\right)}^{2}} + {{\left({{{\sin\left( x\right)}} {{y}}}\right)}^{2}}} = {{y}^{2}}$
GOOD |
time: 1.861000ms stack: size: 10
|
| ||
simplifyLHSAssertEq( (sin(x)^2)(), sin(x)^2)
|
${{\sin\left( x\right)}^{2}} = {{\sin\left( x\right)}^{2}}$
GOOD |
time: 1.898000ms stack: size: 18
|
| ||
simplifyLHSAssertEq( (cos(b)^2 - 1)(), -sin(b)^2)
|
${-{{\sin\left( b\right)}^{2}}} = {-{{\sin\left( b\right)}^{2}}}$
GOOD |
time: 1.224000ms stack: size: 12
|
simplifyLHSAssertEq( (1 - cos(b)^2)(), sin(b)^2)
|
${{\sin\left( b\right)}^{2}} = {{\sin\left( b\right)}^{2}}$
GOOD |
time: 0.975000ms stack: size: 11
|
| ||
simplifyLHSAssertEq( (a * cos(b)^2 - a)(), -(a * sin(b)^2))
|
${-{{{a}} {{{\sin\left( b\right)}^{2}}}}} = {-{{{a}} {{{\sin\left( b\right)}^{2}}}}}$
GOOD |
time: 3.030000ms stack: size: 15
|
simplifyLHSAssertEq( (a - a * cos(b)^2)(), a * sin(b)^2)
|
${{{a}} {{{\sin\left( b\right)}^{2}}}} = {{{a}} {{{\sin\left( b\right)}^{2}}}}$
GOOD |
time: 3.136000ms stack: size: 15
|
| ||
the only one that doesn't worksimplifyLHSAssertEq( (a^2 * cos(b)^2 - a^2)(), -(a^2 * sin(b)^2))
|
${{-{{a}^{2}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}} = {-{{{{a}^{2}}} {{{\sin\left( b\right)}^{2}}}}}$
expected ${-{{a}^{2}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ to equal $-{{{{a}^{2}}} {{{\sin\left( b\right)}^{2}}}}$ found ${-{{a}^{2}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ vs $-{{{{a}^{2}}} {{{\sin\left( b\right)}^{2}}}}$ lhs stack Init ${{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}{-{{a}^{2}}}$ +[*[^[a, 2], ^[cos[b], 2]], unm(^[a, 2])] unm:Prune:doubleNegative ${{-1}} {{{a}^{2}}}$ *[-1, ^[a, 2]] Prune ${{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}} + {{{-1}} {{{a}^{2}}}}$ +[*[^[a, 2], ^[cos[b], 2]], *[-1, ^[a, 2]]] ^:Expand:integerPower ${{a}} {{a}}$ *[a, a] ^:Expand:integerPower ${{\cos\left( b\right)}} {{\cos\left( b\right)}}$ *[cos[b], cos[b]] ^:Expand:integerPower ${{a}} {{a}}$ *[a, a] Expand ${{{{{a}} {{a}}}} {{{{\cos\left( b\right)}} {{\cos\left( b\right)}}}}} + {{{-1}} {{{{a}} {{a}}}}}$ +[*[*[a, a], *[cos[b], cos[b]]], *[-1, *[a, a]]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${\cos\left( b\right)}^{2}$ ^[cos[b], 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] Prune ${{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}} + {{{-1}} {{{a}^{2}}}}$ +[*[^[a, 2], ^[cos[b], 2]], *[-1, ^[a, 2]]] *:Factor:combineMulOfLikePow ${\left({{{a}} {{\cos\left( b\right)}}}\right)}^{2}$ ^[*[a, cos[b]], 2] /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne ${{a}} {{\cos\left( b\right)}}$ *[a, cos[b]] /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne $a$ a /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne ${{a}} {{\cos\left( b\right)}}$ *[a, cos[b]] /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne $a$ a unm:Prune:doubleNegative ${{-1}} {{a}}$ *[-1, a] unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 +:Factor:apply ${{a}} {{\left({{-1} + {\cos\left( b\right)}}\right)}}$ *[a, +[-1, cos[b]]] unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 +:Factor:apply ${{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}$ *[a, +[1, cos[b]]] +:Factor:apply ${{{{a}} {{\left({{-1} + {\cos\left( b\right)}}\right)}}}} {{{{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}}}$ *[*[a, +[-1, cos[b]]], *[a, +[1, cos[b]]]] Factor ${{{{a}} {{\left({{-1} + {\cos\left( b\right)}}\right)}}}} {{{{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}}}$ *[*[a, +[-1, cos[b]]], *[a, +[1, cos[b]]]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{-1} + {\cos\left( b\right)}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[-1, cos[b]]] *:Prune:flatten ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{-1} + {\cos\left( b\right)}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[-1, cos[b]]] *:Prune:flatten ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{-1} + {\cos\left( b\right)}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[-1, cos[b]]] Prune ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{-1} + {\cos\left( b\right)}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[-1, cos[b]]] ^:Expand:integerPower ${{a}} {{a}}$ *[a, a] *:Expand:apply ${{{{{a}} {{a}}}} {{1}} \cdot {{-1}}} + {{{{{a}} {{a}}}} {{1}} {{\cos\left( b\right)}}}$ +[*[*[a, a], 1, -1], *[*[a, a], 1, cos[b]]] *:Expand:apply ${{{{{a}} {{a}}}} {{\cos\left( b\right)}} \cdot {{-1}}} + {{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{\cos\left( b\right)}}}$ +[*[*[a, a], cos[b], -1], *[*[a, a], cos[b], cos[b]]] *:Expand:apply ${{{{{{a}} {{a}}}} {{1}} \cdot {{-1}}} + {{{{{a}} {{a}}}} {{1}} {{\cos\left( b\right)}}}} + {{{{{{a}} {{a}}}} {{\cos\left( b\right)}} \cdot {{-1}}} + {{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{\cos\left( b\right)}}}}$ +[+[*[*[a, a], 1, -1], *[*[a, a], 1, cos[b]]], +[*[*[a, a], cos[b], -1], *[*[a, a], cos[b], cos[b]]]] Expand ${{{{{{a}} {{a}}}} {{1}} \cdot {{-1}}} + {{{{{a}} {{a}}}} {{1}} {{\cos\left( b\right)}}}} + {{{{{{a}} {{a}}}} {{\cos\left( b\right)}} \cdot {{-1}}} + {{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{\cos\left( b\right)}}}}$ +[+[*[*[a, a], 1, -1], *[*[a, a], 1, cos[b]]], +[*[*[a, a], cos[b], -1], *[*[a, a], cos[b], cos[b]]]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}$ *[^[a, 2], ^[cos[b], 2]] *:Prune:apply $0$ 0 +:Prune:combineConstants ${{{-1}} {{{a}^{2}}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[*[-1, ^[a, 2]], *[^[a, 2], ^[cos[b], 2]]] +:Prune:flattenAddMul ${{{-1}} {{{a}^{2}}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[*[-1, ^[a, 2]], *[^[a, 2], ^[cos[b], 2]]] +:Prune:flatten ${{{-1}} {{{a}^{2}}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[*[-1, ^[a, 2]], *[^[a, 2], ^[cos[b], 2]]] Prune ${{{-1}} {{{a}^{2}}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[*[-1, ^[a, 2]], *[^[a, 2], ^[cos[b], 2]]] *:Factor:combineMulOfLikePow ${\left({{{a}} {{\cos\left( b\right)}}}\right)}^{2}$ ^[*[a, cos[b]], 2] Factor ${{{-1}} {{{a}^{2}}}} + {{\left({{{a}} {{\cos\left( b\right)}}}\right)}^{2}}$ +[*[-1, ^[a, 2]], ^[*[a, cos[b]], 2]] Prune ${{{-1}} {{{a}^{2}}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[*[-1, ^[a, 2]], *[^[a, 2], ^[cos[b], 2]]] Expand ${{{-1}} {{{{a}} {{a}}}}} + {{{{{a}} {{a}}}} {{{{\cos\left( b\right)}} {{\cos\left( b\right)}}}}}$ +[*[-1, *[a, a]], *[*[a, a], *[cos[b], cos[b]]]] Prune ${{{-1}} {{{a}^{2}}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[*[-1, ^[a, 2]], *[^[a, 2], ^[cos[b], 2]]] Factor ${{{-1}} {{{a}^{2}}}} + {{\left({{{a}} {{\cos\left( b\right)}}}\right)}^{2}}$ +[*[-1, ^[a, 2]], ^[*[a, cos[b]], 2]] Prune ${{{-1}} {{{a}^{2}}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[*[-1, ^[a, 2]], *[^[a, 2], ^[cos[b], 2]]] Tidy ${-{{a}^{2}}} + {{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[unm(^[a, 2]), *[^[a, 2], ^[cos[b], 2]]] BAD /home/chris/Projects/lua/symmath/tests/unit/unit.lua:141: 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:141: in function 'simplifyLHSAssertEq' [string "simplifyLHSAssertEq( (a^2 * cos(b)^2 - a^2)()..."]: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' test.lua:182: in function 'cb' /home/chris/Projects/lua/ext/timer.lua:58: in function 'timer' test.lua:8: in main chunk [C]: at 0x650dbbc7a380 |
time: 13.929000ms stack: size: 69
|
also the only one that doesn't worksimplifyLHSAssertEq( (a^2 - a^2 * cos(b)^2)(), a^2 * sin(b)^2)
|
${{{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1}{-{\cos\left( b\right)}}}\right)}}} = {{{{a}^{2}}} {{{\sin\left( b\right)}^{2}}}}$
expected ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1}{-{\cos\left( b\right)}}}\right)}}$ to equal ${{{a}^{2}}} {{{\sin\left( b\right)}^{2}}}$ found ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1}{-{\cos\left( b\right)}}}\right)}}$ vs ${{{a}^{2}}} {{{\sin\left( b\right)}^{2}}}$ lhs stack Init ${{a}^{2}}{-{{{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}}$ +[^[a, 2], unm(*[^[a, 2], ^[cos[b], 2]])] unm:Prune:doubleNegative ${{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}$ *[-1, ^[a, 2], ^[cos[b], 2]] Prune ${{a}^{2}} + {{{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[^[a, 2], *[-1, ^[a, 2], ^[cos[b], 2]]] ^:Expand:integerPower ${{a}} {{a}}$ *[a, a] ^:Expand:integerPower ${{a}} {{a}}$ *[a, a] ^:Expand:integerPower ${{\cos\left( b\right)}} {{\cos\left( b\right)}}$ *[cos[b], cos[b]] Expand ${{{a}} {{a}}} + {{{-1}} {{{{a}} {{a}}}} {{{{\cos\left( b\right)}} {{\cos\left( b\right)}}}}}$ +[*[a, a], *[-1, *[a, a], *[cos[b], cos[b]]]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${\cos\left( b\right)}^{2}$ ^[cos[b], 2] Prune ${{a}^{2}} + {{{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[^[a, 2], *[-1, ^[a, 2], ^[cos[b], 2]]] *:Factor:combineMulOfLikePow ${{-1}} {{{\left({{{a}} {{\cos\left( b\right)}}}\right)}^{2}}}$ *[-1, ^[*[a, cos[b]], 2]] /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne $a$ a /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne ${{a}} {{\cos\left( b\right)}}$ *[a, cos[b]] /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne $a$ a /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne ${{a}} {{\cos\left( b\right)}}$ *[a, cos[b]] unm:Prune:doubleNegative ${{-1}} {{a}} {{\cos\left( b\right)}}$ *[-1, a, cos[b]] unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 +:Factor:apply ${{a}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[a, +[1, *[-1, cos[b]]]] unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 +:Factor:apply ${{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}$ *[a, +[1, cos[b]]] +:Factor:apply ${{{{a}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}}} {{{{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}}}$ *[*[a, +[1, *[-1, cos[b]]]], *[a, +[1, cos[b]]]] Factor ${{{{a}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}}} {{{{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}}}$ *[*[a, +[1, *[-1, cos[b]]]], *[a, +[1, cos[b]]]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] *:Prune:flatten ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] *:Prune:flatten ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] Prune ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] ^:Expand:integerPower ${{a}} {{a}}$ *[a, a] *:Expand:apply ${{{{{a}} {{a}}}} {{1}} \cdot {{1}}} + {{{{{a}} {{a}}}} {{1}} {{{{-1}} {{\cos\left( b\right)}}}}}$ +[*[*[a, a], 1, 1], *[*[a, a], 1, *[-1, cos[b]]]] *:Expand:apply ${{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{1}}} + {{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{{{-1}} {{\cos\left( b\right)}}}}}$ +[*[*[a, a], cos[b], 1], *[*[a, a], cos[b], *[-1, cos[b]]]] *:Expand:apply ${{{{{{a}} {{a}}}} {{1}} \cdot {{1}}} + {{{{{a}} {{a}}}} {{1}} {{{{-1}} {{\cos\left( b\right)}}}}}} + {{{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{1}}} + {{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{{{-1}} {{\cos\left( b\right)}}}}}}$ +[+[*[*[a, a], 1, 1], *[*[a, a], 1, *[-1, cos[b]]]], +[*[*[a, a], cos[b], 1], *[*[a, a], cos[b], *[-1, cos[b]]]]] Expand ${{{{{{a}} {{a}}}} {{1}} \cdot {{1}}} + {{{{{a}} {{a}}}} {{1}} {{{{-1}} {{\cos\left( b\right)}}}}}} + {{{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{1}}} + {{{{{a}} {{a}}}} {{\cos\left( b\right)}} {{{{-1}} {{\cos\left( b\right)}}}}}}$ +[+[*[*[a, a], 1, 1], *[*[a, a], 1, *[-1, cos[b]]]], +[*[*[a, a], cos[b], 1], *[*[a, a], cos[b], *[-1, cos[b]]]]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] *:Prune:apply ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] *:Prune:flatten ${{-1}} {{{a}^{2}}} {{\cos\left( b\right)}}$ *[-1, ^[a, 2], cos[b]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${a}^{2}$ ^[a, 2] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}$ *[-1, ^[a, 2], ^[cos[b], 2]] *:Prune:flatten ${{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}$ *[-1, ^[a, 2], ^[cos[b], 2]] *:Prune:apply $0$ 0 +:Prune:combineConstants ${{a}^{2}} + {{{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[^[a, 2], *[-1, ^[a, 2], ^[cos[b], 2]]] +:Prune:flattenAddMul ${{a}^{2}} + {{{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[^[a, 2], *[-1, ^[a, 2], ^[cos[b], 2]]] +:Prune:flatten ${{a}^{2}} + {{{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[^[a, 2], *[-1, ^[a, 2], ^[cos[b], 2]]] Prune ${{a}^{2}} + {{{-1}} {{{a}^{2}}} {{{\cos\left( b\right)}^{2}}}}$ +[^[a, 2], *[-1, ^[a, 2], ^[cos[b], 2]]] *:Factor:combineMulOfLikePow ${{-1}} {{{\left({{{a}} {{\cos\left( b\right)}}}\right)}^{2}}}$ *[-1, ^[*[a, cos[b]], 2]] /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne $a$ a /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne ${{a}} {{\cos\left( b\right)}}$ *[a, cos[b]] /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne $a$ a /:Prune:xOverX $1$ 1 ^:Prune:xToTheOne ${{a}} {{\cos\left( b\right)}}$ *[a, cos[b]] unm:Prune:doubleNegative ${{-1}} {{a}} {{\cos\left( b\right)}}$ *[-1, a, cos[b]] unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 +:Factor:apply ${{a}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[a, +[1, *[-1, cos[b]]]] unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 unm:Prune:doubleNegative $-1$ -1 +:Prune:combineConstants $0$ 0 +:Factor:apply ${{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}$ *[a, +[1, cos[b]]] +:Factor:apply ${{{{a}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}}} {{{{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}}}$ *[*[a, +[1, *[-1, cos[b]]]], *[a, +[1, cos[b]]]] Factor ${{{{a}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}}} {{{{a}} {{\left({{1} + {\cos\left( b\right)}}\right)}}}}$ *[*[a, +[1, *[-1, cos[b]]]], *[a, +[1, cos[b]]]] +:Prune:combineConstants $2$ 2 *:Prune:combinePows ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] *:Prune:flatten ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] *:Prune:flatten ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] Prune ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1} + {{{-1}} {{\cos\left( b\right)}}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, *[-1, cos[b]]]] Constant:Tidy:apply $-{1}$ unm(1) *:Tidy:apply $\cos\left( b\right)$ cos[b] *:Tidy:apply $-{\cos\left( b\right)}$ unm(cos[b]) *:Tidy:apply ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1}{-{\cos\left( b\right)}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, unm(cos[b])]] Tidy ${{{a}^{2}}} {{\left({{1} + {\cos\left( b\right)}}\right)}} {{\left({{1}{-{\cos\left( b\right)}}}\right)}}$ *[^[a, 2], +[1, cos[b]], +[1, unm(cos[b])]] BAD /home/chris/Projects/lua/symmath/tests/unit/unit.lua:141: 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:141: in function 'simplifyLHSAssertEq' [string "simplifyLHSAssertEq( (a^2 - a^2 * cos(b)^2)()..."]: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' test.lua:182: in function 'cb' /home/chris/Projects/lua/ext/timer.lua:58: in function 'timer' test.lua:8: in main chunk [C]: at 0x650dbbc7a380 |
time: 7.257000ms stack: size: 96
|
| ||
simplifyLHSAssertEq( (a^3 * cos(b)^2 - a^3)(), -(a^3 * sin(b)^2))
|
${-{{{{a}^{3}}} {{{\sin\left( b\right)}^{2}}}}} = {-{{{{a}^{3}}} {{{\sin\left( b\right)}^{2}}}}}$
GOOD |
time: 6.041000ms stack: size: 21
|
simplifyLHSAssertEq( (a^3 - a^3 * cos(b)^2)(), a^3 * sin(b)^2)
|
${{{{a}^{3}}} {{{\sin\left( b\right)}^{2}}}} = {{{{a}^{3}}} {{{\sin\left( b\right)}^{2}}}}$
GOOD |
time: 3.904000ms stack: size: 21
|
| ||
simplifyLHSAssertEq( (a^4 * cos(b)^2 - a^4)(), -(a^4 * sin(b)^2))
|
${-{{{{a}^{4}}} {{{\sin\left( b\right)}^{2}}}}} = {-{{{{a}^{4}}} {{{\sin\left( b\right)}^{2}}}}}$
GOOD |
time: 4.453000ms stack: size: 21
|
simplifyLHSAssertEq( (a^4 - a^4 * cos(b)^2)(), a^4 * sin(b)^2)
|
${{{{a}^{4}}} {{{\sin\left( b\right)}^{2}}}} = {{{{a}^{4}}} {{{\sin\left( b\right)}^{2}}}}$
GOOD |
time: 6.185000ms stack: size: 21
|
| ||
| ||
some more stuff
| ||
| ||
simplifyAssertEq((y-x)/(x-y), -1)
|
${\frac{{y}{-{x}}}{{x}{-{y}}}} = {-1}$
GOOD |
time: 1.566000ms stack: size: 8
|
simplifyAssertEq((x+y)/(x+y)^2, 1/(x+y))
|
${\frac{{x} + {y}}{{\left({{x} + {y}}\right)}^{2}}} = {\frac{1}{{x} + {y}}}$
GOOD |
time: 1.344000ms stack: size: 9
|
simplifyAssertEq((-x+y)/(-x+y)^2, 1/(-x+y))
|
${\frac{{-{x}} + {y}}{{\left({{-{x}} + {y}}\right)}^{2}}} = {\frac{1}{{-{x}} + {y}}}$
GOOD |
time: 1.862000ms stack: size: 13
|
| ||
simplifyAssertEq( gUxy * (gUxy^2 - gUxx*gUyy) / (gUxx * gUyy - gUxy^2), -gUxy)
|
${\frac{{{{\gamma^{xy}}}} \cdot {{\left({{{{\gamma^{xy}}}^{2}}{-{{{{\gamma^{xx}}}} \cdot {{{\gamma^{yy}}}}}}}\right)}}}{{{{{\gamma^{xx}}}} \cdot {{{\gamma^{yy}}}}}{-{{{\gamma^{xy}}}^{2}}}}} = {-{{\gamma^{xy}}}}$
GOOD |
time: 6.215000ms stack: size: 11
|
simplifyAssertEq( gUxy * (gUxy - gUxx*gUyy) / (gUxx * gUyy - gUxy), -gUxy)
|
${\frac{{{{\gamma^{xy}}}} \cdot {{\left({{{\gamma^{xy}}}{-{{{{\gamma^{xx}}}} \cdot {{{\gamma^{yy}}}}}}}\right)}}}{{{{{\gamma^{xx}}}} \cdot {{{\gamma^{yy}}}}}{-{{\gamma^{xy}}}}}} = {-{{\gamma^{xy}}}}$
GOOD |
time: 6.502000ms stack: size: 11
|
simplifyAssertEq( gUxy * (gUxy - gUxx) / (gUxx - gUxy), -gUxy)
|
${\frac{{{{\gamma^{xy}}}} \cdot {{\left({{{\gamma^{xy}}}{-{{\gamma^{xx}}}}}\right)}}}{{{\gamma^{xx}}}{-{{\gamma^{xy}}}}}} = {-{{\gamma^{xy}}}}$
GOOD |
time: 2.215000ms stack: size: 11
|
| ||
assert( not( Constant(0) == x * y ) )
| GOOD |
time: 0.014000ms stack: size: 0 |
assert( Constant(0) ~= x * y )
| GOOD |
time: 0.009000ms stack: size: 0 |
simplifyAssertEq( Constant(0):subst( (v'^k' * v'^l' * g'_kl'):eq(var'vsq') ), Constant(0) )
|
${0} = {0}$
GOOD |
time: 0.120000ms stack: size: 0 |
simplifyAssertEq( Constant(0):replace( v'^k' * v'^l' * g'_kl', var'vsq' ), Constant(0) )
|
${0} = {0}$
GOOD |
time: 0.044000ms stack: size: 0 |
simplifyAssertEq( Constant(0):replace( v'^k' * v'^l', var'vsq' ), Constant(0) )
|
${0} = {0}$
GOOD |
time: 0.038000ms stack: size: 0 |
simplifyAssertEq( Constant(0):replace( v'^k', var'vsq' ), Constant(0) )
|
${0} = {0}$
GOOD |
time: 0.028000ms stack: size: 0 |
| ||
fixed this bug with op.div.rules.Prune.negOverNeg
| ||
'a' var lexically before 'f' var, squared, times -1's, simplification loop. oscillates between factoring out the -1 or not.simplifyAssertEq(-f * a^2 + f^3 * a^2 - f^5 * a^2, -f * a^2 * (1 - f^2 + f^4))
|
${{{ {-{f}} {{{a}^{2}}}} + {{{{f}^{3}}} {{{a}^{2}}}}}{-{{{{f}^{5}}} {{{a}^{2}}}}}} = { {-{f}} {{{a}^{2}}} {{\left({{1}{-{{f}^{2}}} + {{f}^{4}}}\right)}}}$
GOOD |
time: 11.236000ms stack: size: 33
|
'g' var lexically before 'f' var, no simplification loopsimplifyAssertEq(-f * g^2 + f^3 * g^2 - f^5 * g^2, -f * g^2 * (1 - f^2 + f^4))
|
${{{ {-{f}} {{{g}^{2}}}} + {{{{f}^{3}}} {{{g}^{2}}}}}{-{{{{f}^{5}}} {{{g}^{2}}}}}} = { {-{f}} {{{g}^{2}}} {{\left({{1}{-{{f}^{2}}} + {{f}^{4}}}\right)}}}$
GOOD |
time: 6.617000ms stack: size: 33
|
replace -1's with +1's, no simplification loopsimplifyAssertEq(f * a^2 + f^3 * a^2 + f^5 * a^2, f * a^2 * (1 + f^2 + f^4))
|
${{{{f}} {{{a}^{2}}}} + {{{{f}^{3}}} {{{a}^{2}}}} + {{{{f}^{5}}} {{{a}^{2}}}}} = {{{f}} {{{a}^{2}}} {{\left({{1} + {{f}^{2}} + {{f}^{4}}}\right)}}}$
GOOD |
time: 3.449000ms stack: size: 25
|
replace a^2 with a, no simplification loopsimplifyAssertEq(-f * a + f^3 * a - f^5 * a, -f * a * (1 - f^2 + f^4))
|
${{{ {-{f}} {{a}}} + {{{{f}^{3}}} {{a}}}}{-{{{{f}^{5}}} {{a}}}}} = { {-{f}} {{a}} {{\left({{1}{-{{f}^{2}}} + {{f}^{4}}}\right)}}}$
GOOD |
time: 5.369000ms stack: size: 26
|
replace f * quadratic of f^2 with f * quadratic of f, no simplification loopsimplifyAssertEq(-f * a^2 + f^2 * a^2 - f^3 * a^2, -f * a^2 * (1 - f + f^2))
|
${{{ {-{f}} {{{a}^{2}}}} + {{{{f}^{2}}} {{{a}^{2}}}}}{-{{{{f}^{3}}} {{{a}^{2}}}}}} = { {-{f}} {{{a}^{2}}} {{\left({{1}{-{f}} + {{f}^{2}}}\right)}}}$
GOOD |
time: 3.408000ms stack: size: 31
|
| ||
this runs forever (unless I push certain rules)
| ||
(b^2 * (a * r^2 + (a + 3 * sqrt(b^2 + delta^2))) * (a + sqrt(b^2 + delta^2))^2 / (3 * (r^2 + (a + sqrt(b^2 + delta^2))^2)^frac(5,2) * (b^2 + delta^2)^frac(3,2)) - lambda * exp(-l^2 / 2)):diff(delta)()
|