[Question]
  [
disclaimer: the Mean mean is made up by me
Define the arithmetic mean of \$n\$ numbers as
$$M\_1(x\_1,...,x\_n)=\frac{x\_1+x\_2+...+x\_n}{n}$$
Define the geometric mean of \$n\$ numbers as
$$M\_0(x\_1,...,x\_n)=\root{n}\of{x\_1x\_2...x\_n}$$
Define the harmonic mean of \$n\$ numbers as
$$M\_{-1}(x\_1,...,x\_n)=\frac{n}{\frac{1}{x\_2} + \frac{1}{x\_2} + ... + \frac{1}{x\_n}}$$
Define the quadratic mean of \$n\$ numbers as
$$M\_2(x\_1,...,x\_n)=\root\of{\frac{x\_1^2+x\_2^2+...+x\_n^2}{n}}$$
The Mean mean (\$M\_M\$) is defined as follows:
Define four sequences (\$a\_k, b\_k, c\_k, d\_k\$) as $$a\_0=M\_1(x\_1,...,x\_n),\\b\_0=M\_0(x\_1,...,x\_n),\\c\_0=M\_{-1}(x\_1,...,x\_n),\\d\_0=M\_2(x\_1,...,x\_n),\\
a\_{k+1}=M\_1(a\_k,b\_k,c\_k,d\_k),\\b\_{k+1}=M\_0(a\_k,b\_k,c\_k,d\_k),\\c\_{k+1}=M\_{-1}(a\_k,b\_k,c\_k,d\_k),\\d\_{k+1}=M\_2(a\_k,b\_k,c\_k,d\_k)$$
All four sequences converge to the same number, \$M\_M(x\_1,x\_2,...,x\_n)\$.
## Example
The Mean mean of 1 and 2 is calculated as follows: start with $$a\_0 = (1+2)/2 = 1.5, b\_0 = \root\of{1 \* 2} = \root\of2 \approx 1.4142,\\ c\_0 = \frac2{\frac1{1}+\frac1{2}} = \frac4{3} \approx 1.3333, d\_0 = \root\of{\frac{1^2+2^2}2} = \root\of{\frac5{2}} \approx 1.5811.$$
Then
$$a\_1 = \frac{1.5+1.4142+1.3333+1.5811}4 \approx 1.4571,\\ b\_1 = \root^4\of{1.5\*1.4142\*1.3333\*1.5811} \approx 1.4542,\\ c\_1 = \frac4{\frac1{1.5}+\frac1{1.4142}+\frac1{1.3333}+\frac1{1.5811}} \approx 1.4512,\\ d\_1 = \root\of{\frac{1.5^2+1.4142^2+1.3333^2+1.5811^2}4} \approx 1.4601.$$
The further calculation of the sequences should be clear. It can be seen that they converge to the same number, approximately \$1.45568889\$.
## Challenge
Given two positive real numbers, \$a\$ and \$b\$ (\$a<b\$), calculate their Mean mean \$M\_M(a,b)\$.
## Test cases
```
1 1 => 1
1 2 => 1.45568889
100 200 => 145.568889
2.71 3.14 => 2.92103713
0.57 1.78 => 1.0848205
1.61 2.41 => 1.98965438
0.01 100 => 6.7483058
```
# Notes
* Your program is valid if the difference between its output and the correct output is not greater than 1/100000 of the absolute value of the difference between input numbers.
* The output should be a single number.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code wins!
  
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 52 bytes
```
#//.x_:>N@{M@x,E^M@Log@x,1/M[1/x],M[x^2]^.5}&
M=Mean
```
[Try it online!](https://tio.run/##JYuxCoMwFEX3fkVAcHq85KVapWDJ0q0p3UMsoUjqoIXiEJB8exrtdM7l3ju55T1MbhlfLvkuFZxjeJ4vd7VqFeDaa3X7@GzEtSEeLGgTeml7rGN50J0e3Jwe33FemPKmsMaQtSVXjK0rAUVgGXKHECCF2FRiQwyOSNWWBNYNA8Km3Wd4yp3Eiv6dyClfY0zpBw "Wolfram Language (Mathematica) – Try It Online")
In my first approach I used these builtins  
`Mean` `GeometricMean` `HarmonicMean` and `RootMeanSquare` 
Here are some substitutions for saving bytes 
`HarmonicMean` --> `1/Mean[1/x]` by @Robin Ryder (3 bytes saved)  
`GeometricMean` --> `E^Mean@Log@x` by @A. Rex (2 bytes saved)  
`RootMeanSquare` --> `Mean[x^2]^.5` by @A. Rex (4 bytes saved) 
finally we can assign `Mean` to `M` (as proposed by @ovs) and save 5 more bytes 
[Answer]
# R, ~~70~~ ~~69~~ 67 bytes
```
x=scan();`?`=mean;while(x-?x)x=c((?x^2)^.5,?x,2^?log2(x),1/?1/x);?x
```
[Try it online!](https://tio.run/##BcFBCoAgEAXQfSeZAUscaCUyN5FEpAIzqEX/9tN7jxnSW8sgjptu6WplxO84eyPMCkaqRIosnJfVKZxk7fcuBHbBa/DgqLAwif0)
-1 byte with better conditioning.  
-2 bytes by switching to base 2.
Like some other answers, this uses the expression of the geometric mean as an arithmetic mean on the log scale (here in base 2):
$$M\_0(x\_1,\ldots, x\_n) = 2^{M\_1(\log\_2 x\_1,\ldots,\log\_2 x\_n)}.$$
It also uses the [fact](https://en.wikipedia.org/wiki/Generalized_mean#Generalized_mean_inequality) that \$\forall k, d\_k\geq a\_k \geq b\_k\geq c\_k\$, i.e. \$d\_k=\max(a\_k, b\_k, c\_k, d\_k)\$. The condition \$a\_k=b\_k=c\_k=d\_k\$ is therefore equivalent to \$d\_k = M\_1(a\_k, b\_k, c\_k, d\_k)\$, which is what I use in the while loop; this is achieved by abusing the syntax of `while` which only considers the first element when the condition is a vector, hence the order in which the means are stored. (Note that we could also use \$c\_k\$ instead since it is the minimum of the four, but we could not use \$a\_k\$ or \$b\_k\$ in the condition.)
When we exit the while loop, `x` is a constant vector. The final `?x` computes its mean to reduce it to a scalar.
[Answer]
# [J](http://jsoftware.com/), 34 bytes
(31 as an expression without the assignment to variable `f`)
```
f=:1{(^.z,%z,*:z,[z=:(+/%#)&.:)^:_
```
[Try it online!](https://tio.run/##y/r/P83WyrBaI06vSke1SkfLqkonusrWSkNbX1VZU03PSjPOKv5/anJGvkKagqGC0X8A "J – Try It Online")
For functions `a` and `b`, `a &.: b` ("a under b" ([related challenge](https://codegolf.stackexchange.com/questions/176865/conjugation-in-real-life))) is equivalent to `(b inv) a b` -- apply b, then a, then inverse of b. In this case, geometric/harmonic/quadratic mean is the arithmetic mean "under" logarithm, inversion, and square respectively.
[Answer]
# TI-BASIC, ~~42~~ ~~35~~ 34 bytes
*-1 byte thanks to @SolomonUcko*
```
While max(ΔList(Ans:{mean(Ans),√(mean(Ans²)),mean(Ans^-1)^-1,e^(mean(ln(Ans:End:Ans(1
```
Input is a list of two integers in `Ans`.  
Output is stored in `Ans` and is automatically printed out when the program completes.
Formulas used for geometric, harmonic, and quadratic means are based off of [user202729's explanation](https://codegolf.stackexchange.com/a/182469/85765).
**Example:**
```
{1,2
           {1 2}
prgmCDGFB
     1.455688891
{100,200
       {100 200}
prgmCDGFB
     145.5688891
```
**Explanation:**  
(Newlines have been added for clarification. They do **NOT** appear in the code.)
```
While max(ΔList(Ans           ;loop until all elements of the current list are equal
                              ; the maximum of the change in each element will be 0
{                             ;create a list containing...
 mean(Ans),                   ; the arithmetic mean
 √(mean(Ans²)),               ; the quadratic mean
 mean(Ans^-1)^-1,             ; the harmonic mean
 e^(mean(ln(Ans               ; and the geometric mean
End
Ans(1                         ;keep the first element in "Ans" and implicitly print it
```
---
**Notes:**
TI-BASIC is a tokenized language. Character count does *not* equal byte count.
`e^(` is [this](http://tibasicdev.wikidot.com/e-exponent) one-byte token.
`^-1` is used for [this](http://tibasicdev.wikidot.com/inverse) one-byte token.  
I opted for writing `^-1` instead because the token looks like `ֿ¹` when in a code block.
`√(` is [this](http://tibasicdev.wikidot.com/square-root) one-byte token.
`ΔList(` is [this](http://tibasicdev.wikidot.com/deltalist) two-byte token.
[Answer]
# Java 10, ~~234~~ ~~229~~ ~~214~~ ~~211~~ ~~215~~ ~~206~~ ~~203~~ ~~196~~ ~~180~~ 177 bytes
```
a->{for(;a[1]-a[0]>4e-9;){double l=a.length,A[]={0,0,0,1};for(var d:a){A[2]+=d/l;A[3]*=Math.pow(d,1/l);A[0]+=1/d;A[1]+=d*d;}A[0]=l/A[0];A[1]=Math.sqrt(A[1]/l);a=A;}return a[0];}
```
-5 bytes thanks to *@PeterCordes*.  
-15 more bytes thanks to *@PeterCordes*, inspired by [*@RobinRyder*'s R answer](https://codegolf.stackexchange.com/a/182478/52210).  
+4 bytes because I assumed the inputs are pre-ordered.  
-27 bytes thanks to *@OlivierGrégoire*.
[Try it online.](https://tio.run/##fVLLjoIwFN37FY0rUCgtOuOMDSZ8gG5cMizuQFWcWpxSNIbw7U4LmrgYTZO299V7zrndwwn8ff5zzQRUFVpCIZsBQoXUXG0g42hlTYTysv4WHGVOf0lSBC4zkXZgtkqDLjK0QhJF6Ar@otmUymGQ0NSHhKSLKfc/mdvcHhERYMHlVu@8OEmjhnh20ZbZqhMolM/BbeIkTMdRHggWJ5N0FC1B7/CxPDu5RwPhGi8xcRrk5kZt5ihnrXVGIrBH5@6rql@lHWvaOohi1iquayWRBcfaK7MkjgabIXHjciqLHB2MGs5aq0JuO8K9FJpX2pH8jO5SNNSA79T4Pxi@CBLihYQ8TwjxjHoTTKfPUwh@m3kUzz5etMHvBgaehq9eIYbGHcrjWDspuoKH2fdSrC@V5gdc1hofjUpaSGdvPhSudSFwrBRcKqzLXkEH3PFw/qWHY4kzY9z6tNc/)
**Explanation:**
```
a->{                        // Method with double-array parameter and double return-type
  for(;a[1]-a[0]            //  Loop as long as the difference between the 2nd and 1st items
                >4e-9;){    //  is larger than 0.000000004:
    double l=a.length,      //   Set `l` to the amount of values in the array `a`
           A[]={0,0,0,1};   //   Create an array `A`, filled with the values [0,0,0,1]
    for(var d:a){           //   Inner loop over the values of `a`:
      A[2]+=d/l;            //    Calculate the sum divided by the length in the third spot
      A[3]*=Math.pow(d,1/l);//    The product of the power of 1/length in the fourth spot
      A[0]+=1/d;            //    The sum of 1/value in the first spot
      A[1]+=d*d;            //    And the sum of squares in the second spot
    }                       //   After the inner loop:
                            //   (the third spot of the array now holds the Arithmetic Mean)
                            //   (the fourth spot of the array now holds the Geometric Mean)
    A[0]=l/A[0];            //   Divide the length by the first spot
                            //   (this first spot of the array now holds the Harmonic Mean)
    A[1]=Math.sqrt(A[1]/l); //   Take the square of the second spot divided by the length
                            //   (this second spot of the array now holds the Quadratic Mean)
    a=A;                    //   And then replace input `a` with array `A`
  }                         //  After the outer loop when all values are approximately equal:
  return a[0];}             //  Return the value in the first spot as result
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 40 bytes
```
Ｗ‹⌊θ⌈θ≔⟦∕ΣθＬθＸΠθ∕¹Ｌθ∕ＬθΣ∕¹θ₂∕ΣＸθ²Ｌθ⟧θＩ⊟θ
```
[Try it online!](https://tio.run/##VY25DoMwEET7fIXLteQUoaWKkhIkFErLhQUWrAR2fAD5e4dLgXSr2Tfzqla6ysguxqnFThHIlPeQo8Z@6MFSRnL52W9Kyd17bDTwJ45YKyh3JlO6Ce2CMFKYSTkonKmHKqzfHb6duSP@ZYwscwe8UaUdpFMvYwKcpJvEMpLQP71YaumlcKgDPKQPM/lefWmMnM@riRDxOnZf "Charcoal – Try It Online") Link is to verbose version of code. Takes input as an array of numbers. Explanation:
```
Ｗ‹⌊θ⌈θ
```
Repeat while the array contains different values...
```
≔⟦....⟧θ
```
... replace the array with a list of values:
```
∕ΣθＬθ
```
... the mean...
```
ＸΠθ∕¹Ｌθ
```
... the geometric mean...
```
∕ＬθΣ∕¹θ
```
... the harmonic mean...
```
₂∕ΣＸθ²Ｌθ
```
... and the root mean square.
```
Ｉ⊟θ
```
Cast an element of the array to string and implicitly print it.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 24 bytes
```
;µ*Ɱ-;Ø½¤©Æm*İɼ;P½½ƊµÐLḢ
```
[Try it online!](https://tio.run/##ATkAxv9qZWxsef//O8K1KuKxri07w5jCvcKkwqnDhm0qxLDJvDtQwr3CvcaKwrXDkEzhuKL///9bMSwgMl0 "Jelly – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~25~~ 24 bytes
```
Wẋ4¹ÆlÆeƭ²½ƭİ4ƭÆm$€⁺µÐLḢ
```
[Try it online!](https://tio.run/##y0rNyan8/z/84a5uk0M7D7flHG5LPbb20KZDe4@tPbLB5Njaw225Ko@a1jxq3HVo6@EJPg93LPp/dNLDnTOsHzXMUdC1U3jUMNf6cDvX4Xagosj//6MNdQxjdYCkEYg0MNAxMjAAsoz0zA11jPUMTYBsAz1Tcx1DPXMLkAo9M6BSPRNDsLgBUDNQOQA "Jelly – Try It Online")
### Explanation
```
                    µÐL | Repeat until unchanged:
W                       |   Wrap as a list
 ẋ4                     |   Copy list 4 times
                   ⁺    |   Do twice:
                 $€     |     For each copy of the list:
             4ƭ         |     One of these functions, cycling between them:
   ¹                    |       Identity
    ÆlÆeƭ               |       Alternate between log and exp
         ²½ƭ            |       Alternate between square and square root
            İ           |       Reciprocal
               Æm       |    Then take the mean
                       Ḣ| Finally take the first item
```
[Answer]
# [PowerShell](https://docs.microsoft.com/en-us/powershell/), ~~182~~ ~~180~~ 183 bytes
```
$f={$a=$c=$d=$n=0
$b=1
$m=[math]
$args|%{$n++
$a+=$_
$b*=$_
$c+=1/$_
$d+=+$_*$_}
$p=($a/$n),$m::pow($b,1/$n),($n/$c),$m::sqrt($d/$n)|%{$m::round($_,9)}
if($p-ne$p[0]){$p=&$f @p}$p[0]}
```
[Try it online!](https://tio.run/##NZDRjoIwEEXf@xXzMAoK1hZaKCbd@B@uISi6mmhlwY0PyLezA@w@NL09d@ZOptXjdaqby@l263s82xYLi0eLpUVnBcODlQzvdncvnpc9w6L@at6zFl0Q0COwmFPJcryOgZXrQZSBDTBfYt4xrKyPxRrdIsT7ZlM9Xj4eQjkCH90aj5PRfNdPH8uBD@lE6sePK33Mw2zRsevZx2rlTljtxH7RUuocz7CtuhF0/dZjEiTYD5AkolFwpXVijMmYFAIiOgNVmv/RiKcSYi7VwCOeRVLEqYyZ4Dql7tRMKcIoEwnNJE8omatpCs9MlmgVGyoXNHpKT3iqTCy0Yd4WVk11uz7B@3QevGHWMgAsQqD1AWuw/z59GMAcaB0syGRd/ws)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~26~~ ~~24~~ 23 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Δ©ÅA®.²ÅAo®zÅAz®nÅAt)}н
```
[Try it online](https://tio.run/##yy9OTMpM/f//3JRDKw@3Oh5ap3doE5DOP7SuCkhVHVqXB6RKNGsv7P3/P9pQxygWAA) or [see the steps of all test cases](https://tio.run/##MzBNTDJM/V92aJt9pb2SwqO2SQpK9pX/z005tPJwq@OhdXqHNgHp/EPrqoBU1aF1eUCqRPO/i87/6GhDHcNYHQUgZQSmDAx0jAwMQEwjPXNDHWM9QxMQx0DP1BzOMdQzAyrXMzGEyBgAjQBqiQUA).
-1 byte thanks to *@Grimy*.
**23 byter alternative for Geometric mean:**
```
Δ©P®gzm®ÅA®zÅAz®nÅAt)}н
```
[Try it online](https://tio.run/##yy9OTMpM/f//3JRDKwMOrUuvyj207nCr46F1VUCy6tC6PCBVoll7Ye///9GGOkaxAA) or [see the steps of all test cases](https://tio.run/##MzBNTDJM/V92aJt9pb2SwqO2SQpK9pX/z005tDLg0Lr0qtxD6w63Oh5aVwUkqw6tywNSJZr/XXT@R0cb6hjG6igAKSMwZWCgY2RgAGIa6Zkb6hjrGZqAOAZ6puZwjqGeGVC5nokhRMYAaARQSywA).
**Explanation:**
```
Δ         # Loop until the list no longer changes:
 ©        #  Store the current list in variable `®` (without popping)
          #  (which is the implicit input-list in the first iteration)
          #  Arithmetic mean:
  ÅA      #   Builtin to calculate the arithmetic mean of the list
          #  Geometric mean:
  ®.²     #   Take the base-2 logarithm of each value in the list `®`
     ÅA   #   Get the arithmetic mean of that list
       o  #   And take 2 to the power of this mean
          #  Harmonic mean:
  ®z      #   Get 1/x for each value x in the list `®`
    ÅA    #   Get the arithmetic mean of that list
      z   #   And calculate 1/y for this mean y
          #  Quadratic mean:
  ®n      #   Take the square of each number x in the list from the register
    ÅA    #   Calculate the arithmetic mean of this list
      t   #   And take the square-root of that mean
  )       #  Wrap all four results into a list
}н        # After the list no longer changes: pop and push its first value
          # (which is output implicitly as result)
```
[Answer]
# x86 machine code (SIMD 4x float using 128-bit SSE1&AVX) 94 bytes
# x86 machine code (SIMD 4x double using 256-bit AVX) 123 bytes
`float` passes the test cases in the question, but with a loop-exit threshold small enough to make that happen, it's easy for it to get stuck in an infinite loop with random inputs.
SSE1 packed-single-precision instructions are 3 bytes long, but SSE2 and simple AVX instructions are 4 bytes long. (Scalar-single instructions like `sqrtss` are also 4 bytes long, which is why I use `sqrtps` even though I only care about the low element. It's not even slower than sqrtss on modern hardware). I used AVX for non-destructive destination to save 2 bytes vs. movaps+op.  
 In the double version we can still do a couple `movlhps` to copy 64-bit chunks (because often we only care about the low element of a horizontal sum). Horizontal sum of a 256-bit SIMD vector also requires an extra `vextractf128` to get the high half, vs. the [slow but small 2x `haddps` strategy for float](https://stackoverflow.com/questions/6996764/fastest-way-to-do-horizontal-float-vector-sum-on-x86). The `double` version also needs 2x 8-byte constants, instead of 2x 4-byte. Overall it comes out at close to 4/3 the size of the `float` version.
**`mean(a,b) = mean(a,a,b,b)` for all 4 of these means**, so we can simply duplicate the input up to 4 elements and never have to implement length=2. Thus we can hardcode geometric mean as 4th-root = sqrt(sqrt), for example. And we only need one FP constant, `4.0`.
**We have a single SIMD vector of all 4 `[a_i, b_i, c_i, d_i]`. From that, we calculate the 4 means as scalars in separate registers, and shuffle them back together for the next iteration.** (Horizontal operations on SIMD vectors are inconvenient, but we need to do the same thing for all 4 elements in enough cases that it balances out. I started on an x87 version of this, but it was getting very long and not fun.)
**The loop-exit condition of `}while(quadratic - harmonic > 4e-5)` (or a smaller constant for `double`)** is based on [@RobinRyder's R answer](https://codegolf.stackexchange.com/a/182478/52210), and [Kevin Cruijssen's Java answer](https://codegolf.stackexchange.com/questions/182460/calculate-the-mean-mean-of-two-numbers/182501#182501): quadratic mean is always the *largest* magnitude, and harmonic mean is always the smallest (ignoring rounding errors). So we can check the delta between those two to detect convergence. We return the arithmetic mean as the scalar result. It's usually between those two and is probably the least susceptible to rounding errors.
**Float version**: callable as `float meanmean_float_avx(__m128);` with the arg and return value in xmm0. (So x86-64 System V, or Windows x64 vectorcall, but not x64 fastcall.) Or declare the return-type as `__m128` so you can get at the quadratic and harmonic mean for testing.
Letting this take 2 separate `float` args in xmm0 and xmm1 would cost 1 extra byte: we'd need a `shufps` with an imm8 (instead of just `unpcklps xmm0,xmm0`) to shuffle together and duplicate 2 inputs.
```
    40  address                    align 32
    41          code bytes         global meanmean_float_avx
    42                             meanmean_float_avx:
    43 00000000 B9[52000000]           mov      ecx, .arith_mean      ; allows 2-byte call reg, and a base for loading constants
    44 00000005 C4E2791861FC           vbroadcastss  xmm4, [rcx-4]    ; float 4.0
    45                             
    46                                 ;; mean(a,b) = mean(a,b,a,b) for all 4 types of mean
    47                                 ;; so we only ever have to do the length=4 case
    48 0000000B 0F14C0                 unpcklps xmm0,xmm0          ; [b,a] => [b,b,a,a]
    49                             
    50                                 ; do{ ... } while(quadratic - harmonic > threshold);
    51                             .loop:
    52                             ;;; XMM3 = geometric mean: not based on addition.  (Transform to log would be hard.  AVX512ER has exp with 23-bit accuracy, but not log.  vgetexp = floor(lofg2(x)), so that's no good.)
    53                                 ;; sqrt once *first*, making magnitudes closer to 1.0 to reduce rounding error.  Numbers are all positive so this is safe.
    54                                 ;; both sqrts first was better behaved, I think.
    55 0000000E 0F51D8                 sqrtps   xmm3, xmm0                 ; xmm3 = 4th root(x)
    56 00000011 F30F16EB               movshdup xmm5, xmm3                 ; bring odd elements down to even
    57 00000015 0F59EB                 mulps    xmm5, xmm3
    58 00000018 0F12DD                 movhlps  xmm3, xmm5                 ; high half -> low
    59 0000001B 0F59DD                 mulps    xmm3, xmm5                 ; xmm3[0] = hproduct(sqrt(xmm))
    60                             ;    sqrtps   xmm3, xmm3                 ; sqrt(hprod(sqrt)) = 4th root(hprod)
    61                                 ; common final step done after interleaving with quadratic mean
    62                             
    63                             ;;; XMM2 = quadratic mean = max of the means
    64 0000001E C5F859E8               vmulps   xmm5, xmm0,xmm0
    65 00000022 FFD1                   call     rcx                ; arith mean of squares
    66 00000024 0F14EB                 unpcklps xmm5, xmm3         ; [quad^2, geo^2, ?, ?]
    67 00000027 0F51D5                 sqrtps   xmm2, xmm5         ; [quad,   geo,   ?, ?]
    68                             
    69                             ;;; XMM1 = harmonic mean = min of the means
    70 0000002A C5D85EE8               vdivps   xmm5, xmm4, xmm0    ; 4/x
    71 0000002E FFD1                   call     rcx                ; arithmetic mean (under inversion)
    72 00000030 C5D85ECD               vdivps   xmm1, xmm4, xmm5    ; 4/.  (the factor of 4 cancels out)
    73                             
    74                             ;;; XMM5 = arithmetic mean
    75 00000034 0F28E8                 movaps   xmm5, xmm0
    76 00000037 FFD1                   call     rcx
    77                             
    78 00000039 0F14E9                 unpcklps  xmm5, xmm1           ;     [arith, harm, ?,?]
    79 0000003C C5D014C2               vunpcklps xmm0, xmm5,xmm2      ; x = [arith, harm, quad, geo]
    80                             
    81 00000040 0F5CD1                 subps    xmm2, xmm1        ; largest - smallest mean: guaranteed non-negative
    82 00000043 0F2E51F8               ucomiss  xmm2, [rcx-8]     ; quad-harm > convergence_threshold
    83 00000047 73C5                   jae     .loop
    84                             
    85                                 ; return with the arithmetic mean in the low element of xmm0 = scalar return value
    86 00000049 C3                     ret
    87                             
    88                             ;;; "constant pool" between the main function and the helper, like ARM literal pools
    89 0000004A ACC52738           .fpconst_threshold:   dd 4e-5    ; 4.3e-5 is the highest we can go and still pass the main test cases
    90 0000004E 00008040           .fpconst_4:    dd 4.0
    91                             .arith_mean:               ; returns XMM5 = hsum(xmm5)/4.
    92 00000052 C5D37CED               vhaddps   xmm5, xmm5         ; slow but small
    93 00000056 C5D37CED               vhaddps   xmm5, xmm5
    94 0000005A 0F5EEC                 divps     xmm5, xmm4        ; divide before/after summing doesn't matter mathematically or numerically; divisor is a power of 2
    95 0000005D C3                     ret
    96 0000005E 5E000000           .size:      dd $ - meanmean_float_avx
       0x5e = 94 bytes
```
(NASM listing created with `nasm -felf64 mean-mean.asm -l/dev/stdout | cut -b -34,$((34+6))-`. Strip the listing part and recover the source with `cut -b 34- > mean-mean.asm`)
SIMD horizontal sum and divide by 4 (i.e. arithmetic mean) is implemented in a separate function that we `call` (with a function pointer to amortize the cost of the address). With `4/x` before/after, or `x^2` before and sqrt after, we get the harmonic mean and quadratic mean. (It was painful to write these `div` instructions instead of multiplying by an exactly-representable `0.25`.)
Geometric mean is implemented separately with multiply and chained sqrt. Or with one sqrt first to reduce exponent magnitude and maybe help numerical precision. log is not available, only `floor(log2(x))` via AVX512 `vgetexpps/pd`. Exp is sort of available via AVX512ER (Xeon Phi only), but with only 2^-23 precision.
Mixing 128-bit AVX instructions and legacy SSE is not a performance problem. Mixing 256-bit AVX with legacy SSE can be on Haswell, but on Skylake it just potentially creates a potential false dependency for SSE instructions. I think my `double` version avoids any unnecessary loop-carried dep chains, and bottlenecks
on div/sqrt latency/throughput.
**Double version:**
```
   108                             global meanmean_double_avx
   109                             meanmean_double_avx:
   110 00000080 B9[E8000000]           mov      ecx, .arith_mean
   111 00000085 C4E27D1961F8           vbroadcastsd  ymm4, [rcx-8]    ; float 4.0
   112                             
   113                                 ;; mean(a,b) = mean(a,b,a,b) for all 4 types of mean
   114                                 ;; so we only ever have to do the length=4 case
   115 0000008B C4E37D18C001           vinsertf128   ymm0, ymm0, xmm0, 1       ; [b,a] => [b,a,b,a]
   116                             
   117                             .loop:
   118                             ;;; XMM3 = geometric mean: not based on addition.
   119 00000091 C5FD51D8               vsqrtpd      ymm3, ymm0     ; sqrt first to get magnitude closer to 1.0 for better(?) numerical precision
   120 00000095 C4E37D19DD01           vextractf128 xmm5, ymm3, 1           ; extract high lane
   121 0000009B C5D159EB               vmulpd       xmm5, xmm3
   122 0000009F 0F12DD                 movhlps      xmm3, xmm5              ; extract high half
   123 000000A2 F20F59DD               mulsd        xmm3, xmm5              ; xmm3 = hproduct(sqrt(xmm0))
   124                                ; sqrtsd       xmm3, xmm3             ; xmm3 = 4th root = geomean(xmm0)   ;deferred until quadratic
   125                             
   126                             ;;; XMM2 = quadratic mean = max of the means
   127 000000A6 C5FD59E8               vmulpd   ymm5, ymm0,ymm0
   128 000000AA FFD1                   call     rcx                ; arith mean of squares
   129 000000AC 0F16EB                 movlhps  xmm5, xmm3         ; [quad^2, geo^2]
   130 000000AF 660F51D5               sqrtpd   xmm2, xmm5         ; [quad  , geo]
   131                             
   132                             ;;; XMM1 = harmonic mean = min of the means
   133 000000B3 C5DD5EE8               vdivpd   ymm5, ymm4, ymm0    ; 4/x
   134 000000B7 FFD1                   call     rcx                 ; arithmetic mean under inversion
   135 000000B9 C5DB5ECD               vdivsd   xmm1, xmm4, xmm5    ; 4/.  (the factor of 4 cancels out)
   136                             
   137                             ;;; XMM5 = arithmetic mean
   138 000000BD C5FC28E8               vmovaps  ymm5, ymm0
   139 000000C1 FFD1                   call     rcx
   140                             
   141 000000C3 0F16E9                 movlhps     xmm5, xmm1            ;     [arith, harm]
   142 000000C6 C4E35518C201           vinsertf128 ymm0, ymm5, xmm2, 1   ; x = [arith, harm, quad, geo]
   143                             
   144 000000CC C5EB5CD1               vsubsd   xmm2, xmm1               ; largest - smallest mean: guaranteed non-negative
   145 000000D0 660F2E51F0             ucomisd  xmm2, [rcx-16]           ; quad - harm > threshold
   146 000000D5 77BA                   ja      .loop
   147                             
   148                                 ; vzeroupper ; not needed for correctness, only performance
   149                                 ; return with the arithmetic mean in the low element of xmm0 = scalar return value
   150 000000D7 C3                     ret
   151                             
   152                             ; "literal pool" between the function
   153 000000D8 95D626E80B2E113E   .fpconst_threshold:   dq 1e-9
   154 000000E0 0000000000001040   .fpconst_4:    dq 4.0            ; TODO: golf these zeros?  vpbroadcastb and convert?
   155                             .arith_mean:                     ; returns YMM5 = hsum(ymm5)/4.
   156 000000E8 C4E37D19EF01           vextractf128 xmm7, ymm5, 1
   157 000000EE C5D158EF               vaddpd       xmm5, xmm7
   158 000000F2 C5D17CED               vhaddpd      xmm5, xmm5      ; slow but small
   159 000000F6 C5D35EEC               vdivsd     xmm5, xmm4        ; only low element matters
   160 000000FA C3                     ret
   161 000000FB 7B000000           .size:      dd $ - meanmean_double_avx
    0x7b = 123 bytes
```
---
## C test harness
```
#include <immintrin.h>
#include <stdio.h>
#include <math.h>
static const struct ab_avg {
    double a,b;
    double mean;
} testcases[] = {
    {1, 1, 1},
    {1, 2, 1.45568889},
    {100, 200, 145.568889},
    {2.71, 3.14, 2.92103713},
    {0.57, 1.78, 1.0848205},
    {1.61, 2.41, 1.98965438},
    {0.01, 100, 6.7483058},
};
// see asm comments for order of  arith, harm, quad, geo
__m128 meanmean_float_avx(__m128);       // or float ...
__m256d meanmean_double_avx(__m128d);    // or double ...
int main(void) {
    int len = sizeof(testcases) / sizeof(testcases[0]);
    for(int i=0 ; i<len ; i++) {
        const struct ab_avg *p = &testcases[i];
#if 1
        __m128 arg = _mm_set_ps(0,0, p->b, p->a);
        double res = meanmean_float_avx(arg)[0];
#else
        __m128d arg = _mm_loadu_pd(&p->a);
        double res = meanmean_double_avx(arg)[0];
#endif
        double allowed_diff = (p->b - p->a) / 100000.0;
        double delta = fabs(p->mean - res);
        if (delta > 1e-3 || delta > allowed_diff) {
            printf("%f %f => %.9f but we got %.9f.  delta = %g allowed=%g\n",
                   p->a, p->b, p->mean, res, p->mean - res, allowed_diff);
        }
    }
    while(1) {
        double a = drand48(), b = drand48();  // range= [0..1)
        if (a>b) {
            double tmp=a;
            a=b;
            b=tmp; // sorted
        }
//      a *= 0.00000001;
//      b *= 123156;
        // a += 1<<11;  b += (1<<12)+1;  // float version gets stuck inflooping on 2048.04, 4097.18 at fpthreshold = 4e-5
        // a *= 1<<11 ; b *= 1<<11;   // scaling to large magnitude makes sum of squares loses more precision
        //a += 1<<11; b+= 1<<11;   // adding to large magnitude is hard for everything, catastrophic cancellation
#if 1
        printf("testing float %g, %g\n", a, b);
        __m128 arg = _mm_set_ps(0,0, b, a);
        __m128 res = meanmean_float_avx(arg);
        double quad = res[2], harm = res[1];  // same order as double... for now
#else
        printf("testing double %g, %g\n", a, b);
        __m128d arg = _mm_set_pd(b, a);
        __m256d res = meanmean_double_avx(arg);
        double quad = res[2], harm = res[1];
#endif
        double delta = fabs(quad - harm);
        double allowed_diff = (b - a) / 100000.0; // calculated in double even for the float case.
        // TODO: use the double res as a reference for float res
        // instead of just checking quadratic vs. harmonic mean
        if (delta > 1e-3 || delta > allowed_diff) {
            printf("%g %g we got q=%g, h=%g, a=%g.  delta = %g,  allowed=%g\n",
                   a, b, quad, harm, res[0], quad-harm, allowed_diff);
        }
    }
}
```
Build with:
```
nasm -felf64 mean-mean.asm &&
gcc -no-pie -fno-pie -g -O2 -march=native mean-mean.c mean-mean.o
```
Obviously you need a CPU with AVX support, or an emulator like Intel SDE. To compile on a host without native AVX support, use `-march=sandybridge` or `-mavx`
Run: passes the hard-coded test cases, but for the float version, random test cases often fail the `(b-a)/10000` threshold set in the question.
```
$ ./a.out
 (note: empty output before the first "testing float" means clean pass on the constant test cases)
testing float 3.90799e-14, 0.000985395
3.90799e-14 0.000985395 we got q=3.20062e-10, h=3.58723e-05, a=2.50934e-05.  delta = -3.5872e-05,  allowed=9.85395e-09
testing float 0.041631, 0.176643
testing float 0.0913306, 0.364602
testing float 0.0922976, 0.487217
testing float 0.454433, 0.52675
0.454433 0.52675 we got q=0.48992, h=0.489927, a=0.489925.  delta = -6.79493e-06,  allowed=7.23169e-07
testing float 0.233178, 0.831292
testing float 0.56806, 0.931731
testing float 0.0508319, 0.556094
testing float 0.0189148, 0.767051
0.0189148 0.767051 we got q=0.210471, h=0.210484, a=0.21048.  delta = -1.37389e-05,  allowed=7.48136e-06
testing float 0.25236, 0.298197
0.25236 0.298197 we got q=0.274796, h=0.274803, a=0.274801.  delta = -6.19888e-06,  allowed=4.58374e-07
testing float 0.531557, 0.875981
testing float 0.515431, 0.920261
testing float 0.18842, 0.810429
testing float 0.570614, 0.886314
testing float 0.0767746, 0.815274
testing float 0.118352, 0.984891
0.118352 0.984891 we got q=0.427845, h=0.427872, a=0.427863.  delta = -2.66135e-05,  allowed=8.66539e-06
testing float 0.784484, 0.893906
0.784484 0.893906 we got q=0.838297, h=0.838304, a=0.838302.  delta = -7.09295e-06,  allowed=1.09422e-06
```
FP errors are enough that quad-harm comes out less than zero for some inputs.
Or with `a += 1<<11; b += (1<<12)+1;` uncommented:
```
testing float 2048, 4097
testing float 2048.04, 4097.18
^C  (stuck in an infinite loop).
```
**None of these problems happen with `double`.** Comment out the `printf` before each test to see that the output is empty (nothing from the `if(delta too high)` block).
TODO: use the `double` version as a reference for the `float` version, instead of just looking at how they converging with quad-harm.
[Answer]
# [Python 3](https://docs.python.org/3/), 152 bytes
```
from math import*
s=sum
def f(*a):l=len(a);return 2>len({*a})and{*a}or f(s(a)/l,l/s(map(pow,a,l*[-1])),exp(s(map(log,a))/l),(s(map(pow,a,l*[2]))/l)**.5)
```
[Try it online!](https://tio.run/##XY3LCsIwEEX3/YqCm0wYY5KqFUV/RFwE2qqQF2lERfz2mipo62o4d86d8fd4crbouiY4kxsVT/nZeBcizdptezFZVTd5Q6iCtd7q2hIFm1DHS7C53PX8oOoJylb9dCGpbVJmGvWsJUZ54t0VFWq6n4oDANY3Tz4L7Y6oIKmA5E@Vh3dOKVtA58PZRtIQgQIg@5FMNPki5yg5H0aSlQILJuaDFmeLEgUrV6MuW6ZrbC5GIk//@oPdCw "Python 3 – Try It Online")
Recursive function `f`, will converge to floating point precision. Works in principle for all lists of positive numbers of *any* size, but is limited by ~~Python's recursion limit~~ a rounding error for some test cases.
---
Alternatively, settling for 9 decimals precision:
# [Python 3](https://docs.python.org/3/), 169 bytes
```
from math import*
s=sum
def f(*a):l=len(a);return(2>len({round(i,9)for i in a}))*a[0]or f(s(a)/l,l/s(map(pow,a,l*[-1])),exp(s(map(log,a))/l),(s(map(pow,a,l*[2]))/l)**.5)
```
[Try it online!](https://tio.run/##XY3LTsMwEEX3@QovZ6zBtd1HoKj8SJWFpcbUkl9yHBWE@PbgwoLA8p45905@r9cUt8tiSwosmHplLuRUKu@m0zSH7jJaZoEbPPqTHyMYfC5jnUsE/XLPHyXN8QKOntCmwhxzkZlPRG7OcmjAwtQ6G09@M0EwGXK6kSHPzw9qQKTxLcPPwadXMthUJPin6uGbcy72uOTiYgULihRi95v0OklJWsoV0aJXtBVqt2JS7HtSon9cN8WhTYmd@uPJ9uw@t3wB "Python 3 – Try It Online")
[Answer]
# [C#](https://docs.microsoft.com/en-us/dotnet/csharp/), 173 bytes
```
double m(int n,params double[]a)=>(n<1?a[0]:m(n-1,a.Sum()/a.Length,Math.Pow(a.Aggregate((t,x)=>t*x),1.0/a.Length),a.Length/a.Sum(x=>1/x),Math.Sqrt(a.Sum(x=>x*x)/a.Length)));
```
[Try it online!](https://tio.run/##lY9BS8MwGIbP66/IMZEsbaYiWDcRrxsMevBQevjsQhZoE5d8dRXZb69ZxzaPeknyvbzPQ746TOtQD10wVpPiK6Bq8@T3JJbG7vKkbiAEsvZOe2jJdzIJCGhq8unMhqzAWBrQR6qsCHgd2LEyeXU2uEaJN29QRY@iVu3PEspES@8zTqSIx0xkjOV/Z7JspI7Xf7iZeJCc3Ap5N1KHYeO690aRlhqLxPIPiO1ATmlZAZsvqH2Sz1Bm1WNL7VRyEEUXhSmIpbIat3wFuBVrt6cgXrT2SgMqSpH3EcabnvG44KXN@PmVnkT9fCHTWBotxc4jveR9hK9g/PBwGH4A)
[Answer]
# [Clean](https://github.com/Ourous/curated-clean-linux), 124 bytes
```
import StdEnv
f=avg o limit o iterate\l=let n=toReal(length l)in[avg l,prod l^(1.0/n),n/sum[1.0/x\\x<-l],avg[x*x\\x<-l]^0.5]
```
[Try it online!](https://tio.run/##NY7BboMwDIbvewof2ymlhHVlh3Ebh0k7rUdIpQgCi@Q4CNyKvfyyRGyX@P9kf3Y6NJqC8/0NDThtKVg3@Znhwn1N94eh0vcRPKB1lmO1bGbNpsUKDQNV7D@Nxh0aGvkLcG@pSQKKafY94HUns/xIe0HH5eaaBGvbrq8HVCLONevjP17z7FmFC@t4u4o/mWCAJgkC4qMEbLn4y3URc12kXGSlFPCUyVOiuKZMSvmyOWeZpJPcenmk6CoVfroB9biEw/tHePsm7Wy3/AI "Clean – Try It Online")
Performs the operation until the result stops changing.
Hurray for limited precision floating point!
[Answer]
# Pyth, 32 bytes
```
h.Wt{H[.OZ@*[[email protected]](/cdn-cgi/l/email-protection)^R2Z2
```
Try it online [here](https://pyth.herokuapp.com/?code=h.Wt%7BH%5B.OZ%40%2AFZJlZcJscL1Z%40.O%5ER2Z2&input=%5B2.71%2C3.14%5D&debug=0), or verify all the test cases (bar two, see note below) at once [here](https://pyth.herokuapp.com/?code=h.Wt%7BH%5B.OZ%40%2AFZJlZcJscL1Z%40.O%5ER2Z2&test_suite=1&test_suite_input=%5B1%2C%201%5D%0A%5B1%2C%202%5D%0A%5B100%2C%20200%5D%0A%5B2.71%2C%203.14%5D%0A%5B0.57%2C%201.78%5D%0A%5B1.61%2C%202.41%5D%0A%5B0.01%2C%20100%5D&debug=0). Accepts input as a list.
There seem to be some issues with rounding, as certain inputs don't converge correctly when they otherwise should. In particular, test case `0.01 100` gets stuck at values `[6.748305820749738, 6.748305820749738, 6.748305820749739, 6.748305820749738]`, and test case `1.61 2.41` gets stuck at `[1.9896543776640825, 1.9896543776640825, 1.9896543776640827, 1.9896543776640825]` - note in both cases that the 3rd mean (harmonic mean) differs from the others.
I'm not sure if this problem invalidates my entry, but I'm posting it anyway as it *should* work. If this isn't acceptable, it can be fixed by instering `.RRT` before the `[`, to round each of the means to 10 decimal places, as seen in [this test suite](https://pyth.herokuapp.com/?code=h.Wt%7BH.RRT%5B.OZ%40%2AFZJlZcJscL1Z%40.O%5ER2Z2&test_suite=1&test_suite_input=%5B1%2C%201%5D%0A%5B1%2C%202%5D%0A%5B100%2C%20200%5D%0A%5B2.71%2C%203.14%5D%0A%5B0.57%2C%201.78%5D%0A%5B1.61%2C%202.41%5D%0A%5B0.01%2C%20100%5D&debug=0).
```
h.Wt{H[.OZ@*[[email protected]](/cdn-cgi/l/email-protection)^R2Z2)Q   Implicit: Q=eval(input())
                                     Trailing )Q inferred
 .W                              Q   Funcitonal while: While condition is true, call inner. Starting value Q
   t{H                               Condition function: current input H
    {H                                 Deduplicate H
   t                                   Discard first value
                                         Empty list is falsey, so while is terminated when means converge
      [.OZ@*[[email protected]](/cdn-cgi/l/email-protection)^R2Z2)    Inner function: current input Z
              JlZ                      Take length of Z, store in J
       .OZ                             (1) Arithmetic mean of Z
           *FZ                         Product of Z
          @   J                        (2) Jth root of the above
                     L Z               Map each element of Z...
                    c 1                ... to its reciprocal
                   s                   Sum the above
                 cJ                    (3) J / the above
                            R Z        Map each element of Z...
                           ^ 2         ... to its square
                         .O            Arithmetic mean of the above
                        @      2       (4) Square root of the above
      [                         )      Wrap results (1), (2), (3), and (4) in a list
                                         This is used as the input for the next iteration of the loop
h                                    Take the first element of the result, implicit print
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) v2.0a0 [`-g`](https://codegolf.meta.stackexchange.com/a/14339/), ~~42~~ 38 bytes
```
â ÊÉ?ß[Ux²÷(V=UÊ)¬Ux÷V U×qV V÷Ux!÷1]:U
```
There's got to be a shorter way... This is a monstrosity! Saved 4 bytes thanks to @Shaggy!
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=2.0a0&flags=LWc&code=4iDKyT/fW1V4svcoVj1VyimsVXj3ViBV13FWIFb3VXgh9zFdOlU&input=WzEsMl0)
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 177 bytes
```
double f(double[]g)=>g.All(c=>Math.Abs(c-g[0])<1e-9)?g[0]:f(new[]{g.Sum()/(z=g.Length),Math.Pow(g.Aggregate((a,b)=>a*b),1d/z),z/g.Sum(x=>1/x),Math.Sqrt(g.Sum(x=>x*x)/z)});int z;
```
Thanks to @KevinCruijjsen for pointing out that using floating point precision was causing problems! Would be 163 bytes if doubles were perfectly precise.
[Try it online!](https://tio.run/##dY5NT4NAEIbv/ooeZ5pl2MEqWgTTe01MevBAOPCx3ZJQGmGbEkx/O66t9uReJpN55nnzlr1X9vU0VYdj0ajZFq5LmmmME02rpoEyTt5ys6NV0UPp6VRm@MLKe8bXn325hVad0uxL0@a4B/RhjDWtVavNDsVFfD@cwEZp3SmdGwWQi8Km5/MCBVf@iGL0r/YQJ@wPv9rmszNwuw/zAe3rGaO6NbMxmj662qh13Sr4a8CVCKozYnT3L2Mnk9Kadjh4QCGLe@KFg0t6CAVT@OTKp0cWAS0Cpy9Z2BIXPH0D "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# Javascript - 186 bytes
Takes input as an array of numbers. Uses the mean transformations in [J42161217's answer](https://codegolf.stackexchange.com/a/182462/70475) to shorten the code.
[Try It Online](https://tio.run/##TU9LboMwEN1zCq8i2zWDTUKJUpmusuwJLBYOhdBicAQIuD01n0ZZzfuOZn71oLus/Xn0fmO/87mQMx6YkaqWeGSV5EQmI9T6gSeZVG9yIodDFYxg8ubel2yUiQhq/EyIYCJkUb90X8KV0hdvlYy9YxdZMy/eRGlICKUQpU8JD4RAZ9seY81u7g7t34gbRh1T3yieJiL3o88CG3JZqDd/eMpDSAmGRMp2FO6Ic4c531gIsbOOIE4b5xDFrgTxeU/D@1KFk/j3@bLU1b0UCttedVbiCckEZbbprMm3vxgq1ufm@Q8)
```
f=(v,l=[m=(w,k=0)=>w.map(x=>k+=x)&&k/w.length,w=>1/m(w.map(x=>1/x)),w=>Math.E**m(w.map(x=>Math.log(x))),w=>m(w.map(x=>x**2))**.5].map(x=>x(v)).sort((a,b)=>a-b))=>l[3]-l[0]>1e-5?f(l):l[0]
```
## Explanation
```
f = (
  v,
  l=[
    m=(w,k=0)=>w.map(x=>k+=x)&&k/w.length,  // m = w => arithmetic mean of values in w
    w=>1/m(w.map(x=>1/x)),                  // w => harmonic mean of values in w   
    w=>Math.E**m(w.map(x=>Math.log(x))),    // w => geometric mean of values in w   
    w=>m(w.map(x=>x**2))**.5                // w => quadratic mean of values in w   
  ].map(x=>x(v))                            // get array of each mean using input v, stored in l
  .sort((a,b)=>a-b)                         // sort the outputs
) =>
  l[3] - l[0] > 1e-5 ?                      // is the difference between the largest
                                            // and smallest means > 1/100000?
    f(l) :                                  // if yes, get the mean mean of the means
    l[0]                                    // if no, arbitrarily return the smallest value
                                            // as close enough
```
[Answer]
# [Perl 5](https://www.perl.org/), ~~92~~ 72 bytes
```
sub f{@_=map{$m=$_;sum(map$_**$m/@_,@_)**(1/$m)}1,1e-9,-1,2for 1..9;pop}
```
[Try it online!](https://tio.run/##xZRdT4MwFIbv9ytOSJcAltIWCmWMuSVe6p1eOdNAHEocHxksxiz762IRZ/wF2KTJ24/T86TnbZvdYS/6vj1mkJ/WKinT5oTKBKm4PZamHiFl26h01wqvlWXbJnNRaZ0ZZjsnwg7DPK8PwAiJ4qZuzv37a7Hfmcubzf1mZZ1mAOWHiVKMMoxyK3Eft89b8nTlvsTfS4DKMsnHDdYw1RyKqsvBmDtBC2kydxhvAbKLyC9Ch80dTtttZWAdBpBmrakPc3SWpUYT10b9ZiyMqu5ACww6BWgIQDkeksaz80ypgVIp@Lc2Y8B@ZLL6lVMj8D8IxBcikFJGkyJQClz3EcEXZHoETkIGHmH@gMBJxBn1QuZNiUCJCHUBQjkWgkpfciqm9QIJtB2Iz0aESEaB8D057S1Q/SgGM2iEgIS@9KiYkgD6z7rpirpqe@futmi7xeKhK/aJ/g6/AA "Perl 5 – Try It Online")
...using some dirty tricks.
[Answer]
# [SNOBOL4 (CSNOBOL4)](http://www.snobol4.org/csnobol4/), 296 bytes
```
	X =INPUT
	Y =INPUT
	A =(X + Y) / 2.
	P =X * Y
	G =P ^ 0.5
	H =P / A
	Q =(2 * (A ^ 2) - P) ^ 0.5
O	OUTPUT =EQ(Q,A) Q	:S(END)
	M =A
	N =G
	O =H
	P =Q
	A =(M + N + O + P) / 4
	G =(M * N * O * P) ^ 0.25
	H =4 / (1 / M + 1 / N + 1 / O + 1 / P)
	Q =((M ^ 2 + N ^ 2 + O ^ 2 + P ^ 2) / 4) ^ 0.5	:(O)
END
```
[Try it online!](https://tio.run/##PY47b8MwDIRn8lfcKLnNS3CXABoMJEgyRA80BuylQ@cgGfL/4ZwttQN1BMXjfa/H8/d5b6dJBvhLSP1NZfzvOngz4AOjxQZurZLgBzQYVU7wCT/Yrr9UznO/QaeSaXBcMB3/nMUKydatKLG/8Sr8MZv82Vlk2X@bYzhYlSs83QH@pBLhz0tSLgBXAgRWZKUZpF3SOW84bzhv/lJcgWm5ZHZ8ZuusoWqsmmxB5Q1iLveLxqqp4DOr4sveRKuEnaadujc "SNOBOL4 (CSNOBOL4) – Try It Online")
Straightforward implementation. Uses a trick from [my answer to a related question](https://codegolf.stackexchange.com/a/145360/67312) to golf a bit more.
[Answer]
# Sledgehammer, 15 bytes
so I just posted the winning answer to my own question
```
⡈⠀⣐⢕⠠⢵⠂⡒⡓⠄⠬⢔⣲⣔⢯
```
Take input as a list of two (or more) machine precision integers.
Mathematica has all the built-ins you could need for this challenge!
* `FixedPoint` for iterating until done
* `Mean`, `HarmonicMean`, `GeometricMean` and `RootMeanSquare` are the built-ins for all four means necessary
Corresponding Mathematica code:
```
First@FixedPoint[{Mean@#,HarmonicMean@#,GeometricMean@#,RootMeanSquare@#}&,#]&
```
(golfing in Sledgehammer is noticeably different from golfing in Mathematica; replacing the means with shorter expressions is unlikely to help here, although I haven't actually tried)
[Answer]
# [Factor](https://factorcode.org), 101 bytes
```
[ [ { mean geometric-mean harmonic-mean quadratic-mean } [ execute ] with map ] to-fixed-point last ]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=XZC9TsMwEMfFmqc4RoZYdmInDghWxMKCmKoOJr1Si-aj9kUUVXkSli7lneBpcJumqJxl3Z3udx_6f37NTUmN2_5cXD0_PTzeX8MbuhqX4HHVYV2ih8rQgnkyZD3Z0kPZVC-2NqHLQ-uQ6KN1tia4iaJNBME2IMLrYbBLuL0DcSok_wpMKpVprYuR4ByS8PsTIRU7IxKWC0iZkIE5EAkrEsHTXKRHgjOVh8m5HgnBuJY64WpcwrJwCZPiDyh0kSmZ6tMILg639MczMpZLnXKlo37X0TzW3ziBSSArNDW8YlMhOVvGh3RhXNXUY7bqzMwF-Y5pH9pwjWVHCFN4t7QIErchpCae2zXO4rbZ67k0nmA6LNvtCTbE2-3gfwE)
]