old_contents: from slm_lab.lib import math_util
  import numpy as np
  import pytest
  
  
  @pytest.mark.parametrize('vec,res', [
      ([1, 1, 1], [False, False, False]),
      ([1, 1, 2], [False, False, True]),
      ([[1, 1], [1, 1], [1, 2]], [False, False, True]),
  ])
  def test_is_outlier(vec, res):
      assert np.array_equal(util.is_outlier(vec), res)
  
  
  @pytest.mark.parametrize('start_val, end_val, start_step, end_step, step, correct', [
      (0.1, 0.0, 0, 100, 0, 0.1),
      (0.1, 0.0, 0, 100, 50, 0.05),
      (0.1, 0.0, 0, 100, 100, 0.0),
      (0.1, 0.0, 0, 100, 150, 0.0),
      (0.1, 0.0, 100, 200, 50, 0.1),
      (0.1, 0.0, 100, 200, 100, 0.1),
      (0.1, 0.0, 100, 200, 150, 0.05),
      (0.1, 0.0, 100, 200, 200, 0.0),
      (0.1, 0.0, 100, 200, 250, 0.0),
  ])
  def test_linear_decay(start_val, end_val, start_step, end_step, step, correct):
      assert math_util.linear_decay(start_val, end_val, start_step, end_step, step) == correct
  
  
  @pytest.mark.parametrize('start_val, end_val, start_step, end_step, step, correct', [
      (1.0, 0.0, 0, 100, 0, 1.0),
      (1.0, 0.0, 0, 100, 5, 0.9),
      (1.0, 0.0, 0, 100, 10, 0.81),
      (1.0, 0.0, 0, 100, 25, 0.59049),
      (1.0, 0.0, 0, 100, 50, 0.3486784401),
      (1.0, 0.0, 0, 100, 100, 0.0),
      (1.0, 0.0, 0, 100, 150, 0.0),
      (1.0, 0.0, 100, 200, 0, 1.0),
      (1.0, 0.0, 100, 200, 50, 1.0),
      (1.0, 0.0, 100, 200, 100, 1.0),
      (1.0, 0.0, 100, 200, 105, 0.9),
      (1.0, 0.0, 100, 200, 125, 0.59049),
      (1.0, 0.0, 100, 200, 200, 0.0),
      (1.0, 0.0, 100, 200, 250, 0.0),
  ])
  def test_rate_decay(start_val, end_val, start_step, end_step, step, correct):
      np.testing.assert_almost_equal(math_util.rate_decay(start_val, end_val, start_step, end_step, step), correct)
  
new_contents: from slm_lab.lib import math_util
  import numpy as np
  import pytest
  
  
  @pytest.mark.parametrize('vec,res', [
      ([1, 1, 1], [False, False, False]),
      ([1, 1, 2], [False, False, True]),
      ([[1, 1], [1, 1], [1, 2]], [False, False, True]),
  ])
  def test_is_outlier(vec, res):
      assert np.array_equal(math_util.is_outlier(vec), res)
  
  
  @pytest.mark.parametrize('start_val, end_val, start_step, end_step, step, correct', [
      (0.1, 0.0, 0, 100, 0, 0.1),
      (0.1, 0.0, 0, 100, 50, 0.05),
      (0.1, 0.0, 0, 100, 100, 0.0),
      (0.1, 0.0, 0, 100, 150, 0.0),
      (0.1, 0.0, 100, 200, 50, 0.1),
      (0.1, 0.0, 100, 200, 100, 0.1),
      (0.1, 0.0, 100, 200, 150, 0.05),
      (0.1, 0.0, 100, 200, 200, 0.0),
      (0.1, 0.0, 100, 200, 250, 0.0),
  ])
  def test_linear_decay(start_val, end_val, start_step, end_step, step, correct):
      assert math_util.linear_decay(start_val, end_val, start_step, end_step, step) == correct
  
  
  @pytest.mark.parametrize('start_val, end_val, start_step, end_step, step, correct', [
      (1.0, 0.0, 0, 100, 0, 1.0),
      (1.0, 0.0, 0, 100, 5, 0.9),
      (1.0, 0.0, 0, 100, 10, 0.81),
      (1.0, 0.0, 0, 100, 25, 0.59049),
      (1.0, 0.0, 0, 100, 50, 0.3486784401),
      (1.0, 0.0, 0, 100, 100, 0.0),
      (1.0, 0.0, 0, 100, 150, 0.0),
      (1.0, 0.0, 100, 200, 0, 1.0),
      (1.0, 0.0, 100, 200, 50, 1.0),
      (1.0, 0.0, 100, 200, 100, 1.0),
      (1.0, 0.0, 100, 200, 105, 0.9),
      (1.0, 0.0, 100, 200, 125, 0.59049),
      (1.0, 0.0, 100, 200, 200, 0.0),
      (1.0, 0.0, 100, 200, 250, 0.0),
  ])
  def test_rate_decay(start_val, end_val, start_step, end_step, step, correct):
      np.testing.assert_almost_equal(math_util.rate_decay(start_val, end_val, start_step, end_step, step), correct)
  
subject: fix math util test