public double Function(double x) { double y = alpha * x; if (y > range.Max) return range.Max; else if (y < range.Min) return range.Min; return y; }