[Question]
  [
Implement a function diff that takes as input three integers x, y, and z. It should return whether subtracting one of these numbers from another gives the third.
```
Test cases:
diff(5, 3, 2) yields True because 5 - 3 = 2
diff(2, 3, 5) yields True because 5 - 3 = 2
diff(2, 5, 3) yields True because 5 - 3 = 2
diff(-2, 3, 5) yields True because 3 - 5 is -2
diff(-5, -3, -2) # -5 - -2 is -3
diff(2, 3, -5) yields False
diff(10, 6, 4) yields True because 10 - 6 = 4
diff(10, 6, 3) yields False
```
You don't have to name the function, you may implement default input methods the examples above are not a strict guideline. 
  
[Answer]
## Python 3, 21 bytes
```
lambda*l:sum(l)/2in l
```
If two numbers add to the other, the sum of all three will be double that other number, so half the sum will be an element of the list. Python 3 is needed to avoid floor-division, unless the numbers are given like `3.0` rather than `3`.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~5~~ 3 bytes
Thanks to [@Sp3000](https://codegolf.stackexchange.com/users/21487/sp3000) for saving two bytes!
Code, uses quite the same algorithm as [@xnor's great answer](https://codegolf.stackexchange.com/a/71338/34388):
```
Sf·∏§
```
Explanation:
```
S     # Sum of the argument list
  ·∏§   # Double the list
 f    # Filter, remove everything that isn't equal to the sum of the list
```
This gives `[]` as falsy, and anything else as truthy.
[Try it online!](http://jelly.tryitonline.net/#code=U2bhuKQ&input=&args=MiwgMywgNQ)
[Answer]
## ES6, 31 bytes
```
(a,b,c)=>a+b==c|b+c==a|c+a==b
```
Add 5 bytes if you need to name the function `diff`.
Edit: Saved 2 bytes thanks to @Alex L.
[Answer]
# JavaScript ES6, ~~38~~ ~~34~~ 33 bytes
```
x=>x.some(a=>2*a==x[0]+x[1]+x[2])
```
Very simple anonymous function, and borrows from the Python answer. Takes input `x` as an array; returns `true` or `false`. Bytes shaved to Molarmanful and jrich
A 38-byte program, taking each number as an argument:
```
(a,b,c)=>[a,b,c].some(t=>t==(a+b+c)/2)
```
[Answer]
# Oracle SQL 11.2, 49 bytes
```
SELECT 1 FROM DUAL WHERE(:1+:2+:3)/2IN(:1,:2,:3);
```
Rewrite of @xnor solution, kudos to him.
[Answer]
# J, 6 bytes
```
+/e.+:
```
Try it with [J.js](https://a296a8f7c5110b2ece73921ddc2abbaaa3c90d10.googledrive.com/host/0B3cbLoy-_9Dbb0NaSk9MRGE5UEU/index.html#code=(%2B%2Fe.%2B%3A)%202%203%205).
### How it works
```
+/e.+:    Monadic verb. Argument: A
    +:    Double the elements of A.
+/        Compute the sum of the elements of A.
  e.      Test for membership.
```
[Answer]
# APL, ~~8~~ 5 bytes
```
+/‚àä+‚ç®
```
This is a monadic function train that accepts an array and returns a boolean (0/1 in APL). It uses the same algorithm as xnor's Python 3 [answer](https://codegolf.stackexchange.com/a/71338/20469).
Explanation:
```
   +‚ç®  ‚çù Double the input (+‚ç®x is the same as x+x)
  ‚àä    ‚çù Test the membership of
+/     ‚çù The sum of the input
```
[Try it online](http://tryapl.org/?a=f%u2190+/%u220A+%u2368%u22C4f%205%203%202%u22C4f%202%203%20%AF5&run)
Saved 3 bytes thanks to Dennis!
[Answer]
# [DUP](https://esolangs.org/wiki/DUP), 31 chars / 39 bytes
```
[2√∏2√∏2√∏++2/\%3√∏^=3√∏2√∏=3√∏3√∏=||.]
```
`[Try it here!](http://www.quirkster.com/iano/js/dup.html)`
My first DUP submission ever! *Unicode is your oyster.*
It's an anonymous function/lambda. Usage:
```
5 3 2[2√∏2√∏2√∏++2/\%3√∏^=3√∏2√∏=3√∏3√∏=||.]!
```
# Explanation
```
[                               {start lambda}
 2√∏2√∏2√∏                         {duplicate 3 inputnums}
       ++                       {push sum(3 popped stack items)}
         2/\%                   {push (popped stack item)/2}
             3√∏^=3√∏2√∏=3√∏3√∏=     {for all 3 inputs, -1 if inputnum=sum/2; else 0}
                           ||   {check if any of the 3 resulting values are truthy}
                             .  {output top of stack (boolean value)}
                              ] {end lambda}
```
[Answer]
## Java 7, 81
```
boolean d(int[]a){int s=0,t=1;for(int b:a)s+=b;for(int b:a)t*=2*b-s;return t==0;}
```
[Answer]
# Perl 6, ~~20~~ 19 bytes
I have two functions equal in byte count, so I'll put both. Appreciate whichever tickles your fancy.
```
{@_‚àã@_.sum div 2}
{@_‚àã+~(@_.sum/2)}
```
Usage: assign either one to a variable from which you can call it.  
EDIT: Thanks @b2gills for the byte reduction
[Answer]
# Java 8 (lambda function), 29 bytes
```
// Lambda Signature: (int, int, int) -> boolean
(a,b,c)->a+b==c|a+c==b|b+c==a
```
Java code golf solutions are usually only short when the program does not have to be a fully functional program. (\*cough cough\* class declaration, main method)
[Answer]
# Pyth, 6 bytes
```
/Q/sQ2
```
[Try it online!](http://pyth.herokuapp.com/?code=%2FQ%2FsQ2&input=%5B19%2C3%2C6%5D&test_suite=1&test_suite_input=%5B5%2C3%2C2%5D%0A%5B2%2C3%2C5%5D%0A%5B2%2C5%2C3%5D%0A%5B-2%2C3%2C5%5D%0A%5B-5%2C-3%2C-2%5D%0A%5B2%2C3%2C-5%5D%0A%5B10%2C6%2C4%5D%0A%5B10%2C6%2C3%5D&debug=0)
Expects input as a list of integers. Outputs 0 if no number can be built by subtracting the other two and >0 if at least one can.
### Explanation:
Same algorithm as the answer of @xnor
```
/Q/sQ2
   sQ     # Sum all elements in the list
  /  2    # Divide the sum by 2
/Q        # Count Occurences of above number in the list
```
[Answer]
# [Kona](https://github.com/kevinlawler/kona) 16 chars
```
{((+/x)%2)_in x}
```
Takes a vector from the stack, sums them, divides by 2 and determines if it's in the vector. Returns 1 as truthy and 0 as falsey.
Called via
```
> {((+/x)%2)_in x} [(2;3;5)]
1
> {((+/x)%2)_in x} [(2;3;4)]
0
```
[Answer]
# jq, 17 characters
(Yet another rewrite of [xnor](https://codegolf.stackexchange.com/users/20260/xnor)'s [Python 3 answer](https://codegolf.stackexchange.com/a/71338). Upvotes should go to that one.)
```
contains([add/2])
```
Input: array of 3 integers.
Sample run:
```
bash-4.3$ jq 'contains([add/2])' <<< '[5, 3, 2]'
true
bash-4.3$ jq 'contains([add/2])' <<< '[2, 3, -5]'
false
```
On-line test:
* [[5, 3, 2]](https://jqplay.org/jq?q=contains%28[add/2]%29&j=[5%2C%203%2C%202])
* [[2, 3, -5]](https://jqplay.org/jq?q=contains%28[add/2]%29&j=[2%2C%203%2C%20-5])
## jq, 18 characters
(17 characters code + 1 character command line option.)
```
contains([add/2])
```
Input: list of 3 integers.
Sample run:
```
bash-4.3$ jq -s 'contains([add/2])' <<< '5 3 2'
true
bash-4.3$ jq -s 'contains([add/2])' <<< '2 3 -5'
false
```
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 5 bytes
Using [@xnor's great approach](https://codegolf.stackexchange.com/a/71338/36398):
```
s2/Gm
```
[**Try it online!**](http://matl.tryitonline.net/#code=czIvR20&input=WzIgNSAzXQ)
```
s    % implicitly input array of three numbers. Compute their sum
2/   % divide by 2
G    % push input again
m    % ismember function: true if sum divided by 2 equals some element of the input
```
---
**Brute-force approach, 12 bytes**:
```
Y@TT-1h*!s~a
```
[**Try it online!**](http://matl.tryitonline.net/#code=WUBUVC0xaCohc35h&input=WzIgNSAzXQ)
```
Y@       % input array of three numbers. Matrix with all
         % permutations, each one on a different row
TT-1h    % vector [1,1,-1]
*        % multiply with broadcast
!s       % transpose, sum of each column (former row)
~a       % true if any value is 0
```
[Answer]
# ùîºùïäùïÑùïöùïü, 7 chars / 9 bytes
```
√Ø‚íÆ‚âî‚®≠√Ø/2
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter3.html?eval=true&input=%5B2%2C3%2C5%5D&code=%C3%AF%E2%92%AE%E2%89%94%E2%A8%AD%C3%AF%2F2)`
Meh. I'm still finding better ways. It's just @xnor's awesome algorithm.
[Answer]
# CJam, 10 ~~12~~ bytes
```
l~:d_:+2/&
```
2 bytes removed thanks to @MartinB√ºttner.
This displays a number as truthy result, and no output as falsy result.
[**Try it here**](http://cjam.aditsu.net/#code=l%7E%3Ad_%3A%2B2%2F%26&input=%5B-2%203%205%5D)
```
l~     e# read line and evaluate. Pushes the array
:d     e# convert array to double
_      e# duplicate
:+     e# fold addition on the array. Computes sum of the array
2/     e# divide sum by 2
&      e# setwise and (intersection)
```
[Answer]
## Seriously, 6 bytes
```
,;Œ£¬Ω√≠u
```
Outputs 0 if false and a positive integer otherwise.
[Answer]
# Mathematica, ~~20~~ 19 bytes
```
MemberQ[2{##},+##]&
```
Works similarly to most of the other answers.
[Answer]
# Haskell, 20 bytes
```
(\l->sum l/2`elem`l)
```
Using xnor's solution.
[Answer]
## Perl, 24 + 4 = 28 bytes
```
$^+=$_/2 for@F;$_=$^~~@F
```
Requires `-paX` flags to run, prints `1` as True and nothing as False:
`-X` disables all warnings. 
```
$ perl -paXe'$^+=$_/2 for@F;$_=$^~~@F' <<< '5 3 7'
$ perl -paXe'$^+=$_/2 for@F;$_=$^~~@F' <<< '5 3 8'
1
```
[Answer]
# [R](https://www.r-project.org/), 23 bytes
```
sum(x<-scan())%in%(2*x)
```
[Try it online!](https://tio.run/##K/r/v7g0V6PCRrc4OTFPQ1NTNTNPVcNIq0Lzv6mCsYLRfwA "R ‚Äì Try It Online")
Shameless port of [xnor's answer](https://codegolf.stackexchange.com/a/71338/80010).
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 4 bytes
```
DO;¬¢
```
Using 0 as falsy and > 0 as truthy. Uses CP-1252 encoding.
[Answer]
# [Prolog (SWI)](http://www.swi-prolog.org), 35 bytes
```
\A:-permutation([X,Y,E],A),X-Y=:=E.
```
[Try it online!](https://tio.run/##KyjKz8lP1y0uz/z/P8bRSrcgtSi3tCSxJDM/TyM6QidSxzVWx1FTJ0I30tbK1lXvv6O2k7azla5CTLSjjpOOc6zef1NtY20jPS4uIyBtCqaBIkDa0EDbTNsEyNDQNdKEymnommpqa@gagwgjTagmkCBMvbEeAA "Prolog (SWI) ‚Äì Try It Online")
[Answer]
# Jolf, 6 bytes
[Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=IGh4wr11eA)
```
 hx¬Ωux
_hx    the input array
   ¬Ωux  has half the sum of the array
```
This is xnor's awesome solution to the problem, but in Jolf.
[Answer]
# [Pylons](https://github.com/morganthrapp/Pylons-lang), 8
Yet another implementation of xnor's algorithm.
```
i:As2A/_
```
How it works:
```
i    # Get command line input.
:A   # Initialize a constant A.
  s  # Set A to the sum of the stack.
2    # Push 2 to the stack.
A    # Push A to the stack.
/    # Divide A/2
_    # Check if the top of the stack is in the previous elements.
     # Print the stack on quit.
```
[Answer]
# SpecBAS - 36 bytes
Uses xnors formula
```
1 INPUT a,b,c: ?(a+b+c)/2 IN [a,b,c]
```
outputs 1 if true and 0 if false
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~6~~ 5 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
;O–º_O
```
-1 byte by creating a port of [*@xnor*'s Python 3 algorithm](https://codegolf.stackexchange.com/a/71338/52210).
[Try it online](https://tio.run/##MzBNTDJM/f//0HZP/wt74v3//482NNAx0zGJBQA) or [verify all test cases](https://tio.run/##MzBNTDJM/X9u66GVh9b9t/a/sCfe/3/sod3/o6NNdYx1jGJ1FKKNgAxTCAMoBmLowoV0TXV0jXV04ep0waKGBjpmOiZwlnFsLAA).
**Explanation:**
```
¬∑        # Halve every item in the input-array
         #  i.e. [10,6,4] ‚Üí [5.0,3.0,2.0]
 O       # Sum this array
         #  i.e. [5.0,3.0,2.0] ‚Üí 10.0
  –º_O    # Output 1 if the input-array contain this sum, 0 otherwise
         #  i.e. [10,6,4] and 10.0 ‚Üí 1
```
I'm pretty sure `–º_O` can be shortened, but I'm not sure which command(s) I have to use for it..
]