-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlibfcns.xml
More file actions
7531 lines (7075 loc) · 379 KB
/
libfcns.xml
File metadata and controls
7531 lines (7075 loc) · 379 KB
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
<PFASpecification>
<version>0.8.1</version>
<libfcns>
<fcn name="+">
<sig>
<par name="x"><any label="A" of="int, long, float, double"/></par>
<par name="y"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Add <p>x</p> and <p>y</p>.</desc><error code="18000">Integer results above or below -2147483648 and 2147483647 (inclusive) produce an "int overflow" runtime error.</error><error code="18001">Long-integer results above or below -9223372036854775808 and 9223372036854775807 (inclusive) produce a "long overflow" runtime error.</error><detail>Float and double overflows do not produce runtime errors but result in positive or negative infinity, which would be carried through any subsequent calculations (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or NaN values.</detail>
</doc>
</fcn>
<fcn name="-">
<sig>
<par name="x"><any label="A" of="int, long, float, double"/></par>
<par name="y"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Subtract <p>y</p> from <p>x</p>.</desc><error code="18010">Integer results above or below -2147483648 and 2147483647 (inclusive) produce an "int overflow" runtime error.</error><error code="18011">Long-integer results above or below -9223372036854775808 and 9223372036854775807 (inclusive) produce a "long overflow" runtime error.</error><detail>Float and double overflows do not produce runtime errors but result in positive or negative infinity, which would be carried through any subsequent calculations (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or NaN values.</detail>
</doc>
</fcn>
<fcn name="*">
<sig>
<par name="x"><any label="A" of="int, long, float, double"/></par>
<par name="y"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Multiply <p>x</p> and <p>y</p>.</desc><error code="18020">Integer results above or below -2147483648 and 2147483647 (inclusive) produce an "int overflow" runtime error.</error><error code="18021">Long-integer results above or below -9223372036854775808 and 9223372036854775807 (inclusive) produce a "long overflow" runtime error.</error><detail>Float and double overflows do not produce runtime errors but result in positive or negative infinity, which would be carried through any subsequent calculations (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or NaN values.</detail>
</doc>
</fcn>
<fcn name="/">
<sig>
<par name="x">double</par>
<par name="y">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Divide <p>y</p> from <p>x</p>, returning a floating-point number (even if <p>x</p> and <p>y</p> are integers).</desc>
<detail>This function returns an infinite value if <p>x</p> is non-zero and <p>y</p> is zero and NaN if both are zero.</detail>
</doc>
</fcn>
<fcn name="//">
<sig>
<par name="x"><any label="A" of="int, long"/></par>
<par name="y"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Divide <p>y</p> from <p>x</p>, returning the largest whole number <c>N</c> for which <c>N</c> ≤ <p>x</p>/<p>y</p> (integral floor division).</desc>
<error code="18040">If <p>y</p> is zero, this function raises a "integer division by zero" runtime error.</error>
</doc>
</fcn>
<fcn name="u-">
<sig>
<par name="x"><any label="A" of="int, long, float, double"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Return the additive inverse of <p>x</p>.</desc>
<error code="18050">For exactly one integer value, -2147483648, this function raises an "int overflow" runtime error.</error>
<error code="18051">For exactly one long value, -9223372036854775808, this function raises a "long overflow" runtime error.</error>
</doc>
</fcn>
<fcn name="%">
<sig>
<par name="k"><any label="A" of="int, long, float, double"/></par>
<par name="n"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Return <p>k</p> modulo <p>n</p>; the result has the same sign as the modulus <p>n</p>.</desc>
<detail>This is the behavior of the <c>%</c> operator in Python, <c>mod</c>/<c>modulo</c> in Ada, Haskell, and Scheme.</detail>
<error code="18060">If <p>n</p> is zero and <p>k</p> and <p>n</p> are int or long, this function raises a "integer division by zero" runtime error.</error>
</doc>
</fcn>
<fcn name="%%">
<sig>
<par name="k"><any label="A" of="int, long, float, double"/></par>
<par name="n"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Return the remainder of <p>k</p> divided by <p>n</p>; the result has the same sign as the dividend <p>k</p>.</desc>
<detail>This is the behavior of the <c>%</c> operator in Fortran, C/C++, and Java, <c>rem</c>/<c>remainder</c> in Ada, Haskell, and Scheme.</detail>
<error code="18070">If <p>n</p> is zero and <p>k</p> and <p>n</p> are int or long, this function raises a "integer division by zero" runtime error.</error>
</doc>
</fcn>
<fcn name="**">
<sig>
<par name="x"><any label="A" of="int, long, float, double"/></par>
<par name="y"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Raise <p>x</p> to the power <p>n</p>.</desc><error code="18080">Integer results above or below -2147483648 and 2147483647 (inclusive) produce an "int overflow" runtime error.</error><error code="18081">Long-integer results above or below -9223372036854775808 and 9223372036854775807 (inclusive) produce a "long overflow" runtime error.</error><detail>Float and double overflows do not produce runtime errors but result in positive or negative infinity, which would be carried through any subsequent calculations (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or NaN values.</detail>
</doc>
</fcn>
<fcn name="cmp">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret>int</ret>
</sig>
<doc>
<desc>Return <c>1</c> if <p>x</p> is greater than <p>y</p>, <c>-1</c> if <p>x</p> is less than <p>y</p>, and <c>0</c> if <p>x</p> and <p>y</p> are equal.</desc>
</doc>
</fcn>
<fcn name="==">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is equal to <p>y</p>, <c>false</c> otherwise.</desc>
</doc>
</fcn>
<fcn name=">=">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is greater than or equal to <p>y</p>, <c>false</c> otherwise.</desc>
</doc>
</fcn>
<fcn name=">">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is greater than <p>y</p>, <c>false</c> otherwise.</desc>
</doc>
</fcn>
<fcn name="!=">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is not equal to <p>y</p>, <c>false</c> otherwise.</desc>
</doc>
</fcn>
<fcn name="<">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is less than <p>y</p>, <c>false</c> otherwise.</desc>
</doc>
</fcn>
<fcn name="<=">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is less than or equal to <p>y</p>, <c>false</c> otherwise.</desc>
</doc>
</fcn>
<fcn name="max">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Return <p>x</p> if <p>x</p> ≥ <p>y</p>, <p>y</p> otherwise.</desc>
<detail>For the maximum of more than two values, see <f>a.max</f></detail>
</doc>
</fcn>
<fcn name="min">
<sig>
<par name="x"><any label="A"/></par>
<par name="y"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Return <p>x</p> if <p>x</p> < <p>y</p>, <p>y</p> otherwise.</desc>
<detail>For the minimum of more than two values, see <f>a.min</f></detail>
</doc>
</fcn>
<fcn name="&&">
<sig>
<par name="x">boolean</par>
<par name="y">boolean</par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> and <p>y</p> are both <c>true</c>, <c>false</c> otherwise.</desc>
<detail>If <p>x</p> is <c>false</c>, <p>y</p> won't be evaluated. (Only relevant for arguments with side effects.)</detail>
</doc>
</fcn>
<fcn name="||">
<sig>
<par name="x">boolean</par>
<par name="y">boolean</par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if either <p>x</p> or <p>y</p> (or both) are <c>true</c>, <c>false</c> otherwise.</desc>
<detail>If <p>x</p> is <c>true</c>, <p>y</p> won't be evaluated. (Only relevant for arguments with side effects.)</detail>
</doc>
</fcn>
<fcn name="^^">
<sig>
<par name="x">boolean</par>
<par name="y">boolean</par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is <c>true</c> and <p>y</p> is <c>false</c> or if <p>x</p> is <c>false</c> and <p>y</p> is <c>true</c>, but return <c>false</c> for any other case.</desc>
</doc>
</fcn>
<fcn name="!">
<sig>
<par name="x">boolean</par>
<ret>boolean</ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is <c>false</c> and <c>false</c> if <p>x</p> is <c>true</c>.</desc>
</doc>
</fcn>
<fcn name="&&&">
<sig>
<par name="x"><union>boolean</union><union>null</union></par>
<par name="y"><union>boolean</union><union>null</union></par>
<ret><union>boolean</union><union>null</union></ret>
</sig>
<doc>
<desc>Return <c>false</c> if <p>x</p> or <p>y</p> is <c>false</c>, <c>true</c> if <p>x</p> and <p>y</p> are <c>true</c>, and <c>null</c> otherwise.</desc>
<detail>This corresponds to Kleene's three-state logic, in which <c>null</c> represents a boolean quantity whose value is unknown.</detail>
<detail>If <p>x</p> is <c>false</c>, <p>y</p> won't be evaluated. (Only relevant for arguments with side effects.)</detail>
</doc>
</fcn>
<fcn name="|||">
<sig>
<par name="x"><union>boolean</union><union>null</union></par>
<par name="y"><union>boolean</union><union>null</union></par>
<ret><union>boolean</union><union>null</union></ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> or <p>y</p> is <c>true</c>, <c>false</c> if both <p>x</p> and <p>y</p> is <c>false</c>, or <c>null</c> otherwise.</desc>
<detail>This corresponds to Kleene's three-state logic, in which <c>null</c> represents a boolean quantity whose value is unknown.</detail>
<detail>If <p>x</p> is <c>true</c>, <p>y</p> won't be evaluated. (Only relevant for arguments with side effects.)</detail>
</doc>
</fcn>
<fcn name="!!!">
<sig>
<par name="x"><union>boolean</union><union>null</union></par>
<ret><union>boolean</union><union>null</union></ret>
</sig>
<doc>
<desc>Return <c>true</c> if <p>x</p> is <c>false</c>, <c>false</c> if <p>x</p> is <c>true</c>, or <c>null</c> if <p>x</p> is <c>null</c>.</desc>
<detail>This corresponds to Kleene's three-state logic, in which <c>null</c> represents a boolean quantity whose value is unknown.</detail>
</doc>
</fcn>
<fcn name="&">
<sig>
<par name="x">int</par>
<par name="y">int</par>
<ret>int</ret>
</sig>
<sig>
<par name="x">long</par>
<par name="y">long</par>
<ret>long</ret>
</sig>
<doc>
<desc>Calculate the bitwise-and of <p>x</p> and <p>y</p>.</desc>
</doc>
</fcn>
<fcn name="|">
<sig>
<par name="x">int</par>
<par name="y">int</par>
<ret>int</ret>
</sig>
<sig>
<par name="x">long</par>
<par name="y">long</par>
<ret>long</ret>
</sig>
<doc>
<desc>Calculate the bitwise-or of <p>x</p> and <p>y</p>.</desc>
</doc>
</fcn>
<fcn name="^">
<sig>
<par name="x">int</par>
<par name="y">int</par>
<ret>int</ret>
</sig>
<sig>
<par name="x">long</par>
<par name="y">long</par>
<ret>long</ret>
</sig>
<doc>
<desc>Calculate the bitwise-exclusive-or of <p>x</p> and <p>y</p>.</desc>
</doc>
</fcn>
<fcn name="~">
<sig>
<par name="x">int</par>
<ret>int</ret>
</sig>
<sig>
<par name="x">long</par>
<ret>long</ret>
</sig>
<doc>
<desc>Calculate the bitwise-not of <p>x</p>.</desc>
</doc>
</fcn>
<fcn name="m.pi">
<sig>
<ret>double</ret>
</sig>
<doc>
<desc>The double-precision number that is closer than any other to <m>\pi</m>, the ratio of a circumference of a circle to its diameter.</desc>
</doc>
</fcn>
<fcn name="m.e">
<sig>
<ret>double</ret>
</sig>
<doc>
<desc>The double-precision number that is closer than any other to <m>e</m>, the base of natural logarithms.</desc>
</doc>
</fcn>
<fcn name="m.abs">
<sig>
<par name="x"><any label="A" of="int, long, float, double"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Return the absolute value of <p>x</p>.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
<error code="27020">For exactly one integer value, -2147483648, this function produces an "int overflow" runtime error.</error>
<error code="27021">For exactly one long value, -9223372036854775808, this function produces a "long overflow" runtime error.</error>
</doc>
</fcn>
<fcn name="m.acos">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the arc-cosine (inverse of the cosine function) of <p>x</p> as an angle in radians between <m>0</m> and <m>\pi</m>.</desc><detail>The domain of this function is from -1 to 1 (inclusive). Beyond this domain, the result is <c>NaN</c>, not an exception (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or <c>NaN</c> values."</detail>
</doc>
</fcn>
<fcn name="m.asin">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the arc-sine (inverse of the sine function) of <p>x</p> as an angle in radians between <m>-\pi/2</m> and <m>\pi/2</m>.</desc><detail>The domain of this function is from -1 to 1 (inclusive). Beyond this domain, the result is <c>NaN</c>, not an exception (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or <c>NaN</c> values."</detail>
</doc>
</fcn>
<fcn name="m.atan">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the arc-tangent (inverse of the tangent function) of <p>x</p> as an angle in radians between <m>-\pi/2</m> and <m>\pi/2</m>.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.atan2">
<sig>
<par name="y">double</par>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the arc-tangent (inverse of the tangent function) of <p>y</p>/<p>x</p> without loss of precision for small <p>x</p>.</desc><detail>The domain of this function is the whole real plane; no pair of inputs is invalid.</detail>
<detail>Note that <p>y</p> is the first parameter and <p>x</p> is the second parameter.</detail>
</doc>
</fcn>
<fcn name="m.ceil">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the smallest (closest to negative infinity, not closest to zero) whole number that is greater than or equal to the input.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.copysign">
<sig>
<par name="mag"><any label="A" of="int, long, float, double"/></par>
<par name="sign"><ref label="A"/></par>
<ret><ref label="A"/></ret>
</sig>
<doc>
<desc>Return a number with the magnitude of <p>mag</p> and the sign of <p>sign</p>.</desc><detail>The domain of this function is the whole real or integer plane; no pair of inputs is invalid.</detail>
<details>The return value is positive if <p>mag</p> is not zero and <p>sign</p> is zero.</details>
</doc>
</fcn>
<fcn name="m.cos">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the trigonometric cosine of <p>x</p>, which is assumed to be in radians.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.cosh">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the hyperbolic cosine of <p>x</p>, which is equal to <m>\frac{e^x + e^{-x}}{2}</m></desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.exp">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return <f>m.e</f> raised to the power of <p>x</p>.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.expm1">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return <m>e^x - 1</m>.</desc><detail>Avoids round-off or overflow errors in the intermediate steps.</detail><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.floor">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the largest (closest to positive infinity) whole number that is less than or equal to the input.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.hypot">
<sig>
<par name="x">double</par>
<par name="y">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return <m>\sqrt{x^2 + y^2}</m>.</desc><detail>Avoids round-off or overflow errors in the intermediate steps.</detail><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.ln">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the natural logarithm of <p>x</p>.</desc>
<detail>The domain of this function is from 0 to infinity (exclusive). Given zero, the result is negative infinity, and below zero, the result is <c>NaN</c>, not an exception (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or <c>NaN</c> values."</detail>
</doc>
</fcn>
<fcn name="m.log10">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the logarithm base 10 of <p>x</p>.</desc>
<detail>The domain of this function is from 0 to infinity (exclusive). Given zero, the result is negative infinity, and below zero, the result is <c>NaN</c>, not an exception (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or <c>NaN</c> values."</detail>
</doc>
</fcn>
<fcn name="m.log">
<sig>
<par name="x">double</par>
<par name="base">int</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the logarithm of <p>x</p> with a given <p>base</p>.</desc>
<detail>The domain of this function is from 0 to infinity (exclusive). Given zero, the result is negative infinity, and below zero, the result is <c>NaN</c>, not an exception (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or <c>NaN</c> values."</detail>
<error code="27170">If <p>base</p> is less than or equal to zero, this function produces a "base must be positive" runtime error.</error>
</doc>
</fcn>
<fcn name="m.ln1p">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return <m>ln(x + 1)</m>.</desc><detail>Avoids round-off or overflow errors in the intermediate steps.</detail>
<detail>The domain of this function is from -1 to infinity (exclusive). Given -1, the result is negative infinity, and below -1, the result is <c>NaN</c>, not an exception (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or <c>NaN</c> values."</detail>
</doc>
</fcn>
<fcn name="m.round">
<sig>
<par name="x">float</par>
<ret>int</ret>
</sig>
<sig>
<par name="x">double</par>
<ret>long</ret>
</sig>
<doc>
<desc>Return the closest whole number to <p>x</p>, rounding up if the fractional part is exactly one-half.</desc>
<detail>Equal to <f>m.floor</f> of (<p>x</p> + 0.5).</detail>
<error code="27190">Integer results outside of -2147483648 and 2147483647 (inclusive) produce an "int overflow" runtime error.</error>
<error code="27191">Long-integer results outside of -9223372036854775808 and 9223372036854775807 (inclusive) produce a "long overflow" runtime error.</error>
</doc>
</fcn>
<fcn name="m.rint">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the closest whole number to <p>x</p>, rounding toward the nearest even number if the fractional part is exactly one-half.</desc>
</doc>
</fcn>
<fcn name="m.signum">
<sig>
<par name="x">double</par>
<ret>int</ret>
</sig>
<doc>
<desc>Return 0 if <p>x</p> is zero, 1 if <p>x</p> is positive, and -1 if <p>x</p> is negative.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.sin">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the trigonometric sine of <p>x</p>, which is assumed to be in radians.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.sinh">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the hyperbolic sine of <p>x</p>, which is equal to <m>\frac{e^x - e^{-x}}{2}</m>.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.sqrt">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the positive square root of <p>x</p>.</desc><detail>The domain of this function is from 0 (inclusive) to infinity. Beyond this domain, the result is <c>NaN</c>, not an exception (see IEEE 754). Use <f>impute.ensureFinite</f> to produce errors from infinite or <c>NaN</c> values."</detail>
</doc>
</fcn>
<fcn name="m.tan">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the trigonometric tangent of <p>x</p>, which is assumed to be in radians.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.tanh">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the hyperbolic tangent of <p>x</p>, which is equal to <m>\frac{e^x - e^{-x}}{e^x + e^{-x}}</m>.</desc><detail>The domain of this function is the whole real line; no input is invalid.</detail>
</doc>
</fcn>
<fcn name="m.special.nChooseK">
<sig>
<par name="n">int</par>
<par name="k">int</par>
<ret>int</ret>
</sig>
<doc>
<desc> The number of ways to choose <p>k</p> elements from a set of <p>n</p> elements.</desc>
<param name="n">Total number of elements.</param>
<param name="k">Numer of elements chosen.</param>
<ret>With <m>n</m> and <m>k</m>, this function evaluates the binomial coefficient.</ret>
<error code="36000">Raises "domain error" if <m>k \leq 0</m> or <m>k \geq n</m>.</error>
</doc>
</fcn>
<fcn name="m.special.lnBeta">
<sig>
<par name="a">double</par>
<par name="b">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Compute the beta function parameterized by <p>a</p> and <p>b</p>.</desc>
<ret>With <m>a</m> and <m>b</m>, this function evaluates natural logarithm of the beta function. The beta function is <m>\int_{0}^{1} t^{a - 1}(1 - t)^{b - 1} dt </m>.</ret>
<error code="36010">Raises "domain error" if <m>a \leq 0</m> or if <m>b \leq 0</m>.</error>
</doc>
</fcn>
<fcn name="m.special.erf">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the error function of <p>x</p>.</desc>
</doc>
</fcn>
<fcn name="m.special.erfc">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the complimentary error function of <p>x</p>.</desc>
</doc>
</fcn>
<fcn name="m.special.lnGamma">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Return the natural log of the gamma function of <p>x</p>.</desc>
</doc>
</fcn>
<fcn name="m.link.softmax">
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the softmax function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>\exp(x_i)/\sum_j \exp(x_j)</m>.</ret>
<error code="25000">If <p>x</p> is an empty array or an empty map, this function raises an "empty input" error.</error>
</doc>
</fcn>
<fcn name="m.link.logit">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the logit function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>1 / (1 + \exp(-x_i))</m>.</ret>
</doc>
</fcn>
<fcn name="m.link.probit">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the probit function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>(\mbox{erf}(x_i/\sqrt{2}) + 1)/2</m>.</ret>
</doc>
</fcn>
<fcn name="m.link.cloglog">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the cloglog function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>1 - \exp(-\exp(x_i))</m>.</ret>
</doc>
</fcn>
<fcn name="m.link.loglog">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the loglog function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>\exp(-\exp(x_i))</m>.</ret>
</doc>
</fcn>
<fcn name="m.link.cauchit">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the cauchit function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>0.5 + (1/\pi) \tan^{-1}(x_i)</m>.</ret>
</doc>
</fcn>
<fcn name="m.link.softplus">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the softplus function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>\log(1.0 + \exp(x_i))</m>.</ret>
</doc>
</fcn>
<fcn name="m.link.relu">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the rectified linear unit (ReLu) function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>\log(1.0 + \exp(x_i))</m>.</ret>
</doc>
</fcn>
<fcn name="m.link.tanh">
<sig>
<par name="x">double</par>
<ret>double</ret>
</sig>
<sig>
<par name="x"><array>double</array></par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<ret><map>double</map></ret>
</sig>
<doc>
<desc>Normalize a prediction with the hyperbolic tangent function.</desc>
<ret>Each element <m>x_i</m> is mapped to <m>\tanh(x_i)</m>.</ret>
</doc>
</fcn>
<fcn name="m.kernel.linear">
<sig>
<par name="x"><array>double</array></par>
<par name="y"><array>double</array></par>
<ret>double</ret>
</sig>
<doc>
<desc>Linear kernel function.</desc>
<param name="x">Length <p>n</p> vector.</param>
<param name="y">Length <p>n</p> vector.</param>
<ret>Returns the dot product of <p>x</p> and <p>y</p>, <m>\sum_{i=1}^{n} x_{i} y_{j}</m>.</ret>
<error code="23000">Raises a "arrays must have same length" error if the lengths of <p>x</p> and <p>y</p> are not the same.</error>
</doc>
</fcn>
<fcn name="m.kernel.rbf">
<sig>
<par name="x"><array>double</array></par>
<par name="y"><array>double</array></par>
<par name="gamma">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Radial Basis Function (RBF) kernel function.</desc>
<param name="x">Length <p>n</p> vector.</param>
<param name="y">Length <p>n</p> vector.</param>
<param name="gamma">Gamma coefficient.</param>
<ret>Returns the result of <m>\mathrm{exp}(-\gamma || x - y ||^{2})</m>.</ret>
<error code="23010">Raises a "arrays must have same length" error if the lengths of <p>x</p> and <p>y</p> are not the same.</error>
</doc>
</fcn>
<fcn name="m.kernel.poly">
<sig>
<par name="x"><array>double</array></par>
<par name="y"><array>double</array></par>
<par name="gamma">double</par>
<par name="intercept">double</par>
<par name="degree">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Polynomial kernel function.</desc>
<param name="x">Length <p>n</p> vector.</param>
<param name="y">Length <p>n</p> vector.</param>
<param name="gamma">Gamma coefficient.</param>
<param name="intecept">Intercept constant.</param>
<param name="degree">Degree of the polynomial kernel.</param>
<ret>Returns the result of <m>(\gamma \sum_{i=1}^{n} x_{i} y_{j} + \mathrm{intercept})^{\mathrm{degree}}</m>.</ret>
<error code="23020">Raises a "arrays must have same length" error if the lengths of <p>x</p> and <p>y</p> are not the same.</error>
</doc>
</fcn>
<fcn name="m.kernel.sigmoid">
<sig>
<par name="x"><array>double</array></par>
<par name="y"><array>double</array></par>
<par name="gamma">double</par>
<par name="intercept">double</par>
<ret>double</ret>
</sig>
<doc>
<desc>Sigmoid kernel function.</desc>
<param name="x">Length <p>n</p> vector.</param>
<param name="y">Length <p>n</p> vector.</param>
<param name="gamma">Gamma coefficient.</param>
<param name="intecept">Intercept constant.</param>
<ret>Returns the result of <m>\mathrm{tanh}( \mathrm{gamma} \sum_{i=1}^{n} x_{i} y_{j} + \mathrm{intercept})</m>.</ret>
<error code="23030">Raises a "arrays must have same length" error if the lengths of <p>x</p> and <p>y</p> are not the same.</error>
</doc>
</fcn>
<fcn name="la.map">
<sig>
<par name="x"><array><array>double</array></array></par>
<par name="fcn">
<function>
<par>double</par>
<ret>double</ret>
</function></par>
<ret><array><array>double</array></array></ret>
</sig>
<sig>
<par name="x"><map><map>double</map></map></par>
<par name="fcn">
<function>
<par>double</par>
<ret>double</ret>
</function></par>
<ret><map><map>double</map></map></ret>
</sig>
<doc>
<desc>Apply <p>fcn</p> to each element from <p>x</p>.</desc>
<detail>This can be used to perform scalar multiplication on a matrix: supply a function that multiplies each element by a constant.</detail>
<detail>The order in which elements are computed is not specified, and may be in parallel.</detail>
</doc>
</fcn>
<fcn name="la.scale">
<sig>
<par name="x"><array>double</array></par>
<par name="alpha">double</par>
<ret><array>double</array></ret>
</sig>
<sig>
<par name="x"><array><array>double</array></array></par>
<par name="alpha">double</par>
<ret><array><array>double</array></array></ret>
</sig>
<sig>
<par name="x"><map>double</map></par>
<par name="alpha">double</par>
<ret><map>double</map></ret>
</sig>
<sig>
<par name="x"><map><map>double</map></map></par>
<par name="alpha">double</par>
<ret><map><map>double</map></map></ret>
</sig>
<doc>
<desc>Scale vector or matrix <p>x</p> by factor <p>alpha</p>.</desc>
<detail>The order in which elements are computed is not specified, and may be in parallel.</detail>
</doc>
</fcn>
<fcn name="la.zipmap">
<sig>
<par name="x"><array><array>double</array></array></par>
<par name="y"><array><array>double</array></array></par>
<par name="fcn">
<function>
<par>double</par>