btdtr.c 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* btdtr.c
  2. *
  3. * Beta distribution
  4. *
  5. *
  6. *
  7. * SYNOPSIS:
  8. *
  9. * double a, b, x, y, btdtr();
  10. *
  11. * y = btdtr( a, b, x );
  12. *
  13. *
  14. *
  15. * DESCRIPTION:
  16. *
  17. * Returns the area from zero to x under the beta density
  18. * function:
  19. *
  20. *
  21. * x
  22. * - -
  23. * | (a+b) | | a-1 b-1
  24. * P(x) = ---------- | t (1-t) dt
  25. * - - | |
  26. * | (a) | (b) -
  27. * 0
  28. *
  29. *
  30. * This function is identical to the incomplete beta
  31. * integral function incbet(a, b, x).
  32. *
  33. * The complemented function is
  34. *
  35. * 1 - P(1-x) = incbet( b, a, x );
  36. *
  37. *
  38. * ACCURACY:
  39. *
  40. * See incbet.c.
  41. *
  42. */
  43. /* btdtr() */
  44. /*
  45. Cephes Math Library Release 2.8: June, 2000
  46. Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
  47. */
  48. #include <math.h>
  49. #ifdef ANSIPROT
  50. extern double incbet ( double, double, double );
  51. #else
  52. double incbet();
  53. #endif
  54. double btdtr( a, b, x )
  55. double a, b, x;
  56. {
  57. return( incbet( a, b, x ) );
  58. }