func chebyshev_init(dos []float64, nos int, eta float64) int {
	if nos < 1 {
		return 0
	}
	err := 0.0
	i := 0  
	for ii := 1; ii <= nos; ii++ {
		i = nos - ii
		err += abs(dos[i])
		if err > eta {
			return i
		}
	}
	return i
}
The Chebyshev series.
package fn