title: Find Harmonic Mean Using Arithmetic Mean Geometric Mean
signature: func findHarmonicMeanUsingArithmeticMeanGeometricMean(a int, b int) float64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual float64, expected float64) bool {
      return math.Abs(actual - expected) < 1e-09
  }
  
  func driver(a int, b int, expected float64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(a, b),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(54, 
  	83, 65.43065693430657)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(42, 
  	56, 48.0)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(63, 
  	12, 20.16)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(19, 
  	76, 30.4)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(41, 
  	50, 45.054945054945065)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(7, 
  	26, 11.030303030303031)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(39, 
  	42, 40.444444444444436)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(11, 
  	64, 18.773333333333333)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(96, 
  	81, 87.86440677966101)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(15, 
  	54, 23.47826086956522)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }