title: Find Harmonic Mean Using Arithmetic Mean Geometric Mean
signature: function find_harmonic_mean_using_arithmetic_mean_geometric_mean(a, b)
source_py: def find_harmonic_mean_using_arithmetic_mean_geometric_mean(a, b):
      AM = ((a + b) / 2)
      GM = math.sqrt((a * b))
      HM = ((GM * GM) / AM)
      return HM
source_cpp: double find_harmonic_mean_using_arithmetic_mean_geometric_mean(int a, int b) {
    double AM, GM, HM;
    AM = ( a + b ) / 2;
    GM = sqrt ( a * b );
    HM = ( GM * GM ) / AM;
    return HM;
  }
question_info.entry_fn_name: find_harmonic_mean_using_arithmetic_mean_geometric_mean
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return math.abs(actual - expected) < 1e-09
  end
  
  function driver(a, b, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(a, b) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(54, 83, 65.43065693430657)
      print(string.format("TEST-0...%s",result))
  
      result = driver(42, 56, 48.0)
      print(string.format("TEST-1...%s",result))
  
      result = driver(63, 12, 20.16)
      print(string.format("TEST-2...%s",result))
  
      result = driver(19, 76, 30.4)
      print(string.format("TEST-3...%s",result))
  
      result = driver(41, 50, 45.054945054945065)
      print(string.format("TEST-4...%s",result))
  
      result = driver(7, 26, 11.030303030303031)
      print(string.format("TEST-5...%s",result))
  
      result = driver(39, 42, 40.444444444444436)
      print(string.format("TEST-6...%s",result))
  
      result = driver(11, 64, 18.773333333333333)
      print(string.format("TEST-7...%s",result))
  
      result = driver(96, 81, 87.86440677966101)
      print(string.format("TEST-8...%s",result))
  
      result = driver(15, 54, 23.47826086956522)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 65.43065693430657, "inputs": {"a": 54, "b": 83}}, {"idx": 1, "outputs": 48.0, "inputs": {"a": 42, "b": 56}}, {"idx": 2, "outputs": 20.16, "inputs": {"a": 63, "b": 12}}, {"idx": 3, "outputs": 30.4, "inputs": {"a": 19, "b": 76}}, {"idx": 4, "outputs": 45.054945054945065, "inputs": {"a": 41, "b": 50}}, {"idx": 5, "outputs": 11.030303030303031, "inputs": {"a": 7, "b": 26}}, {"idx": 6, "outputs": 40.444444444444436, "inputs": {"a": 39, "b": 42}}, {"idx": 7, "outputs": 18.773333333333333, "inputs": {"a": 11, "b": 64}}, {"idx": 8, "outputs": 87.86440677966101, "inputs": {"a": 96, "b": 81}}, {"idx": 9, "outputs": 23.47826086956522, "inputs": {"a": 15, "b": 54}}]