///|
/// Generate a deterministic resting RR fixture for tests and benchmarks.
pub fn generate_resting_fixture(
  length : Int,
  baseline : Double,
) -> Array[Double] {
  let result = []
  let count = if length < 0 { 0 } else { length }
  for i in 0.. Array[Double] {
  let result = []
  let count = if length < 0 { 0 } else { length }
  for i in 0.. Array[Double] {
  let result = []
  for value in values {
    result.push(value)
  }
  if result.length() > 3 {
    result[3] = 180.0
  }
  if result.length() > 11 {
    result[11] = 2200.0
  }
  if result.length() > 19 {
    result[19] = result[18]
  }
  if result.length() > 27 {
    result[27] = 0.0 / 0.0
  }
  result
}

///|
/// Repeat a fixture without sharing its backing array.
pub fn repeat_fixture(
  values : Array[Double],
  repetitions : Int,
) -> Array[Double] {
  let result = []
  let count = if repetitions < 0 { 0 } else { repetitions }
  for _ in 0..