Re: how to get around bug
- To: mathgroup at smc.vnet.net
- Subject: [mg94410] Re: how to get around bug
- From: "gam at iap.fr" <gam at iap.fr>
- Date: Fri, 12 Dec 2008 06:54:58 -0500 (EST)
- References: <ghr0vb$8or$1@smc.vnet.net>
On Dec 11, 12:27 pm, Bob Hanlon <hanl... at cox.net> wrote: > Since you know the workaround, define your own function. > > beta[z_, a_, b_, n_: 10] := > Module[{rz, ra, rb}, > {rz, ra, rb} = Rationalize[{z, a, b}, 0]; > N[Beta[rz, ra, rb], n]] > > beta[-1.7, 1.39646, -0.37188] > > -0.2065655322-0.6124813175 I > > Bob Hanlon > > ---- "g... at iap.fr" <g... at iap.fr> wrote: > > ============= > I've encountered a bug with the incomplete Beta function (both > versions 6.0 and 7.0), which I just submitted to support.wolfram.com. > > Beta[-1.7, 1.39646, -0.37188] > returns 0. + 0. i > > however > > Beta[N[-17/10, 10], N[139646/100000, 10], N[-37188/100000, 10]= ] > provides the correct answer: -0.20657 - 0.6125 i > > There is a relation between Beta[z,a,b] and Hypergeometric functions > Beta[z,a,b] = z^a/a Hypergeometric2F1[a,1-b,a+1,z] = z^a/a > Hypergeometric1F1[1-b,a+1,z]. > > If I estimate Hypergeometric2F1[a,1-b,a+1,z] for my values of z=-1.7, > a=1.39646, b=-0.37188, I get > Hypergeometric2F1[1.39646, 1.37188, 2.39646, -1.7] > returns 0 > > However, if I use Hypergeometric1F1[1-b,a+1,z]: > Hypergeometric1F1[1.37188, 2.39646, -1.7] > this returns a plausible value of 0.420134 > > So I believe that Beta and Hypergeometric2F1 are bugged, but not > Hypergeometric1F1. > > -- > > Bob Hanlon Thanks Bob, for your very elegant solution! Now I know about Rationalize. Gary