[Question]
  [
### Introduction:
Two resistors, `R1` and `R2`, in parallel (denoted `R1 || R2`) have a combined resistance `Rp` given as:
$$R\_{P\_2} = \frac{R\_1\cdot R\_2}{R\_1+R\_2}$$
or as suggested in comments:
$$R\_{P\_2} = \frac{1}{\frac{1}{R\_1} + \frac{1}{R\_2}}$$
Three resistors, `R1`, `R2` and `R3` in parallel (`R1 || R2 || R3`) have a combined resistance `(R1 || R2) || R3 = Rp || R3` :
$$R\_{P\_3} = \frac{\frac{R\_1\cdot R\_2}{R\_1+R\_2}\cdot R\_3}{\frac{R\_1\cdot R\_2}{R\_1+R\_2}+R\_3}$$
or, again as suggested in comments:
$$R\_{P\_3} = \frac{1}{\frac{1}{R\_1} + \frac{1}{R\_2}+ \frac{1}{R\_3}}$$
These formulas can of course be extended to an indefinite number of resistors.
---
### Challenge:
Take a list of positive resistor values as input, and output the combined resistance if they were placed in parallel in an electric circuit. You may not assume a maximum number of resistors (except that your computer can handle it of course).
### Test cases:
```
1, 1
0.5
1, 1, 1
0.3333333
4, 6, 3
1.3333333
20, 14, 18, 8, 2, 12
1.1295
10, 10, 20, 30, 40, 50, 60, 70, 80, 90
2.6117  
```
---
**Shortest code in each language wins. Explanations are highly encouraged.**
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~5~~ 3 bytes
```
zOz
```
[Try it online!](https://tio.run/##yy9OTMpM/f@/yr/q//9oQwMdBRA2AmJjIDYBYlMgNgNicyC2AGJLg1gA "05AB1E – Try It Online")
---
### Explanation
```
z                     # compute 1/x for each x in input 
 O                    # sum input 
  z                   # compute 1/sum
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~18~~ 16 bytes
```
(1/).sum.map(1/)
```
[Try it online!](https://tio.run/##y0gszk7NyfmfZhvzX8NQX1OvuDRXLzexAMT@n5uYmadgq1BQlJlXoqCikKYQbaKjYKajYBz7/19yWk5ievF/3QjngAAA "Haskell – Try It Online")
[Answer]
# [MATLAB](https://ch.mathworks.com/products/matlab.html), 14 bytes
In MATLAB `norm(...,p)` computes the `p`-norm of a vector. This is usually defined for \$p \geqslant 1\$ as 
$$\Vert v \Vert\_p = \left( \sum\_i \vert v\_i \vert^p \right)^{\frac{1}{p}}.$$
But luckily for us, it also happens to work for \$p=-1\$. (Note that it does not work in Octave.)
```
@(x)norm(x,-1)
```
[Don't try it online!](https://tio.run/##y08uSSxL/f/fQaNCMy@/KFejQkfXUPN/Yl6xRrShjpGOcazmfwA "Octave – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~5~~ 3 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
İSİ
```
**[Try it online!](https://tio.run/##y0rNyan8///IhuAjG/7//x9taKCjAMJGQGwMxCZAbArEZkBsDsQWQGxpEAsA "Jelly – Try It Online")**
### How?
Initially I forgot this form from my electronic engineering days ...how easily we forget.
```
İSİ - Link: list of numbers, R   e.g. [r1, r2, ..., rn]
İ   - inverse (vectorises)            [1/r1, 1/r2, ..., 1/rn]
 S  - sum                             1/r1 + 1/r2 + ... + 1/rn
  İ - inverse                         1/(1/r1 + 1/r2 + ... + 1/rn)
```
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 15 bytes
```
@(x)1/sum(1./x)
```
[Try it online!](https://tio.run/##y08uSSxL/Z@mYKugp6f330GjQtNQv7g0V8NQT79C83@aRrShgmGsJheIYaCjAMJGQGwMxCZAbArEZkBsDsQWQGxpEKv5HwA "Octave – Try It Online")
Harmonic mean, divided by `n`. Easy peasy.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 22 bytes
```
$args|%{$y+=1/$_};1/$y
```
[Try it online!](https://tio.run/##RY3BDoJADETv@xUbUgXiJHYXxFVCwp@gB9ADiQYOSnC/fa0kag/NvGknc7892mG8tn0fqKvmQOfhMr5WM02bymyp8aXsKXil6KkrXSeJgUmhtMxH/iFHgewLlmFyGAcHC2N/AbEZcswYOWPHKBh7hmMcOE2lQ6qX14ia0zFa5Jo6XTdlHCsf3g "PowerShell – Try It Online")
Takes input via splatting and uses the same 1/sum of inverse trick as many of the others are doing
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 4 [bytes](https://github.com/abrudz/SBCS)
```
÷1⊥÷
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT/////B2w0ddSw9v/5/2qG3Co94@o0ddzY/6pgYHOQPJEA/PYC4gDZRKUzA0ACEjAwVjAwUTAwVTAwUzAwVzAwULAwVLg/8A "APL (Dyalog Unicode) – Try It Online")
-1 thanks to [Adám](https://codegolf.stackexchange.com/users/43319/ad%c3%a1m).
[Answer]
# [R](https://www.r-project.org/), 15 bytes
```
1/sum(1/scan())
```
[Try it online!](https://tio.run/##K/r/31C/uDRXA0gmJ@ZpaGr@NzTgAiIjAy5jAy4TAy5TAy4zAy5zAy4LAy5Lg/8A "R – Try It Online")
Follows the same Harmonic Mean principle seen in other answers.
[Answer]
# JavaScript, 28 bytes
```
a=>a.map(y=>x+=1/y,x=0)&&1/x
```
[Try it Online!](https://tio.run/##DcJRDoIwFATA25A2LLBVQfx4XMT48YJAIEgJGFJOX53MpIfu7Tau32zx7y72ElUazT@6mlOakIorTgShTRJXhNj6Zfdzl89@ML15OuL/QlyJG1ESFXEnauLBl7XxBw)
[Answer]
# [Perl 5](https://www.perl.org/) `-pa -MList::Util=reduce`, 26 bytes
```
$_=reduce{$a*$b/($a+$b)}@F
```
[Try it online!](https://tio.run/##K0gtyjH9/18l3rYoNaU0ObVaJVFLJUlfQyVRWyVJs9bB7f9/QwVDLiAGkiYKZgrGXEYGCoYmCoYWChYKRgqGRlyGQL6BAlDU2EDBxEDB1EDBzEDB3EDBwkDB0uBffkFJZn5e8X9dX5/M4hIrq9CSzByoXf91E3MKAA "Perl 5 – Try It Online")
[Answer]
# [Perl 6](http://perl6.org/), 14 bytes
```
1/*.sum o 1/**
```
[Try it online!](https://tio.run/##JcpBDoIwFIThq/whxAUx@l6ppUbpVQgLu5JgICwI8ey1wmq@zMznNb1dGlZOkTbptbrMy8BIVpUezP1KUXa0gS1Sdt@COE48FQ3nPQ5YHPUfRlCLejwGNfspV0IeasEKN8EJjeCFu4T0Aw "Perl 6 – Try It Online")
`1 / **` is an anonymous function that returns a list of the reciprocals of its arguments. `1 / *.sum` is another anonymous function that returns the reciprocal of the sum of the elements of its list argument. The `o` operator composes those two functions.
[Answer]
# bash + coreutils, 25 bytes
```
bc -l<<<"1/(0${@/#/+1/})"
```
[TIO](https://tio.run/##DYhBCsIwFAX3OcWjdqGI5P001kiz8B6li9YEKgQLVnBhPXvMYgZmpnGd82d@pIhXHAPStvU96oRh6BAWrPFdqsvTHafkva9E71l/b3qnj6J/hyqH5RmzQFSh2KJFowwhFuLgYCBGSWmi3IawxJloiQvhiCv/)
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 10 bytes
```
1/Tr[1/#]&
```
[Try it online!](https://tio.run/##JYoxDoMwFEN3roHE5Cr@IdAwFHEEBjbUIUJFZaBDlA3l7GmAyc/P3l34fnYXtsWl9ZVETX4WVb6rNPrtF@by0a9Drmo4ikMgEVfcYNCiPkETYiAWFhqir1NWRB5qwhAN0RJPwhIdYxHTHw "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), 3 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
∩Σ∩
```
The same as other answers, using the builtins `∩` (\$\frac{1}{n}\$) and `Σ` (sum):
$$M(x\_1,...,x\_n)=\frac{1}{\frac{1}{x\_1} + \frac{1}{x\_2} + ... + \frac{1}{x\_n}}$$
[Try it online.](https://tio.run/##y00syUjPz0n7//9Rx8pzi4HE///RhjqGsVwgEkyb6JjpGANpIwMdQxMdQwsdCx0jHUMjkAqgiIEOUNzYQMfEQMfUQMfMQMfcQMfCQMfSIBYA)
[Answer]
# Java 8, 24 bytes
```
a->1/a.map(d->1/d).sum()
```
I noticed there wasn't a Java answer yet, so figured I'd add one.
[Try it online.](https://tio.run/##hVDLTsMwELz3K1Y9Oep2sdNQgiqQkLjSS4@Ig0lclJA4UexUqlCvfACfyI@EzUOiFQculnd3ZnZ2cn3Qyzx975JCOwdPOrMfM4DMetPsdWJg25cAadW@FgYSkTOBWp8V5HxjdEmPw2Q3FKCDDcNPM36c1z5LYAsW7qDTy3t1panUtUj7bxqQa0sRdJseW7MEYyfKocpSKNmJYNXMvj2/sO5owxvnhUI1rPktLxsRrnF13gglqghVjDGGqMILMo8kMmAlMZJ4LXEt8UZiLPFW/jlmcDbwxjyIiKOqWz/Z2x2dNyVVraeanfvCnuX10DT66MhX41ViJC7m8P35BfOFpX/CpWo/cYLJ2Kn7AQ)
**Explanation:**
Uses the same Harmonic Mean approach as other answers:
$$M(x\_1,...,x\_n)=\frac{1}{\frac{1}{x\_1} + \frac{1}{x\_2} + ... + \frac{1}{x\_n}}$$
```
a->                       // Method with DoubleStream parameter and double return-type
     a.map(d->1/d)        //  Calculate 1/d for each value `d` in the input-stream
                  .sum()  //  Then take the sum of the mapped list
   1/                     //  And return 1/sum as result
```
[Answer]
# [PHP](https://php.net/), 51 bytes
Reciprocal of sum of reciprocals. Input is `$a`.
```
1/array_reduce($a,function($c,$i){return$c+1/$i;});
```
[Try it online!](https://tio.run/##HcuxDsIgEADQX2G4ASJJQa2tQeOnGHLSwALkUgbT9Nvx7PDGV2Ptj1eNVYB/eiL/ldZo8XdmF3ZlI7uxic3sbpQTAWPpdjjWm8KnYZDg9dIyrqlkCaghqY3C2igDnuwAye3K9f4D "PHP – Try It Online")
[Answer]
# JavaScript (ES6), 29 bytes
```
a=>a.reduce((p,c)=>p*c/(p+c))
```
[Try it online!](https://tio.run/##lc@9DoIwEMDx3ae4sdVa2vI9wOhLGIemFIMhtAE0vn09ViFBL/0nnX65e@iXnszY@fk8uMaGtgq6qjUfbfM0lhDPDK1qfzQR8SdDaTBumFxvee/upCVXyUDC7twon92le9uGJJRCFIHg6WGD2te2qBjnW0sYZAzivzW5qSmBmyEpCwb4FP7Ub5pU5frSRcMWNcYSLMUyLMcKrBRrTfFMyjx8AA "JavaScript (Node.js) – Try It Online")
or:
```
a=>1/a.reduce((p,c)=>p+1/c,0)
```
[Try it online!](https://tio.run/##lc@9DoMgEMDxvU/BCCkFDr8HHfsSTQeC2GiMGLVN356eazWxvfBPmH6568zLzHZqx@Uy@NqFpgymrEAaMbn6aR2lI7esrMYzSMsVC9YPs@@d6P2DNvQGnAA5nDsTi7@2b1fTmDEiJVEiOe1Qx9oeFeF8azEnKSfR3xrsalrhZkhCzgk@jT/9mwa62F66atiqRliMJViKZViOFWqraZECZOED "JavaScript (Node.js) – Try It Online")
But with this approach, using `map()` (as [Shaggy did](https://codegolf.stackexchange.com/a/192651/58563)) is 1 byte shorter.
[Answer]
# [Python 3](https://docs.python.org/3/), 30 bytes
```
lambda r:1/sum(1/v for v in r)
```
**[Try it online!](https://tio.run/##TY7LCoMwEEX3fsXsTGBAY6y1gl9SXVhUKtQoMRX69emN0EfIYc7NzEDWl7svRvuxbvyjm299R7ZSyfachUp2GhdLO02GrPTB3bC5EEVEOFfFpFr@@V/MmQom/YlZih7eVMmEm8Gy72bogTCjQQ5OoABnUIJL2kayOuZXOxknwk@YxqNKpm1Y67gxMdNg@mBw6d8 "Python 3 – Try It Online")**
[Answer]
# [Perl 5](https://www.perl.org/) (-p), 17 bytes
```
$a+=1/$_}{$_=1/$a
```
[Try it online!](https://tio.run/##K0gtyjH9/18lUdvWUF8lvrZaJR7ESPz/39CAC4iMDLiMDbhMDLhMDbjMDLjMDbgsDLgsDf7lF5Rk5ucV/9ctAAA "Perl 5 – Try It Online")
[Answer]
# x86-64 Machine code - ~~20~~ 18 bytes
```
0F 57 C0             xorps       xmm0,xmm0  
loopHead
F3 0F 53 4C 8A FC    rcpss       xmm1,dword ptr [rdx+rcx*4-4]
0F 58 C1             addps       xmm0,xmm1  
E2 F6                loop        loopHead
0F 53 C0             rcpps       xmm0,xmm0  
C3                   ret  
```
Input - Windows calling convention. First parameter is the number of resistors in `RCX`. A pointer to the resistors is in `RDX`. `*ps` instructions are used since they are one byte smaller. Technically, you can only have around 2^61 resistors but you will be out of RAM long before then. The precision isn't great either, since we are using `rcpps`.
[Answer]
# [MATL](https://github.com/lmendo/MATL), 5 bytes
```
,1w/s
```
[Try it online!](https://tio.run/##y00syfn/X8ewXL/4//9oIwMdBUMTILbQUQAiIyDLKBYA "MATL – Try It Online")
I'm not sure if "do twice" (`,`) counts as a loop, but this is just the harmonic mean, divided by `n`.
Alternately, `,-1^s` is five bytes as well.
[Answer]
# Intel 8087 FPU machine code, 19 bytes
```
 D9 E8      FLD1                    ; push 1 for top numerator on stack
 D9 EE      FLDZ                    ; push 0 for running sum 
        R_LOOP: 
 D9 E8      FLD1                    ; push 1 numerator for resistor
 DF 04      FILD WORD PTR[SI]       ; push resistor value onto stack 
 DE F9      FDIV                    ; divide 1 / value 
 DE C1      FADD                    ; add to running sum 
 AD         LODSW                   ; increment SI by 2 bytes 
 E2 F4      LOOP R_LOOP             ; keep looping 
 DE F9      FDIV                    ; divide 1 / result                  
 D9 1D      FSTP WORD PTR[DI]       ; store result as float in [DI]
```
This uses the stack-based floating point instructions in the original IBM PC's 8087 FPU.
Input is pointer to resistor values in `[SI]`, number of resistors in `CX`. Output is to a single precision (DD) value at `[DI]`.
[Answer]
# [Rattle](https://github.com/DRH001/Rattle), 24 bytes
```
|>II^[=1+#g`e_1P+~s]`e_1
```
[Try it Online!](https://www.drh001.com/rattle/?flags=&code=%7C%3EII%5E%5B%3D1%2B%23g%60e_1P%2B%7Es%5D%60e_1&inputs=10%2C%2010%2C%2020%2C%2030%2C%2040%2C%2050%2C%2060%2C%2070%2C%2080%2C%2090)
This answer can probably be golfed more (can anyone outgolf me in my own language?)
# Explanation
```
|                 take input, parse automatically (Rattle's input parsing is powerful 
                   enough to recognise "1,2,3" etc. as a list)
 >                move pointer to the right (to slot 1)
  I               flatten input list and insert into consecutive memory slots
   I^             get length of this list (which is still on top of the stack)
     [ ... ]`     loop structure: loop as many times as the length of the list
=1                set top of stack to 1
  +#              increment top of stack by list's iterator 
                   (the number of times the loop has run)
    g`            get the value in storage at the calculated index (iterator + 1)
      e_1         get 1/x of this value
         P        set the pointer to slot 0
          +~      increment the current value by the stored value in slot 0
            s     save the result to slot 0
e_1                get 1/x of this value
```
[Answer]
# [Dart](https://www.dartlang.org/), 42 bytes
```
f(List<num>a)=>a.reduce((p,e)=>p*e/(p+e));
```
[Try it online!](https://tio.run/##ZYxBDsIgFET3noLlRyf6oVgxak/gDYwLYmnCooRUujKeHYk7a2Y1702md1MuZaBreOZznMfOyUvntpPv54cnSvC1p7XfUdp4KU9ldCGSfK2ESFOImQa6KQh1r@6X1SyhQYtmCTVDGSgLCw2l/46qZtRRwzCMPaNlHBiWceTv@F0@ "Dart – Try It Online")
Having to explicitly specify the `num` type is kinda sucky, prevents type infering, because it would infer to `(dynamic, dynamic) => dynamic` which can't yield doubles for some reason
[Answer]
# [PHP](https://php.net/), 40 bytes
```
for(;$n=$argv[++$i];$r+=1/$n);echo 1/$r;
```
[Try it online!](https://tio.run/##K8go@G9jXwAk0/KLNKxV8mxVEovSy6K1tVUyY61VirRtDfVV8jStU5Mz8hWAzCLr////GxqAkJHBf2OD/yYG/00N/psZ/Dc3@G9h8N/SAAA "PHP – Try It Online")
Tests: [Try it online!](https://tio.run/##VY/baoQwEIbv8xSDBDZiUKO77iGVvkNvrZSwpKvFjZJooZQ@u501le0O@WEO3/xDhmaYn56HZiCEjtqNDkqoCGBUgoOoOSQJpPHu3vrXzX342ZZDwSH3M/E4y1LcQkAcOODLMMtWUGTH1f1GoW50jtqidqgCtUcdUMfU72VxIcSe1JKQ995qdW6A/X1AOViyEL4XX6rs5RO/paxVX29XbS@aVWbqOnTyoFw4fW56CF60m7oR0BSqAGL46FvDNhw2K4y9oIbWnSCQM2JMUlMuN6ooom0tqY1KkVATysURUyvn@4FXG/h7k3F6ZLQNH0qL5c/8Cw "PHP – Try It Online")
Similar to [Yimin Rong's solution](https://codegolf.stackexchange.com/a/192652/81663) but without built-ins and all program bytes are included in the bytes count.
[Answer]
# Python 3, ~~58~~ 44 bytes
```
f=lambda x,y=0,*i:f(x*y/(x+y),*i)if y else x
```
A recursive function. Requires arguments to be passed unpacked, like so:
```
i=[10, 10, 20]
f(*i)
```
or
```
f(10, 10, 20)
```
**Explanation:**
```
# lambda function with three arguments. *i will take any unpacked arguments past x and y,
# so a call like f(10, 20) is also valid and i will be an empty tuple
# since y has a default value, f(10) is also valid
f=lambda x,y=0,*i: \
# a if case else b
# determine parallel resistance of x and y and use it as variable x
# since i is passed unpacked, the first item in the remaining list will be y and
# the rest of the items will be stored in i
# in the case where there were no items in the list, y will have the default value of 0
f(x*y/(x+y),*i) \
# if y does not exist or is zero, return x
if y else x
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 7 bytes
```
Ｉ∕¹Σ∕¹Ａ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwyWzLDMlVcNQRyG4NBeJ55lXUFqioQkG1v//R0cbGegoGJoAsYWOAhAZAVlGsbH/dctyAA "Charcoal – Try It Online") Link is to verbose version of code. Works by calculating the current drawn by each resistor when 1V is applied, taking the total, and calculating the resistance that would draw that current when 1V is applied. Explanation:
```
      Ａ Input array
    ∕¹  Reciprocal (vectorised)
   Σ    Sum
 ∕¹     Reciprocal
Ｉ       Cast to string for implicit print
```
[Answer]
# [J](http://jsoftware.com/), 6 bytes
```
1%1#.%
```
[Try it online!](https://tio.run/##TYsxCoNAFER7T/GIiAR0mb@uugqpAqlS5QpBCWm8f7WaIirMg3kM800XV87cRkoqxLhRO@6v5yNZYbkr0jUjm96fhRnDTvWQQEfzFy8sYJGIx/x@0C/b2IggWtGJXkQxKK0 "J – Try It Online")
[Answer]
# [MATLAB], 15 bytes
One more byte than *flawr* excellent answer, but I had to use other functions so here goes:
```
@(x)1/sum(1./x)
```
It's rather explicit, it sums the inverse of the resistances, then invert the sum to output the equivalent parallel resistance.
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 49 bytes
```
: f 0e 0 do dup i cells + @ s>f 1/f f+ loop 1/f ;
```
[Try it online!](https://tio.run/##hY9BTsMwEEX3PcVnxaJTGCdpmlIJISFxCcrCJA6JSOPKdoCevkxiEJVQVS9iR/7v/XFtXWgWb/W4HY93qMEGjMqiGvZoUZqu85jjAf6@hrqtUc/RWbufzhshvmI8DOX7Sf4qhionnw228I00lENAsPDBOoNKB422x87srDsQfNuXBk/jIOIzvr8OaPSHwevQdmEhSe2cPviZgsJeV0ikelxbPDqjg4n3@GxF8KxIvcxiSka@QelmExjRdELPgb9o@odmyOX3AppRTuk/NGGoDKpAIbOoZJLk5yUJk8pIFVRQQiqJuvzkEaJjiDRlZIwlI2esGAVjzZNcrs@/TuxM0pEyZUxLppxpxVQwrTl2Cf5TdvwG "Forth (gforth) – Try It Online")
Input is a memory address and array length (used as an impromptu array, since Forth doesn't have a built-in array construct)
Uses the sum-of-inverse method as most other answers are
### Code Explanation
```
: f           \ start a new word definition
  0e          \ stick an accumulator on the floating point stack
  0 do        \ start a loop from 0 to array-length -1
    dup       \ copy the array address
    i cells + \ get the address of the current array value
    @ s>f     \ get the value and convert it to a float
    1/f f+    \ invert and add to accumulator
  loop        \ end the loop definition
  1/f         \ invert the resulting sum
;             \ end the word definition
```
]