fn insert_and_merge_range(ranges: &mut Vec<(f64, f64)>, start: f64, end: f64)
Insert a range into a sorted list, merging with any overlapping ranges.