2 A collection of tests to stress $limit and friends
8 Tests to check how limit deals with weird combinations of
9 infinitesimals and infinities. See bug 2563
18 /* Tests from Bug 1036900 */
19 /* These bugs were fixed in limit.lisp rev 1.7, 2004/10/04 */
22 limit(7^(n^2)/8^n,n,inf);
24 limit((10^n+9^n+8^n)^(1/n),n,inf);
26 limit(4^n/2^(2*n),n,inf);
29 /* Test from Bug 1052308 */
30 /* Fixed in limit.lisp rev 1.11 */
33 limit(erf(nn*zz), nn, inf);
35 limit(tanh(nn*zz), nn, inf);
40 /* Bug 1281737, fixed in limit.lisp rev 1.15 */
41 limit(atan(x)/(1/exp(1)-exp(-(1+x)^2)),x,inf,plus);
45 limit(atan2(y,x),y,minf);
49 limit(abs(sqrt(1-1/x)-1),x,0);
53 limit(x*atan(x)/(x+1),x,inf);
55 limit(x*atan(x)-log(x),x,inf);
63 limit(sin(x)/x,x,0,plus);
65 limit(sin(x)/x,x,0,minus);
70 /* #2504 wrong answer for simple limit, limit(sin(x)+1/x, x, inf)=0 */
71 limit(1/x + sin(x), x, inf);
79 limit(t^2*exp(-4*t/3-8*exp(-t)),t,inf);
83 * From bug 535363, but this isn't really fixed. The fix for 1469411
84 * broke this test, so we're adding it to make sure we don't break it.
88 limit(exp(-1/x)/x^4,x,0,'plus);
92 limit(x*(atan(x)-%pi/2),x,inf);
95 limit((atan(x)-(%pi/2))/(sin(10/x)),x,inf);
98 /* [ 1498047 ] limit(a/n,n,inf); */
103 * [ 1646761 ] limit atanh @ -1 / 1 all wrong...
105 /* Limit at 1 is (complex) infinity). But one-sided limit can be inf (real infinity). */
108 limit(atanh(x),x,1,'minus);
110 limit(atanh(x),x,-1);
112 limit(atanh(x),x,-1,'plus);
115 /* There shouldn't be an error message printed out here. Need to look at output to see. */
116 limit(2*atanh(x),x,1);
118 limit(2*atanh(x),x,1,'minus);
121 limit(atanh(a-1)-log(a)/2,a,0,'plus),logarc:true;
124 /* [ 1606731 ] limit of algebraic when algebraic : true */
125 limit(x*(sqrt(1+x^2)-x),x,inf), algebraic : true, gcd : subres;
128 /* [ 1097982 ] limit(x/(x^(log(x)))); returns wrong answer */
129 limit(x/(x^log(x)), x, inf);
132 /* [ 1039965 ] limit(4^n/2^(2*n),n,inf) is wrong */
133 limit(4^n/2^(2*n),n,inf);
136 /* [ 1731127 ] limit((1 + 1/x)*(sqrt(x + 1) + 1), x, inf) => 0 (not inf) */
137 limit((1 + 1/x)*(sqrt(x + 1) + 1), x, inf);
140 /* [ 1593083 ] tlimit(t^2*exp(-4*t/3-8*exp(-t)),t,inf) gives error */
141 tlimit(t^2*exp(-4*t/3-8*exp(-t)),t,inf);
144 /* [ 1786774 ] tlimit((5^x + 3^x)^(1/x), x, inf) => Error */
145 tlimit((5^x + 3^x)^(1/x), x, inf);
148 /* [ 1603900 ] taylor/tlimit (4^n+1)/2^(2*n) internal error */
149 tlimit((4^n+1)/2^(2*n),n,inf);
152 /* [ 1281736 ] limit((x/log(x))*(x^(1/x)-1),x,inf) - wrong result */
153 limit((x/log(x))*(x^(1/x)-1),x,inf);
156 /* [ 1036901 ] tlimit(7^(n^2)/8^n,n,inf); wrong result */
157 tlimit(7^(n^2)/8^n, n, inf);
160 /* [ 1665657 ] limit fails to find easy limit */
161 limit(x/(x-1)-1/log(x),x,1,plus);
164 /* [ 611411 ] limit asks sign of IND */
165 limit(abs(sin(x)),x,inf);
168 /* [ 1629723 ] bug in limit, asks sign of IND, encountered in integrator */
169 limit(abs(sin(x))/x, x, inf);
172 /* [ 782099 ] limit returns expression in IND */
173 limit(sinh(exp(%i*x)),x,inf);
176 /* [ 1528607 ] limit(a^x,x,inf) can't solve for a : abs(a) < 1 */
177 limit((-2/3)^x,x,inf);
180 limit(signum(x), x, 0, plus);
183 limit(signum(x), x, 0, minus);
186 limit((-1/%pi)^x,x,inf);
189 tlimit(exp(%i*t), t, inf);
192 tlimit(exp(-t+%i*t),t,inf);
195 /* [ 1811503 ] computing a wrong result */
196 limit((((1+1/x)^(x^2))+1)^(1/x),x,inf);
199 /* [ 1760232 ] limit(1/n * n!^(1/n), n, inf); */
200 limit(1/n * n!^(1/n), n, inf);
203 /* Apparently wrong limit with factorial - ID: 3198530 */
204 limit(1/(2+1/factorial(n)),n,inf);
207 limit(t*(erf((t))-1),t,inf);
210 /* #3153 Limits of erfc */
211 limit(erfc(x*(1 + %i)), x, inf);
214 limit(erfc(x*(1 + %i)), x, minf);
217 limit(exp(x)*(sin(1/x+exp(-x))-sin(1/x+exp(-x^2))), x, inf);
220 /* it would be nice to handle this someday
221 limit(n - exp(psi[0](n)), n, inf);
225 limit(x*gamma(x), x, 0);
228 /* [ 744679 ] limit overflows memory? */
229 (assume(a>1), limit((a^(1/n)+1)^n/2^n, n, inf));
232 /* [ 702512 ] limit(1/(1/a*2^(%i*a)+1),a,inf) => UND */
233 limit(1/(1/a*2^(%i*a)+1),a,inf);
236 /* [ 923407 ] limit(atan(sqrt(x))/sqrt(x),x,0) wrong */
237 limit(atan(sqrt(x))/sqrt(x),x,0);
240 /* [ 1102908 ] limit/atan/exp returns complex expr with wrong principal val */
241 limit(atan(x)/(1/exp(1)-exp(-(1+x)^2)),x,inf,plus);
244 limit( (3^(1/x) + 5^(1/x))^x, x, 0, minus);
247 limit( (3^(1/x) + 5^(1/x))^x, x, 0, plus);
250 limit( (3^(1/x) + 5^(1/x))^x, x, 0);
253 /* [ 1852415 ] limit(sqrt(1-%e^(-x^2)), x, inf) = 0 */
254 limit(sqrt(1-%e^(-x^2)), x, inf);
257 /* [ 1515712 ] tlimit (x*atan(x)/(x+1),x,inf) => 3 %pi/2, etc */
258 tlimit(x*atan(x)/(x+1),x,inf);
261 tlimit(x*(atan(x)-%pi/2),x,inf);
264 tlimit(atan(x^-1), x, 0, minus);
267 /* [ 1973399 ] F(x) := 1/%pi*(atan(x) + %pi/2) */
268 (assume(c>0), limit(((1/%pi)*(atan(n/%pi) + %pi/2))^n, n, inf));
271 /* [ 1103515 ] limit(atan2(x,-1),x,0) wrong */
272 limit(atan2(x,-1), x, 0, minus);
275 limit(atan2(x,-1), x, 0, plus);
278 limit(atan2(x,-1), x, 0);
280 /* ideally should be ind */
282 /* limit of atan2 - ID: 3539699 */
283 limit(atan2(x^2-2,x^3-3*x), x, sqrt(2), minus);
286 limit(atan2(x^2-2,x^3-3*x), x, sqrt(2), plus);
289 limit(atan2((x^2-2), x^3-2*x), x, sqrt(2), minus);
292 limit(atan2((x^2-2), x^3-2*x), x, sqrt(2), plus);
295 limit(atan2(-(x^2-2), x^3-2*x), x, sqrt(2), minus);
298 limit(atan2(-(x^2-2), x^3-2*x), x, sqrt(2), plus);
301 limit(floor(x), x, 5, minus);
304 limit(floor(x), x, 5, plus);
307 limit(ceiling(x), x, 5, minus);
310 limit(ceiling(x), x, 5, plus);
313 limit(round(x), x, 5/2, minus);
316 limit(round(x), x, 5/2, plus);
319 limit(floor(sin(x)), x, 0, minus);
322 /* #3616 limit with floor problems */
323 limit(floor(atan(x)),x,1);
326 limit(ceiling(cos(x)),x,0);
329 limit(floor(cos(x)),x,0);
332 limit(ceiling(cos(x)^2),x,0);
335 /* [ 2914296 ] Limit gets Maxima stuck */
336 /* caused blow-up in behavior-by-diff with loop up to 5th derivative */
337 limit( (log(1+x^2)-2+2*cos(x))/((sin(x))^2+2*sqrt(1-x^2)-2),x,0);
340 /* [ 1587235 ] limit(floor(x),x,1) wrong */
344 /* [ 1885377 ] wrong limit evaluation in 5.14.0 */
345 limit((3/4)^(5*n+1), n, inf);
348 limit(-%e^x/x, x, inf);
351 /* [ 2083561 ] Limit of the Wallis product */
352 limit((%pi*4^N*N!^2)/(2*2^(2*N)*gamma(N+1/2)*gamma(N+3/2)), N, inf);
355 /* wrong limit(log(gamma(x+1))/x,x,0) - ID: 2727078 */
356 limit(log(gamma(x+1))/x, x, 0);
359 /* log has a branch cut on negative real axis */
360 limit(log(-1+x*%i), x, 0, plus);
363 limit(log(-1+x*%i), x, 0, minus);
366 limit((log(y+h)-log(y))/h,h,0,plus);
370 limit(log(3-sqrt(x)),x,9,minus);
374 limit((sqrt(x)-2)*log(1-sqrt(x)/2),x,4,minus);
378 /* limit of incomplete gamma */
379 /* function simplim%gamma_incomplete in gamma.lisp */
381 /* sin(x^2)/(x^2) improper integral incorrect? - ID: 3397562 */
382 limit( gamma_incomplete(-1/2, -%i*x^2), x, inf);
385 /* should be complex infinity */
386 limit( gamma_incomplete(2, -%i*x), x, inf);
387 'limit(gamma_incomplete(2,-%i*x),x,inf);
389 /* Error integrating exp(-x)*sinh(sqrt(x)) with domain: complex - ID: 3529144 */
390 /* need taylor expansion of gamma_incomplete(1/2, x) at x=0 */
391 limit(gamma_incomplete(1/2,(1-2*sqrt(x))^2/4)*(1-2*sqrt(x))
392 /(sqrt((1-2*sqrt(x))^2)), x, 1/4, minus),domain:complex;
395 limit(gamma_incomplete(1/2,(1-2*sqrt(x))^2/4)*(1-2*sqrt(x))
396 /(sqrt((1-2*sqrt(x))^2)), x, 1/4, plus),domain:complex;
399 /* [ 635606 ] limit(abs(log(x))) internal error, UND */
400 limit(abs(log(x)), x, 0);
403 limit(exp(-x)*(x*sin(x)+cos(x)), x, inf);
406 /* tex(t[1]) shouldn't change t to true */
409 "; /* tex output contains embedded newline */
411 /* tex(x[1]^2) shouldn't get confused by debug info in expression CAR */
412 (foo : x[1]^2, tex (foo, false));
414 "; /* tex output contains embedded newline */
416 /* [ 2084910 ] limit bugs */
417 limit((%pi*N^(2*N+1)*2^(2*N))/((2*N-1)^(2*N)*(2*%e*N+%e)), N, inf);
420 /* [ 1977992 ] no limit calculation */
421 limit(abs(sin(x))/sqrt(1-cos(x)), x, 0);
424 /* [ 1973399 ] F(x) := 1/%pi*(atan(x) + %pi/2) */
425 /* only works with taylor_logexpand:true */
426 limit( ((1/%pi)*(atan(n/%pi) + %pi/2))^n, n, inf);
429 /* limit(x*expintegral_ei(x),x,0) --> Error - ID: 2801821 */
430 limit(x*expintegral_ei(x), x, 0);
433 /* Limit of the factorial function - 4 problems - ID: 2841504 */
434 limit(factorial(x),x,-2,plus);
437 /* Calculus mistake: wrong answer: limit - ID: 3534858 */
438 limit((sin(x)-tan(x))/(x*(cos(x)-1)),x,0);
441 /* #2639 limit asks about internal variable */
442 limit(tan(x)/sqrt(tan(x)^2+1),x,%pi/2,plus);
445 limit(1/psi[1](x), x, inf);
448 /* limit of psi[i] - ID: 2843705 */
449 limit(psi[i](x),x,inf);
450 'limit(psi[i](x),x,inf);
452 /* tests for gruntz limit algorithm */
453 gruntz(exp(x), x, inf);
456 gruntz(exp(-x), x, inf);
459 gruntz( (x + 2^x) / 3^x, x, inf);
462 gruntz( x^2/(x + 2*x^2), x, inf);
465 gruntz( x/x^log(x), x, inf);
468 gruntz( (2^x)/(x + exp(x)) , x, 0, plus);
471 gruntz( (erf(x))/sqrt(1-cos(x)) , x, 0, minus);
472 -2*sqrt(2)/sqrt(%pi);
474 gruntz( (erf(x))/sqrt(1-cos(x)) , x, 0, plus);
477 gruntz( x*(x^(1/x)-1)/log(x), x, inf);
480 gruntz( (x*x^(1/x)-x)/log(x), x, inf);
483 gruntz(exp(-1/x)/x^6,x,0,plus);
486 /* limit gives the wrong answer - ID: 3410704 */
487 limit(sqrt(t^2+4)*(((t+2/t^2)^2+4)^(3/2)-(t+2/t^2)^3-4*(t+2/t^2))
488 /(sqrt((t+2/t^2)^2+4)*((t^2+4)^(3/2)-t^3-4*t)), t, inf);
491 /* Inaccurate Limit Evaluation - ID: 3276461 */
492 radcan(limit((-4*x^2-10*x+24)/((4*x+8)^(1/3)+2), x, -4));
495 limit(-(3*n^2 + 1)*(-1)^n/sqrt(n^5 + 8*n^3 + 8),n,inf);
499 * Bug ID: 1315837 limit(?foo)
500 * Bug ID: 1119228 limit(1/zeraoa)
515 * Bug ID: 1797296 - Crazy results when doing limit of 'diff
517 limit('diff(x+1,x),x,2);
518 'limit('diff(x+1,x),x,2);
520 limit('integrate(x+1,x),x,2);
521 'limit('integrate(x+1,x),x,2);
523 limit(integrate(f(t),t,0,x),x,0,plus);
524 'limit(integrate(f(t),t,0,x),x,0,plus);
526 limit(integrate(t,t,0,x)/x,x,inf);
529 (assume(a>2), limit(integrate(t/log(t),t,2,a)/a,a,inf));
532 /* limit(1/inf-1/minf) => 0+0 - ID: 903074 */
537 1-arg limit: limit(a*inf-inf) => minf - ID: 1385306
539 The original fix for this bug sent it to inf, assuming that the two
540 different "inf" occurrences were the same. I disagree: inf - inf
541 probably shouldn't ever be simplified to zero, but we can avoid it
547 /* limit(1 - (-1/2)^inf) --> inf - ID: 2853506 */
548 limit(1 - (-1/2)^inf);
550 /* ideally should be 1 */
552 /* definition of derivative in terms of limit */
553 limit((sin(3*(x+h)) - sin(3*(x)))/h, h, 0, plus);
556 /* limit incorrect for -x/sqrt(1-x^2) - ID: 2869955 */
557 limit(-x/sqrt(1-x^2), x, 1, minus);
560 /* limit(%i*log(a),a,0) nounform (%i*und problem) - ID: 816797 */
561 limit(%i*log(x),x,0);
564 /* limit(sqrt(x),x,minf) not fully evaluated - ID: 2901855 */
565 limit(sqrt(x), x, minf);
568 /* #2847 limits of powers of constants */
569 limit((5+%i)^n,n,inf);
572 /* limit bug - ID: 3101075 */
573 limit((2+cos(x))/(x^3*sin(x))-3/x^4,x,0,plus);
576 /* #2527 exponent too big in limit */
577 limit ((cosh(sqrt(x+1))-cosh(sqrt(x)))^(1/sqrt(x)),x,inf );
580 /* #2561 limit(log(x^2),x,-20) gives 2*log(-20) */
581 limit(log(x^2),x,-20),logexpand:false;
584 /* #2412 Problems with integral (x/(exp(x)+1),x,0,inf) */
585 limit(-x*log(%e^x+1)-li[2](-%e^x)+x^2/2, x, inf);
588 /* The initial problem which triggers this bug */
591 limit ((sin(n*x) - n*x*cos(n*x))/n^2, x, %pi);
594 /* #2503 Declaring x as an integer changes result of limit from 3 to inf */
595 limit((2^n+3^n)^(1/n), n,inf);
598 /* #2624 Erroneous limit result */
599 (assume(n>2), limit(x-x*(1-1/x)^n, x, inf));
605 /* Bug ID: 593351 - limit/sin(inf)etc. should give 0, not IND
607 limit(cos(1/x)*sin(x)-sin(x),x,inf);
609 limit(cos(1/x)*sin(x)-sin(x)+a,x,inf);
612 /* Bug ID: 1376392 - limit(x/(2+sin(1/x)), x, 0); wrong result
614 limit(x/(2+sin(1/x)),x,0);
617 /* Bug ID: 1106912 - limit(x/sin(x)^2,x,inf)
618 I think the limit is not defined because the func is not defined
619 for all x > any constant.
621 limit(x/sin(x)^2,x,inf);
624 /* Bug ID: #3459 Wrong limit calculation */
625 limit(x / (x+2^x+cos(x)),x,-inf);
628 /* Bug ID: 811522 - redundant question in limit
629 * b is assumed to be zero. Maxima now can deduce from the database
630 * that b-2 is an even number.
634 limit(r^(b-2)*(x-r)^2,r,0);
635 'limit(r^(b-2)*(x-r)^2,r,0);
639 /* Bug ID: 221642 limit needs %piargs to be true
640 * The implementation of simp-%atan and simpatan2 has been revised.
641 * We get more limits independent of the value of %piargs.
645 limit(atan2(0,y),y,0,plus);
647 limit(atan2(0,y),y,0,minus);
649 limit(atan2(x,0),x,0,plus);
651 limit(atan2(x,0),x,0,minus);
656 /* Bug ID: 3002971 - limit fails where rat+subst works
658 limit(min(x,x+2,sin(x)/x),x,0);
660 limit(max(x,x+2,sin(x)/x),x,0);
663 /* Bug ID: 1969790 - limits and subscripts
665 limit(mu[inf],x,inf);
669 * Bug 3509430: limit of tanh(x) at 0 makes no sense
671 limit(tanh(x), x, 0);
674 /* bug 2535: stack exhausted when computing limit(log(..)) */
676 limit(log(-1/3125*((-1/2*sqrt(5) + 1/2)^n - (1/2*sqrt(5) +
677 1/2)^n)^9*sqrt(5))/log(-1/5*((-1/2*sqrt(5) + 1/2)^(8*n) - (1/2*sqrt(5) +
678 1/2)^(8*n))*((-1/2*sqrt(5) + 1/2)^n - (1/2*sqrt(5) + 1/2)^n) -
679 1/5*((-1/2*sqrt(5) + 1/2)^(9*n) - (1/2*sqrt(5) +
680 1/2)^(9*n))*sqrt(5)),n,inf);
683 /* #2675 maxima will not do the simplest of definite integrals
684 and will not factor otherwise */
685 limit(x^2*exp(-%i*x - x), x, inf);
688 /* bug #2621 gamma limit error */
690 limit(gamma(x+1/2)/(sqrt(x)*gamma(x)), x, inf);
693 /* Triggered by #2849. This result isn't great, but it's better than
694 an error. A more useful result would be und. */
698 limit((a*exp(a*x)*sin(b*x))/(b^2+a^2)-(b*exp(a*x)*cos(b*x))/(b^2+a^2), x, 0, plus);
701 /* Bug #2898: limit of continuous --> und */
703 limit(log(x)^2+2*log(x)+q/2+1,x,1);
706 limit(log(x)^2+2*%gamma*log(x)-%pi^2/6+%gamma^2,x,1);
707 -((%pi^2-6*%gamma^2)/6)$
709 /* #2972 Wrong limits involving logs */
710 limit( 27^(log(n)/log(3))/n^3, n, inf);
713 limit( 27^(log(n)/log(3)+1)/n^3, n, inf);
716 limit( ((27^(log(n)/log(3)+1)-1)/26+n-log(n)/log(3)-1)/n^3,n,inf);
719 /* examples from mailing list 2014-10-10: "Re: bug in limit code" */
722 kill (beta, hbar, omega, delta, n),
723 assume (beta > 0, hbar > 0, omega > 0, delta > 0, 2*n - 1 > 0),
727 limit (%e^(beta*hbar*omega-beta*(hbar*(2*n+1)*omega+delta))
728 /(1/(1-%e^-(beta*hbar*omega))^2
729 +(%e^-(beta*delta)-1)/(1-%e^-(2*beta*hbar*omega))), beta, inf);
733 assume (h > 0, d > 0, z > 0, 2*h*z > d),
737 limit ((%e^-(b*d)-1)/(1-%e^-(2*b*h*z)), b, inf);
740 (kill (a), assume (a < 0), 0);
743 limit (exp (b*a), b, inf);
746 limit((exp(a*x)-1)/(exp(a*x)+1),x,inf) ;
749 (forget (a < 0), assume (a > 0), 0);
752 limit((exp(a*x)-1)/(exp(a*x)+1),x,inf) ;
755 (forget (a > 0), assume (equal (a, 0)), 0);
758 limit((exp(a*x)-1)/(exp(a*x)+1),x,inf) ;
761 (forget (equal (a, 0)), assume (a > 0), 0);
764 integrate(%e^(-a*r)*sin(k*r),r,0,inf);
770 (forget (a > 0), assume (a < 0), limit (a*x, x, inf));
773 (forget (a < 0), assume (equal (a, 0)), limit (a*x, x, inf));
776 killcontext (context);
779 /* SF bug #3104: "limit(log(1 - exp(x)), x, 0, plus), numer => stack overflow" */
781 limit(log(1 - exp(x)), x, 0, plus);
784 limit(log(1 - exp(x)), x, 0, plus), numer;
787 limit(log(1 + exp(x)), x, 0, plus);
790 limit(log(1 + exp(x)), x, 0, plus), numer;
793 /* inspired by this example from #3103; for the present purpose,
794 * it's not too important to get these specific results,
795 * only that numer doesn't cause an error here.
798 integrate(x^3/(exp(x)-1),x,0,inf);
799 'limit(6*li[4](%e^x)-6*x*li[3](%e^x)+3*x^2*li[2](%e^x)+x^3*log(1-%e^x)-x^4/4,
800 x,inf,minus) -%pi^4/15$
802 integrate(x^3/(exp(x)-1),x,0,inf), numer;
803 'limit(6.0*li[4](%e^x)-6.0*x*li[3](%e^x)+3.0*x^2*li[2](%e^x)
804 +1.0*x^3*log(1-%e^x)-0.25*x^4,x,inf,minus)
807 /* #3142 limit((x^(1/x) - 1)*sqrt(x), x, inf) => inf */
808 limit((x^(1/x) - 1)*sqrt(x), x, inf);
811 /* #3143 limit((x^(1/x) - 1)*sqrt(x), x, 0, minus) => inf */
812 /* should really be '$infinity */
813 limit((x^(1/x) - 1)*sqrt(x), x, 0, minus);
814 'limit((x^(1/x) - 1)*sqrt(x), x, 0, minus);
816 /* SF bug #3185: "Error in sum with non-false modulus" */
818 block([modulus:7], sum(i^-2,i,1,inf));
821 block([modulus:7], limit(inf));
824 /* SF bug #3235: "ECL lisp arithmetic error in definite integration with large limits"
825 * the bug is actually in ECL (https://gitlab.com/embeddable-common-lisp/ecl/issues/299);
826 * here we'll test a work around.
829 block ([actual, expected],
830 actual : limit(x*exp(x)*log(exp(x)+1),x,-1000,plus),
831 expected : -1000*%e^-1000*log(%e^-1000*(%e^1000+1)),
832 if ev (equal (actual, expected), logexpand='super) then true else [actual, expected]);
835 /* accommodate different equivalent forms via 'equal' */
836 block ([actual, expected],
837 actual : integrate((x^2)*exp(x) / (1 + exp(x))^2,x,-1000,1000),
838 expected : (-(2000*%e^1000*log(%e^-1000*(%e^1000+1)))/(%e^1000+1))
839 -(2000*log(%e^-1000*(%e^1000+1)))/(%e^1000+1)
840 -((2000*%e^1000+2000)*log(%e^1000+1)
841 +(2*%e^1000+2)*li[2](-%e^1000)-1000000*%e^1000)
842 /(%e^1000+1)+(2*%e^1000*li[2](-%e^-1000))/(%e^1000+1)
843 +(2*li[2](-%e^-1000))/(%e^1000+1)-1000000/(%e^1000+1),
844 if ev (equal (actual, expected), logexpand='super) then true else [actual, expected]);
847 /* SF bug #3244: "error trying to promote float infinity to bigfloat in sign comparison"
848 * same as test under #3235 but ensure that bigfloat assume is present to trigger bug
851 block ([actual, expected, ctxt:newcontext()],
852 assume (xfoo > 200b0),
853 actual : limit(xfoo*exp(xfoo)*log(exp(xfoo)+1),xfoo,-1000,plus),
854 expected : -1000*%e^-1000*log(%e^-1000*(%e^1000+1)),
856 if ev (equal (actual, expected), logexpand='super) then true else [actual, expected]);