def _region_1(g1plus2g0, g0plus2g1, g0, g1, x):
  """Computes conditional and value for points in region 1."""
  is_region_1 = (((g1plus2g0 < 0) & (g0plus2g1 >= 0)) | ((g1plus2g0 > 0) &
                                                         (g0plus2g1 <= 0)))
  # Reference: Eq. 27 in Ref [2]
  # Quadratic form a x^2 + b x + c
  a, b, c = 3 * (g0 + g1), -2 * g1plus2g0, g0
  region_1_value = (a * x + b) * x + c
  # Integrated value is: x(1-x)(g0 (1-x) - g1 x)
  one_minus_x = 1 - x
  integrated_value = x * one_minus_x * (g0 * one_minus_x - g1 * x)
  return is_region_1, region_1_value, integrated_value