File: ProbFuncMathCore.h

package info (click to toggle)
bornagain 23.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 103,956 kB
  • sloc: cpp: 423,131; python: 40,997; javascript: 11,167; awk: 630; sh: 356; ruby: 173; xml: 130; makefile: 45; ansic: 24
file content (793 lines) | stat: -rw-r--r-- 21,973 bytes parent folder | download | duplicates (5)
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
// @(#)root/mathcore:$Id$
// Authors: L. Moneta, A. Zsenei   06/2005

/**********************************************************************
 *                                                                    *
 * Copyright (c) 2005 , LCG ROOT MathLib Team                         *
 *                                                                    *
 *                                                                    *
 **********************************************************************/

#ifndef ROOT_Math_ProbFuncMathCore
#define ROOT_Math_ProbFuncMathCore


namespace ROOT {
namespace Math {


   /** @defgroup ProbFunc Cumulative Distribution Functions (CDF)

   @ingroup StatFunc

   *  Cumulative distribution functions of various distributions.
   *  The functions with the extension <em>_cdf</em> calculate the
   *  lower tail integral of the probability density function
   *
   *  \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f]
   *
   *  while those with the <em>_cdf_c</em> extension calculate the complement of
   *  cumulative distribution function, called in statistics the survival
   *  function.
   *  It corresponds to the upper tail integral of the
   *  probability density function
   *
   *  \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f]
   *
   *
   * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_cdf</em> functions were called
   * <em>_quant</em> and the <em>_cdf_c</em> functions were called
   * <em>_prob</em>.
   * These names are currently kept for backward compatibility, but
   * their usage is deprecated.
   *
   *  These functions are defined in the header file <em>Math/ProbFunc.h<em> or in the global one
   *  including all statistical functions <em>Math/DistFunc.h<em>
   *
   */



   /**

   Complement of the cumulative distribution function of the beta distribution.
   Upper tail of the integral of the #beta_pdf

   @ingroup ProbFunc

   */

   double beta_cdf_c(double x, double a, double b);



   /**

   Cumulative distribution function of the beta distribution
   Upper tail of the integral of the #beta_pdf

   @ingroup ProbFunc

   */

   double beta_cdf(double x, double a, double b);




   /**

   Complement of the cumulative distribution function (upper tail) of the Breit_Wigner
   distribution and it is similar (just a different parameter definition) to the
   Cauchy distribution (see #cauchy_cdf_c )

   \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{\frac{1}{2} \Gamma}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f]


   @ingroup ProbFunc

   */
   double breitwigner_cdf_c(double x, double gamma, double x0 = 0);


   /**

   Cumulative distribution function (lower tail) of the Breit_Wigner
   distribution and it is similar (just a different parameter definition) to the
   Cauchy distribution (see #cauchy_cdf )

   \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{b}{x'^2 + (\frac{1}{2} \Gamma)^2} dx' \f]


   @ingroup ProbFunc

   */
   double breitwigner_cdf(double x, double gamma, double x0 = 0);



   /**

   Complement of the cumulative distribution function (upper tail) of the
   Cauchy distribution which is also Lorentzian distribution.
   It is similar (just a different parameter definition) to the
   Breit_Wigner distribution (see #breitwigner_cdf_c )

   \f[ D(x) = \int_{x}^{+\infty} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */
   double cauchy_cdf_c(double x, double b, double x0 = 0);




   /**

   Cumulative distribution function (lower tail) of the
   Cauchy distribution which is also Lorentzian distribution.
   It is similar (just a different parameter definition) to the
   Breit_Wigner distribution (see #breitwigner_cdf )

   \f[ D(x) = \int_{-\infty}^{x} \frac{1}{\pi} \frac{ b }{ (x'-m)^2 + b^2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/CauchyDistribution.html">
   Mathworld</A>.


   @ingroup ProbFunc

   */
   double cauchy_cdf(double x, double b, double x0 = 0);




   /**

   Complement of the cumulative distribution function of the \f$\chi^2\f$ distribution
   with \f$r\f$ degrees of freedom (upper tail).

   \f[ D_{r}(x) = \int_{x}^{+\infty} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
   Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double chisquared_cdf_c(double x, double r, double x0 = 0);



   /**

   Cumulative distribution function of the \f$\chi^2\f$ distribution
   with \f$r\f$ degrees of freedom (lower tail).

   \f[ D_{r}(x) = \int_{-\infty}^{x} \frac{1}{\Gamma(r/2) 2^{r/2}} x'^{r/2-1} e^{-x'/2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
   Mathworld</A>.   It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma_c,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double chisquared_cdf(double x, double r, double x0 = 0);


   /**

      Cumulative distribution for the Crystal Ball distribution function

      See the definition of the Crystal Ball function at
      <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function">
      Wikipedia</A>.

      The distribution is defined only for n > 1 when the integral converges

      @ingroup ProbFunc

   */
   double crystalball_cdf(double x, double alpha, double n, double sigma, double x0 = 0);

   /**

      Complement of the Cumulative distribution for the Crystal Ball distribution

      See the definition of the Crystal Ball function at
      <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function">
      Wikipedia</A>.

      The distribution is defined only for n > 1 when the integral converges

      @ingroup ProbFunc

   */
   double crystalball_cdf_c(double x, double alpha, double n, double sigma, double x0 = 0);

   /**
      Integral of the not-normalized Crystal Ball function

      See the definition of the Crystal Ball function at
      <A HREF="http://en.wikipedia.org/wiki/Crystal_Ball_function">
      Wikipedia</A>.

      see ROOT::Math::crystalball_function for the function evaluation.

      @ingroup ProbFunc

   */
   double crystalball_integral(double x, double alpha, double n, double sigma, double x0 = 0);

   /**

   Complement of the cumulative distribution function of the exponential distribution
   (upper tail).

   \f[ D(x) = \int_{x}^{+\infty} \lambda e^{-\lambda x'} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */

   double exponential_cdf_c(double x, double lambda, double x0 = 0);



   /**

   Cumulative distribution function of the exponential distribution
   (lower tail).

   \f[ D(x) = \int_{-\infty}^{x} \lambda e^{-\lambda x'} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/ExponentialDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */


   double exponential_cdf(double x, double lambda, double x0 = 0);



   /**

   Complement of the cumulative distribution function of the F-distribution
   (upper tail).

   \f[ D_{n,m}(x) = \int_{x}^{+\infty} \frac{\Gamma(\frac{n+m}{2})}{\Gamma(\frac{n}{2}) \Gamma(\frac{m}{2})} n^{n/2} m^{m/2} x'^{n/2 -1} (m+nx')^{-(n+m)/2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/F-Distribution.html">
   Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double fdistribution_cdf_c(double x, double n, double m, double x0 = 0);




   /**

   Cumulative distribution function of the F-distribution
   (lower tail).

   \f[ D_{n,m}(x) = \int_{-\infty}^{x} \frac{\Gamma(\frac{n+m}{2})}{\Gamma(\frac{n}{2}) \Gamma(\frac{m}{2})} n^{n/2} m^{m/2} x'^{n/2 -1} (m+nx')^{-(n+m)/2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/F-Distribution.html">
   Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double fdistribution_cdf(double x, double n, double m, double x0 = 0);



   /**

   Complement of the cumulative distribution function of the gamma distribution
   (upper tail).

   \f[ D(x) = \int_{x}^{+\infty} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/GammaDistribution.html">
   Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double gamma_cdf_c(double x, double alpha, double theta, double x0 = 0);




   /**

   Cumulative distribution function of the gamma distribution
   (lower tail).

   \f[ D(x) = \int_{-\infty}^{x} {1 \over \Gamma(\alpha) \theta^{\alpha}} x'^{\alpha-1} e^{-x'/\theta} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/GammaDistribution.html">
   Mathworld</A>. It is implemented using the incomplete gamma function, ROOT::Math::inc_gamma,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double gamma_cdf(double x, double alpha, double theta, double x0 = 0);



  /**

   Cumulative distribution function of the Landau
   distribution (lower tail).

   \f[ D(x) = \int_{-\infty}^{x} p(x) dx  \f]

   where \f$p(x)\f$ is the Landau probability density function :
  \f[ p(x) = \frac{1}{\xi} \phi (\lambda) \f]
   with
   \f[  \phi(\lambda) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} e^{\lambda s + s \log{s}} ds\f]
   with \f$\lambda = (x-x_0)/\xi\f$. For a detailed description see
   K.S. K&ouml;lbig and B. Schorr, A program package for the Landau distribution,
   <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A>
   <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>.
   The same algorithms as in
   <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/g110/top.html">
   CERNLIB</A> (DISLAN) is used.

   @param x The argument \f$x\f$
   @param xi The width parameter \f$\xi\f$
   @param x0 The location parameter \f$x_0\f$

   @ingroup ProbFunc

   */

   double landau_cdf(double x, double xi = 1, double x0 = 0);

  /**

     Complement of the distribution function of the Landau
     distribution (upper tail).

     \f[ D(x) = \int_{x}^{+\infty} p(x) dx  \f]

     where p(x) is the Landau probability density function.
     It is implemented simply as 1. - #landau_cdf

   @param x The argument \f$x\f$
   @param xi The width parameter \f$\xi\f$
   @param x0 The location parameter \f$x_0\f$

    @ingroup ProbFunc

  */
   inline double landau_cdf_c(double x, double xi = 1, double x0 = 0) {
      return 1. - landau_cdf(x,xi,x0);
   }

   /**

   Complement of the cumulative distribution function of the lognormal distribution
   (upper tail).

   \f[ D(x) = \int_{x}^{+\infty} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */

   double lognormal_cdf_c(double x, double m, double s, double x0 = 0);




   /**

   Cumulative distribution function of the lognormal distribution
   (lower tail).

   \f[ D(x) = \int_{-\infty}^{x} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'} - m)^2/2 s^2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */

   double lognormal_cdf(double x, double m, double s, double x0 = 0);




   /**

   Complement of the cumulative distribution function of the normal (Gaussian)
   distribution (upper tail).

   \f[ D(x) = \int_{x}^{+\infty} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */

   double normal_cdf_c(double x, double sigma = 1, double x0 = 0);
   /// Alternative name for same function
   inline double gaussian_cdf_c(double x, double sigma = 1, double x0 = 0) {
      return normal_cdf_c(x,sigma,x0);
   }



   /**

   Cumulative distribution function of the normal (Gaussian)
   distribution (lower tail).

   \f[ D(x) = \int_{-\infty}^{x} {1 \over \sqrt{2 \pi \sigma^2}} e^{-x'^2 / 2\sigma^2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
   Mathworld</A>.
   @ingroup ProbFunc

   */

   double normal_cdf(double x, double sigma = 1, double x0 = 0);
   /// Alternative name for same function
   inline double gaussian_cdf(double x, double sigma = 1, double x0 = 0) {
      return normal_cdf(x,sigma,x0);
   }



   /**

   Complement of the cumulative distribution function of Student's
   t-distribution (upper tail).

   \f[ D_{r}(x) = \int_{x}^{+\infty} \frac{\Gamma(\frac{r+1}{2})}{\sqrt{r \pi}\Gamma(\frac{r}{2})} \left( 1+\frac{x'^2}{r}\right)^{-(r+1)/2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
   Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double tdistribution_cdf_c(double x, double r, double x0 = 0);




   /**

   Cumulative distribution function of Student's
   t-distribution (lower tail).

   \f[ D_{r}(x) = \int_{-\infty}^{x} \frac{\Gamma(\frac{r+1}{2})}{\sqrt{r \pi}\Gamma(\frac{r}{2})} \left( 1+\frac{x'^2}{r}\right)^{-(r+1)/2} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
   Mathworld</A>. It is implemented using the incomplete beta function, ROOT::Math::inc_beta,
   from <A HREF="http://www.netlib.org/cephes">Cephes</A>

   @ingroup ProbFunc

   */

   double tdistribution_cdf(double x, double r, double x0 = 0);


   /**

   Complement of the cumulative distribution function of the uniform (flat)
   distribution (upper tail).

   \f[ D(x) = \int_{x}^{+\infty} {1 \over (b-a)} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/UniformDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */

   double uniform_cdf_c(double x, double a, double b, double x0 = 0);




   /**

   Cumulative distribution function of the uniform (flat)
   distribution (lower tail).

   \f[ D(x) = \int_{-\infty}^{x} {1 \over (b-a)} dx' \f]

   For detailed description see
   <A HREF="http://mathworld.wolfram.com/UniformDistribution.html">
   Mathworld</A>.

   @ingroup ProbFunc

   */

   double uniform_cdf(double x, double a, double b, double x0 = 0);




   /**

   Complement of the cumulative distribution function of the Poisson distribution.
   Upper tail of the integral of the #poisson_pdf

   @ingroup ProbFunc

   */

   double poisson_cdf_c(unsigned int n, double mu);

   /**

   Cumulative distribution function of the Poisson distribution
   Lower tail of the integral of the #poisson_pdf

   @ingroup ProbFunc

   */

   double poisson_cdf(unsigned int n, double mu);

   /**

   Complement of the cumulative distribution function of the Binomial distribution.
   Upper tail of the integral of the #binomial_pdf

   @ingroup ProbFunc

   */

   double binomial_cdf_c(unsigned int k, double p, unsigned int n);

   /**

   Cumulative distribution function of the Binomial distribution
   Lower tail of the integral of the #binomial_pdf

   @ingroup ProbFunc

   */

   double binomial_cdf(unsigned int k, double p, unsigned int n);


   /**

   Complement of the cumulative distribution function of the Negative Binomial distribution.
   Upper tail of the integral of the #negative_binomial_pdf

   @ingroup ProbFunc

   */

   double negative_binomial_cdf_c(unsigned int k, double p, double n);

   /**

   Cumulative distribution function of the Negative Binomial distribution
   Lower tail of the integral of the #negative_binomial_pdf

   @ingroup ProbFunc

   */

   double negative_binomial_cdf(unsigned int k, double p, double n);



#ifdef HAVE_OLD_STAT_FUNC

   /** @name Backward compatible MathCore CDF functions */


   inline double breitwigner_prob(double x, double gamma, double x0 = 0) {
      return  breitwigner_cdf_c(x,gamma,x0);
   }
   inline double breitwigner_quant(double x, double gamma, double x0 = 0) {
      return  breitwigner_cdf(x,gamma,x0);
   }

   inline double cauchy_prob(double x, double b, double x0 = 0) {
      return cauchy_cdf_c(x,b,x0);
   }
   inline double cauchy_quant(double x, double b, double x0 = 0) {
      return cauchy_cdf  (x,b,x0);
   }
   inline double chisquared_prob(double x, double r, double x0 = 0) {
      return chisquared_cdf_c(x, r, x0);
   }
   inline double chisquared_quant(double x, double r, double x0 = 0) {
      return chisquared_cdf  (x, r, x0);
   }
   inline double exponential_prob(double x, double lambda, double x0 = 0) {
      return exponential_cdf_c(x, lambda, x0 );
   }
   inline double exponential_quant(double x, double lambda, double x0 = 0) {
      return exponential_cdf  (x, lambda, x0 );
   }

   inline double gaussian_prob(double x, double sigma, double x0 = 0) {
      return  gaussian_cdf_c( x, sigma, x0 );
   }
   inline double gaussian_quant(double x, double sigma, double x0 = 0) {
      return  gaussian_cdf  ( x, sigma, x0 );
   }

   inline double lognormal_prob(double x, double m, double s, double x0 = 0) {
      return lognormal_cdf_c( x, m, s, x0 );
   }
   inline double lognormal_quant(double x, double m, double s, double x0 = 0) {
      return lognormal_cdf  ( x, m, s, x0 );
   }

   inline double normal_prob(double x, double sigma, double x0 = 0) {
      return  normal_cdf_c( x, sigma, x0 );
   }
   inline double normal_quant(double x, double sigma, double x0 = 0) {
      return  normal_cdf  ( x, sigma, x0 );
   }

   inline double uniform_prob(double x, double a, double b, double x0 = 0) {
      return uniform_cdf_c( x, a, b, x0 );
   }
   inline double uniform_quant(double x, double a, double b, double x0 = 0) {
      return uniform_cdf  ( x, a, b, x0 );
   }
   inline double fdistribution_prob(double x, double n, double m, double x0 = 0) {
      return fdistribution_cdf_c  (x, n, m, x0);
   }
   inline double fdistribution_quant(double x, double n, double m, double x0 = 0) {
      return fdistribution_cdf    (x, n, m, x0);
   }

   inline double gamma_prob(double x, double alpha, double theta, double x0 = 0) {
      return gamma_cdf_c (x, alpha, theta, x0);
   }
   inline double gamma_quant(double x, double alpha, double theta, double x0 = 0) {
      return gamma_cdf   (x, alpha, theta, x0);
   }

   inline double tdistribution_prob(double x, double r, double x0 = 0) {
      return tdistribution_cdf_c  (x, r, x0);
   }

   inline double tdistribution_quant(double x, double r, double x0 = 0) {
      return tdistribution_cdf    (x, r, x0);
   }

#endif

   /** @defgroup TruncFunc Statistical functions from truncated distributions

   @ingroup StatFunc

   Statistical functions for the truncated distributions. Examples of such functions are the
   first or the second momentum of the truncated distribution.
   In the case of the Landau, first and second momentum functions are provided for the Landau
   distribution truncated only on the right side.
   These functions are defined in the header file <em>Math/ProbFunc.h<em> or in the global one
   including all statistical functions <em>Math/StatFunc.h<em>

   */

   /**

   First moment (mean) of the truncated Landau distribution.
   \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t\, p(t) d t \f]
   where \f$p(x)\f$ is the Landau distribution
   and \f$D(x)\f$ its cumulative distribution function.

   For detailed description see
   K.S. K&ouml;lbig and B. Schorr, A program package for the Landau distribution,
   <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A>
   <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>.
   The same algorithms as in
   <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/g110/top.html">
   CERNLIB</A> (XM1LAN)  is used

   @param x The argument \f$x\f$
   @param xi The width parameter \f$\xi\f$
   @param x0 The location parameter \f$x_0\f$

   @ingroup TruncFunc

   */

   double landau_xm1(double x, double xi = 1, double x0 = 0);



   /**

   Second moment of the truncated Landau distribution.
   \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t^2\, p(t) d t \f]
   where \f$p(x)\f$ is the Landau distribution
   and \f$D(x)\f$ its cumulative distribution function.

   For detailed description see
   K.S. K&ouml;lbig and B. Schorr, A program package for the Landau distribution,
   <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. Comm. 31 (1984) 97-111</A>
   <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 (2008) 972]</A>.
   The same algorithms as in
   <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/g110/top.html">
   CERNLIB</A> (XM1LAN)  is used

   @param x The argument \f$x\f$
   @param xi The width parameter \f$\xi\f$
   @param x0 The location parameter \f$x_0\f$

   @ingroup TruncFunc

   */

   double landau_xm2(double x, double xi = 1, double x0 = 0);



} // namespace Math
} // namespace ROOT


#endif // ROOT_Math_ProbFuncMathCore