[Question]
  [
## Challenge
Given a (floating-point/decimal) number, return its reciprocal, i.e. 1 divided by the number. The output must be a floating-point/decimal number, not just an integer.
### Detailed specification
* You must receive input in the form of a floating-point/decimal number...
	+ ...which has at least 4 significant digits of precision (if needed).
	+ More is better, but does not count in the score.
* You must output, with any acceptable output method...
	+ ...the reciprocal of the number.
	+ This can be defined as 1/x, x⁻¹.
	+ You must output with at least 4 significant digits of precision (if needed).
Input will be positive or negative, with absolute value in the range [0.0001, 9999] inclusive. You will never be given more than 4 digits past the decimal point, nor more than 4 starting from the first non-zero digit. Output needs to be accurate up to the 4th digit from the first non-zero one.
(Thanks @MartinEnder)
Here are some sample inputs:
```
0.5134
0.5
2
2.0
0.2
51.2
113.7
1.337
-2.533
-244.1
-0.1
-5
```
Note that you will never be given inputs which have above 4 digits of precision.
Here is a sample function in Ruby:
```
def reciprocal(i)
    return 1.0 / i
end
```
## Rules
* All accepted forms of output are allowed
* Standard loopholes banned
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), shortest answer in bytes wins, but will not be selected.
### Clarifications
* You will never receive the input `0`.
## Bounties
This challenge is obviously trivial in most languages, but it can offer a fun challenge in more esoteric and unusual languages, so some users are willing to award points for doing this in unusually difficult languages.
* ~~[@DJMcMayhem](https://codegolf.stackexchange.com/users/31716/djmcmayhem) will award a **+150 points** bounty to the shortest brain-flak answer, since brain-flak is notoriously difficult for floating-point numbers~~
* [@L3viathan](https://codegolf.stackexchange.com/users/21173/l3viathan) will award a **+150 points** bounty to the shortest [OIL](https://github.com/L3viathan/OIL) answer. OIL has no native floating point type, nor does it have division.
* [@Riley](https://codegolf.stackexchange.com/users/57100/riley) will award a **+100 points** bounty to the shortest sed answer.
* [@EriktheOutgolfer](https://codegolf.stackexchange.com/users/41024/erik-the-outgolfer) will award a **+100 points** bounty to the shortest Sesos answer. Division in brainfuck derivatives such as Sesos is very difficult, let alone floating-point division.
* ~~I ([@Mendeleev](https://codegolf.stackexchange.com/users/53551/Mendeleev)) will award a bounty of **+100 points** to the shortest Retina answer.~~
If there's a language you think would be fun to see an answer in, and you're willing to pay the rep, feel free to add your name into this list (sorted by bounty amount)
## Leaderboard
Here is a Stack Snippet to generate an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
```
# Language Name, N bytes
```
where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:
```
# Ruby, <s>104</s> <s>101</s> 96 bytes
```
If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header:
```
# Perl, 43 + 2 (-p flag) = 45 bytes
```
You can also make the language name a link which will then show up in the leaderboard snippet:
```
# [><>](http://esolangs.org/wiki/Fish), 121 bytes
```
```
var QUESTION_ID=114544,OVERRIDE_USER=62393;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={};e.forEach(function(e){var o=e.language;/<a/.test(o)&&(o=jQuery(o).text().toLowerCase()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link,uniq:o}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.uniq>s.uniq?1:e.uniq<s.uniq?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=617d0685f6f3"> <div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr></tbody> </table>
```
  
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~772~~ ~~536~~ ~~530~~ ~~482~~ 480 + 1 = 481 bytes
Since Brain-Flak does not support floating point numbers I had to use the `-c` flag in order input and output with strings, hence the +1.
```
(({})[((((()()()()())){}{})){}{}]){((<{}>))}{}({}<{({}[((((()()()){}())()){}{}){}]<>)<>}<>{({}<>[()()])<>}{}([]<{({}<>[()()])<>}>)<>([[]](())){({}()<((((((({}<(((({})({})){}{}){}{})>)({})){}{}){})({})){}{}){})>)}{}({}(<>))<>([()]{()<(({})){({}[()])<>}{}>}{}<><{}{}>){({}<((()()()()()){})>(<>))<>([()]{()<(({})){({}[()])<>}{}>}{}<><([{}()]{})>)}{}<>({}()<<>([]){{}({}<>)<>([])}{}<>>){({}[()]<({}<>((((()()()){}){}){}){})<>>)}{}([()()])([]){{}({}<>((((()()()){}){}){}){})<>([])}<>>)
```
[Try it online!](https://tio.run/nexus/brain-flak#lVBBDsMwCPuOOXTqbRfERyJO2y@ivL0z0GzNpB2WtlQB23F8AH1IQyyZj0gf7GZ16YD2YSLcEayd5UIgigUnhwQ1URtqgVNrgfHoENdcv7sBRmvuyHMRaopaRNZPMO1UsaWxbuz0CfpIbR7UUzNRaX4aik9Ng2o50iWGUPtDBi3M@/RAUl4myEyxwqvres3traM5W0L9vAHM9Cq0q9pPRp4RxOPY7rd9P7bn4wU "Brain-Flak – TIO Nexus")
# Explanation
The first thing we need to take care of is the negative case. Since the reciprocal of a negative number is always negative we can simply hold on to the negative sign until the end. We start by making a copy of the top of the stack and subtracting 45 (the ASCII value of `-`) from it. If this is one we put a zero on the top of the stack, if not we do nothing. Then the we pick up the top of the stack to be put down at the end of the program. If the input started with a `-` this is still a `-` however if it is *not* we end up picking up that zero we placed. 
```
(({})[((((()()()()())){}{})){}{}]){((<{}>))}{}
({}<
```
Now that that is out of the way we need to convert the ASCII realizations of each digit into there actual values (0-9). We also are going to remove the decimal point `.` to make computations easier. Since we need to know where the decimal point started when we reinsert it later we store a number to keep track of how many digits were in front of the `.` on the offstack.
Here is how the code does that:
We start by subtracting 46 (the ASCII value of `.`) from each element on the stack (simultaneously moving them all onto the offstack). This will make each digit two more than should be but will make the `.` exactly zero.
```
{({}[((((()()()){}())()){}{}){}]<>)<>}<>
```
Now we move everything onto the left stack until we hit a zero (subtracting two from each digit while we go):
```
{({}<>[()()])<>}{}
```
We record the stack height
```
([]<
```
Move everything else onto the left stack (once again subtracting the last two from every digit as we move them)
```
  {({}<>[()()])<>}
```
And put the stack height we recorded down
```
>)
```
Now we want to combine the digits into a single base 10 number. We also want to make a power of 10 with twice the digits as that number for use in the calculation.
We start by setting up a 1 on top of the stack to make the power of 10 and pushing the stack height minus one to the on stack for the use of looping.
```
<>([][(())])
```
Now we loop the stack height minus 1 times,
```
{
 ({}[()]<
```
Each time we multiply the top element by 100 and underneath it multiply the next element by 10 and add that to the number below.
```
 ((((((({}<(((({})({})){}{}){}{})>)({})){}{}){})({})){}{}){})
```
We end our loop
```
 >)
}{}
```
Now we are finally done with the set up and can begin the actual calculation.
```
({}(<>))<>([()]{()<(({})){({}[()])<>}{}>}{}<><{}{}>)
```
That was it...
We divide the power of 10 by the modified version of the input using [0 '](https://codegolf.stackexchange.com/users/20059/millet-mage)'s integer division algorithm as found on [the wiki](https://github.com/DJMcMayhem/Brain-Flak/wiki/Basic-Arithmetic-Operations). This simulates the division of 1 by the input the only way Brain-Flak knows how.
Lastly we have to format our output into the appropriate ASCII.
Now that we have found `ne` we need to take out the `e`. The first step to this is converting it to a list of digits. This code is a modified version of [0 '](https://codegolf.stackexchange.com/users/20059/)'s [divmod algorithm](https://codegolf.stackexchange.com/a/114321/56656).
```
{({}<((()()()()()){})>(<>))<>([()]{()<(({})){({}[()])<>}{}>}{}<><([{}()]{})>)}{}
```
Now we take the number and add the decimal point back where it belongs. Just thinking about this part of the code brings back headaches so for now I will leave it as an exercise for the reader to figure out how and why it works.
```
<>({}()<<>([]){{}({}<>)<>([])}{}<>>){({}[()]<({}<>((((()()()){}){}){}){})<>>)}{}([()()])([]){{}({}<>((((()()()){}){}){}){})<>([])}<>
```
Put the negative sign down or a null character if there is no negative sign.
```
>)
```
[Answer]
# [Python 2](https://docs.python.org/2/), 10 bytes
```
1..__div__
```
[Try it online!](https://tio.run/nexus/python2#S1OwVYj5b6inFx@fklkWH/@/oCgzr0QjTcNcU/M/AA "Python 2 – TIO Nexus")
[Answer]
## [Retina](https://github.com/m-ender/retina), ~~99~~ 91 bytes
```
1`\.|$
8$*;
+`;(;*)(\d)
$2$1
\d+
$*1,10000000$*
(1+),(\1)+1*
$#2
+`(\d)(;+);
$2$1
1`;
.
;
0
```
[Try it online!](https://tio.run/nexus/retina#JYu7DcMwEEN7rhEF0Mc@iCcrdnADZAkVKjJGdnfOMIv3WJDP@Jkn55BfwBGyoUyLllMc34SggRjfgpC5sN4JGZElLXEwFWaEh/rp2kcrye4Tp0FgqOdZpbNtcEGhUr0pOh1kkx2U1pzqm1Wlt@baNiHWeqFffh/76w8 "Retina – TIO Nexus")
Woohoo, sub-100! This is surprisingly efficient, considering that it creates (and then matches against) a string with more than 107 characters at one point. I'm sure it's not optimal yet, but I'm quite happy with the score at the moment.
Results with absolute value less than 1 will be printed without the leading zero, e.g. `.123` or `-.456`.
### Explanation
The basic idea is to using integer division (because that's fairly easy with regex and unary arithmetic). To ensure that we get a sufficient number of significant digits, we divide the input into **107**. That way, any input up to **9999** still results in a 4-digit number. Effectively, that means we're multiplying the result by **107** so we need to keep track of that when later reinsert the decimal point.
```
1`\.|$
8$*;
```
We start by replacing the decimal point, or the end of the string if there is no decimal point with 8 semicolons. The first one of them is essentially the decimal point itself (but I'm using semicolons because they don't need to be escaped), the other 7 indicate that value has been multiplied by **107** (this isn't the case yet, but we know we will do that later).
```
+`;(;*)(\d)
$2$1
```
We first turn the input into an integer. As long as there are still digits after the decimal point, we move one digit to the front and remove one of the semicolons. This is because moving the decimal point right multiplies the input by **10**, and therefore divides the result by **10**. Due to the input restrictions, we know this will happen at most four times, so there are always enough semicolons to be removed.
```
\d+
$*1,10000000$*
```
Now that the input is an integer, we convert it to unary and append **107** `1`s (separated by a `,`).
```
(1+),(\1)+1*
$#2
```
We divide the integer into **107** by counting how many backreferences to it fit (`$#2`). This is standard unary integer division `a,b` --> `b/a`. Now we just need to correct the position of the decimal point.
```
+`(\d)(;+);
$2$1
```
This is basically the inverse of the second stage. If we still have more than one semicolon, that means we still need to divide the result by **10**. We do this by moving the semicolons one position to the left and dropping one semicolon until we either reach the left end of the number, or we're left with only one semicolon (which is the decimal point itself).
```
1`;
.
```
Now is a good time to turn the first (and possibly only) `;` back into `.`.
```
;
0
```
If there are still semicolons left, we've reached the left end of the number, so dividing by 10 again will insert zeros behind the decimal point. This is easily done by replacing each remaining `;` with a `0`, since they're immediately after the decimal point anyway.
[Answer]
# [yup](https://github.com/ConorOBrien-Foxx/yup), 5 bytes
```
|0~-e
```
[Try it online!](https://tio.run/nexus/yup#0/pfY1Cnm/pf@f9/3bz/RgA "yup – TIO Nexus") This takes input from the top of the stack and leaves output on the top of the stack. The TIO link takes input from command line arguments, which is only capable of taking integer input.
## Explanation
yup only has a few operators. The ones used in this answer are **ln**(x) (represented by `|`), **0**() (constant, nilary function returning `0`), **−** (subtraction), and **exp**(x) (represented by `e`). `~` switches the top two members on the stack.
```
|0~-e     top of the stack: n    stack: [n]
|         pop n, push ln(n)      stack: [ln(n)]
 0        push 0                 stack: [ln(n), 0]
  ~       swap                   stack: [0, ln(n)]
   -      subtract               stack: [-ln(n)]
    e     exp                    stack: [exp(-ln(n))]
```
This uses the identity
[![x/y = e^(ln(x)-ln(y))](https://i.stack.imgur.com/KrP3L.gif)](https://i.stack.imgur.com/KrP3L.gif)
which implies that
[![](https://i.stack.imgur.com/w5l7r.gif)](https://i.stack.imgur.com/w5l7r.gif)
[Answer]
# [LOLCODE](http://lolcode.org/), ~~63~~, 56 bytes
```
HOW DUZ I r YR n 
VISIBLE QUOSHUNT OF 1 AN n
IF U SAY SO
```
7 bytes saved thanks to @devRicher!
This defines a function 'r', which can be called with:
```
r 5.0
```
or any other `NUMBAR`.
[Try it online!](https://repl.it/Gn1P/1)
[Answer]
# [sed](https://www.gnu.org/software/sed/), 575 + 1 (`-r` flag) = ~~723~~ ~~718~~ ~~594~~ ~~588~~ 576 bytes
```
s/$/\n0000000000/
tb
:b
s/^0+//
s/\.(.)(.*\n)/\1.\2/
tD
bF
:D
s/.*/&&&&&&&&&&/2m
tb
:F
s/\.//
h
s/\n.+//
s/-//
:
s/\b9/;8/
s/\b8/;7/
s/\b7/;6/
s/\b6/;5/
s/\b5/;4/
s/\b4/;3/
s/\b3/;2/
s/\b2/;1/
s/\b1/;0/
s/\b0//
/[^;]/s/;/&&&&&&&&&&/g
t
y/;/0/
x
G
s/[^-]+(\n0+)\n(0+)/\2\1/
s/\n0+/&&\n./
:a
s/^(-?)(0*)0\n0\2(.*)$/\10\2\n\30/
ta
s/.*/&&&&&&&&&&/2m
s/\n0(0*\n\..*)$/\n\1 x/
Td
s/x//
ta
:d
s/[^-]+\n//
s/-(.+)/\1-/
s/\n//
:x
s/^0{10}/0x/
s/(.)0{10}/0\1/
tx
s/00/2/g
s/22/4/g
y/0/1/
s/41/5/g
s/21/3/g
s/45/9/g
s/44/8/g
s/43/7/g
s/42/6/g
y/ /0/
s/([1-9])0/\1/g
y/x/0/
s/(.+)-/-\1/
```
[Try it online!](https://tio.run/nexus/sed#bVG7bhsxEOz3K1wExp2E5ZK8t1ikMZwfSCdKgM4OYhehgpyKM4J8dtooQ65jpDABknO7O3uzw@siHyQm@7aELjPtZlrkaLciuKOpTF2ZTUy1RGeiR8kdzfe0u0PWbOT2bYn/Vuj3hQb2UwbJaCPGucuBeZIwltbzKGFQNEjoFfUSOkWdhFZRK6FR1EjwirwEp8hJsIos/iH7YzjIIuF/ZV/pQi8IoW6lT6jdH/mwrTD6to6pwinRR@2HGKjQDb2n7ETFH@vKbmqLVPTwooZpDjCm2GTLTu85UTqBhiKjlBTdzSr0@RG5VQpv9/hPS0zqUmWyFscqJXu2ltf46ewvsWsO40FeP7PiS87j5TyGXMR7aQFeMGmZpnXSacJJU0DbyaSglVFBI4MCL30h30gxtNo7ng61hZ4SXl/DkMjCCF6v7ExD7PK2xBPxSDwQ98QdcUuMhEeO2OAy@bYdle0IIUeeGmqpo54GGmkitEE3dP1z/n55Pqflyj9@pzM/nB6evvwF "sed – TIO Nexus")
Note: floats for which the absolute value is less than 1 will have to be written without a leading 0 like `.5` instead of `0.5`. Also the number of decimal places is equal to [![enter image description here](https://i.stack.imgur.com/VgXZk.gif)](https://i.stack.imgur.com/VgXZk.gif), where `n` is the number of decimal places in the number (so giving `13.0` as input will give more decimal places than giving `13` as input)
This is my first sed submission on PPCG. Ideas for the decimal-to-unary conversion were taken from [this amazing answer](https://codegolf.stackexchange.com/a/51329/41805). Thanks to @seshoumara for guiding me through sed!
This code performs repeated long division to get the result. The division only takes ~150 bytes. The unary-decimal conversions take the most bytes, and a few other bytes go to supporting negative numbers and floating-point inputs
### Explanation
[Explanation on TIO](https://tio.run/nexus/sed#hVRtb9s2EP5@v@IQD6ucRKIk23mxsA3r3BQG1nTYun2JEoCSGJuITAoindgr@teXHUnbSYABE2zpeOS9PXzungc/d51QDWYppu9Mgl@W0iD97FJgIx9lQ5unOKe1VA9g2HesVOnhYWArgIE3qnqu6iWu9KPYmYtarniLnZbKYoZWe3UvF0sL0woGvwt3GFvBG6kWLj5GZk0@uMH7Xq9QrVeV6A228kFgkk7whx8xTSZDyuMuPWEMBp@cg/8NZliZRMkwSo5LNWRllpQ52c7v/RFeOR9LitkLs26taFAq5EiZ1MKY@3VLYmWstGsrtTrFhXbed@XOwM5gIFoj3uqvoLoiZD6RQ9m12zd4YrUlvAvkrdH4IEQX8Fpp3VD@Rlr5KGA6o7STY/b94WH5ykEtlItU8frhVbjKX8T06gDqWzyMVLVAad3N8rb14Z749g1KqPSTR4pwXR78HK2VEg4H3m@PPAsWxp1SicPfsJjeMPhFq0fRW@dvregkTN2Z6pIVF8xLF6w4D9I5K86CdMaKSZAmrBgHacyKUZBGrMiDlLMiC1LGijRIKYVlN3fFLTOseI3RAixsSZW6tHbcdiX6tHaE2pfdcWtFr9B0vBawgY/k@uYuvj2JiOMnw1JF9GZlXmbO2WCAH65nOAvAxlbHf3qfta/dEDX8mfcfPs6vcUZX7VUw@E3097pfGfxVE8kPG4MrUnKLrdYPBo1eCQ9u4Lp1DRXVXL2zxMqVcFkPp55ARvel2jOpVLVeK1uqQF13EbR0KdletwaX@glXXG1f6NBSqYFuXJknwsIs9bptiP@PosCmcy2WpXcE1EwupDWRGu65YPbxQ3Me2MwDxNQzDS0wdfDu8/nsePeW@6KmWikFrdFQSu0p8nBNPFzEi7n33Acecvxb9DpE9jVTVlIZsTvTCe7bnO6N2EDsZDDlbkxE8U/DKD0eprRV5jQBhjTBMhJLVY7c/OL/1WbeE5nRoSSYqDLDDYMvDe1tmLd7ocT8r/kf88/Xr@7fU8NxZEeX1yyBabMnWqlCE0WJI1oWe3Ir31JHNe@JXVR7fxQTMQoagIcnDEKYbvwk/Jql31i6ccY05XZLR1q7edWbgtOc6LjsUd/v2iE1u1YgZXNIlMAVfcd76xqdZnxOTWVYnrMxCVvqLN@N44xNwkbGRl4YT9hlEMbsIggjdh6EnJ15Y2S@gaObLL68HaZUs1dvdmqCIWYxKZ@f4ywZQZylEF9CfAHxOcRnEE8gHkNMGzntQZzQJ3HfdAL@nwGpMshhBGOYwBmcwwVcArkhd//ozk1w8xz3/wI "sed – TIO Nexus")
```
#Append 10 0's. This is the dividend, I think
s/$/\n0000000000/
tb
#This branch moves the decimal point 1 to the right
:b
#Remove leading 0's (such as from numbers like .05 => 0.5)
s/^0+//
#Move the decimal point 1 to the right
s/\.(.)(.*\n)/\1.\2/
#If the above has resulted in a successful substitution, go to branch D
tD
#else go to branch F
bF
#Multiply the dividend by 10; also keeps the mood positive
:D
s/.*/&&&&&&&&&&/2m
#Then go back to branch b
tb
:F
#Remove decimal point since it is all the way to the right now
s/\.//
h
#Remove "unnecessary" things
s/\n.+//
s/-//
#Convert to unary
:
s/\b9/;8/
s/\b8/;7/
s/\b7/;6/
s/\b6/;5/
s/\b5/;4/
s/\b4/;3/
s/\b3/;2/
s/\b2/;1/
s/\b1/;0/
s/\b0//
/[^;]/s/;/&&&&&&&&&&/g
t
y/;/0/
#Append the unary number to the pattern space
x
G
s/[^-]+(\n0+)\n(0+)/\2\1/
### END Decimal-to-Unary conversion
### BEGIN Division
#Performs Long Division
#Format looks something like this (can't remember): divisor\ndividend\ncount\nresult
#Count controls how many decimal places the answer should have; dp => 10^numDigits(n)
#Removes divisor from dividend and then add a 0 to result
#Once the dividend becomes too small, append a space to result and remove a zero from count
#Rinse and repeat
s/\n0+/&&\n./
:a
s/^(-?)(0*)0\n0\2(.*)$/\10\2\n\30/
ta
s/.*/&&&&&&&&&&/2m
s/\n0(0*\n\..*)$/\n\1 x/
Td
s/x//
ta
### END DIVISION
### BEGIN Unary-to-Decimal conversion
:d
s/[^-]+\n//
s/-(.+)/\1-/
s/\n//
#"carry over"-ing; .0000000000 => 0.
:x
s/^0{10}/0x/
s/(.)0{10}/0\1/
tx
#Convert each pair of unary 0s to their decimal counterparts
s/00/2/g
s/22/4/g
y/0/1/
s/41/5/g
s/21/3/g
s/45/9/g
s/44/8/g
s/43/7/g
s/42/6/g
y/ /0/
s/([1-9])0/\1/g
y/x/0/
s/(.+)-/-\1/
```
### Edits
* `s:s/(.)/(.)/g:y/\1/\2/g:g` to save 1 byte at each substitution (5 in total)
* Saved a ton of bytes by looking at a nice decimal-to-unary converter on "Tips for golfing in sed"
* I changed around some substitutions revolved around taking care of the minus sign to save 6 bytes.
* Used `\n` instead of `;` as the separator, then I was able to shorten the "multiply by 10" substitutions to save 12 bytes (thanks to @Riley and @seshoumara for showing me this)
[Answer]
# [OIL](https://github.com/L3viathan/OIL), ~~1428~~ 1420 bytes
Oh well. I thought I might as well try it, and I did in the end succeed. There's just one downside: It takes almost as long to run as it took to write.
The program is separated into multiple files, which have all 1-byte-filenames (and count for one additional byte in my byte calculation). Some of the files are part of the example files of the OIL language, but there's no real way to consistently call them (there's no search path or anything like that in OIL yet, so I don't consider them a standard library), but that also means that (at the time of posting) some of the files are more verbose than neccessary, but usually only by a few bytes.
The computations are accurate to 4 digits of precision, but calculating even a simple reciprocal (such as the input `3`) takes a really long time (over 5 minutes) to complete. For testing purposes, I've also made a minor variant that's accurate to 2 digits, which takes only a few seconds to run, in order to prove that it does work.
I'm sorry for the huge answer, I wish I could use some kind of spoiler tag. I could also put the bulk of it on gist.github.com or something similar, if desired.
Here we go: `main`, 217 bytes (file name doesn't count for bytes):
```
5
1
1
4
-
14
a
5
Y
10
5
8
14
29
12
1
97
1
97
24
9
24
13
99
1
1
4
31
1
35
14
a
32
.
10
32
8
50
41
1
53
2
14
b
1
1
6
72
14
c
5
0000
14
d
6
6
10
74
5
63
68
1
6
1
6
72
14
b
1
5
1
77
0
14
e
1
0
14
f
1
1
1
31
0
14
b
0
0
4
```
`a` (checks if a given string is in a given other string), 74+1 = 75 bytes:
```
5
0
5
1
14
g
2
0
10
2
30
24
13
10
1
31
27
18
14
h
1
1
6
4
4
30
3
4
29
N
Y
```
`b` (joins two given strings), 20+1=21 bytes:
```
5
0
5
1
13
0
2
0
4
0
```
`c` (given a symbol, splits the given string at its first occurrence), 143+1=144 bytes (this one is obviously still golfable):
```
5
0
5
83
12
83
83
10
84
0
21
17
8
13
6
12
1
13
1
1
5
2
14
i
45
1
1
83
1
1
45
2
14
i
57
1
9
45
13
84
1
8
13
1
13
56
13
13
2
4
1
11
4
2
```
`d` (given a string, gets the first 4 characters), 22+1=23 bytes:
```
5
0
12
0
20
13
21
4
4
```
`e` (high-level division (but with zero division danger)), 138+1=139 bytes:
```
5
0
5
1
.
.
1
1
6
14
j
0
0
1
0
4
10
11
1
58
21
14
b
4
4
1
1
15
14
k
0
15
1
6
1
14
j
0
0
1
0
5
14
b
4
4
9
8
10
8
11
58
53
10
11
1
58
25
4
4
```
`f` (moves a dot 4 positions to the right; "divides" by 10000), 146+1=147 bytes:
```
5
.
12
0
100
10
101
1
14
10
8
6
6
5
1
6
34
1
6
33
8
33
1
6
37
8
37
10
55
3
48
32
1
102
101
1
1
102
9
55
8
34
8
33
8
37
6
27
1
100
53
13
101
4
4
```
`g` (checks if a string starts with a given character), 113+1=114 bytes:
```
5
0
5
1
12
0
100
12
1
200
1
6
2
1
9
3
8
2
8
3
9
100
9
200
1
2
31
1
3
32
10
39
35
4
38
3
N
10
100
5
44
16
4
46
Y
```
`h` (returns everything but the first character of a given string), 41+1=42 bytes:
```
5
0
12
0
100
9
100
1
100
12
13
102
0
4
0
```
`i` (subtracts two numbers), 34+1=35 bytes:
```
5
0
5
1
10
16
1
14
9
9
0
9
1
6
4
0
```
`j` (low-level division that doesn't work in all cases), 134+1=135 bytes:
```
5
0
5
2
10
2
19
52
9
1
2
3
10
23
2
28
17
10
23
0
35
22
9
0
9
2
6
12
8
1
1
3
2
6
17
10
23
2
46
40
9
2
9
3
6
35
4
1
11
4
3
3
4
19
11
4
0
```
`k` (multiplication), 158+1=159 bytes:
```
5
0
5
1
8
0
9
0
8
1
9
1
1
5
2
12
0
68
10
69
66
23
29
8
7
14
l
0
0
12
1
68
10
69
66
37
43
8
7
14
l
1
1
10
0
5
56
48
9
0
14
m
2
1
6
43
10
7
3
61
63
4
66
4
2
3
-
```
`l` (return absolute value), 58+1=59 bytes:
```
5
-
12
0
24
10
25
1
13
10
4
0
3
9
24
1
24
20
13
26
0
6
10
```
`m` (addition), 109+1=110 bytes:
```
5
0
5
1
8
0
9
0
8
1
9
1
12
1
46
10
47
45
31
20
10
1
43
42
25
9
1
8
0
6
20
10
1
43
42
36
8
1
9
0
6
31
4
0
3
-
```
[Answer]
# [JSFuck](http://www.jsfuck.com), 3320 bytes
JSFuck is an esoteric and educational programming style based on the atomic parts of JavaScript. It uses only six different characters `()[]+!` to write and execute code.
```
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[!+[]+!+[]]+[+!+[]]+(![]+[+![]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]+!+[]])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]]
```
### Try it online!
```
alert(
  /* empty array       */ []
  /* ['fill']          */ [(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]]
  /* ['constructor']   */ [([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]
  /* ('return+1/this') */ ((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[!+[]+!+[]]+[+!+[]]+(![]+[+![]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]+!+[]])
  /* ['call']          */ [([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]]
  (prompt())
)
```
[Answer]
## J, 1 byte
```
%
```
`%` is a function giving the reciprocal of its input. You can run it like this
```
   % 2
0.5
```
[Answer]
# [Taxi](https://bigzaphod.github.io/Taxi/), 467 bytes
```
Go to Starchild Numerology:w 1 l 2 r 1 l 1 l 2 l.1 is waiting at Starchild Numerology.Pickup a passenger going to Divide and Conquer.Go to Post Office:w 1 r 2 r 1 r 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 l 1 r.Pickup a passenger going to Divide and Conquer.Go to Divide and Conquer:e 4 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:e 1 r.Pickup a passenger going to Post Office.Go to Post Office:e 1 l 1 r.
```
[Try it online!](https://tio.run/nexus/taxi#rVDNCoJAEH6V7wkEq5PHCrqVUC@w6bgObbs1uyY@vZVKRElBdJphhu@3XTkEh21QkpVscqyrI4kzTjdJjRgGE0g3@91EMdijVhzYaqgwCo1Szg7VCQon5T1ZTQLt7oCb1pIvnBOUzbFw9lyRRL2J1PmATVFwRp22DNqd/kfKXUmYqz2Zgn1J0gyEr@fED0nkN4Pvj4Qw@5M3@urrqZ@RxuiRrW2nVw "Taxi – TIO Nexus")
Ungolfed:
```
Go to Starchild Numerology:west 1 left, 2 right, 1 left, 1 left, 2 left.
1 is waiting at Starchild Numerology.
Pickup a passenger going to Divide and Conquer.
Go to Post Office:west 1 right, 2 right, 1 right, 1 left.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery:south 1 left, 1 right.
Pickup a passenger going to Divide and Conquer.
Go to Divide and Conquer:east 4 left.
Pickup a passenger going to The Babelfishery.
Go to The Babelfishery:east 1 right.
Pickup a passenger going to Post Office.
Go to Post Office:east 1 left, 1 right.
```
[Answer]
# Vim, ~~10~~ 8 bytes/keystrokes
```
C<C-r>=1/<C-r>"
```
Since V is backwards compatible, you may [Try it online!](https://tio.run/nexus/v#@@9s46xbZGdrqA@mlbj@/zfVM/ivWwYA "V – TIO Nexus")
[Answer]
# x86\_64 Linux machine language, 5 bytes
```
0:       f3 0f 53 c0             rcpss  %xmm0,%xmm0
4:       c3                      retq
```
To test this, you can compile and run the following C program
```
#include<stdio.h>
#include<math.h>
const char f[]="\xf3\xf\x53\xc0\xc3";
int main(){
  for( float i = .1; i < 2; i+= .1 ) {
    printf( "%f %f\n", i, ((float(*)(float))f)(i) );
  }
}
```
[Try it online!](https://tio.run/nexus/c-gcc#PYvBCsIwEETv@YohUshqKWrx1NYfsR5C6tJAm0gaoSD99poqeBjezrBv3Vlnhlf3qKfYWV/0V/FfRh37bTDeTRGm1wF8uzeynblMaedLgjmmlLIS1kWM2jpFbwGwDwo8eB1h0aA4VYk1zgmHrYKwvQHPkERWkBkj49bJHDaHUl9X7el3EDEpS6AqSYtY1vUD "C (gcc) – TIO Nexus")
[Answer]
# C, ~~15~~ 12 bytes
```
#define f 1/
```
[Try it online!](https://tio.run/nexus/c-gcc#@6@ckpqWmZeqkKZgqP8/M69EITcxM09Dk6uaSwEICoqAQmkaSqppSjoKaRrGegaamtZctf8B)
**~~16~~ 13 bytes, if it needs to handle integer input also:**
```
#define f 1./
```
So you can call it with `f(3)` instead of `f(3.0)`.
[Try it online!](https://tio.run/nexus/c-gcc#@6@ckpqWmZeqkKZgqKf/PzOvRCE3MTNPQ5OrmksBCAqKgEJpGkqqaUo6Cmkaxpqa1ly1/wE)
*Thanks to @hvd for golfing 3 bytes!*
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 1 byte
```
z
```
[Try it online!](https://tio.run/nexus/05ab1e#@1/1/78pAA "05AB1E – TIO Nexus")
```
z # pop a  push 1 / a
```
[Answer]
# MATLAB / Octave, 4 bytes
```
@inv
```
Creates a function handle (named `ans`) to the built-in [`inv`](https://www.mathworks.com/help/matlab/ref/inv.html) function
[Online Demo](http://ideone.com/F9NFL4)
[Answer]
## [GNU sed](https://www.gnu.org/software/sed/), ~~377~~ 362 + 1(r flag) = 363 bytes
**Warning:** the program will eat all the system memory trying to run and require more time to finish than you'd be willing to wait! See below for an explanation and a fast, but less precise, version.
```
s:\.|$:,,,,,,,,:;:i;s:,(,+)(\w):\2\1:;ti
h;:;s:\w::2g;y:9876543210:87654321\t :;/ /!s:,:@,:;/\s/!t;x;s:-?.::;x;G;s:,.*::m;s:\s::g;/\w/{s:@+:&&&&&&&&&&:;t}
/@,-?@/!{s:^:10000000,:;h;t}
:l;s:(@+)(,-?\1):\2;:;tl;s:,::;s:@+;?@+::
s:-?:&0:;:c;s:\b9+:0&:;s:.9*;:/&:;h;s:.*/::;y:0123456789:1234567890:;x;s:/.*::;G;s:\n::;s:;::;/;/tc
:f;s:(\w)(,+),:\2\1:;tf;s:,:.:;y:,:0:
```
This is based on the [Retina answer](https://codegolf.stackexchange.com/a/114630/59010) by Martin Ender. I count `\t` from line 2 as a literal tab (1 byte).
My main contribution is to the conversion method from decimal to plain unary (line 2), and vice versa (line 5). I managed to significantly reduce the size of code needed to do this (by ~40 bytes combined), compared to the methods shown in a previous [tip](https://codegolf.stackexchange.com/a/51329/59010). I created a [separate tip answer](https://codegolf.stackexchange.com/a/115617/59010) with the details, where I provide ready to use snippets. Because 0 is not allowed as input, a few more bytes were saved.
**Explanation:** to better understand the division algorithm, read the Retina answer first
The program is theoretically correct, the reason why it consumes so much computational resources is that the division step is run hundred of thousands of times, more or less depending on the input, and the regex used gives rise to a backtracking nightmare. The fast version reduces the precision (hence the number of division steps), and changes the regex to reduce the backtracking.
Unfortunately, sed doesn't have a method to directly count how many times a backreference fits into a pattern, like in Retina.
```
s:\.|$:,,,,,,,,:             # replace decimal point or end of string with 8 commas
:i                           # loop to generate integer (useful for unary division)
  s:,(,+)(\w):\2\1:          # move 1 digit in front of commas, and delete 1 comma
ti                           # repeat (':i')
h;:                          # backup pattern and start decimal to unary conversion
  s:\w::2g                   # delete decimal digits, except the first (GNU magic)
  y:9876543210:87654321\t :; # transliterate characters
  / /!s:,:@,:                # if no space is present, append a unary digit ('@')
  /\s/!t                     # if no whitespace is present, go back to ':'
  x;s:-?.::;x                # delete first digit and the negative sign from backup
  G;s:,.*::m;s:\s::g         # append backup, delete whitespace and duplicate stuff
/\w/{s:@+:&&&&&&&&&&:        # if decimal digit left, multiply unary number by 10
t}                           # and repeat (':')
/@,-?@/!{                    # if only one unary number found (the input)
  s:^:10000000,:             # prepend decimal 10^7 separated by a comma
h;t}                         # backup pattern and convert new number to unary also
:l                           # start unary division loop (tons of RAM and time!!!)
  s:(@+)(,-?\1):\2;:         # delete as many '@'s from 10^7, as found in unary
                             #input, and add one ';' (new unary digit)
tl                           # repeat (':l')
s:,::;s:@+;?@+::             # delete leftover stuff
s:-?:&0:;:c                  # prepend zero and start unary to decimal conversion
  s:\b9+:0&:                 # if only 9s found, prepend zero to them
  s:.9*;:/&:                 # separate the digit(s) that would change on increment
  h;s:.*/::                  # backup, delete all (non-changing) digits (till '/')
  y:0123456789:1234567890:   # increment changing digit(s)
  x;s:/.*::                  # delete changing digits from backup
  G;s:\n::                   # append backup, delete newline
  s:;::                      # delete one unary digit (';')
/;/tc                        # if unary portion left, repeat (':c')
:f                           # loop to generate floating-point number
  s:(\w)(,+),:\2\1:          # move 1 digit after the commas, and delete 1 comma
tf                           # repeat (':f')
s:,:.:                       # turn first comma into a decimal point
y:,:0:                       # turn the rest of commas into zeroes (final result)
                             # implicit printing
```
For a fast and safe version of the program, but less precise, you can [try this online](https://tio.run/nexus/sed#PVDLasMwELz7K2Ioxg9Zr8RJPDpEt/6EyKGBJoY2KZXADW1/ve6uwdmD2N3Rzs7sFBHkzxPEHHAYXIQoRVOVYawQbDBwacguDgSEEbBnd0e/3227zdoajSULaQWnViqneXiiUiGqPLkvmmsPEqDsmcllDbwzWQTO9GtU3xG@QfEI2vibKS/ag1c5gUcYzUGkF4YiSt9UoiS8EYtIvBHnkXqurmY4WATjgqWpxJindRlrQaHp@4klvPQNdMHWZF87qII3UFEr0nuHNna96ba7fY9HpjFbUmxjNhSuYAJHr3IqnTK8Usnn4zOK5YbcFJBMK6AxTZ2R9u/2kYbbNU7t5z8).
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 2 bytes
The obvious solution would be
```
1/U
```
which is, quite literally, `1 / input`. However, we can do one better:
```
pJ
```
This is equivalent to `input ** J`, and `J` is set to -1 by default.
[Try it online!](https://tio.run/nexus/japt#@1/g9f@/KQA "Japt – TIO Nexus")
Fun fact: as `p` is the power function, so `q` is the root function (`p2` = `**2`, `q2` = `**(1/2)`); this means that `qJ` will work as well, since `-1 == 1/-1`, and therefore `x**(-1) == x**(1/-1)`.
[Answer]
# Javascript ES6, 6 bytes
```
x=>1/x
```
[Try it online!](https://tio.run/nexus/javascript-node#S7P9X2FrZ6hf8T85P684PydVLyc/XSNNw9BAU/M/AA "JavaScript (Node.js) – TIO Nexus")
Javascript defaults to floating point division.
[Answer]
# APL, 1 byte
```
÷
```
`÷` Computes reciprocal when used as monadic function. [Try it online!](http://tryapl.org/?a=%F73&run)
Uses the Dyalog Classic character set.
[Answer]
# [Cheddar](http://cheddar.vihan.org/), 5 bytes
```
1&(/)
```
[Try it online!](https://tio.run/nexus/cheddar#y0ktUUiz/W@opqGv@b@gKDOvRCNNw680Nym1yMoqOSM1JSWxSC@xKL0s2ihWU/P/fxMA "Cheddar – TIO Nexus")
This uses `&`, which bonds an argument to a function . In this case, `1` is bound to the left hand side of `/`, which gives us `1/x`, for an argument `x`. This is shorter than the canonical `x->1/x` by 1 byte.
---
Alternatively, in the newer versions:
```
(1:/)
```
[Answer]
# Python, 12 bytes
```
lambda x:1/x
```
One for 13 bytes:
```
(-1).__rpow__
```
One for 14 bytes:
```
1 .__truediv__
```
[Answer]
# TI-Basic (TI-84 Plus CE), ~~6~~ ~~5~~ 2 bytes
```
Ans⁻¹
```
-1 byte thanks to [Timtech](https://codegolf.stackexchange.com/questions/114544/reciprocal-of-a-number-1-x?page=2&tab=votes#comment279524_114610).
-3 bytes with `Ans` thanks to [Григорий Перельман](https://codegolf.stackexchange.com/questions/114544/reciprocal-of-a-number-1-x/114610?noredirect=1#comment279663_114610).
`Ans` and `⁻¹` are [one-byte tokens](http://tibasicdev.wikidot.com/one-byte-tokens).
TI-Basic implicitly returns the last value evaluated (`Ans⁻¹`).
[Answer]
## Java 8, 6 bytes
```
x->1/x
```
Almost the same as the [JavaScript answer](https://codegolf.stackexchange.com/a/114547/34543).
[Answer]
## Mathematica, 4 bytes
```
1/#&
```
Provides you with an exact rational if you give it an exact rational, and with a floating-point result if you give it a floating-point result.
[Answer]
## ZX Spectrum BASIC, 13 bytes
```
1 INPUT A: PRINT SGN PI/A
```
Notes:
* Each line costs 2 bytes for the line number, 2 bytes for the length of the line and 1 byte for the newline
* Numeric literals are converted into binary at parse time, costing an extra 6 bytes, thus the use of `SGN PI` instead of literal `1`.
* Keywords take 1 byte each.
ZX81 version for 17 bytes:
```
1 INPUT A
2 PRINT SGN PI/A
```
[Answer]
# [Haskell](https://www.haskell.org/), 4 bytes
```
(1/)
```
[Try it online!](https://tio.run/nexus/haskell#@59mq2Gor/k/NzEzT8FWoaC0JLikyCdPQUWhOCO/HEilKRj/BwA "Haskell – TIO Nexus")
[Answer]
## R, 8 bytes
```
1/scan()
```
Pretty straightforward. Directly outputs the inverse of the input.
Another, but 1 byte longer solution can be : `scan()^-1`, or even `scan()**-1` for an additional byte. Both `^` and `**` the power symbol.
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 3 bytes
```
l_^
```
Try it at [**MATL Online**](https://matl.io/?code=l_%5E&inputs=10&version=19.8.0)
**Explanation**
```
    % Implictily grab input
l_  % Push -1 to the stack
^   % Raise the input to the -1 power
    % Implicitly display the result
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 1 byte
```
İ
```
[Try it online!](https://tio.run/nexus/jelly#@39kw////80B "Jelly – TIO Nexus")
[Answer]
## C, 30 bytes
```
float f(float x){return 1./x;}
```
]