[Question]
  [
Write shortest possible code that will return true if the two given integer values are equal or their sum or absolute difference is 5.
Example test cases:
```
4 1 => True
10 10 => True
1 3 => False
6 2 => False
1 6 => True
-256 -251 => True
6 1 => True
-5 5 => False
```
The shortest I could come up with in python2 is 56 characters long:
```
x=input();y=input();print all([x-y,x+y-5,abs(x-y)-5])<1
```
-9, thanks @ElPedro. It takes input in format x,y:
```
x,y=input();print all([x-y,x+y-5,abs(x-y)-5])<1
```
  
[Answer]
# [Python 2](https://docs.python.org/2/), 30 bytes
```
lambda a,b:a in(b,5-b,b-5,b+5)
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFRJ8kqUSEzTyNJx1Q3SSdJ11QnSdtU839BUWZeiUaahqGOiaYmF5xnoGNogMzXMUbimekYociZIfF0jUzNdICEoabmfwA "Python 2 – Try It Online")
One byte saved by Arnauld
Three bytes saved by alephalpha
[Answer]
# JavaScript (ES6), 28 bytes
Takes input as `(a)(b)`. Returns \$0\$ or \$1\$.
```
a=>b=>a+b==5|!(a-=b)|a*a==25
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1i7J1i5RO8nW1rRGUSNR1zZJsyZRK9HW1sj0f3J@XnF@TqpeTn66RpqGiaaGoaamAhTo6yuEFJWmcqGqMTTQBGFNvGo0NYxRzHFLzClGV2SmqWFEUBHQJDNCLtI1MgWaBSTBboeq@Q8A "JavaScript (Node.js) – Try It Online")
[Answer]
# [Dyalog APL](https://www.dyalog.com/), 9 bytes
```
=∨5∊+,∘|-
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R2wTbRx0rTB91dGnrPOqYUaP7/7@JQpqCIZehAYgy4DIEUsZcZkDSCMw24zq03sgUxAfRhlzq6iABMNcYAA "APL (Dyalog Unicode) – Try It Online")
Spelled out:
```
  =   ∨  5      ∊                +   , ∘    |            -
equal or 5 found in an array of sum and absolute of difference.
```
[Answer]
# x86 machine code, 39 bytes
```
00000000: 6a01 5e6a 055f 5251 31c0 39d1 0f44 c601  j.^j._RQ1.9..D..
00000010: d139 cf0f 44c6 595a 29d1 83f9 050f 44c6  .9..D.YZ).....D.
00000020: 83f9 fb0f 44c6 c3                        ....D..
```
# Assembly
```
section .text
	global func
func:					;inputs int32_t ecx and edx
	push 0x1
	pop esi
	push 0x5
	pop edi
	push edx
	push ecx
	xor eax, eax
	;ecx==edx?
	cmp ecx, edx
	cmove eax, esi
	;ecx+edx==5?
	add ecx, edx
	cmp edi, ecx
	cmove eax, esi
	
	;ecx-edx==5?
	pop ecx
	pop edx
	sub ecx, edx
	cmp ecx, 5
	
	;ecx-edx==-5?
	cmove eax, esi
	cmp ecx, -5
	cmove eax, esi
	ret
```
[Try it online!](https://tio.run/##bVNNj5swED3jXzFCShUSkw/S5JCEjVS1q16qvfTWjSJjzMYrYiNsWrZVfns6ht0k7AaBPW/83swwAwkz@xNnFtbrbw/3cAdjeyjGbMTM4WQEt1IrGFlRW@I95TphOWSV4sQtS89dK6mKyhqQys6inQXBa2AqBZHWxCsqs4dJPUVLFyCMPLvmr670zXXhYwTi1boEwWrqFkK8FTrjGDkb4vFD4Ti0lfCD/i1eqRi/pQ7xKI7nSGZp2iE3KWmb453Ua7XhWdsU6IhtpWiYKnkfzaF5VxvONx@Dn8nh/EbRpbAn7D8hH0ZhbJWMOMEJiFK5LsNux6wtZVJZsdv1@xkzlrM8D4JmNH2kUHyCFZADk6of/COek1lhrPm1jRF6n@mU4jadULydQWduW9CoRQu3hdF8QXGZtkc4xOOKeJkuXQqQ8WQl10b@FTrrN7GD8StqssthHLnUXlEizvp@L6W9dAk986h82hYjt2/GcLqlTfU3DoKN/7OshL/071luhB9gFUdyJE2/FH6oEGYiz2bR1bcLoW4R16kYafLEedeFguv@XpMhVDospIDwMIuITp65Ll4gfIBEKlai9dz@ER3NxUYWcaq0womHXyH84aYm8g797lNEBN9jLgH@oxoMBl9erACuK2WXiPyG8QeL5rDuBr@h/S5ql@0irOv0hoh0Xv/0Hw "Bash – Try It Online")
Edit: fixed bash stderr errors on TIO
Edit 2: improved formatting in TIO header and footer code
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
+,ạ5eo=
```
[Try it online!](https://tio.run/##y0rNyan8/19b5@Guhaap@bb/Dy830leI/P9fQ0FBwUQHSCgY6nCBSAMdCMkFEQORxhCOGZhjhCxjBuToGpkCZYAk0ABNAA "Jelly – Try It Online")
### How it works
```
+,ạ5eo=  Main link. Arguments: x, y (integers)
+        Yield x+y.
  ạ      Yield |x-y|.
 ,       Pair; yield (x+y, |x-y|).
   5e    Test if 5 exists in the pair.
      =  Test x and y for equality.
     o   Logical OR.
```
[Answer]
# [R](https://www.r-project.org/), 40 bytes (or 34)
```
function(x,y)any((-1:1*5)%in%c(x+y,x-y))
```
[Try it online!](https://tio.run/##LcdBCoAgEEDRfaeYjTBTM5BpJdFlQhDcGESBnt4QXL3/nxrglBq@5N94J8xc6EoFUfShx5VUTMpjngpnKUQ1oGbYaAhoGEzXNV1/sQuD2L31zJrqDw "R – Try It Online")
For non-R users:
* `-1:1*5` expands to `[-5, 0, 5]`
* the `%in%` operator takes elements from the left and checks (element-wise) if they exist in the vector on the right
A direct port of [@ArBo's solution](https://codegolf.stackexchange.com/a/178803/79980) has ~~35~~ 34 bytes, so go upvote that answer if you like it:
```
function(x,y)x%in%c(y--1:1*5,5-y)
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~29~~ 31 bytes
```
lambda a,b:a+b==5or`a-b`in"0-5"
```
[Try it online!](https://tio.run/##LYzLDsIgFET3fsWkKx@XBFC6aMKXYJNClEii0NC78euxbdzMmTOLmb/8Klm3aO/t7T/h4eEpDP4SrDWlTl6EKeVOCtM1fi68wMI5RbiNBKckQcm9Ea4be4L@e79RaLNOa6pxPMRSwUgZ@9Mw15QZTIjHM5/aDw "Python 2 – Try It Online")
Since I didn't manage to read the task carefully the first time, in order to fix it, I had to come up with a completely different approach, which is unfortunately not as concise.
[Answer]
# [J](http://jsoftware.com/), ~~12~~ 11 bytes
*1 byte saved thanks to Adám*
```
1#.=+5=|@-,+
```
[Try it online!](https://tio.run/##JU1PC4IwHL37KR4G/Ryu5Sw9bEyEwFOn6B5hmkoo2DoE0Vdfkw7vH7zHG1woQC2MAoEjgfLYCBxOx8rJlTBxZj7lhseOBXZ@2e69VHe@Rn0r8MZt8ns6z6@GCM3j2Syxunqz5PEmKLD1stlDaplAJlpip3OkXnN9SbMcnmTQ1N1URgRTgIapH5927sd7qHQUqvJ/zYkR/xIi4qFiZdRuGVuLArZ2Pw "J – Try It Online")
## Explanation
This is equivalent to:
```
1 #. = + 5 = |@- , +
```
This can be divided into the following fork chain:
```
(= + (5 e. (|@- , +)))
```
Or, visualized using `5!:4<'f'`:
```
  ┌─ =               
  ├─ +               
──┤   ┌─ 5           
  │   ├─ e.          
  └───┤          ┌─ |
      │    ┌─ @ ─┴─ -
      └────┼─ ,      
           └─ +      
```
Annotated:
```
  ┌─ =                                     equality
  ├─ +                                     added to (boolean or)
──┤   ┌─ 5                                   noun 5
  │   ├─ e.                                  is an element of
  └───┤          ┌─ |  absolute value         |
      │    ┌─ @ ─┴─ -  (of) subtraction       |
      └────┼─ ,        paired with            |
           └─ +        addition               | any of these?
```
[Answer]
# Python 2, 38 bytes
-2 bytes thanks to @DjMcMayhem
```
lambda a,b:a+b==5or abs(a-b)==5or a==b
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFRJ8kqUTvJ1tY0v0ghMalYI1E3SRPKs7VN@l9QlJlXopGmYahjoqn5HwA "Python 2 – Try It Online")
[Answer]
# [Java (JDK)](http://jdk.java.net/), 30 bytes
```
a->b->a+b==5|a==b|(b-=a)*b==25
```
[Try it online!](https://tio.run/##ZVBLi4MwGLz7Kz4KQtJVUXftod14XNjDwkKP0kN8lbgaxXwWSutvd@ODpV0DSSYzk8mQgl@4XaQ/g6iaukUo9NnpUJTO9mCsuLyTCYpajmJScqXgiwsJNwOg6eJSJKCQo94utUih0ho5YivkOToBb8@KTlaAT4kfS9S7xt9tloqEYxZCDgwGboexHfKXmLHgzhmL7yS2GadbTfjBcJgyhMTopHMxU6j0rTl5HDd4s8CD3npgPFdT7j/OgtdnZmeBv/LsnhnbD7RNr97q7gPTzyXzuiVT0anmfi5L/7oerwqzyqk7dBr9TZiTjZmCme7BVKbcWJM/ck8L8DTIHd405ZUsCnVGQBaZ0vnZ3hhnP/wC "Java (JDK) – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 22 bytes
Takes input as `[a][b]`.
```
MatchQ[#|5-#|#-5|#+5]&
```
[Try it online!](https://tio.run/##LYjBCoQgFEV/5cKDNimkZbsGf2Cg1uJCoqhFLQZ36rc7Gm3uOedezh/b5fy5urxjyl/n12MxFBWnSFxFapVt8vw7b28CUQL/YDdkDUlr0UBrjRAGBpEYguiKdI8x9JUjg3x7rORSlausSCn/AQ "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~48~~ ~~44~~ 40 bytes
```
param($a,$b)$b-in($a-5),(5-$a),(5+$a),$a
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/vyCxKDFXQyVRRyVJUyVJNzMPyNY11dTRMNVVSQRR2iBKJfH///@6RqZmIMIQAA "PowerShell – Try It Online") or [Verify all Test Cases](https://tio.run/##ZZBfa4MwFMXf8ylSyEbCElBXfRsIhcGeWljfShmxTalFjTVxZXR@dneNzlZ6H3KS3zk3/0p9UZU5qixrSYHf8LUtZSVzSiQnCSOJSAuYi5BxGgoiO3nphMi2QSimCEPFdM6xKx/UZ3ygvuewkzs6ZF9BvZFGAw0m9D8bTXYQQRhxGKanRZM7IIZ/8dPVeZvV56I2VufL5KR2dhv3uKtDWhn7UZS1hceTr423HS2jdrrY33n@zdO17TF9hm9zfX2CjZFvmaX71P6slbHLMf6Qx0Kd8WwGi2BoblADV3/XVS6tWMskU@0f "PowerShell – Try It Online")
Takes input `$a` and `$b`. Checks if `$b` is `-in` the group (`$a-5`, `5-$a` `5+$a`, or `$a`), which checks all possible combinations of `$a`,`$b`, and `5`.
*-4 bytes thanks to mazzy.*  
*-4 bytes thanks to KGlasier.*
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 24 bytes
*-1 byte thanks to Grimy*
```
{$^a-$^b==5|0|-5|5-2*$b}
```
[Try it online!](https://tio.run/##RYzBCoMwAEPv/YocZOiw0ta1t7rbvmC3oqCswkCn1MkY1m/v3EVDCHkQMlrXqdB/cWqhEZaoqmlUNVpLzzyVXlJxjpo1tIND3D1fdkqKIvsM7jFhIdg0zm@Yaxv7zLCUl0maGZHmZUnWcAGHLnB3syWcYfNOyP/9VneTJQriAA61r6iQClscL@p4/AE "Perl 6 – Try It Online")
This uses the Any Junction but technically, `^` could work as well.
### Explanation:
```
{                      }  # Anonymous code block
 $^a-$^b==                # Is the difference equal to
           | |  |        # Any of
          0 
            5
              -5
                 5-2*$b
```
[Answer]
# [Pascal (FPC)](https://www.freepascal.org/), ~~26~~ 70 bytes
**Edit:** + input variables.
```
Procedure z(a,b:integer);begin Writeln((abs(a-b)in[0,5])or(a+b=5))end;
```
[Try it online!](https://tio.run/##TcxBCsIwEIXhvafIcgYTsYUiGHoHdy7ExSQdQ6AmYVpBvHysitDdB@/xF5o8jeZWfC2Sg9BdPW09SfY8PITVC0i7Y0wzBxa0jkNM6ixx5jEBkJuAjMOYLnvdXTEL0Nb1HSKnwdbve7M0mlY3LdoPzUGblf9c67cvhV19Aw "Pascal (FPC) – Try It Online")
---
```
(abs(a-b)in[0,5])or(a+b=5)
```
[Try it online!](https://tio.run/##DcnBCsIwDADQ@74ixxZXUWEIjv2Elx3EQ9JlpVC7ko7h1xt7fa9g9ZjcWrwW2YLgB75jBwcKYE@PmHcOLE2IQ8wdwJNxSdm0tE1hlrizUYNUDTqyMb8u/fC2mxg80TRYtSNwXs7q7uCuN/j5NWGo@gc "Pascal (FPC) – Try It Online")
I hope that my answer is according to all rules of code-golf. It was fun anyway.
[Answer]
# x86-16 machine code, ~~21~~ 20 bytes
```
00000000: 8bd0 2bc3 740d 7902 f7d8 3c05 7405 03d3  ..+.t.y...<.t...
00000010: 80fa 05c3                                ....
```
Listing:
```
8B D0       MOV  DX, AX     ; Save AX to DX 
2B C3       SUB  AX, BX     ; AX = AX - BX 
74 0D       JZ   DONE       ; if 0, they are equal (ZF=1) 
79 02       JNS  IS_POS     ; if positive, check if result is 5
F7 D8       NEG  AX         ; is negative, negate the result to get abs value
        IS_POS: 
3C 05       CMP  AL, 5      ; is result 5?
74 05       JZ   DONE       ; if so, exit with ZF=1
03 D3       ADD  DX, BX     ; DX = DX + BX
80 FA 05    CMP  DL, 5      ; ZF = ( DX == 5 )
        DONE:
C3          RET             ; return to caller
```
Input numbers in `AX` and `BX` and returns Zero Flag (`ZF`) if result is truthy.
[Try it online!](https://tio.run/##dVThUuJIEP6deYqu1LoQnSBB8WpBtERwva1VLNEry41FDckAuQ0TLjPReC7P7vUMiYi1l4LJ9HT3191fd2bM5Ow1YAoOD/uDMziCXTVf7LIak3Nog9Avd8LjyV7jvcZNVlKQhLyWoCEPZgnYhOeKpwIioWA0Ykql0ThTfDSqVidMqoDFsePAJBNBFU0o/p02kDmLRNV5IdpLcankj4fOi0/2qUeJV6f4Ix7do@SANvTugBK30TyguHj60CPLNpkkqYaEqFNvR4cy@pcnk6oBc3YLyUSLdjoNDLVIUZpUfXsrpFthC7akL3ybrqJHD@Vmx3ugJtvfKJxj375JM@7bLd8@Y7HEndMmS7K0Sxalysa1oO0Tn0yDYJM0pPS90QadrkjcRcTBne81jHcy/jvM5gtwe@BeaHZ5vOFw9PmDndxQ/0JaORxVdZs9tHV@wTTlaNaHyo@6@@XhZX8JFTQLMgXuGP5w9xvaKQU3hIovKmvBmGk0gz/jeU3lCo@esLwA3@zpJ1ReDL3wydttLLX9im2wfbG9vd19VhyCJBOqhZIvNPU2fDLJuc5bKWagXF44nfNcF6Y9bGMCeR6CizktPmaiFSXIBt2vkgcqSgTUFI4psaZxMmaxmUail5aFTxvZXWRKapL3GiOFg50DEyHwMCdQPHen51@hf3JHoX96B9qJhWyhoJxxUAlSKVUyBy1GYooFi0cudPgPKF2N0rsjxLoY/AV6SzW0QR2yRw64Rzi0sIa3XSjCdlcGqOvoxYUu6r/dI2pvcNk3umgCdQpqxoVenoGlHPg/GVZcvT/reA7aXw4B/hyOrgbD0mORyEhFj5xCMOPBT32UcpnF@GFJaBKwLvtf4S0/PBN8ylYOZsd1rNIF055yBWws4ZHFGSerWC1inV5cAZx8p9AsYAqP5vFvqpAJBZ5HCp4iNQOdO7FOer2Sq4KKnqYClx1DhQnQ0wFKlCY1rhbR0JiC9a5tqW7U//UL8GrB/FSWihYUfob3@zM4Bg9aUH9rqckdq7y5vu2XDOEdoWbPmnTneN37wXXZypLLCZhL5JmCRNJMhDXwdf@GFLitt8Or2@E5eGtxcLVuDUeodfR3mB5OGqK94mX/@h8 "Bash – Try It Online") (testing code borrowed and adapted from [@Logem's answer](https://codegolf.stackexchange.com/a/178821/84624) - thanks!)
*Explanation:*
If the difference between the numbers is 0, they are equal. Otherwise if result is negative, first negate it (abs value) and check for 5. If still not true, add and check for 5.
*Bonus:*
If desired, you can also determine which condition was true with the following:
* `ZF` = `1` and `DX` = `5` ; sum is 5
* `ZF` = `1` and `AX` = `5` ; diff is 5
* `ZF` = `1` and `AX` = `0` ; equal
* `ZF` = `0` ; falsey
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 10 bytes
```
OIÆ‚Ä50SåZ
```
[Try it online!](https://tio.run/##yy9OTMpM/f/f3/Nw26OGWYdbTA2CDy@N@v8/WtfQyFAHSJjFAgA "05AB1E – Try It Online")
---
```
O           # Sum the input.
 IÆ         # Reduced subtraction of the input.
   ‚        # Wrap [sum,reduced_subtraction]
    Ä       # abs[sum,red_sub]
     50S    # [5,0]
        å   # [5,0] in abs[sum,red_sub]?
         Z  # Max of result, 0 is false, 1 is true.
```
Tried to do it using stack-only operations, but it was longer.
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~43~~, ~~48~~, ~~47~~, 33 bytes
EDIT: Tried to use % and apparently forgot how to %. Thanks to Arnauld for pointing that out!
EDIT2: AdmBorkBork with a -1 byte golf rearranging the parentheses to sit next to the return so no additional space is needed!
EDIT3: Thanks to dana for -14 byte golf for the one-line return shortcut and currying the function (Ty Embodiment of Ignorance for linking to TIO).
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 33 bytes
```
a=>b=>a==b|a+b==5|(a-b)*(a-b)==25
```
[Try it online!](https://tio.run/##hc2xCgIxDAbgvU@RsVVPVKyL5hbBSUFwcE57VQq1lWtPEPXZz54Obh6BP4F8JDoWOtSmbaL1ZzjcYzKXJdOOYoR9Hc41XR4M4NooZzXERCm3W7AV7Mh6LrolwKbxemV9Gv0mFYIrS6gAW8JSYUmI6klDhSifnAolBp9EnMl2yb6fx@vgY3BmfKxtMlvrDa@4FHwqhfhrphPB@8xcdKznTjY9pJjJrHIuOsjYK1d7amzlIrkTvQE "C# (.NET Core) – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 33 bytes
```
f(a,b){a=!(a+b-5&&(a-=b)/6|a%5);}
```
[Try it online!](https://tio.run/##FY3BCsIwEETv@YoasGTpBttqIxiDN7/AW@lhE6jkYBWtp5pvj9uBGRgewwR9DyHnURF6WMhtFFVed2WpSDsPO/OjbQc25QfFSUGxiDjNBfWDWw7Y1NigYeu2M2gSioLlV9iscI8tY4bckhXj863WdXS1jeejjVUF4vWdP4rv@zig54CLvMmTvEqwIuU/ "C (gcc) – Try It Online")
Tried an approach I didn't see anyone else try using. The return expression is equivalent to `a+b==5||((-6<a-b||a-b<6)&&(a-b)%5==0)`.
---
[Answer]
# Scala, 43 bytes
```
def f(a:Int,b:Int)=a+b==5|(a-b).abs==5|a==b
```
[Try it online!](https://tio.run/##dcyxCoMwFAXQ3a94SIeEajFaHQopdOzQj3jRCBaJ0mQoqN@eJoGiRZrhQi7nXV1jj3YQT1kbeGCnQL6NVI2G2zjCFNlGttASvNyVSYRPyvEoOC/nmWAq6AmFDj/kXFiA8dUp0yui43MC7jEf/AqHqSWuYXSJabRlLPOOZSvzDcv2MOwVmz3XFDtWBZZvmGvyP2vV71q1Y2leunOX7MvWJuDFfgA)
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 8 bytes
```
=|+5|-ȧ5
```
Takes input as a list of two numbers (use `_` for negatives). [Try it online!](https://tio.run/##SypKTM6ozMlPN/r/37ZG27RG98Ry0///ow11zGIB "Brachylog – Try It Online")
### Explanation
Pretty much a direct translation of the spec:
```
=          The two numbers are equal
 |         or
  +        The sum of the two numbers
   5       is 5
    |      or
     -     The difference of the two numbers
      ȧ    absolute value
       5   is 5
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~41~~ 34 bytes
```
f(a,b){a=5==abs(a-b)|a+b==5|a==b;}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NI1EnSbM60dbU1jYxqVgjUTdJsyZRO8nW1rQm0dY2ybr2f25iZp6GJlc1l4KCQkFpSbFGmoahkY6hgaa9UkhRaaqSlZJbYk5xqpKmNReyEh0TLAqQ5A2wG4FsghkW@dr/AA "C (gcc) – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~13~~ 12 bytes
```
ÐO5Qs`α5QrËO
```
[Try it online!](https://tio.run/##yy9OTMpM/f//8AR/08DihHMbTQOLDnf7//8frWtkaqYDJAxjAQ "05AB1E – Try It Online")
Takes input as a list of integers, saving one byte. Thanks @Wisław!
# Alternate 12 byte answer
```
Q¹²α5Q¹²+5QO
```
[Try it online!](https://tio.run/##yy9OTMpM/f8/8NDOQ5vObTQF09qmgf7//@samZpxAQlDAA "05AB1E – Try It Online")
This one takes input on separate lines.
[Answer]
## [Ruby](https://www.ruby-lang.org/en/), 34 Bytes
```
->(a,b){[a+5,a-5,5-a,a].include?b}
```
[Online Eval](https://tio.run/##KypNqvyfZvtf104jUSdJszo6UdtUJ1HXVMdUN1EnMVYvMy85pzQl1T6p9n@BQlq0iY6CYSwXiGVoAGQaQNk6CsYQlpmOghFczAzC0jUyBQoDSUO4GigLaI2Caex/AA)
- Thanks @ASCII-Only
[Answer]
# [Factor](https://factorcode.org/), ~~44~~ 40 bytes
Saved 4 bytes thanks to @chunes!
```
[ { [ = ] [ - abs 5 = ] [ + 5 = ] } || ]
```
[Try it online!](https://tio.run/##LYi9CgIxEAZ7n@LrJQGFs1CsxcZGrI4r9pbIBfNzbNZCPJ89prhmmJknsWapj/v1djmCcxx9onaKLVMWNeyF315tiSSKl5PkAiLphFmc6mcWnxSnjdl3BzTsao8vepwxNBrQWNCttV3th2XBUJlCgK1/ "Factor – Try It Online")
The repetition of `=` is annoying, but I couldn't find another way.
`||` tries out each of the three quotations in `{...}` and checks if the result is true for any of them. The first, `[ = ]`, checks if they're equal, the second finds the absolute value of their difference and compares that to 5, and the third compares their sum to 5.
[Answer]
# [Tcl](http://tcl.tk/), 53 bytes
```
proc P a\ b {expr abs($a-$b)==5|$a==$b|abs($a+$b)==5}
```
[Try it online!](https://tio.run/##LYuxCoNAEAX7/YpXbGEIgmv0uvsH@8RiV@wMHmpAOO/bL4I2MzAw2zDlHJZ5QAf9wBDHPSxQWwvWku3hfXuwes92XPF5xZSnr4b7oQZCUkEqErzIoT7tqKxbhxNCCTH8thXvDqxg61P@Aw "Tcl – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~14~~ 13 bytes
```
¥VªaU ¥5ª5¥Nx
```
[Try it online!](https://tio.run/##y0osKPn//9DSsEOrEkMVDi01PbTK9NBSv4r//w0VzAA "Japt – Try It Online")
[Answer]
## Batch, 81 bytes
```
@set/as=%1+%2,d=%1-%2
@if %d% neq 0 if %d:-=% neq 5 if %s% neq 5 exit/b
@echo 1
```
Takes input as command-line arguments and outputs 1 on success, nothing on failure. Batch can't easily do disjunctions so I use De Morgan's laws to turn it into a conjunction.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 18 bytes
```
Ｎθ¿№⟦θ⁺⁵θ⁻⁵θ⁻θ⁵⟧Ｎ1
```
[Try it online!](https://tio.run/##S85ILErOT8z5/98zr6C0xK80Nym1SKNQ05orM01Bwzm/NK9EI7pQRyEgp7RYw1RHoVBTR8E3Mw@dA1Rhqhmro4BsiKampkJAUSbQACVDJU3r//91jUzNFICE4X/dshwA "Charcoal – Try It Online") Link is to verbose version of code. Port of @ArBo's Python 2 solution.
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 82 bytes
```
\d+
$*
^(-?1*) \1$|^(-?1*)1{5} -?\2$|^-?(-?1*) (\3)1{5}$|^-?(1 ?){5}$|^(1 ?-?){5}$
```
[Try it online!](https://tio.run/##LYmxDkAwFEX39xVvIGnJS9yWrh39RCMkDBaD2PDtVWq5955z9@VYtymWqh9jmGsqKhqUeFSaA4rr3zi7m8UHk4z4/1fBfkd2YK8zvFMyxNgyCA2jIbAlxya1IzGd4xRIBg8 "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation: The first two lines convert the inputs into unary. The final line then checks for any of the permitted matches:
```
^(-?1*) \1$                              x==y
^(-?1*)1{5} -?\2$   x>=0 y>=0 x=5+y i.e. x-y=5
                    x>=0 y<=0 x=5-y i.e. x+y=5
                    x<=0 y<=0 x=y-5 i.e. y-x=5
^-?(-?1*) (\3)1{5}$ x<=0 y<=0 y=x-5 i.e. x-y=5
                    x<=0 y>=0 y=5-x i.e. x+y=5
                    x>=0 y>=0 y=5+x i.e. y-x=5
^-?(1 ?){5}$        x>=0 y>=0 y=5-x i.e. x+y=5
                    x<=0 y>=0 y=5+x i.e. y-x=5
^(1 ?-?){5}$        x>=0 y>=0 x=5-y i.e. x+y=5
                    x>=0 y<=0 x=5+y i.e. x-y=5
```
Pivoted by the last column we get:
```
x==y            ^(-?1*) \1$
x+y=5 x>=0 y>=0 ^-?(1 ?){5}$
      x>=0 y>=0 ^(1 ?-?){5}$
      x>=0 y<=0 ^(-?1*)1{5} -?\2$
      x<=0 y>=0 ^-?(-?1*) (\3)1{5}$
      x<=0 y<=0 (impossible)       
x-y=5 x>=0 y>=0 ^(-?1*)1{5} -?\2$
      x>=0 y<=0 ^(1 ?-?){5}$
      x<=0 y>=0 (impossible)
      x<=0 y<=0 ^-?(-?1*) (\3)1{5}$
y-x=5 x>=0 y>=0 ^-?(-?1*) (\3)1{5}$
      x>=0 y<=0 (impossible)
      x<=0 y>=0 ^-?(1 ?){5}$
      x<=0 y<=0 ^(-?1*)1{5} -?\2$
```
[Answer]
# Japt, ~~13~~ 12 bytes
```
x ¥5|50ìøUra
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=eCClNXw1MOz4VXJh&input=WzQsMV0=) or [run all test cases](https://ethproductions.github.io/japt/?v=1.4.6&code=eCClNXw1MOz4VXJh&input=WwpbNCwxXQpbMTAsMTBdClsxLDNdCls2LDJdClsxLDZdClstMjU2LC0yNTFdClstNSw1XQpdCi1tUg==)
```
x ¥5|50ìøUra
                 :Implicit input of array U
x                :Reduce by addition
  ¥5             :Equal to 5?
    |            :Bitwise OR
     50ì         :Split 50 to an array of digits
        ø        :Contains?
         Ur      :  Reduce U
           a     :    By absolute difference
```
]