code: func (pwl PieceWiseLinear) ValueAt(x uint64) float64 {
  	l := 0
  	h := len(pwl)
  	if h == 0 {
  		return 0
  	}
  	for h != l {
  		m := (l + h) / 2
  		if x > pwl[m].X {
  			l = m + 1
  		} else {
  			h = m
  		}
  	}
  	if l == 0 {
  		return float64(pwl[0].Y)
  	}
  	l--
  	if h == len(pwl) {
  		return float64(pwl[l].Y)
  	}
  	dx := pwl[h].X - pwl[l].X
  	if dx < 1 {
  		return float64(pwl[l].Y)
  	}
  	return float64(pwl[l].Y) + float64(pwl[h].Y-pwl[l].Y)*float64(x-pwl[l].X)/float64(dx)
  }
docs: // ValueAt returns the curve's value at a given point