code: 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
  
file_path: tf-quant-finance/tf_quant_finance/rates/hagan_west/monotone_convex.py
imports: import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance.math import piecewise
  from tf_quant_finance.math.diff_ops import diff
  from tf_quant_finance.rates.analytics import forwards
label_desc: Use image node_id 5 for calling a global function with example usage: _region_1(g1plus2g0, g0plus2g1, g0, g1, x) and returns: is_region_1,  region_1_value,  integrated_value