code: static double lerp(double start_, double end_, double t) {
  		// When end == start, we want result to be equal to start, for all t
  		// values. At the same time, when end != start, we want the result to be
  		// equal to start for t==0 and end for t == 1.0
  		// The regular formula end_ * t + (1.0 - t) * start_, when end_ ==
  		// start_, and t at 1/3, produces value different from start
  		double v;
  		if (t <= 0.5)
  			v = start_ + (end_ - start_) * t;
  		else
  			v = end_ - (end_ - start_) * (1.0 - t);
  
  		assert (t < 0 || t > 1.0 || (v >= start_ && v <= end_) || (v <= start_ && v >= end_) || NumberUtils.isNaN(start_) || NumberUtils.isNaN(end_));
  		return v;
  	}
docs: Computes interpolation between two values, using the interpolation factor t.
  The interpolation formula is (end - start) * t + start.
  However, the computation ensures that t = 0 produces exactly start, and t = 1, produces exactly end.
  It also guarantees that for 0 <= t <= 1, the interpolated value v is between start and end.