File: rtest16.mac

package info (click to toggle)
maxima 5.21.1-2squeeze
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 94,928 kB
  • ctags: 43,849
  • sloc: lisp: 298,974; fortran: 14,666; perl: 14,325; tcl: 10,494; sh: 4,052; makefile: 2,975; ansic: 471; awk: 24; sed: 7
file content (1450 lines) | stat: -rw-r--r-- 29,489 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
kill (all);
done;

/* make sure things work after a reset().  ID: 1986726 and ID: 2787047 */
(reset(),0);
0;

/* Tests from Bug 1036900 */
/* These bugs were fixed in limit.lisp rev 1.7, 2004/10/04 */
limit(7^n/8^n,n,inf);
0$
limit(7^(n^2)/8^n,n,inf);
inf$
limit((10^n+9^n+8^n)^(1/n),n,inf);
10$

limit(4^n/2^(2*n),n,inf);
1$
/* Test from Bug 1052308 */
/* Fixed in limit.lisp rev 1.11 */
assume(equal(zz,0));
[equal(zz,0)]$
limit(erf(nn*zz), nn, inf);
0$
limit(tanh(nn*zz), nn, inf);
0$
limit(nn^zz, nn, 0);
1$

/* From A. Reiner.  Fixed in buildq.lisp rev. 1.4.
   Exposed a bug caused by the dynamical scope of VARLIST. */
buildq([foo:sin(baz+bar)],1);
1$

buildq([foo:[sin(baz+bar),sin(baz-bar)]],+splice(foo));
sin(baz+bar)+sin(baz-bar)$

/* Fixed in series.lisp rev 1.5, 04 Feb 2004.  
   First case returned second result */
powerseries(1/sqrt(1+x),x,0);
2*'sum(x^i1/beta(1/2-i1,i1+1),i1,0,inf);
powerseries(sqrt(1+x),x,0);
2*('sum(x^i2/beta(3/2-i2,i2+1),i2,0,inf))/3;

/* sf bug 1730044 - powerseries(1+x^n,x,0) wrong */
powerseries(1+x^n, x, 0);
('sum(x^(i3*n)/beta(2-i3,i3+1),i3,0,inf))/2;

(declare(n, integer), powerseries(1/(1+x^n), x, 0));
'sum((-1)^i4*x^(i4*n),i4,0,inf);


/* Examples from SF bug report [ 1722156 ] powerseries((x+1)/(1-2*x^2), x, 0);
 * tnx Dan Gildea
 */

gensumnum : 0;
0;

/* two simple roots */
powerseries((1)/((1-2*x)*(1-3*x)), x, 0);
'sum((3^(i1+1)+(-2*2^i1))*x^i1,i1,0,inf);

/* fibonacci */
powerseries((1)/(1-x-x^2), x, 0);
-'sum((-2*(sqrt(5)-1)^(-i2-1)*2^i2/sqrt(5)
 -2*(sqrt(5)+1)^(-i2-1)*(-2)^i2/sqrt(5))
 *x^i2,i2,0,inf);

/* 1 1 2 2 4 4 8 8 */
factor(powerseries((1+x)/(1-2*x^2), x, 0));
/*
'sum( (-1*(1/-(1/sqrt(2)))*(1/sqrt(2)-1)*(1/-(4/sqrt(2)))*(1/-(1/sqrt(2)))^i3 + 
      -1*(1/(1/sqrt(2)))*(-1/sqrt(2)-1)*(1/(4/sqrt(2)))*(1/(1/sqrt(2)))^i3 ) * x^i3,i3,0,inf);
*/

'sum(2^(i3/2-3/2)*((sqrt(2)-1)*(-1)^i3+sqrt(2)+1)*x^i3,i3,0,inf);

/* multiple root */
powerseries((1+x)/(1-x)^2, x, 0);
'sum(2*(i4+1)*x^i4-x^i4,i4,0,inf);

/* numerator higher order poly than denom */
powerseries((1+x^3)/(1-x-x^2), x, 0);
-2*x
 *'sum((-2*(sqrt(5)-1)^(-i5-1)*2^i5/sqrt(5)
   -2*(sqrt(5)+1)^(-i5-1)*(-2)^i5/sqrt(5))
   *x^i5,i5,0,inf)
  -x+1;

/* zero root in denom */
powerseries((1)/((1-2*x)*(x)), x, 0);
('sum(2^i6*x^i6,i6,0,inf))/x;

/* one simple and one repeated root in denom */
powerseries((1+x+x^2)/((1-2*x)*(1+x)^2), x, 0);
'sum(7*2^i7*x^i7/9+(i7+1)*(-1)^i7*x^i7/3-(-1)^i7*x^i7/9,i7,0,inf);

/* gcd of exps is two */
powerseries((1-x^2)/(1-4*x^2+x^4), x, 0);
'sum((-1*(1/(2-sqrt(3)))*(sqrt(3)-1)*(1/(2*(2-sqrt(3))-4))*(1/(2-sqrt(3)))^i8 +
      -1*(1/(sqrt(3)+2))*(-sqrt(3)-1)*(1/(2*(sqrt(3)+2)-4))*(1/(sqrt(3)+2))^i8 )*x^(2*i8), 
      i8, 0, inf);

/* Bug 1281737, fixed in limit.lisp rev 1.15 */
limit(atan(x)/(1/exp(1)-exp(-(1+x)^2)),x,inf,plus);
%e*%pi/2;

/* Verify that extended functionality of rhs/lhs works as advertised */

(kill (x, y, aa, bb, cc), infix("@@"), 0);
0;

map (lhs, [aa < bb, aa <= bb, aa = bb, aa # bb, equal (aa, bb), notequal (aa, bb), aa >= bb, aa > bb]);
[aa, aa, aa, aa, aa, aa, aa, aa];

map (rhs, [aa < bb, aa <= bb, aa = bb, aa # bb, equal (aa, bb), notequal (aa, bb), aa >= bb, aa > bb]);
[bb, bb, bb, bb, bb, bb, bb, bb];

map (lhs, [foo(x) := 2*x, bar(y) ::= 3*y, '(aa : bb), '(aa :: bb), ?marrow(aa, bb)]);
['(foo(x)), '(bar(y)), aa, aa, aa];

map (rhs, [foo(x) := 2*x, bar(y) ::= 3*y, '(aa : bb), '(aa :: bb), ?marrow(aa, bb)]);
[2*x, 3*y, bb, bb, bb];

[lhs (aa @@ bb), lhs (aa @@ bb @@ cc), rhs (aa @@ bb), rhs (aa @@ bb @@ cc)];
[aa, aa @@ bb, bb, cc];

map (lhs, [aa + bb, aa - bb, aa * bb, aa / bb, sin(aa), log(aa)]);
[aa + bb, aa - bb, aa * bb, aa / bb, sin(aa), log(aa)];

map (rhs, [aa + bb, aa - bb, aa * bb, aa / bb, sin(aa), log(aa)]);
[0, 0, 0, 0, 0, 0];

kill ("@@");
done;

/* Verify that grind treats nouns correctly. string calls MSIZE in src/grind.lisp.
 */

kill (all);
done;

string ('(integrate(f(x), x) + integrate(g(x), x, minf, inf) + diff(u, x) + sum(h(x), x, 1, n)));
"sum(h(x),x,1,n)+integrate(g(x),x,minf,inf)+integrate(f(x),x)+diff(u,x)";

string ('integrate(f(x), x) + 'integrate(g(x), x, minf, inf) + 'diff(u, x) + 'sum(h(x), x, 1, n));
"'sum(h(x),x,1,n)+'integrate(g(x),x,minf,inf)+'integrate(f(x),x)+'diff(u,x,1)";

/* GREAT puts nounified atoms before others, it appears ... */
string (%a%a + %b%b + nounify(%c%c) + nounify(%d%d) + %e%e + %f%f);
"%d%d+%c%c+%f%f+%e%e+%b%b+%a%a";

string (sin(x) * cos(x) + tan(x));
"tan(x)+cos(x)*sin(x)";

string ('foo(x, y, z) / bar(a, b, c) + 'baz(%pi - 'quux(%e ^ mumble(%i))));
"'foo(x,y,z)/bar(a,b,c)+'baz(%pi-'quux(%e^mumble(%i)))";

/* It's conceivable that someday nounified arithmetic operators would be treated differently by grind.
 * If/when that happens, revise this example accordingly.
 */
string ('"+"(a, b, '"."(c, d), '"^"(e, f)));
"'?mplus(a,b,'?mnctimes(c,d),'?mexpt(e,f))";

/* Bug 626697 */
limit(atan2(y,x),y,minf);
-'limit(atan2(y,x),y,inf);

/* Bug 1548643 */
limit(abs(sqrt(1-1/x)-1),x,0);
inf;

/* Bug 671574 */
limit(x*atan(x)/(x+1),x,inf);
%pi/2;
limit(x*atan(x)-log(x),x,inf);
inf;

/* Bug 1152668 */
numer:true;
true;
limit(sin(x)/x,x,0);
1;
limit(sin(x)/x,x,0,plus);
1;
limit(sin(x)/x,x,0,minus);
1;
numer:false;
false;

/* Bug 593344 */
limit(abs(infinity));
inf;

/* Bug 626721 */
logarc(atan2(y,x));
-%i*log((%i*y+x)/sqrt(x^2+y^2));
rectform(ev(%,x=-1,y=1));
3*%pi/4; 

/* Bug 1469411 */
limit(t^2*exp(-4*t/3-8*exp(-t)),t,inf);
0;

/*
 * From bug 535363, but this isn't really fixed.  The fix for 1469411
 * broke this test, so we're adding it to make sure we don't break it.
 * 
*/

limit(exp(-1/x)/x^4,x,0,'plus);
0;

/* Bug 1594330 */
limit(x*(atan(x)-%pi/2),x,inf);
-1;

/* [ 1498047 ] limit(a/n,n,inf); */
limit(a/n, n, inf);
0;

/*
 * Bug [ 1661490 ] An integral gives a wrong result.
 */
(assume(a>0, b>0, sqrt(sqrt(b^2+a^2)-a)*(sqrt(b^2+a^2)+a)^(3/2)-b^2>0),0);
0;
radcan(integrate(exp(-(a+%i*b)*x^2),x,minf,inf)/rectform(sqrt(%pi)/sqrt(a+%i*b)));
1;

/*
 * [ 1663704 ] integrate(sin(r*x)^7/x^4,x,0,inf) -> r^3*false
 *
 * Should return the integral instead of producing false.
 */
integrate(sin(a*x)^7/x^4,x,0,inf);
'integrate(sin(a*x)^7/x^4,x,0,inf);

/* we have assumed a>0 */
integrate(%e^(-a*r)*sin(k*r),r,0,inf);
k/(k^2+a^2);

/*
 * [ 1646761 ] limit atanh @ -1 / 1 all wrong...
 */
/* Limit at 1 is (complex) infinity).  But one-sided limit can be inf (real infinity). */
limit(atanh(x),x,1);
infinity;
limit(atanh(x),x,1,'minus);
inf;
limit(atanh(x),x,-1);
infinity;
limit(atanh(x),x,-1,'plus);
minf;

/* There shouldn't be an error message printed out here.  Need to look at output to see. */
limit(2*atanh(x),x,1);
infinity;
limit(2*atanh(x),x,1,'minus);
inf;

limit(atanh(a-1)-log(a)/2,a,0,'plus),logarc:true;
-log(2)/2;

/* [ 1606731 ] limit of algebraic when algebraic : true */
limit(x*(sqrt(1+x^2)-x),x,inf), algebraic : true, gcd : subres;
1/2;

/* [ 1097982 ] limit(x/(x^(log(x)))); returns wrong answer */
limit(x/(x^log(x)), x, inf);
0;

/* [ 1039965 ] limit(4^n/2^(2*n),n,inf) is wrong */
limit(4^n/2^(2*n),n,inf);
1;

/* [ 1731127 ] limit((1 + 1/x)*(sqrt(x + 1) + 1), x, inf) => 0 (not inf) */
limit((1 + 1/x)*(sqrt(x + 1) + 1), x, inf);
inf;

/* [ 1593083 ] tlimit(t^2*exp(-4*t/3-8*exp(-t)),t,inf) gives error */
tlimit(t^2*exp(-4*t/3-8*exp(-t)),t,inf);
0;

/* [ 1786774 ] tlimit((5^x + 3^x)^(1/x), x, inf) => Error */
tlimit((5^x + 3^x)^(1/x), x, inf);
5;

/* [ 1603900 ] taylor/tlimit (4^n+1)/2^(2*n) internal error */
tlimit((4^n+1)/2^(2*n),n,inf);
1;

/* [ 1281736 ] limit((x/log(x))*(x^(1/x)-1),x,inf) - wrong result */
limit((x/log(x))*(x^(1/x)-1),x,inf);
1;

/* [ 1036901 ] tlimit(7^(n^2)/8^n,n,inf); wrong result */
tlimit(7^(n^2)/8^n, n, inf);
inf;

/* [ 1665657 ] limit fails to find easy limit */
limit(x/(x-1)-1/log(x),x,1,plus);
1/2;

/* [ 611411 ] limit asks sign of IND */
limit(abs(sin(x)),x,inf);
ind;

/* [ 1629723 ] bug in limit, asks sign of IND, encountered in integrator */
limit(abs(sin(x))/x, x, inf);
0;

/* [ 782099 ] limit returns expression in IND */
limit(sinh(exp(%i*x)),x,inf);
ind;

/* [ 1528607 ] limit(a^x,x,inf) can't solve for a : abs(a) < 1 */
limit((-2/3)^x,x,inf);
0;

limit(signum(x), x, 0, plus);
1;

limit(signum(x), x, 0, minus);
-1;

limit((-1/%pi)^x,x,inf);
0;

tlimit(exp(%i*t), t, inf);
ind;

tlimit(exp(-t+%i*t),t,inf);
0;

/* [ 1811503 ] computing a wrong result */
limit((((1+1/x)^(x^2))+1)^(1/x),x,inf);
%e;

/* [ 1760232 ] limit(1/n * n!^(1/n), n, inf); */
limit(1/n * n!^(1/n), n, inf);
%e^-1;

limit(t*(erf((t))-1),t,inf);
0;

limit(exp(x)*(sin(1/x+exp(-x))-sin(1/x+exp(-x^2))), x, inf);
1;

/* it would be nice to handle this someday
  limit(n - exp(psi[0](n)), n, inf);
  1/2;
*/

limit(x*gamma(x), x, 0);
1;

/* [ 744679 ] limit overflows memory? */
(assume(a>1), limit((a^(1/n)+1)^n/2^n, n, inf));
'sqrt(a);

/* [ 702512 ] limit(1/(1/a*2^(%i*a)+1),a,inf) =&gt; UND */
limit(1/(1/a*2^(%i*a)+1),a,inf);
1;

/* [ 923407 ] limit(atan(sqrt(x))/sqrt(x),x,0) wrong */
limit(atan(sqrt(x))/sqrt(x),x,0);
1;

/* [ 1102908 ] limit/atan/exp returns complex expr with wrong principal val */
limit(atan(x)/(1/exp(1)-exp(-(1+x)^2)),x,inf,plus);
%e*%pi/2;

limit( (3^(1/x) + 5^(1/x))^x, x, 0, minus);
3;

limit( (3^(1/x) + 5^(1/x))^x, x, 0, plus);
5;

limit( (3^(1/x) + 5^(1/x))^x, x, 0);
und;

/* [ 1852415 ] limit(sqrt(1-%e^(-x^2)), x, inf) = 0 */
limit(sqrt(1-%e^(-x^2)), x, inf);
1;

/* [ 1515712 ] tlimit (x*atan(x)/(x+1),x,inf) => 3 %pi/2, etc */
tlimit(x*atan(x)/(x+1),x,inf);
%pi/2;

tlimit(x*(atan(x)-%pi/2),x,inf);
-1;

tlimit(atan(x^-1), x, 0, minus);
-%pi/2;

/* [ 1973399 ] F(x) := 1/%pi*(atan(x) + %pi/2) */
(assume(c>0), limit(((1/%pi)*(atan(n/%pi) + %pi/2))^n, n, inf));
%e^(-1);

/* [ 1103515 ] limit(atan2(x,-1),x,0) wrong */
limit(atan2(x,-1), x, 0, minus);
-%pi;

limit(atan2(x,-1), x, 0, plus);
%pi;

limit(atan2(x,-1), x, 0);
und;
/* ideally should be ind */

/* [ 1587235 ] limit(floor(x),x,1) wrong */
limit(floor(x),x,0);
und;

/* [ 1885377 ] wrong limit evaluation in 5.14.0 */
limit((3/4)^(5*n+1), n, inf);
0;

limit(-%e^x/x, x, inf);
minf;

/* [ 2083561 ] Limit of the Wallis product */
limit((%pi*4^N*N!^2)/(2*2^(2*N)*gamma(N+1/2)*gamma(N+3/2)), N, inf);
%pi/2;

/* wrong limit(log(gamma(x+1))/x,x,0) - ID: 2727078 */
limit(log(gamma(x+1))/x, x, 0);
-%gamma;

/* [ 635606 ] limit(abs(log(x))) internal error, UND */
limit(abs(log(x)), x, 0);
inf;

limit(exp(-x)*(x*sin(x)+cos(x)), x, inf);
0;

/* tex(t[1]) shouldn't change t to true */
tex (t[1], false);
"$$t_{1}$$
"; /* tex output contains embedded newline */

/* tex(x[1]^2) shouldn't get confused by debug info in expression CAR */
(foo : x[1]^2, tex (foo, false));
"$$x_{1}^2$$
"; /* tex output contains embedded newline */

/* [ 2084910 ] limit bugs */
limit((%pi*N^(2*N+1)*2^(2*N))/((2*N-1)^(2*N)*(2*%e*N+%e)), N, inf);
%pi/2;

/* [ 1977992 ] no limit calculation */
limit(abs(sin(x))/sqrt(1-cos(x)), x, 0);
sqrt(2);

/* [ 1973399 ] F(x) := 1/%pi*(atan(x) + %pi/2) */
/* only works with taylor_logexpand:true */
limit( ((1/%pi)*(atan(n/%pi) + %pi/2))^n, n, inf);
%e^-1;

/* limit(x*expintegral_ei(x),x,0) --> Error - ID: 2801821 */
limit(x*expintegral_ei(x), x, 0);
0;

/* Limit of the factorial function - 4 problems - ID: 2841504 */
limit(factorial(x),x,-2,plus);
minf;

limit(1/psi[1](x), x, inf);
inf;

/* limit of psi[i] - ID: 2843705 */
limit(psi[i](x),x,inf);
'limit(psi[i](x),x,inf);

/* tests for gruntz limit algorithm */
gruntz(exp(x), x, inf);
inf;

gruntz(exp(-x), x, inf);
0;

gruntz( (x + 2^x) / 3^x, x, inf);
0;

gruntz( x^2/(x + 2*x^2), x, inf);
1/2;

gruntz( x/x^log(x), x, inf);
0;

gruntz( (2^x)/(x + exp(x)) , x, 0, plus);
1;

gruntz( (erf(x))/sqrt(1-cos(x)) , x, 0, minus);
-2*sqrt(2)/sqrt(%pi);

gruntz( (erf(x))/sqrt(1-cos(x)) , x, 0, plus);
2*sqrt(2)/sqrt(%pi);

gruntz( x*(x^(1/x)-1)/log(x), x, inf);
1;

gruntz( (x*x^(1/x)-x)/log(x), x, inf);
1;

gruntz(exp(-1/x)/x^6,x,0,plus);
0;

/*
 * Bug [ 1854888 ] hgfred([5],[5], 1) doesn't simplify
 */
hgfred([5],[5],1);
%e;

/*
 * Bug [ 1858964 ] hgfred([7],[-1], x) --/--> error
 */
hgfred([7],[-1],x);
und;

/*
 * Bug [ 1858939 ] hgfred([-1],[-2],x) --> error
 */
hgfred([-1],[-2],x);
/* Because of revision 1.110 of hyp.lisp gen_laguerre simplifies
   -gen_laguerre(1,-3,x)/2; */
1+x/2;

/*
 * Tests for the :: operator
 */
a:b;
b$

a::3;
3$

b;
3$

p:concat('p,1);
p1$

p::5;
5$

p1;
5$

kill(all);
done$

/* Bug [ 1860250 ] erf(-inf) --> -erf(inf) */

erf(-inf);
-1$

erf(inf);
1$

erf(-x) + erf(x);
0$

erf(a-b) + erf(b-a);
0$

/* Bug [ 1950653 ] bessel_j not simplified 
 * A few additional related tests added too.
 */

bessel_j(1/2,%pi),besselexpand:true;
0;
bessel_y(1/2,%pi/2),besselexpand:true;
0;

/* Bug [ 2149714 ] fpprintprec does not work correctly
*/

fpprec:16;
16;

block([fpprintprec:5], string(1.23b0));
"1.23b0";

block([fpprintprec:5], string(1.2345b0));
"1.2345b0";

block([fpprintprec:5], string(1.23456789b0));
"1.2345b0";

block([fpprintprec:25], string(1.2345678901234567890123456789b0));
"1.234567890123457b0";

/*
 * Bug 2142758: integrate(sqrt(2-2*x^2)*(sqrt(2)*x^2+sqrt(2))/(4-4*x^2),x,0,1)
 */
integrate(sqrt(2-2*x^2)*(sqrt(2)*x^2+sqrt(2))/(4-4*x^2),x,0,1);
3*%pi/8;


integrate(sqrt(1-x^2)*(x^2+1)/(2-2*x^2),x,0,1);
3*%pi/8;

integrate(sqrt(1-x^2)*(x^2+1)/(1-x^2),x,0,1);
3*%pi/4;

/*
 * Bug [ 2208303 ] Problem with jacobi_dn and elliptic_kc
 */
jacobi_dn(elliptic_kc(m)*t,m);
jacobi_dn(elliptic_kc(m)*t,m);

/*
 * Bug [ 2180110 ] GCL do not signal an overflow converting bigfloat to float
 */
errcatch(float(2b400));
[];

errcatch(float(bfloat(2^1024)));
[];

/*
 * Bug [ 2055235 ] Plot leaves range with jacobi functions
 *
 * Actually jacobi_cn(100, .7) is computed inaccurately.  Just check that abs(jacobi_cn(100,.7)) < 1
 */

is(abs(jacobi_cn(100.0, 0.7)) < 1);
true$

/*
 * Bug [ 1658067 ] jacobi_sn(elliptic_kc(1-m)*%i/2,m) isn't simplified
 */
jacobi_sn(elliptic_kc(1-m)*%i/2,m);
%i*m^(1/4)$

jacobi_sc(elliptic_kc(m)+u,m);
-jacobi_cs(u,m)/sqrt(1-m)$

/*
 * Bug [ 2505945 ] - hgfred([2,-1/2],[3],-x^2);
 *
 * Shouldn't signal from diff about non-variable second arg.
 *
 * The expected value here is computed from
 * factor(ratsimp(subst([z=-x^2],hgfred([2,-1/2],[3],z))))
 */
factor(ratsimp(hgfred([2,-1/2],[3],-x^2)));
4*(3*x^4*sqrt(x^2+1)+x^2*sqrt(x^2+1)-2*sqrt(x^2+1)+2)/(15*x^4)$

/*
 * Bug 2534420: asinh(%i*2b0) causes error
 */
is(abs(asinh(%i*2b0)-expand(bfloat(asinh(%i*2)))) < 3b-17);
true;

/*
 * Bug 2543079: bfloat(gamma(3/4)/gamma(1/4)) is wrong.
 */
bfloat(gamma(3/4)/gamma(1/4));
3.379891200336424b-1;

/*
 * Bug 2582034 - hgfred([a/2,-a/2],[1/2],z) causes error
 */
(assume(zn<0), done);
done;

hgfred([a/2,-a/2],[1/2],zn);
((%i*sqrt(zn)+sqrt(1-zn))^a+(sqrt(1-zn)-%i*sqrt(zn))^a)/2$
 
/*
 * Bug 2618401 - bfloat produces incorrect answer
 */
is(abs(bfloat((sqrt(2)+2)*%pi^(3/2)/(8*gamma(3/4)^2))-float((sqrt(2)+2)*%pi^(3/2)/(8*gamma(3/4)^2))) < 1d-15);
true;

/* (-1.0b0)^(1/3) vs (-1.0d0)^(1/3) - ID: 619927 */
(-1b0)^(1/3);
-1.0b0;

(-1.0)^(1/3);
-1.0;

domain:complex;
complex;

(-1b0)^(1/3);
1.0b0*(-1)^(1/3);

(-1.0)^(1/3);
1.0*(-1)^(1/3);

domain:real;
real;

(-1b0)^(1/3),domain:complex,m1pbranch:true;
1.0b0*(sqrt(3)*%i/2+1/2);

(-1.0)^(1/3),domain:complex,m1pbranch:true;
 1.0*(sqrt(3)*%i/2+1/2);


/*
 * Bug [ 2688847 ] float of rats rounds incorrectly
 */
float((2^60-1)/2^60)-1;
0.0;
float((2^1000-1)/2^1000)-1;
0.0;

/*
 * Bug [ 2687962 ] hgfred([-3/2,1],[-1/2],-t) division by zero
 *
 * Solution from functions.wolfram.com
 */
ratsimp(hgfred([-3/2,1],[-1/2], t));
1+3*t-3*t^(3/2)*atanh(sqrt(t));

/*
 * Bug 2793827: internal error in integrate
 */
(assume(n>0),0);
0;

integrate((g32475^n*(g32475*n-n-1)/(g32475-1)^2+1/(g32475-1)^2)/(1-g32475)
 -(g32475^(2*n+1)*(g32475*n-n-1)/(g32475-1)^2+g32475^(n+1)/(g32475-1)^2)
  /(1-g32475),g32475,0,1);
(n+1)^2/2-1/2;

/*
 * Bug 609464 : 1+%e,numer and %e^%e,numer
 *
 * The simplifier has been extended to handle %e like other constants.
 * In addition functions with arguments which involve %e simplify
 * accordingly.
 */

%e,numer;
2.7182818284590451;

%e+1,numer;
3.7182818284590451;

%e^%e,numer;
15.154262241479262;

%e^x,numer;
%e^x;

sin(%e),numer;
0.41078129050290885;

sin(%e+1),numer;
-0.54525155669233449;

/* Do not simplify, when %e is the base of an expression and %enumer FALSE*/

sin(%e^(2*x+1)),numer;
sin(%e^(2*x+1));

sin(%e^(%e^(2*x+1))),numer;
sin(%e^(%e^(2*x+1)));

/* Additionally simplifications when %enumer TRUE */

%enumer:true;
true;

sin(%e^x),numer;
sin(2.7182818284590451^x);

sin(%e^(%e^(2*x+1))),numer;
sin(2.7182818284590451^(2.7182818284590451^(2*x+1)));

%enumer:false;
false;

/*
 * Bug ID: 2797885 - "problem with integration"
 *
 * integrate(exp(%i*x)*sin(x),x) generates a Lisp error.
 *
 * This is a special case for the integrand: exp(a*x)*sin(b*x),
 * with a^2+b^2 equal to zero.
 */

/* This is the general case for an integral with exp and sin or cos */
integrate(exp(a*x)*sin(b*x),x);
%e^(a*x)*(a*sin(b*x)-b*cos(b*x))/(b^2+a^2);

integrate(exp(a*x)*cos(b*x),x);
%e^(a*x)*(b*sin(b*x)+a*cos(b*x))/(b^2+a^2);

/* Now the special case with a=%i and b=1 */
expand(integrate(exp(%i*x)*sin(x),x));
%i*x/2-%e^(2*%i*x)/4;

expand(integrate(exp(x)*sin(%i*x),x));
%i*%e^(2*x)/4-%i*x/2;

expand(integrate(exp(%i*x)*cos(x),x));
x/2-%i*%e^(2*%i*x)/4;

expand(integrate(exp(x)*cos(%i*x),x));
%e^(2*x)/4+x/2;

/* Bug ID: 932076 -  ode2( 'diff(y,x)=%i*y+sin(x), y, x) => div by 0
 *
 * This bug is related to the Bug ID: 2797885 - "problem with integration"
 */

ode2('diff(y,x)-%i*y-sin(x),y,x);
y = (%c-%i*(x-%i*%e^-(2*%i*x)/2)/2)*%e^(%i*x);

/*
 * Bug ID: 826623 "simplifer returns %i*%i"
 * 
 * Some examples to show simplification of expressions of the form
 * (a*b*...)^q*(a*b*...)^r, where q+r=1
 */

sqrt(-%i)*sqrt(-%i)*%i;
1;

sqrt(a*b)*sqrt(a*b)*a*b;
a^2*b^2;

(a*b*c)^(3/4)*(a*b*c)^(1/4)*c;
a*b*c^2;

/*
 * Bug ID: 2792493 "hgfred([1],[-5.2],x);"
 */
hgfred([1],[-5.2],x);
%f[1,1]([-6.2],[-5.2],-x)*%e^x$

/*
 * Bug ID: 1315837 limit(?foo)
 * Bug ID: 1119228 limit(1/zeraoa)
 */

limit(?foo);
?foo;
limit(true);
true;
limit(false);
false;
limit(1/zeroa);
inf;
limit(1/zerob);
minf;

/* BUG ID: 721575 2/sqrt(2) doesn\'t simplify */
2/sqrt(2);
sqrt(2);

(1/2)*sqrt(2);
1/sqrt(2);

sqrt(2)*(1/2);
1/sqrt(2);

/* BUG ID 2029041 a*sqrt(2)/2 unsimplified */

a*sqrt(2)/2;
a/sqrt(2);

/* BUG ID 1923119 1/sqrt(8)-sqrt(8)/8 */

1/sqrt(8)-sqrt(8)/8;
0;

/* BUG ID 1927178 integrate(sin(t),t,%pi/4,3*%pi/4) */

integrate(sin(t),t,%pi/4,3*%pi/4);
sqrt(2);

/* BUG ID: 1480562 2*a*2^k isn't simplified to a*2^(k+1) */

2*a*2^k;
a*2^(k+1);

a*2^k*2;
a*2^(k+1);

/* Some examples to show simplification of expressions
 * with floating point and bigfloat numbers after improvement
 * of plusin
 */

(4.0*x-4.0*x);
0.0;
(4.0*x-3.0*x);
1.0*x;
(4.0*x-3.0*x)/2;
0.5*x;

(4.0b0*x-4.0*x);
0.0b0;
(4.0b0*x-3.0*x);
1.0b0*x;
(4.0b0*x-3.0*x)/2;
0.5b0*x;

/* BUG ID: 1996354 unsimplifed result from expand */

expand((%e^(-2*sqrt(2))*(%e^(2*sqrt(2))+2*%e^sqrt(2)+1)^2)/16
       +(%e^(-2*sqrt(2))*(%e^(2*sqrt(2))-2*%e^sqrt(2)+1)^2)/16
       -(%e^(-2*sqrt(2))*(%e^(2*sqrt(2))-1)^2)/8);
1;

/* BUG ID: 631216 - "horner([...],x)/FIX" 
   horner now maps over lists, matrices and equations.
 */

horner(x^2+x=a*x^2+b*x);
x*(x+1) = x*(a*x+b);
horner([x^2+x,x^3+x,x^4+x]);
[x*(x+1),x*(x^2+1),x*(x^3+1)];

/* BUG ID: 2699862 "derivative of polylogarithm"
 * The noun form is not put on the property list, but NIL. The routine 
 * sdiffgrad generates a noun form, when the derivative is not known.
 */

diff(li[n](x),n);
'diff(li[n](x),n);

diff(li[n*x](x),x);
'diff(li[n*x](x),x);

diff(li[n](x),x,1,n,1);
'diff(li[n-1](x),n)/x;

/* Not reported as a bug, but the same problem for the function psi */

diff(psi[n](x),n);
'diff(psi[n](x),n);

diff(psi[n*x](x),x);
'diff(psi[n*x](x),x);

diff(psi[n](x),x,1,n,1);
'diff(psi[n+1](x),n);

/* BUG ID: 2824909 " exp(%i*%pi/4) not simplified" 
 * Check the simplification of exp(%i*%pi/4) and exp(-%i*pi/4)
 */

exp(%i*%pi/4);
1/sqrt(2)+%i/sqrt(2);
exp(-%i*%pi/4);
1/sqrt(2)-%i/sqrt(2);

/*
 * Bug ID: 2831259 - bfloat() underflow bug
 */
fpprec:500;
500;
float(0b0);
0.0;

/*
 * BUG ID: 2835098 - SIGN-PREP strangeness
 */
 
block ([?limitp : true], sign (foo (x)));
pnz;

integrate(sqrt(2*m*(E[n]-U(x))),x,-x[0],x[0])=(n-1/2)*%pi*hbar;
sqrt(2)*'integrate(sqrt(m*(E[n]-U(x))),x,-x[0],x[0]) = %pi*hbar*(n-1/2);

integrate(f(x),x,x[0],x[1]);
'integrate(f(x),x,x[0],x[1]);

/*
 * BUG ID: 2840566 - defint fails to determine if one of its limit is real
 */
 
(assume(b>0,c>0),done);
done;
 
integrate(x,x,0,sqrt(b^2+(b-c)^2));
(c^2-2*b*c+2*b^2)/2;

/*
 * BUG ID: 2842060 - unsimplified result from integrate
 */
 
/* The result for a general symbol x */
integrate(1/x/sqrt(x^2-1),x);
-asin(1/abs(x));

(assume(x>0), done);
done;
 
/* abs(x) simplifies to x for x>0 */
integrate(1/x/sqrt(x^2-1),x);
-asin(1/x);

(forget(x>0), done);
done;

/* 
 * Bug ID: 2820202 - rootscontract(%i/2) 
 */
rootscontract(%i/2);
%i/2;

/* 
 * Bug ID: 1797296 - Crazy results when doing limit of 'diff
 */
limit('diff(x+1,x),x,2);
'limit('diff(x+1,x),x,2);

limit('integrate(x+1,x),x,2);
'limit('integrate(x+1,x),x,2);

limit(integrate(f(t),t,0,x),x,0,plus);
'limit(integrate(f(t),t,0,x),x,0,plus);

limit(integrate(t,t,0,x)/x,x,inf);
inf;

(assume(a>2), limit(integrate(t/log(t),t,2,a)/a,a,inf));
inf;

/* limit(1/inf-1/minf) => 0+0 - ID: 903074 */
limit(1/inf-1/minf);
0;

/* 1-arg limit: limit(a*inf-inf) => minf - ID: 1385306 */
limit(a*inf-inf);
minf+inf;
/* ideally should be inf, if two infs represent same var */

/* limit(1 - (-1/2)^inf) --> inf - ID: 2853506 */
limit(1 - (-1/2)^inf);
1-(-1)^inf/2^inf;
/* ideally should be 1 */

/* definition of derivative in terms of limit */
limit((sin(3*(x+h)) - sin(3*(x)))/h, h, 0, plus);
3*cos(3*x);

/* limit incorrect for -x/sqrt(1-x^2) - ID: 2869955 */
limit(-x/sqrt(1-x^2), x, 1, minus);
minf;

/* limit(%i*log(a),a,0) nounform (%i*und problem) - ID: 816797 */
limit(%i*log(x),x,0);
infinity;

/* limit(sqrt(x),x,minf) not fully evaluated - ID: 2901855 */
limit(sqrt(x), x, minf);
infinity;

/* Bug ID: 2872738 - sign(-(1/n)*(-1)^n)
 * We got the error because of the simplification
 *  (-1)^n*(-1) -> (-1)^(n+1) and not -(-1)^n
 * The other case 
    (-1)*(-1)^n simplifies already to -(-1)^n
 * Adding tests for both cases.
 */
kill(all);
done;
sign(-(1/n)*(-1)^n);
pn;
(-1)*(-1)^n;
-(-1)^n;
(-1)^n*(-1);
-(-1)^n;

/* The initial problem which triggers this bug */
declare(n,integer);
done;
limit ((sin(n*x) - n*x*cos(n*x))/n^2, x, %pi);
-%pi*(-1)^n/n;

/* Bug ID: 2835634 - logcontract broken
 * Bug ID: 1467368 - logcontract returns unsimplified expr
 */
logcontract(log(x)-log(2));
log(x/2);
/* Check that we do not break the following again */
logcontract(log(%e*k)-log(%e^-1*k));
2;
log(%e^2),logexpand:false;
2;

/* Bug ID: 2880923 - realpart --> floating-point-overflow
 */
sign(exp(2009));
pos;
realpart(sqrt(4*%e^2009-3)-1);
sqrt(4*%e^2009-3)-1;
sqrt(4*exp(2009));
2*%e^(2009/2);

/* Bug ID: 640332 - Need to specdisrep more systematically
   Add the examples of the bug report.
 */
ratdisrep(diff(rat(x),rat(x)));
1;
diff(x,rat(x));
1;
outofpois(diff(intopois(sin(x)),x));
cos(x);
taylor(intopois(sin(x)),x,0,3);
x-x^3/6;
ratsimp(intopois(sin(x)));
sin(x);

/* Bug ID: 627759 - Ratdisrep of aggregates 
 */
ratdisrep(rat(x=y));
x = y;
ratdisrep(rat([x=a,y=b]));
[x = a,y = b];
ratdisrep(rat(matrix([a,b],[c,d])));
matrix([a,b],[c,d]);

/* Bug ID: 711885 - Rootscontract with imaginaries fails
 */
(oldvalue:radexpand, radexpand:false, done);
done;

rootscontract(((sqrt(3)*%i+1)^(3/2)-4*%i)/sqrt(sqrt(3)*%i+1));
((sqrt(-3)+1)^(3/2)-4*%i)/sqrt(sqrt(-3)+1);

/* It is a problem of the simplifier. Show that it works */
sqrt(1/(1+sqrt(-3)));
1/sqrt(sqrt(-3)+1);

(radexpand:oldvalue, done);
done;

/* BUG ID: 767556 - Distributing operations over =
 * The operators "." and "^^" distribute over equations.
 */

x . (a=b);
x . a = x . b;

(a=b)^^x;
a^^x = b^^x;

/* A more complicated example */
x . ((2*a+b . c) = x . (y + z))^^w;
x . (b . c+2*a)^^w = x . (x . (z+y))^^w;

/* Bug ID: 593351 - limit/sin(inf)etc. should give 0, not IND
 */

limit(cos(1/x)*sin(x)-sin(x),x,inf);
0;
limit(cos(1/x)*sin(x)-sin(x)+a,x,inf);
a;

/* Bug ID: 2914176  	 Conversion of rational to bfloat is inaccurate
 *
 * The difference should be 1/262144, but we don't check for that.
 */
(oldfpprec:fpprec, fpprec:5, done);
done;
is(bfloat((2^20+1)/(2^20-1)) - 1b0 > 0);
true;

/* Related to the fix for 2914176.  Didn't handle the ratio 0/1 */
is(equal(0b0, 0));
true;

(fpprec:oldfpprec, done);
done;

/* Bug ID:2933882 - Power function: 0^a not fully implemented
 * Show some simplifications of 0^a
 */

assume(a>0);
[a>0];
0^a;
0;
errcatch(0^-a);
[];
0^(a+%i);
0;
0^(1/2+%i);
0;
errcatch(0^(-1/2+%));
[];
errcatch(0^%i);
[]; 

forget(a>0);
[a>0];

/* Bug ID: 2938078 - Crash on attached input
 */
 
declare(n,integer, j,noninteger);
done;
assume(equal(x,n), equal(y,j), equal(z,i));
[equal(x, n), equal(y, j), equal(z,i)];

featurep(x,integer);
true;
featurep(x,noninteger);
false;
featurep(y,integer);
false;
featurep(y,noninteger);
true;

diff(z+1,z);
1;

remove(n,integer, j,noninteger);
done;
forget(equal(x,n), equal(y,j), equal(z,i));
[equal(x, n), equal(y, j), equal(z, i)];

/* Bug ID:  2948800 - integrate((1-cos(2*x)^2)^2/x^4,x,0,inf) wrong
 */
 
integrate((1-cos(2*x)^2)^2/x^4,x,0,inf);
8*%pi/3;

assume(a>0);
[a>0];

/* The more general type with an argument a*x and a positive */
integrate((1-cos(a*x)^2)^2/x^4,x,0,inf);
%pi*a^3/3;

forget(a>0);
[a>0];

/* Bug ID: 1376392 - limit(x/(2+sin(1/x)), x, 0); wrong result
 */
 
limit(x/(2+sin(1/x)),x,0);
0;
 
/* Bug ID: 1106912 - limit(x/sin(x)^2,x,inf)
   I think the limit is not defined because the func is not defined
   for all x > any constant.
 */
limit(x/sin(x)^2,x,inf);
und;

/* Bug ID: 777564 - subtraction \"-\"(a,b) should work/FIX */

"-"();
0;

"-"(a);
-a;

"-"(2*a);
-2*a;

"-"(a+b);
-b-a;

"-"(a+b+c);
-c-b-a;

"-"(100,20,10);
70;

map("-",[a,x,100],[b,y,20]);
[a-b,x-y,80];

map("-",[a,x,100],[b,y,20],[c,z,10]);
[-c-b+a,-z-y+x,70];

/* Bug ID: 910270 - 1/+3*x parses as 1/(+3*x)
 * Show that the "+" operator can be used as a prefix operator too.
 */
1/+3*x;
x*1/3;
1/+x/3;
1/(3*x);
a^+b*c;
c*a^b;

/* Bug ID: 2961822 - sinh(0.0b0) causes Maxima to abort
 */
sinh(0.0b0);
0.0b0;

/* Bug ID: 1219846 - properties of translated functions
 * The property noun is already present
 */
kill(f);
done;
f(x):=x;
f(x):=x;
properties(f);
[function,noun];
translate(f);
[f];
properties(f);
[transfun,function,noun];
kill(f);
done;

/* Bug ID: 2968344 - gamma_incomplete(1.0, 4.368265444147715e+19) fails
 */
gamma_incomplete(1.0, 4.368265444147715e+19);
0.0;

/* Bug ID: 643254 - orderlessp([rat(x)], [rat(x)])
 */
orderlessp([rat(x)],[rat(x)]);
false;

/* Bug ID: 781657 - binomial(x,x) => 1, but binomial(-1,-1) => 0
 * binomial(x,x) simplifies to 1 only if the sign of x is known not to be zero.
 */
is(equal(binomial(x,x),1));
'unknown;
is(equal(binomial(x^2,x^2),1));
true;

/* Bug ID: 811522 - redundant question in limit
 * b is assumed to be zero. Maxima now can deduce from the database 
 * that b-2 is an even number.
 */
assume(equal(b,0));
[equal(b,0)];
limit(r^(b-2)*(x-r)^2,r,0);
'limit(r^(b-2)*(x-r)^2,r,0);
forget(equal(b,0));
[equal(b,0)];

/* Bug ID:856209 - inconsistency between facts() and facts(v)
 * Show that facts(expr) now works more general.
 */
assume(z+a>0,b>z);
[a+z>0,b>z];
facts(a);
[a+z>0];
facts(b);
[b>z];
facts(z);
[a+z>0,b>z];
facts(a+z);
[a+z>0];
forget(z+a>0,b>z);
[a+z>0,b>z];

/* Bug ID: 840848 - trigreduce doesn't enter unknown functions
 */
trigexpand(f(sin(2*x)));
f(2*cos(x)*sin(x));
trigreduce(%);
f(sin(2*x));

/* Bug ID: 2954472 - rectform with large floats gives bad answer
*/
is(abs(rectform(1e160/(1e160+%i))-1) < 1e-160);
true;

is(abs(rectform(1e160/(1e160+3/2*%i))-1) < 1.5e-160);
true;

/* Bug ID: 2953369 - Definite Integration of 1/(a-b*cos(x)) wrong
 *
 * For simplicity we test the equivalent integrate(1/(1-r*cos(x)),x,0,%pi).
 */
/* These assumes are to answer the questions integrate (from routine unitcir) will ask */
(assume(r>0,r<1,abs(sqrt(1-r^2)-1)/r-1 < 0, sqrt(1-r^2)-r+1>0), 0);
0;
integrate(1/(1-r*cos(x)),x,0,%pi);
%pi/sqrt(1-r^2);

/* Bug ID: 2907727 - Incorrect Integral with option integrate_use_rootsof
 * :true
 */
%rnum:0;
0;
integrate((d*x^2+2*c*x+3*b)/(g*r*x^3+d*x^2+c*x+b), x), integrate_use_rootsof:true;
lsum((%r1^2*d+2*%r1*c+3*b)*log(x-%r1)/(3*%r1^2*g*r+2*%r1*d+c),%r1,
             rootsof(g*r*x^3+d*x^2+c*x+b));

/* Bug ID: 2880797 - bad answer in integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi)
 *
 */
integrate(sqrt(sin(t)^2+cos(t)^2),t,0,2*%pi);
2*%pi;

/* Bug ID: 2980551 - Inconsistent simplification of exp(x*%i*%pi)
 *
 * These examples show consistent simplification for x an expression which
 * can contain float or bigfloat values
 */

exp(2*%i*%pi);
1;

exp((2+x)*%i*%pi);
exp(x*%i*%pi);

exp(2*%i*%pi+x*%i*%pi);
exp(x*%i*%pi);

log(exp((2+x)^2*%i*%pi));
(2+x)^2*%i*%pi;

exp(2.0*%i*%pi);
1.0;

exp((2.0+x)*%i*%pi);
exp(1.0*x*%i*%pi);

exp(2.0*%i*%pi+x*%i*%pi);
exp(1.0*x*%i*%pi);

log(exp((2.0+x)^2*%i*%pi));
(2.0+x)^2*%i*%pi;

exp(2.0b0*%i*%pi);
1.0b0;

exp((2.0b0+x)*%i*%pi);
exp(1.0b0*x*%i*%pi);

exp(2.0b0*%i*%pi+x*%i*%pi);
exp(1.0b0*x*%i*%pi);

log(exp((2.0b0+x)^2*%i*%pi));
(2.0b0+x)^2*%i*%pi;

exp(3/2*%pi*%i);
-%i;
exp(1.5*%pi*%i);
-1.0*%i;
exp(1.5b0*%pi*%i);
-1.0b0*%i;

exp((3/2+x)*%pi*%i);
-%i*exp(%i*%pi*x);
exp((1.5+x)*%pi*%i);
-%i*exp(1.0*%i*%pi*x);
exp((1.5b0+x)*%pi*%i);
-%i*exp(1.0b0*%i*%pi*x);