simplifyAssertEq(lim(x, x, a), a) |
${{\underset{ x\rightarrow a}{\lim}}{{x}}} = {a}$
GOOD |
time: 1.201000ms stack: size: 10
|
simplifyAssertEq(lim(x, x, a, '+'), a) |
${{\underset{ x\rightarrow{ a{}^+}}{\lim}}{{x}}} = {a}$
GOOD |
time: 0.727000ms stack: size: 8
|
simplifyAssertEq(lim(x, x, a, '-'), a) |
${{\underset{ x\rightarrow{ a{}^-}}{\lim}}{{x}}} = {a}$
GOOD |
time: 0.405000ms stack: size: 8
|
|
| ||
|
constants | ||
simplifyAssertEq(lim(0, x, a), 0) |
${{\underset{ x\rightarrow a}{\lim}}{{0}}} = {0}$
GOOD |
time: 2.020000ms stack: size: 7
|
simplifyAssertEq(lim(1, x, a), 1) |
${{\underset{ x\rightarrow a}{\lim}}{{1}}} = {1}$
GOOD |
time: 3.062000ms stack: size: 7
|
|
| ||
|
ops | ||
simplifyAssertEq(lim(x + 2, x, a), a + 2) |
${{\underset{ x\rightarrow a}{\lim}}{{\left({{x} + {2}}\right)}}} = {{a} + {2}}$
GOOD |
time: 4.684000ms stack: size: 9
|
simplifyAssertEq(lim(x + x, x, a), 2 * a) |
${{\underset{ x\rightarrow a}{\lim}}{{\left({{x} + {x}}\right)}}} = {{{2}} {{a}}}$
GOOD |
time: 3.534000ms stack: size: 7
|
simplifyAssertEq(lim(x + a, x, a), 2 * a) |
${{\underset{ x\rightarrow a}{\lim}}{{\left({{x} + {a}}\right)}}} = {{{2}} {{a}}}$
GOOD |
time: 4.327000ms stack: size: 7
|
simplifyAssertEq(lim(a + a, x, a), 2 * a) |
${{\underset{ x\rightarrow a}{\lim}}{{\left({{a} + {a}}\right)}}} = {{{2}} {{a}}}$
GOOD |
time: 5.252000ms stack: size: 7
|
simplifyAssertEq(lim(x * 2, x, a), 2 * a) |
${{\underset{ x\rightarrow a}{\lim}}{{\left({{{x}} {{2}}}\right)}}} = {{{2}} {{a}}}$
GOOD |
time: 2.730000ms stack: size: 7
|
simplifyAssertEq(lim(x / 2, x, a), a / 2) |
${{\underset{ x\rightarrow a}{\lim}}{{{\frac{1}{2}} {x}}}} = {{\frac{1}{2}} {a}}$
GOOD |
time: 6.865000ms stack: size: 14
|
|
| ||
|
involving infinity | ||
simplifyAssertEq(lim(x, x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{x}}} = {\infty}$
GOOD |
time: 0.592000ms stack: size: 8
|
simplifyAssertEq(lim(x, x, -inf), -inf) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{x}}} = {-{\infty}}$
GOOD |
time: 1.566000ms stack: size: 14
|
simplifyAssertEq(lim(x, x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{x}}} = {\infty}$
GOOD |
time: 0.257000ms stack: size: 8
|
simplifyAssertEq(lim(1/x, x, inf), 0) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\frac{1}{x}}}} = {0}$
GOOD |
time: 2.337000ms stack: size: 7
|
simplifyAssertEq(lim(1/x, x, -inf), 0) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\frac{1}{x}}}} = {0}$
GOOD |
time: 1.192000ms stack: size: 7
|
simplifyAssertEq(lim(1/x, x, 0), invalid) |
${{\underset{ x\rightarrow 0}{\lim}}{{\frac{1}{x}}}} = {¿}$
GOOD |
time: 1.853000ms stack: size: 7
|
|
| ||
simplifyAssertEq(lim(1/x, x, 0, '+'), inf) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{\frac{1}{x}}}} = {\infty}$
GOOD |
time: 1.903000ms stack: size: 9
|
simplifyAssertEq(lim(1/x, x, 0, '-'), -inf) |
${{\underset{ x\rightarrow{ 0{}^-}}{\lim}}{{\frac{1}{x}}}} = {-{\infty}}$
GOOD |
time: 2.343000ms stack: size: 14
|
|
| ||
simplifyAssertEq(lim(1/x^2, x, 0, '+'), inf) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{\frac{1}{{x}^{2}}}}} = {\infty}$
GOOD |
time: 4.307000ms stack: size: 11
|
simplifyAssertEq(lim(1/x^2, x, 0, '-'), inf) |
${{\underset{ x\rightarrow{ 0{}^-}}{\lim}}{{\frac{1}{{x}^{2}}}}} = {\infty}$
GOOD |
time: 7.301000ms stack: size: 11
|
|
| ||
|
sqrts | ||
simplifyAssertEq(lim(sqrt(x), x, 0), invalid) |
${{\underset{ x\rightarrow 0}{\lim}}{{\sqrt{x}}}} = {¿}$
GOOD |
time: 1.873000ms stack: size: 7
|
simplifyAssertEq(lim(sqrt(x), x, 0, '-'), invalid) |
${{\underset{ x\rightarrow{ 0{}^-}}{\lim}}{{\sqrt{x}}}} = {¿}$
GOOD |
time: 1.075000ms stack: size: 7
|
simplifyAssertEq(lim(sqrt(x), x, 0, '+'), 0) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{\sqrt{x}}}} = {0}$
GOOD |
time: 1.203000ms stack: size: 7
|
|
in each form ... | ||
simplifyAssertEq(lim(x^frac(1,2), x, 0), invalid) |
${{\underset{ x\rightarrow 0}{\lim}}{{{x}^{\frac{1}{2}}}}} = {¿}$
GOOD |
time: 1.421000ms stack: size: 7
|
simplifyAssertEq(lim(x^frac(1,2), x, 0, '-'), invalid) |
${{\underset{ x\rightarrow{ 0{}^-}}{\lim}}{{{x}^{\frac{1}{2}}}}} = {¿}$
GOOD |
time: 1.258000ms stack: size: 7
|
simplifyAssertEq(lim(x^frac(1,2), x, 0, '+'), 0) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{{x}^{\frac{1}{2}}}}} = {0}$
GOOD |
time: 1.557000ms stack: size: 7
|
|
and one more power up ... | ||
simplifyAssertEq(lim(x^frac(1,4), x, 0), invalid) |
${{\underset{ x\rightarrow 0}{\lim}}{{{x}^{\frac{1}{4}}}}} = {¿}$
GOOD |
time: 2.526000ms stack: size: 7
|
simplifyAssertEq(lim(x^frac(1,4), x, 0, '-'), invalid) |
${{\underset{ x\rightarrow{ 0{}^-}}{\lim}}{{{x}^{\frac{1}{4}}}}} = {¿}$
GOOD |
time: 2.733000ms stack: size: 7
|
simplifyAssertEq(lim(x^frac(1,4), x, 0, '+'), 0) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{{x}^{\frac{1}{4}}}}} = {0}$
GOOD |
time: 1.636000ms stack: size: 7
|
|
| ||
|
| ||
|
functions | ||
|
| ||
|
TODO all of these are only good for 'a' in Real, not necessarily extended-Real, because I don't distinguish them | ||
|
| ||
|
another thing to consider ... most these are set up so that the limit is the same as the evaluation without a limit | ||
|
technically this is not true. technically atan(inf) is not pi/2 but is instead undefined outside of the limit. | ||
|
should I enforce this? | ||
simplifyAssertEq(lim(sin(x), x, a), sin(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\sin\left( x\right)}}} = {\sin\left( a\right)}$
GOOD |
time: 1.099000ms stack: size: 7
|
simplifyAssertEq(lim(sin(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\sin\left( x\right)}}} = {¿}$
GOOD |
time: 0.493000ms stack: size: 7
|
simplifyAssertEq(lim(sin(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\sin\left( x\right)}}} = {¿}$
GOOD |
time: 0.863000ms stack: size: 7
|
|
| ||
simplifyAssertEq(lim(cos(x), x, a), cos(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\cos\left( x\right)}}} = {\cos\left( a\right)}$
GOOD |
time: 0.666000ms stack: size: 7
|
simplifyAssertEq(lim(cos(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\cos\left( x\right)}}} = {¿}$
GOOD |
time: 0.355000ms stack: size: 7
|
simplifyAssertEq(lim(cos(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\cos\left( x\right)}}} = {¿}$
GOOD |
time: 0.780000ms stack: size: 7
|
|
| ||
simplifyAssertEq(lim(abs(x), x, a), abs(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\left| x\right|}}} = {\left| a\right|}$
GOOD |
time: 0.514000ms stack: size: 7
|
simplifyAssertEq(lim(abs(x), x, -inf), inf) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\left| x\right|}}} = {\infty}$
GOOD |
time: 0.804000ms stack: size: 13
|
simplifyAssertEq(lim(abs(x), x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\left| x\right|}}} = {\infty}$
GOOD |
time: 0.373000ms stack: size: 10
|
|
| ||
simplifyAssertEq(lim(exp(x), x, a), exp(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\exp\left( x\right)}}} = {\exp\left( a\right)}$
GOOD |
time: 0.677000ms stack: size: 7
|
simplifyAssertEq(lim(exp(x), x, -inf), 0) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\exp\left( x\right)}}} = {0}$
GOOD |
time: 0.399000ms stack: size: 7
|
simplifyAssertEq(lim(exp(x), x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\exp\left( x\right)}}} = {\infty}$
GOOD |
time: 0.380000ms stack: size: 11
|
|
| ||
simplifyAssertEq(lim(atan(x), x, a), atan(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{atan\left( x\right)}}} = {atan\left( a\right)}$
GOOD |
time: 1.191000ms stack: size: 7
|
simplifyAssertEq(lim(atan(x), x, -inf), -pi/2) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{atan\left( x\right)}}} = {{\frac{1}{2}}{\left({-{π}}\right)}}$
GOOD |
time: 7.864000ms stack: size: 19
|
simplifyAssertEq(lim(atan(x), x, inf), pi/2) |
${{\underset{ x\rightarrow \infty}{\lim}}{{atan\left( x\right)}}} = {{\frac{1}{2}} {π}}$
GOOD |
time: 2.859000ms stack: size: 14
|
|
| ||
simplifyAssertEq(lim(tanh(x), x, a), tanh(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\tanh\left( x\right)}}} = {\tanh\left( a\right)}$
GOOD |
time: 0.829000ms stack: size: 7
|
simplifyAssertEq(lim(tanh(x), x, -inf), -1) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\tanh\left( x\right)}}} = {-1}$
GOOD |
time: 0.753000ms stack: size: 8
|
simplifyAssertEq(lim(tanh(x), x, inf), 1) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\tanh\left( x\right)}}} = {1}$
GOOD |
time: 0.492000ms stack: size: 7
|
|
| ||
simplifyAssertEq(lim(asinh(x), x, a), asinh(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{asinh\left( x\right)}}} = {asinh\left( a\right)}$
GOOD |
time: 0.819000ms stack: size: 7
|
simplifyAssertEq(lim(asinh(x), x, -inf), -inf) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{asinh\left( x\right)}}} = {-{\infty}}$
GOOD |
time: 1.309000ms stack: size: 14
|
simplifyAssertEq(lim(asinh(x), x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{asinh\left( x\right)}}} = {\infty}$
GOOD |
time: 0.324000ms stack: size: 10
|
|
| ||
simplifyAssertEq(lim(cosh(x), x, a), cosh(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\cosh\left( x\right)}}} = {\cosh\left( a\right)}$
GOOD |
time: 0.846000ms stack: size: 7
|
simplifyAssertEq(lim(cosh(x), x, -inf), inf) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\cosh\left( x\right)}}} = {\infty}$
GOOD |
time: 1.148000ms stack: size: 12
|
simplifyAssertEq(lim(cosh(x), x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\cosh\left( x\right)}}} = {\infty}$
GOOD |
time: 0.602000ms stack: size: 10
|
|
| ||
simplifyAssertEq(lim(sinh(x), x, a), sinh(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\sinh\left( x\right)}}} = {\sinh\left( a\right)}$
GOOD |
time: 1.120000ms stack: size: 7
|
simplifyAssertEq(lim(sinh(x), x, -inf), -inf) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\sinh\left( x\right)}}} = {-{\infty}}$
GOOD |
time: 1.867000ms stack: size: 14
|
simplifyAssertEq(lim(sinh(x), x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\sinh\left( x\right)}}} = {\infty}$
GOOD |
time: 0.279000ms stack: size: 10
|
|
| ||
simplifyAssertEq(lim(sin(x), x, a), sin(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\sin\left( x\right)}}} = {\sin\left( a\right)}$
GOOD |
time: 0.437000ms stack: size: 7
|
simplifyAssertEq(lim(sin(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\sin\left( x\right)}}} = {¿}$
GOOD |
time: 0.593000ms stack: size: 7
|
simplifyAssertEq(lim(sin(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\sin\left( x\right)}}} = {¿}$
GOOD |
time: 0.240000ms stack: size: 7
|
|
| ||
simplifyAssertEq(lim(cos(x), x, a), cos(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\cos\left( x\right)}}} = {\cos\left( a\right)}$
GOOD |
time: 1.618000ms stack: size: 7
|
simplifyAssertEq(lim(cos(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\cos\left( x\right)}}} = {¿}$
GOOD |
time: 0.747000ms stack: size: 7
|
simplifyAssertEq(lim(cos(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\cos\left( x\right)}}} = {¿}$
GOOD |
time: 0.308000ms stack: size: 7
|
|
| ||
simplifyAssertEq(lim(tan(x), x, a), tan(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\tan\left( x\right)}}} = {\tan\left( a\right)}$
GOOD |
time: 6.504000ms stack: size: 15
|
simplifyAssertEq(lim(tan(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\tan\left( x\right)}}} = {¿}$
GOOD |
time: 1.235000ms stack: size: 7
|
simplifyAssertEq(lim(tan(x), x, -3*pi/2), invalid) |
${{\underset{ x\rightarrow{{\frac{1}{2}} {{{-3}} {{π}}}}}{\lim}}{{\tan\left( x\right)}}} = {¿}$
GOOD |
time: 4.819000ms stack: size: 7
|
simplifyAssertEq(lim(tan(x), x, -pi), tan(-pi)) |
${{\underset{ x\rightarrow -{π}}{\lim}}{{\tan\left( x\right)}}} = {\tan\left( -{π}\right)}$
GOOD |
time: 3.327000ms stack: size: 13
|
simplifyAssertEq(lim(tan(x), x, -pi/2), invalid) |
${{\underset{ x\rightarrow{{\frac{1}{2}}{\left({-{π}}\right)}}}{\lim}}{{\tan\left( x\right)}}} = {¿}$
GOOD |
time: 5.105000ms stack: size: 7
|
simplifyAssertEq(lim(tan(x), x, 0), tan(0)) |
${{\underset{ x\rightarrow 0}{\lim}}{{\tan\left( x\right)}}} = {\tan\left( 0\right)}$
GOOD |
time: 1.851000ms stack: size: 11
|
simplifyAssertEq(lim(tan(x), x, pi/2), invalid) |
${{\underset{ x\rightarrow{{\frac{1}{2}} {π}}}{\lim}}{{\tan\left( x\right)}}} = {¿}$
GOOD |
time: 3.084000ms stack: size: 7
|
simplifyAssertEq(lim(tan(x), x, pi/2, '+'), -inf) |
${{\underset{ x\rightarrow{{{\frac{1}{2}} {π}}{}^+}}{\lim}}{{\tan\left( x\right)}}} = {-{\infty}}$
GOOD |
time: 3.089000ms stack: size: 14
|
simplifyAssertEq(lim(tan(x), x, pi/2, '-'), inf) |
${{\underset{ x\rightarrow{{{\frac{1}{2}} {π}}{}^-}}{\lim}}{{\tan\left( x\right)}}} = {\infty}$
GOOD |
time: 1.245000ms stack: size: 16
|
simplifyAssertEq(lim(tan(x), x, pi), tan(pi)) |
${{\underset{ x\rightarrow π}{\lim}}{{\tan\left( x\right)}}} = {\tan\left( π\right)}$
GOOD |
time: 2.722000ms stack: size: 12
|
simplifyAssertEq(lim(tan(x), x, 3*pi/2), invalid) |
${{\underset{ x\rightarrow{{\frac{1}{2}} {{{3}} {{π}}}}}{\lim}}{{\tan\left( x\right)}}} = {¿}$
GOOD |
time: 5.193000ms stack: size: 7
|
simplifyAssertEq(lim(tan(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\tan\left( x\right)}}} = {¿}$
GOOD |
time: 1.558000ms stack: size: 7
|
|
| ||
if the input is within the domain of the function then we can evaluate it for certaindo local a = set.positiveReal:var'a' simplifyAssertEq(lim(log(x), x, a), log(a)) end |
${{\underset{ x\rightarrow a}{\lim}}{{\log\left( x\right)}}} = {\log\left( a\right)}$
GOOD |
time: 1.572000ms stack: size: 7
|
if the input is outside the domain of the function then we know the result is invalid. TODO is this the same as indeterminate? Or should I introduce a new singleton?do local a = set.negativeReal:var'a' simplifyAssertEq(lim(log(x), x, a), invalid) end |
${{\underset{ x\rightarrow a}{\lim}}{{\log\left( x\right)}}} = {¿}$
GOOD |
time: 0.873000ms stack: size: 7
|
if the input covers both the domain and its complement, and we can't determine the limit evaluation, then don't touch the expressiondo local a = set.real:var'a' print(lim(log(x), x, a):prune()) assert(lim(log(x), x, a):prune() == lim(log(x), x, a)) end | ${\underset{ x\rightarrow a}{\lim}}{{\log\left( x\right)}}$ GOOD |
time: 1.046000ms stack: size: 4
|
simplifyAssertEq(lim(log(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\log\left( x\right)}}} = {¿}$
GOOD |
time: 0.778000ms stack: size: 7
|
simplifyAssertEq(lim(log(x), x, 0), invalid) |
${{\underset{ x\rightarrow 0}{\lim}}{{\log\left( x\right)}}} = {¿}$
GOOD |
time: 0.915000ms stack: size: 7
|
simplifyAssertEq(lim(log(x), x, 0, '+'), -inf) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{\log\left( x\right)}}} = {-{\infty}}$
GOOD |
time: 1.603000ms stack: size: 14
|
simplifyAssertEq(lim(log(x), x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\log\left( x\right)}}} = {\infty}$
GOOD |
time: 0.492000ms stack: size: 10
|
|
| ||
do local a = set.RealSubset(-1, 1, false, false):var'a' simplifyAssertEq(lim(acosh(x), x, a), acosh(a)) end |
${{\underset{ x\rightarrow a}{\lim}}{{acosh\left( x\right)}}} = {acosh\left( a\right)}$
GOOD |
time: 1.337000ms stack: size: 8
|
do local a = set.RealSubset(-math.huge, -1, false, false):var'a' simplifyAssertEq(lim(acosh(x), x, a), invalid) end |
${{\underset{ x\rightarrow a}{\lim}}{{acosh\left( x\right)}}} = {¿}$
GOOD |
time: 0.737000ms stack: size: 7
|
do local a = set.real:var'a' print(lim(acosh(x), x, a):prune()) assert(lim(acosh(x), x, a):prune() == lim(acosh(x), x, a)) end | ${\underset{ x\rightarrow a}{\lim}}{{acosh\left( x\right)}}$ GOOD |
time: 0.889000ms stack: size: 4
|
simplifyAssertEq(lim(acosh(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{acosh\left( x\right)}}} = {¿}$
GOOD |
time: 0.683000ms stack: size: 7
|
simplifyAssertEq(lim(acosh(x), x, 1), invalid) |
${{\underset{ x\rightarrow 1}{\lim}}{{acosh\left( x\right)}}} = {¿}$
GOOD |
time: 0.416000ms stack: size: 7
|
simplifyAssertEq(lim(acosh(x), x, 1, '+'), 0) |
${{\underset{ x\rightarrow{ 1{}^+}}{\lim}}{{acosh\left( x\right)}}} = {0}$
GOOD |
time: 0.545000ms stack: size: 7
|
simplifyAssertEq(lim(acosh(x), x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{acosh\left( x\right)}}} = {\infty}$
GOOD |
time: 0.264000ms stack: size: 10
|
|
| ||
do local a = set.RealSubset(-1, 1, false, false):var'a' simplifyAssertEq(lim(atanh(x), x, a), atanh(a)) end |
${{\underset{ x\rightarrow a}{\lim}}{{atanh\left( x\right)}}} = {atanh\left( a\right)}$
GOOD |
time: 1.273000ms stack: size: 7
|
do local a = set.RealSubset(-math.huge, -1, false, false):var'a' simplifyAssertEq(lim(atanh(x), x, a), invalid) end |
${{\underset{ x\rightarrow a}{\lim}}{{atanh\left( x\right)}}} = {¿}$
GOOD |
time: 0.769000ms stack: size: 7
|
do local a = set.real:var'a' print(lim(atanh(x), x, a):prune()) assert(lim(atanh(x), x, a):prune() == lim(atanh(x), x, a)) end | ${\underset{ x\rightarrow a}{\lim}}{{atanh\left( x\right)}}$ GOOD |
time: 1.443000ms stack: size: 4
|
simplifyAssertEq(lim(atanh(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{atanh\left( x\right)}}} = {¿}$
GOOD |
time: 0.853000ms stack: size: 7
|
simplifyAssertEq(lim(atanh(x), x, -1), invalid) |
${{\underset{ x\rightarrow{-1}}{\lim}}{{atanh\left( x\right)}}} = {¿}$
GOOD |
time: 0.595000ms stack: size: 7
|
simplifyAssertEq(lim(atanh(x), x, -1, '+'), -inf) |
${{\underset{ x\rightarrow{{-1}{}^+}}{\lim}}{{atanh\left( x\right)}}} = {-{\infty}}$
GOOD |
time: 1.259000ms stack: size: 14
|
simplifyAssertEq(lim(atanh(x), x, 0), 0) |
${{\underset{ x\rightarrow 0}{\lim}}{{atanh\left( x\right)}}} = {0}$
GOOD |
time: 0.969000ms stack: size: 7
|
simplifyAssertEq(lim(atanh(x), x, 1), invalid) |
${{\underset{ x\rightarrow 1}{\lim}}{{atanh\left( x\right)}}} = {¿}$
GOOD |
time: 1.621000ms stack: size: 7
|
simplifyAssertEq(lim(atanh(x), x, 1, '-'), inf) |
${{\underset{ x\rightarrow{ 1{}^-}}{\lim}}{{atanh\left( x\right)}}} = {\infty}$
GOOD |
time: 0.521000ms stack: size: 9
|
simplifyAssertEq(lim(atanh(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{atanh\left( x\right)}}} = {¿}$
GOOD |
time: 0.732000ms stack: size: 7
|
|
| ||
do local a = set.RealSubset(-1, 1, false, false):var'a' simplifyAssertEq(lim(asin(x), x, a), asin(a)) end |
${{\underset{ x\rightarrow a}{\lim}}{{asin\left( x\right)}}} = {asin\left( a\right)}$
GOOD |
time: 1.759000ms stack: size: 7
|
do local a = set.RealSubset(-math.huge, -1, false, false):var'a' simplifyAssertEq(lim(asin(x), x, a), invalid) end |
${{\underset{ x\rightarrow a}{\lim}}{{asin\left( x\right)}}} = {¿}$
GOOD |
time: 1.024000ms stack: size: 7
|
do local a = set.real:var'a' print(lim(asin(x), x, a):prune()) assert(lim(asin(x), x, a):prune() == lim(asin(x), x, a)) end | ${\underset{ x\rightarrow a}{\lim}}{{asin\left( x\right)}}$ GOOD |
time: 1.947000ms stack: size: 4
|
simplifyAssertEq(lim(asin(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{asin\left( x\right)}}} = {¿}$
GOOD |
time: 0.871000ms stack: size: 7
|
simplifyAssertEq(lim(asin(x), x, -1), invalid) |
${{\underset{ x\rightarrow{-1}}{\lim}}{{asin\left( x\right)}}} = {¿}$
GOOD |
time: 1.141000ms stack: size: 7
|
simplifyAssertEq(lim(asin(x), x, -1, '+'), -inf) |
${{\underset{ x\rightarrow{{-1}{}^+}}{\lim}}{{asin\left( x\right)}}} = {-{\infty}}$
GOOD |
time: 1.683000ms stack: size: 14
|
simplifyAssertEq(lim(asin(x), x, 0), 0) |
${{\underset{ x\rightarrow 0}{\lim}}{{asin\left( x\right)}}} = {0}$
GOOD |
time: 0.862000ms stack: size: 7
|
simplifyAssertEq(lim(asin(x), x, 1), invalid) |
${{\underset{ x\rightarrow 1}{\lim}}{{asin\left( x\right)}}} = {¿}$
GOOD |
time: 0.761000ms stack: size: 7
|
simplifyAssertEq(lim(asin(x), x, 1, '-'), inf) |
${{\underset{ x\rightarrow{ 1{}^-}}{\lim}}{{asin\left( x\right)}}} = {\infty}$
GOOD |
time: 0.832000ms stack: size: 9
|
simplifyAssertEq(lim(asin(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{asin\left( x\right)}}} = {¿}$
GOOD |
time: 1.032000ms stack: size: 7
|
|
| ||
do local a = set.RealSubset(-1, 1, false, false):var'a' simplifyAssertEq(lim(acos(x), x, a), acos(a)) end |
${{\underset{ x\rightarrow a}{\lim}}{{acos\left( x\right)}}} = {acos\left( a\right)}$
GOOD |
time: 1.937000ms stack: size: 7
|
do local a = set.RealSubset(-math.huge, -1, false, false):var'a' simplifyAssertEq(lim(acos(x), x, a), invalid) end |
${{\underset{ x\rightarrow a}{\lim}}{{acos\left( x\right)}}} = {¿}$
GOOD |
time: 1.557000ms stack: size: 7
|
do local a = set.real:var'a' print(lim(acos(x), x, a):prune()) assert(lim(acos(x), x, a):prune() == lim(acos(x), x, a)) end | ${\underset{ x\rightarrow a}{\lim}}{{acos\left( x\right)}}$ GOOD |
time: 2.103000ms stack: size: 4
|
simplifyAssertEq(lim(acos(x), x, -inf), invalid) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{acos\left( x\right)}}} = {¿}$
GOOD |
time: 1.456000ms stack: size: 7
|
simplifyAssertEq(lim(acos(x), x, -1), invalid) |
${{\underset{ x\rightarrow{-1}}{\lim}}{{acos\left( x\right)}}} = {¿}$
GOOD |
time: 1.499000ms stack: size: 7
|
simplifyAssertEq(lim(acos(x), x, -1, '+'), inf) |
${{\underset{ x\rightarrow{{-1}{}^+}}{\lim}}{{acos\left( x\right)}}} = {\infty}$
GOOD |
time: 0.658000ms stack: size: 9
|
simplifyAssertEq(lim(acos(x), x, 0), pi/2) |
${{\underset{ x\rightarrow 0}{\lim}}{{acos\left( x\right)}}} = {{\frac{1}{2}} {π}}$
GOOD |
time: 9.965000ms stack: size: 14
|
simplifyAssertEq(lim(acos(x), x, 1), invalid) |
${{\underset{ x\rightarrow 1}{\lim}}{{acos\left( x\right)}}} = {¿}$
GOOD |
time: 0.945000ms stack: size: 7
|
simplifyAssertEq(lim(acos(x), x, 1, '-'), -inf) |
${{\underset{ x\rightarrow{ 1{}^-}}{\lim}}{{acos\left( x\right)}}} = {-{\infty}}$
GOOD |
time: 0.918000ms stack: size: 14
|
simplifyAssertEq(lim(acos(x), x, inf), invalid) |
${{\underset{ x\rightarrow \infty}{\lim}}{{acos\left( x\right)}}} = {¿}$
GOOD |
time: 0.376000ms stack: size: 7
|
|
| ||
simplifyAssertEq(lim(Heaviside(x), x, a), Heaviside(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\mathcal{H}\left( x\right)}}} = {\mathcal{H}\left( a\right)}$
GOOD |
time: 0.506000ms stack: size: 7
|
simplifyAssertEq(lim(Heaviside(x), x, -inf), 0) |
${{\underset{ x\rightarrow -{\infty}}{\lim}}{{\mathcal{H}\left( x\right)}}} = {0}$
GOOD |
time: 0.398000ms stack: size: 7
|
simplifyAssertEq(lim(Heaviside(x), x, -1), 0) |
${{\underset{ x\rightarrow{-1}}{\lim}}{{\mathcal{H}\left( x\right)}}} = {0}$
GOOD |
time: 0.279000ms stack: size: 7
|
simplifyAssertEq(lim(Heaviside(x), x, 0), invalid) |
${{\underset{ x\rightarrow 0}{\lim}}{{\mathcal{H}\left( x\right)}}} = {¿}$
GOOD |
time: 0.376000ms stack: size: 7
|
simplifyAssertEq(lim(Heaviside(x), x, 0, '-'), 0) |
${{\underset{ x\rightarrow{ 0{}^-}}{\lim}}{{\mathcal{H}\left( x\right)}}} = {0}$
GOOD |
time: 0.287000ms stack: size: 7
|
simplifyAssertEq(lim(Heaviside(x), x, 0, '+'), 1) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{\mathcal{H}\left( x\right)}}} = {1}$
GOOD |
time: 0.387000ms stack: size: 7
|
simplifyAssertEq(lim(Heaviside(x), x, 1), 1) |
${{\underset{ x\rightarrow 1}{\lim}}{{\mathcal{H}\left( x\right)}}} = {1}$
GOOD |
time: 1.055000ms stack: size: 7
|
simplifyAssertEq(lim(Heaviside(x), x, inf), 1) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\mathcal{H}\left( x\right)}}} = {1}$
GOOD |
time: 0.554000ms stack: size: 7
|
|
| ||
|
products of functions | ||
simplifyAssertEq(lim(x * sin(x), x, a), a * sin(a)) |
${{\underset{ x\rightarrow a}{\lim}}{{\left({{{x}} {{\sin\left( x\right)}}}\right)}}} = {{{a}} {{\sin\left( a\right)}}}$
GOOD |
time: 3.925000ms stack: size: 7
|
|
| ||
|
TODO polynomial roots | ||
simplifyAssertEq(lim(1 / (x - 1), x, 1), invalid) |
${{\underset{ x\rightarrow 1}{\lim}}{{\frac{1}{{x}{-{1}}}}}} = {¿}$
GOOD |
time: 7.675000ms stack: size: 7
|
simplifyAssertEq(lim(1 / (x - 1), x, 1, '+'), inf) |
${{\underset{ x\rightarrow{ 1{}^+}}{\lim}}{{\frac{1}{{x}{-{1}}}}}} = {\infty}$
GOOD |
time: 3.797000ms stack: size: 14
|
simplifyAssertEq(lim(1 / (x - 1), x, 1, '-'), -inf) |
${{\underset{ x\rightarrow{ 1{}^-}}{\lim}}{{\frac{1}{{x}{-{1}}}}}} = {-{\infty}}$
GOOD |
time: 5.742000ms stack: size: 14
|
simplifyAssertEq(lim((x + 1) / (x^2 - 1), x, 1), invalid) |
${{\underset{ x\rightarrow 1}{\lim}}{{\frac{{x} + {1}}{{{x}^{2}}{-{1}}}}}} = {¿}$
GOOD |
time: 27.488000ms stack: size: 7
|
simplifyAssertEq(lim((x + 1) / (x^2 - 1), x, 1, '+'), inf) |
${{\underset{ x\rightarrow{ 1{}^+}}{\lim}}{{\frac{{x} + {1}}{{{x}^{2}}{-{1}}}}}} = {\infty}$
GOOD |
time: 21.890000ms stack: size: 40
|
simplifyAssertEq(lim((x + 1) / (x^2 - 1), x, 1, '-'), -inf) |
${{\underset{ x\rightarrow{ 1{}^-}}{\lim}}{{\frac{{x} + {1}}{{{x}^{2}}{-{1}}}}}} = {-{\infty}}$
GOOD |
time: 22.838000ms stack: size: 14
|
|
| ||
|
can we evaluate derivatives as limits? yes. | ||
difftest(x) |
${f\left( x\right)} = {x}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {1}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {1}$ ${1} = {1}$ GOOD |
time: 2.519000ms stack: size: 7
|
difftest(c * x) |
${f\left( x\right)} = {{{c}} {{x}}}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {c}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {c}$ ${c} = {c}$ GOOD |
time: 5.854000ms stack: size: 10
|
difftest(x^2) |
${f\left( x\right)} = {{x}^{2}}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {{{2}} {{x}}}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {{{2}} {{x}}}$ ${{{2}} {{x}}} = {{{2}} {{x}}}$ GOOD |
time: 9.053000ms stack: size: 7
|
difftest(x^3) |
${f\left( x\right)} = {{x}^{3}}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {{{3}} {{{x}^{2}}}}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {{{3}} {{{x}^{2}}}}$ ${{{3}} {{{x}^{2}}}} = {{{3}} {{{x}^{2}}}}$ GOOD |
time: 27.109000ms stack: size: 10
|
difftest(1/x) |
${f\left( x\right)} = {\frac{1}{x}}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {\frac{-1}{{x}^{2}}}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {\frac{-1}{{x}^{2}}}$ ${\frac{-1}{{x}^{2}}} = {\frac{-1}{{x}^{2}}}$ GOOD |
time: 23.078000ms stack: size: 19
|
|
| ||
|
can't handle these yet. | ||
|
TODO give unit tests a 'reach' section? | ||
|
so console can show that these tests aren't 100% certified. | ||
|
use infinite taylor expansion? | ||
|
or just use L'Hospital's rule -- that solves these too, because, basically, that replaces the limit with the derivative, so it will always be equal. | ||
difftest(sqrt(x)) |
${f\left( x\right)} = {\sqrt{x}}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{\sqrt{{x} + {h}}} + {{{-1}} {{\sqrt{x}}}}}\right)}}}}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {\frac{1}{{{2}} {{{x}^{\frac{1}{2}}}}}}$ ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{\sqrt{{x} + {h}}} + {{{-1}} {{\sqrt{x}}}}}\right)}}}} = {\frac{1}{{{2}} {{{x}^{\frac{1}{2}}}}}}$ GOOD |
time: 306.386000ms stack: size: 89
|
difftest(sin(x)) |
${f\left( x\right)} = {\sin\left( x\right)}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {\cos\left( x\right)}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {\cos\left( x\right)}$ ${\cos\left( x\right)} = {\cos\left( x\right)}$ GOOD |
time: 7.369000ms stack: size: 7
|
difftest(cos(x)) |
${f\left( x\right)} = {\cos\left( x\right)}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {{{-1}} {{\sin\left( x\right)}}}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {{{-1}} {{\sin\left( x\right)}}}$ ${{{-1}} {{\sin\left( x\right)}}} = {{{-1}} {{\sin\left( x\right)}}}$ GOOD |
time: 7.197000ms stack: size: 10
|
difftest(exp(x)) |
${f\left( x\right)} = {\exp\left( x\right)}$
limit: ${{\underset{ h\rightarrow{ 0{}^+}}{\lim}}{{{\frac{1}{h}}{\left({{f\left( {{x} + {h}}\right)}{-{f\left( x\right)}}}\right)}}}} = {\exp\left( x\right)}$ derivative: ${{\frac{\partial}{\partial x}}\left({f\left( x\right)}\right)} = {\exp\left( x\right)}$ ${\exp\left( x\right)} = {\exp\left( x\right)}$ GOOD |
time: 6.290000ms stack: size: 7
|
|
| ||
|
some other L'Hospital rule problems: | ||
simplifyAssertEq(lim(sin(x) / x, x, 0), 1) |
${{\underset{ x\rightarrow 0}{\lim}}{{{\frac{1}{x}} {\sin\left( x\right)}}}} = {1}$
GOOD |
time: 2.642000ms stack: size: 7
|
simplifyAssertEq(lim(exp(x) / x^2, x, inf), inf) |
${{\underset{ x\rightarrow \infty}{\lim}}{{\frac{\exp\left( x\right)}{{x}^{2}}}}} = {\infty}$
GOOD |
time: 3.118000ms stack: size: 15
|
simplifyAssertEq(lim((e^x - 1) / (x^2 + x), x, 0), 1) |
${{\underset{ x\rightarrow 0}{\lim}}{{\frac{{\exp\left( x\right)}{-{1}}}{{{x}^{2}} + {x}}}}} = {1}$
GOOD |
time: 7.719000ms stack: size: 7
|
simplifyAssertEq(lim((2*sin(x) - sin(2*x)) / (x - sin(x)), x, 0), 6) |
${{\underset{ x\rightarrow 0}{\lim}}{{\frac{{{{2}} {{\sin\left( x\right)}}}{-{\sin\left( {{{2}} {{x}}}\right)}}}{{x}{-{\sin\left( x\right)}}}}}} = {6}$
GOOD |
time: 51.345000ms stack: size: 7
|
|
| ||
|
TODO this one, repeatedly apply L'Hospital until the power of x on top is <= 0 | ||
|
but this seems like it would need a special case of evaluating into a factorial | ||
simplifyAssertEq(lim(x^n * e^x, x, 0), 0) |
${{\underset{ x\rightarrow 0}{\lim}}{{\left({{{{x}^{n}}} {{\exp\left( x\right)}}}\right)}}} = {0}$
expected ${\underset{ x\rightarrow 0}{\lim}}{{\left({{{{x}^{n}}} {{\exp\left( x\right)}}}\right)}}$ to equal 0 found ${0}^{n}$ vs $0$ lhs stack Init ${\underset{ x\rightarrow 0}{\lim}}{{\left({{{{x}^{n}}} {{\exp\left( x\right)}}}\right)}}$ Limit{*[^[x, n], ^[_e|2.718281828459, x]], x, 0, {}}
Limit:Prune:apply $e$ _e|2.718281828459 Limit:Prune:apply $0$ 0 ^:Prune:xToTheZero $1$ 1 Limit:Prune:apply $1$ 1 Limit:Prune:apply $0$ 0 Limit:Prune:apply $n$ n Limit:Prune:apply ${0}^{n}$ ^[0, n] *:Prune:apply ${0}^{n}$ ^[0, n] Limit:Prune:apply ${0}^{n}$ ^[0, n] Limit:Prune:apply $e$ _e|2.718281828459 Limit:Prune:apply $0$ 0 ^:Prune:xToTheZero $1$ 1 Limit:Prune:apply $1$ 1 Limit:Prune:apply $0$ 0 Limit:Prune:apply $n$ n Limit:Prune:apply ${0}^{n}$ ^[0, n] *:Prune:apply ${0}^{n}$ ^[0, n] Limit:Prune:apply ${0}^{n}$ ^[0, n] Limit:Prune:apply ${0}^{n}$ ^[0, n] Prune ${0}^{n}$ ^[0, n] Expand ${0}^{n}$ ^[0, n] Prune ${0}^{n}$ ^[0, n] Factor ${0}^{n}$ ^[0, n] Prune ${0}^{n}$ ^[0, n] Tidy ${0}^{n}$ ^[0, n] rhs stack Init $0$ 0 Prune $0$ 0 Expand $0$ 0 Prune $0$ 0 Factor $0$ 0 Prune $0$ 0 Tidy $0$ 0 BAD /home/chris/Projects/lua/symmath/tests/unit/unit.lua:138: failed stack traceback: /home/chris/Projects/lua/symmath/tests/unit/unit.lua:260: in function [C]: in function 'error' /home/chris/Projects/lua/symmath/tests/unit/unit.lua:138: in function 'simplifyAssertEq' [string "simplifyAssertEq(lim(x^n * e^x, x, 0), 0)"]:1: in main chunk /home/chris/Projects/lua/symmath/tests/unit/unit.lua:252: in function [C]: in function 'xpcall' /home/chris/Projects/lua/symmath/tests/unit/unit.lua:251: in function 'exec' limit.lua:249: in function 'cb' [string "/home/chris/Projects/lua/ext/timer.lua"]:101: in function 'timer' limit.lua:6: in main chunk [C]: at 0x56d3ddd1a390 |
time: 4.552000ms stack: size: 7
|
|
| ||
|
TODO this requires representing x ln x as (ln x) / (1/x) before applying L'Hospital | ||
simplifyAssertEq(lim(x * log(x), x, 0, '+'), 0) |
${{\underset{ x\rightarrow{ 0{}^+}}{\lim}}{{\left({{{x}} {{\log\left( x\right)}}}\right)}}} = {0}$
GOOD |
time: 1.781000ms stack: size: 7
|
|
| ||
|
mortgage repayment formula -- works | ||
simplifyAssertEq(lim( (a * x * (1 + x)^n) / ((1 + x)^n - 1), x, 0 ), a / n) |
${{\underset{ x\rightarrow 0}{\lim}}{{\frac{{{a}} {{x}} {{{\left({{1} + {x}}\right)}^{n}}}}{{{\left({{1} + {x}}\right)}^{n}}{-{1}}}}}} = {{\frac{1}{n}} {a}}$
GOOD |
time: 44.266000ms stack: size: 14
|
|
| ||
|
the infamous tanh(x) ... works? hmm ... this is infamous for taking an infinite number of L'Hospital applications. Why is it working? | ||
print( ((e^x + e^-x) / (e^x - e^-x)):lim(x, inf):prune() ) | $1$ GOOD |
time: 22.694000ms stack: size: 27
|