code: func betacf(x, a, b float64) float64 {
  	const maxIterations = 200
  	const epsilon = 3e-14
  
  	raiseZero := func(z float64) float64 {
  		if math.Abs(z) < math.SmallestNonzeroFloat64 {
  			return math.SmallestNonzeroFloat64
  		}
  		return z
  	}
  
  	c := 1.0
  	d := 1 / raiseZero(1-(a+b)*x/(a+1))
  	h := d
  	for m := 1; m <= maxIterations; m++ {
  		mf := float64(m)
  
  		// Even step of the recurrence.
  		numer := mf * (b - mf) * x / ((a + 2*mf - 1) * (a + 2*mf))
  		d = 1 / raiseZero(1+numer*d)
  		c = raiseZero(1 + numer/c)
  		h *= d * c
  
  		// Odd step of the recurrence.
  		numer = -(a + mf) * (a + b + mf) * x / ((a + 2*mf) * (a + 2*mf + 1))
  		d = 1 / raiseZero(1+numer*d)
  		c = raiseZero(1 + numer/c)
  		hfac := d * c
  		h *= hfac
  
  		if math.Abs(hfac-1) < epsilon {
  			return h
  		}
  	}
  	panic("betainc: a or b too big; failed to converge")
  }
docs: // betacf is the continued fraction component of the regularized
  // incomplete beta function Iₓ(a, b).