text:
Wait a minute – in less than ten seconds
Task
Using any type of parallelisation, wait multiple periods, for a total sleep time of at least a minute (but less than a minute and a half).
The program/function must terminate within 10 seconds and return (by any means and in any format) two values: the total elapsed time, and the total executed sleep time. Both time values have to have a precision of at least 0.1 seconds.
This is similar to the concept of man-hours: a job that takes 60 hours can be completed in only 6 hours if 10 workers are splitting the job. Here we can have 60 seconds of sleep time e.g. in 10 parallel threads, thus requiring only 6 seconds for the whole job to be completed.
Example
The program MyProgram creates 14 threads, each thread sleeps for 5 seconds:
MyProgram → [5.016,70.105]
The execution time is greater than 5 seconds, and the total sleep time is greater than 70 seconds because of overhead.

I've read the question several times and I don't get it. Can you clarify a bit? Why "10 seconds" and a delay of "70 seconds"? How are all those times related?

@LuisMendo The whole program terminates in less than 10 seconds (about 5 in the example), but it had several parallel calls to a delay procedure. Each delay was 5 seconds long. 14 parallel delays of 5 seconds is 70 seconds.

@LuisMendo Better now?

How many threads can we assume will be executed in parallel?

@miles You chose how many you want, but it will have to be at least seven in order to finish on time. Or maybe I'm not understanding your question.

What precision is required for the time in output?

@edc65 Less than a second, so let us say 0.1 s.

Are you counting overhead in the "executed sleep time"? Your example seems to indicate so. Meaning, does our code have to explicitly have calculable sleep >60 (e.g., 10 threads at 6 seconds each), or just the actual runtime of the threads must be >60?

@TimmyD The sleep itself must be ≥ 60. However, the sleep must actually be timed, and then it will be > 60 because of overhead (if nothing else, then in the timing procedure itself).

I wonder if this will cause all the golfing language authors to engage in a mad dash to add multi-threading to their creations...

I believe @miles wanted to know how many threads are the maximum. For threads >= 2/4/8 depending on the processor, the programs will not work.

@NoOneIsHere Ah, well, a properly implemented sleep method should not busy a core, so the number of threads may exceed the number of (virtual) processors.

This being code golf, do solutions have to be "golfed" (i.e. compressed to within an inch of their lives), or would you welcome an ungolfed solution in Golang (whose gofmt makes this tricky)?

@miles If you need real-time computed threads, then you may assume 8 – otherwise this isn't possible, I think.

@Rob In some languages the obvious solution is already (close to) the shortest. Besides, one way to view code-golf challenges is finding the shortest solution in EACH language. Otherwise Jelly will win most of the time... So: go ahead.

Done, thanks very much @Adám

Is the output format strictly [a,b], or can it be any sort of delimited list / array, whatever is convenient for the language?

@Rob to undo gofmt, try http://codebeautify.org/javaviewer

Thanks @cat!  @DigitalTrauma, yeah, that'd shave off some characters!  Perhaps it's not too strict a rule?

@DigitalTrauma Adam, in a comment said "Any output format is good"; I wish this were in the question

(why) do we need a new [tag:multi-threading] tag?

@cat Format phase added. Was there any such tag before? I think it is an interesting subject we hadn't had any challenges about. But I look forward to seeing more. By the way, my tag suggestion was peer reviewed and accepted.

I have a solution that works great if threads can burn CPU time instead of sleeping - is that OK, or is it absolutely required to call sleep?

@nneonneo Feel free to post it, even if it isn't eligible to win.

@Adám it originally was unclear, and I haven't retracted my close vote. But I think is it too broad now.

It's unclear what exactly counts as waiting multiple times. Do I have to fire a thread to not do  anything, or is it OK to schedule a task? What if my language doesn't have threads, just an event loop (say, Javascript)? Is it okay then to set up a timer?

@JanDvorak The challenge says "wait" - it's pretty clear from that and the comments that the threads are supposed to sleep (as opposed to busy-waiting).

@JanDvorak Feel free to submit such a solution, even though it will not be eligible to win.

I'm asking about setting up timers. I wouldn't expect that to be legal, but you have blessed the Javascript javascript nevertheless.

Recommended reading: The Mythical Man-Month.

Dyalog APL, 65 27 23 21 bytes
(⌈/,+/)⎕TSYNC⎕DL&¨9/7

I.e.:
      (⌈/,+/)⎕TSYNC⎕DL&¨9/7
7.022 63.162

Explanation:

⎕DL&¨9/7: spin off 9 threads, each of which waits for 7 seconds. ⎕DL returns the actual amount of time spent waiting, in seconds, which will be the same as its argument give or take a few milliseconds.
⎕TSYNC: wait for all threads to complete, and get the result for each thread.
(⌈/,+/): return the longest execution time of one single thread (during the execution of which all other threads finished, so this is the actual runtime), followed by the sum of the execution time of all threads.

Try it online!

This won't work if executed at 23:59:57. However, you're on the right track... While you are already the shortest, can you golf away another 40 bytes?

@Adám: no, but I can golf away 38 bytes. It's quite obvious, I don't know why I didn't think of this the first time around.

There you go. Only another 6 bytes until you get a checkmark. The three things you have to do are pretty obvious too, saving 1, 2, and 3 bytes respectively.

Very nice, you found number 1 and number 3. Number 2 isn't really golfing, as much as an implementation alternative...

Number 2: As you don't need arguments, just make it into a tfn body.

@Adám: if you'll accept it like that, sure, though it's not quite a function then but more like a snippet (a tfn would need ∇F\n body\n ∇, and if you'd actually want to return something you'd need to do ∇R←F\n R←body\n ∇).

I often submit programs (I included "program" in the OP) like that. And returning doesn't necessarily mean as a result, (implied) printing is fine. In any case, you certainly do not need dels (∇), as ⎕FX 'F' 'body' is enough.

I spotted a problem. If the last ⎕DL 7 takes slightly longer than the previous ones, then ⌈/ will return its run time, but since the first ⎕DL 7 began before that, the total time is longer. I'm afraid you'll need (⊃,+/-⊃)⎕TSYNC⎕DL&¨8,9/7 or something like that.

@Adám: that problem actually doesn't occur, the threads all start within a microsecond of each other, at least this: ⌈/ { (⌈/-⌊/)⎕TSYNC{⎕TS[7]}&¨⍳7 } ¨ ⍳1000 consistently gives me 1 (and sometimes 999 when you time it just right, but that's just at the very end of a second).

Ok, you get your checkmark.

Python 2, 172 bytes
import threading as H,time as T
m=T.time
z=H.Thread
s=m()
r=[]
def f():n=m();T.sleep(9);f.t+=m()-n
f.t=0
exec"r+=[z(None,f)];r[-1].start();"*8
map(z.join,r)
print m()-s,f.t

This requires an OS with time precision greater than 1 second to work properly (in other words, any modern OS). 8 threads are created which sleep for 9 seconds each, resulting in a realtime runtime of ~9 seconds, and a parallel runtime of ~72 seconds.
Though the official documentation says that the Thread constructor should be called with keyword arguments, I throw caution to the wind and use positional arguments anyway. The first argument (group) must be None, and the second argument is the target function.
nneonneo pointed out in the comments that attribute access (e.g. f.t) is shorter than list index access (e.g. t[0]). Unfortunately, in most cases, the few bytes gained from doing this would be lost by needing to create an object that allows user-defined attributes to be created at runtime. Luckily, functions support user-defined attributes at runtime, so I exploit this by saving the total time in the t attribute of f.
Try it online
Thanks to DenkerAffe for -5 bytes with the exec trick.
Thanks to kundor for -7 bytes by pointing out that the thread argument is unnecessary.
Thanks to nneonneo for -7 bytes from miscellaneous improvements.

You can save two bytes by removing the argument to f(), and the last two arguments to Thread (thus removing 7 characters) and using t.append(m()-n) to avoid assigning a local variable t (using 5 more characters than +=.)

And you can save five more by keeping the sum instead of a list of times: initialize t with t=[0], replace the append by t[0]+=m()-n, and replace sum(t) by t[0].

Thread names can be omitted.

@ppperry: not if you need to use the subsequent positional arguments (but as I mentioned in previous comments, you can actually elide those.)

Save three bytes by using import threading as H,time as t; save another two bytes by using z=H.Thread and map(z.join,r); save another two bytes by stashing the total time as an attribute (e.g. T.z+=m()-n)

Bash + GNU utilities, 85
\time -f%e bash -c 'for i in {1..8};{ \time -aoj -f%e sleep 8&};wait'
paste -sd+ j|bc

Forces the use of the time executable instead of the shell builtin by prefixing with a \.
Appends to a file j, which must be empty or non-existent at the start.

What about a forking script like; if [ $1 -lt 9 ];then { ./a $(( $1 + 1 )) &};sleep 7;fi or somesuch? Would that be against the rules, or something I'm not understanding about the spec? [edit; I missed the requirement for output. Ooh, that makes it interesting!]

@DewiMorgan Yes, the output requirement makes it quite a bit harder.  What you suggest could be golfed to something like (($1<9))&&$0 $[$1+1]&sleep 7

Go - 189 bytes
Thanks @cat!
package main
import(."fmt";."time");var m,t=60001,make(chan int,m);func main(){s:=Now();for i:=0;i<m;i++{go func(){Sleep(Millisecond);t<-0}()};c:=0;for i:=0;i<m;i++{c++};Print(Since(s),c)}

Outputs (ms):  160.9939ms,60001 (160ms to wait 60.001 seconds)

Hello, and welcome to PPCG! This comment, @Rob In some languages the obvious solution is already (close to) the shortest. Besides, one way to view code-golf challenges is finding the shortest solution in EACH language. Otherwise Jelly will win most of the time... So: go ahead., does not mean that you should not try to golf your answer, but that it is OK if it does not win. Can you please add a golfed solution?

I'm sorry, I just read your edit. For golfed, you could maybe remove newlines and spaces, or change tot to something like q.

@NoOneIsHere, thanks for that, I'd overlooked that variable completely!  Also banged together m and t.

http://codebeautify.org/javaviewer -- click minify

https://codegolf.stackexchange.com/questions/41862/tips-for-golfing-in-go

Try removing whitespace and newlines like other solutions, too.

Go can probably multithread on a zero-core machine :D

Haha, it is an especially good scheduler... ^_^

199 bytes (should compile, it's been a while since I've used golang)

Noice!  Submit your answer!  You could also remove the format args and use the variadic print thinking about it...

package main import(."fmt";."time");var m,t=60001,make(chan int,m);func main(){s:=Now();for i:=0;i<m;i++{go func(){Sleep(Millisecond);t<-0}()};c:=0;for i:=0;i<m;i++{c++};Print(Since(s),c)}

First, you can use newlines instead of semicolons for readability. Second, you can save 9 bytes by reusing the var statement to declare i and s, eliminating c, and removing the i initializations from the loops. Third. this program isn't strictly correct, because the main goroutine doesn't wait for the sleepers. Theoretically, the scheduler could execute only the main goroutine, incrementing c 60001 times, printing it, then exiting without ever sleeping in the spawned goroutines. So c++ needs to be replaced with <-t. This program is 9 bytes shorter: https://pastebin.com/Z0Xu2Dzq

C, 127 bytes (spins CPU)
This solution spins the CPU instead of sleeping, and counts time using the times POSIX function (which measures CPU time consumed by the parent process and in all waited-for children).
It forks off 7 processes which spin for 9 seconds apiece, and prints out the final times in C clocks (on most systems, 100 clock ticks = 1 second).
t;v[4];main(){fork(fork(fork(t=time(0))));while(time(0)<=t+9);wait(0);wait(0);wait(0)>0&&(times(v),printf("%d,%d",v[0],v[2]));}

Sample output:
906,6347

meaning 9.06 seconds real time and 63.47 seconds total CPU time.
For best results, compile with -std=c90 -m32 (force 32-bit code on a 64-bit machine).

Bash 196 117 114 93 bytes
Updated to support better time precision by integrating suggestions from @manatwork and @Digital Trauma as well as a few other space optimizations:
d()(date +$1%s.%N;)
b=`d`
for i in {1..8};{ (d -;sleep 8;d +)>>j&}
wait
bc<<<`d`-$b
bc<<<`<j`

Note that this assumes the j file is absent at the beginning.

function s → s(), b=\date +%s`→b=$SECONDS, expr $t + $i→$[t+i], `cat j`→$(<j)` and generally see Tips for golfing in Bash about how to reduce it to this: http://pastebin.com/DDqUaDug

To reduce it more, better write directly a formula to the file j. I mean instead of 5↵5↵5↵… write +5+5+5… – then load it all directly into arithmetic evaluation and spare the second loop: http://pastebin.com/LB0BjDMZ

As minimum precision was specified later, forget the b=\date +%s`→b=$SECONDS` suggestion.

@manatwork Yeah, sorry about that.

As bash does only integer arithmetic, the entire solution needs to be rewritten to use an external tool for calculation. Typically bc: http://pastebin.com/eYFEVUuz

Me stupid. Why I used an explicit printf in the earlier suggested code…? http://pastebin.com/BihmfSRb

@manatwork I suggest leaving this solution, but with a note that it is int-only and that the rules changed.

@manatwork:  thanks for the suggestions.

Here's my attempt using the /usr/bin/time binary - down to 85 bytes: \time -f%e bash -c 'for i in {1..8};{ \time -aoj -f%e sleep 8&};wait';paste -sd+ j|bc.  Waits for 8x8sec instead of 13x5sec.  Output is newline-separated - not sure if thats OK or not - see comment to OP

"Any output format is good"

@DigitalTrauma:  I like your solution but it uses an entirely different approach which would justify a separate answer.  I had thought of using time but didn't realize I could force the external binary with \\.

@JuliePelletier Ok, I'll post it as my own answer.  Still, I think you can still apply some of the golfing techniques to your answer without significantly changing the approach: http://pastebin.com/ssYzVs1n (93 bytes)

BTW, the +/- thing in the date format string is really clever :)

JavaScript (ES6), 148 bytes

with(performance)Promise.all([...Array(9)].map(_=>new Promise(r=>setTimeout(_=>r(t+=now()),7e3,t-=now())),t=0,n=now())).then(_=>alert([now()-n,t]));

Promises to wait 9 times for 7 seconds for a total of 63 seconds (actually 63.43 when I try), but only actually takes 7.05 seconds of real time when I try.

Scratch - 164 bytes (16 blocks)
when gf clicked
set[t v]to[
repeat(9
  create clone of[s v
end
wait until<(t)>[60
say(join(join(t)[ ])(timer
when I start as a clone
wait(8)secs
change[t v]by(timer

See it in action here.
Uses a variable called 't' and a sprite called 's'. The sprite creates clones of itself, each of which waits 8 seconds, and increments a variable clocking the entire wait time. At the end it says the total execution time and the total wait time (for example, 65.488 8.302).

PowerShell v4, 144 bytes
$d=date;gjb|rjb
1..20|%{sajb{$x=date;sleep 3;((date)-$x).Ticks/1e7}>$null}
while(gjb -s "Running"){}(gjb|rcjb)-join'+'|iex
((date)-$d).Ticks/1e7

Sets $d equal to Get-Date, and clears out any existing job histories with Get-Job | Remove-Job. We then loop 1..20|%{...} and each iteration execute Start-Job passing it the script block {$x=date;sleep 3;((date)-$x).ticks/1e7} for the job (meaning each job will execute that script block). We pipe that output to >$null in order to suppress the feedback (i.e., job name, status, etc.) that gets returned.
The script block sets $x to Get-Date, then Start-Sleep for 3 seconds, then takes a new Get-Date reading, subtracts $x, gets the .Ticks, and divides by 1e7 to get the seconds (with precision).
Back in the main thread, so long as any job is still -Status "Running", we spin inside an empty while loop. Once that's done, we Get-Job to pull up objects for all the existing jobs, pipe those to Receive-Job which will pull up the equivalent of STDOUT (i.e., what they output), -join the results together with +, and pipe it to iex (Invoke-Expression and similar to eval). This will output the resultant sleep time plus overhead.
The final line is similar, in that it gets a new date, subtracts the original date stamp $d, gets the .Ticks, and divides by 1e7 to output the total execution time.

NB
OK, so this is a little bendy of the rules. Apparently on first execution, PowerShell needs to load a bunch of .NET assemblies from disk for the various thread operations as they're not loaded with the default shell profile. Subsequent executions, because the assemblies are already in memory, work fine. If you leave the shell window idle long enough, you'll get PowerShell's built-in garbage collection to come along and unload all those assemblies, causing the next execution to take a long time as it re-loads them. I'm not sure of a way around this.
You can see this in the execution times in the below runs. I started a fresh shell, navigated to my golfing directory, and executed the script. The first run was horrendous, but the second (executed immediately) worked fine. I then left the shell idle for a few minutes to let garbage collection come by, and then that run is again lengthy, but subsequent runs again work fine.
Example runs
Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS H:\> c:

PS C:\> cd C:\Tools\Scripts\golfing

PS C:\Tools\Scripts\golfing> .\wait-a-minute.ps1
63.232359
67.8403415

PS C:\Tools\Scripts\golfing> .\wait-a-minute.ps1
61.0809705
8.8991164

PS C:\Tools\Scripts\golfing> .\wait-a-minute.ps1
62.5791712
67.3228933

PS C:\Tools\Scripts\golfing> .\wait-a-minute.ps1
61.1303589
8.5939405

PS C:\Tools\Scripts\golfing> .\wait-a-minute.ps1
61.3210352
8.6386886

PS C:\Tools\Scripts\golfing>

I'll say that's fine. :-)

Javascript (ES6), 212 203 145 bytes
This code creates 10 images with a time interval of exactly 6 seconds each, upon loading.
The execution time goes a tiny bit above it (due to overhead).
This code overwrites everything in the document!

P=performance,M=P.now(T=Y=0),document.body.innerHTML='<img src=# onerror=setTimeout(`T+=P.now()-M,--i||alert([P.now()-M,T])`,6e3) >'.repeat(i=10)

This assumes that you use a single-byte encoding for the backticks, which is required for the Javascript engine to do not trip.

Alternativelly, if you don't want to spend 6 seconds waiting, here's a 1-byte-longer solution that finishes in less than a second:

P=performance,M=P.now(T=Y=0),document.body.innerHTML='<img src=# onerror=setTimeout(`T+=P.now()-M,--i||alert([P.now()-M,T])`,600) >'.repeat(i=100)

The difference is that this code waits 600ms across 100 images. This will give a massive ammount of overhead.

Old version (203 bytes):
This code creates 10 iframes with a time interval of exactly 6 seconds each, instead of creating 10 images.

for(P=performance,M=P.now(T=Y=i=0),D=document,X=_=>{T+=_,--i||alert([P.now()-M,T])};i<10;i++)I=D.createElement`iframe`,I.src='javascript:setTimeout(_=>top.X(performance.now()),6e3)',D.body.appendChild(I)

Original version (212 bytes):

P=performance,M=P.now(T=Y=0),D=document,X=_=>{T+=_,Y++>8&&alert([P.now()-M,T])},[...''+1e9].map(_=>{I=D.createElement`iframe`,I.src='javascript:setTimeout(_=>top.X(performance.now()),6e3)',D.body.appendChild(I)})

+1 Very nice and different approach. What would happen in a single-threaded browser?

@Adám No change in behaviour. There would still be a delay of around 6 seconds. Firefox (a single-threaded browser) sometimes will output funny stuff like an execution time of 59999..

Ruby, 92
n=->{Time.now}
t=n[]
a=0
(0..9).map{Thread.new{b=n[];sleep 6;a+=n[]-b}}.map &:join
p n[]-t,a

Javascript (ES6), 108 92 bytes
I'm making a new answer since this uses a slightly different aproach.
It generates a massive amount of setTimeouts, which are almost all executed with 4ms between them.
Each interval is of 610 milliseconds, over a total of 99 intervals.

M=(N=Date.now)(T=Y=0),eval('setTimeout("T+=N()-M,--i||alert([N()-M,T])",610);'.repeat(i=99))

It usually runs within 610ms, for a total execution time of around 60.5 seconds.
This was tested on Google Chrome version 51.0.2704.84 m, on windows 8.1 x64.

Old version (108 bytes):

P=performance,M=P.now(T=Y=0),eval('setTimeout("T+=P.now()-M,--i||alert([P.now()-M,T])",610);'.repeat(i=99))

Clojure, 135 120 111 109 bytes
(let[t #(System/nanoTime)s(t)f #(-(t)%)][(apply +(pmap #(let[s(t)](Thread/sleep 7e3)%(f s))(range 9)))(f s)])

Formatted version with named variables:

(let [time #(System/currentTimeMillis)
      start (time)
      fmt #(- (time) %)]
  [(apply +
           (pmap #(let [thread-start (time)]
                   (Thread/sleep 7e3)
                   %
                   (fmt thread-start)) (range 9)))
   (fmt start)])

output (in nanoseconds):
[62999772966 7001137032]

Changed format. Thanks Adám, I might have missed that format specification in the question when I read it.
Changed to nanoTime for golfing abilities.
Thanks cliffroot, I totally forgot about scientific notation and can't believe I didn't see apply. I think I used that in something I was golfing yesterday but never posted. You saved me 2 bytes.

Welcome to PPCG! Nice first post! You might be able to ask the OP about the output format.

No need to reverse. OP: by any means and in any format.

seems like you can use 7e3 instead of 7000 and use apply instead of reduce

Java, 358  343 337 316 313 bytes
import static java.lang.System.*;class t extends Thread{public void run(){long s=nanoTime();try{sleep(999);}catch(Exception e){}t+=nanoTime()-s;}static long t,i,x;public static void main(String[]a)throws Exception{x=nanoTime();for(;++i<99;)new t().start();sleep(9000);out.println((nanoTime()-x)/1e9+" "+t/1e9);}}

and ungolfed
import static java.lang.System.*;

class t extends Thread {
    public void run() {
        long s = nanoTime();
        try {
            sleep(999);
        } catch (Exception e) {
        }
        t += nanoTime() - s;
    }

    static long t,i,x;

    public static void main(String[] a) throws Exception {
        x = nanoTime();
        for (; ++i < 99;)
            new t().start();
        sleep(9000);
        out.println((nanoTime() - x) / 1e9 + " " + t / 1e9);
    }
}

please don't try it at home, as this solution is not thread safe.
Edit:
I took @A Boschman's and @Adám's suggestions, and now my program require less than 10 seconds to run, and it's shorter by 15 bytes.

You're inside a child of the Thread class, can't you omit the Thread. at the static sleep() method calls? Also, won't this program terminate in slightly over 10 seconds, disqualifying it?

@ABoschman thanks for suggestion, and its fixed by now, it doesn't run more than 10 sec anymore

@user902383 If I recall correctly, you can omit the public keyword as it is implicit. Also, int may not be required when defining a function (try it, and tell me if that works)

Also, don't forget we have a great userbase of tips for golfing in java :)

@Katenkyo public isn't implicit but you're correct that it's not required. If you omit it your class will be package private.

This seems susceptible to read-modify-write race conditions. You don't have any sort of locking or anything around your static long t. I only mention this because the spec says "Both time values have to have a precision of at least 0.1 second."

You can remove the long  before the s and add ,s to the static long t,i,s; to save a few bytes.

Rust, 257, 247 bytes
I use the same times as Mego's Python answer.
Really the only slightly clever bit is using i-i to get a Duration of 0 seconds.
fn main(){let n=std::time::Instant::now;let i=n();let h:Vec<_>=(0..8).map(|_|std::thread::spawn(move||{let i=n();std::thread::sleep_ms(9000);i.elapsed()})).collect();let mut t=i-i;for x in h{t+=x.join().unwrap();}print!("{:?}{:?}",t,i.elapsed());}

Prints:
Duration { secs: 71, nanos: 995877193 }Duration { secs: 9, nanos: 774491 }

Ungolfed:
fn main(){
    let n = std::time::Instant::now;
    let i = n();
    let h :Vec<_> =
        (0..8).map(|_|
            std::thread::spawn(
                move||{
                    let i = n();
                    std::thread::sleep_ms(9000);
                    i.elapsed()
                }
            )
        ).collect();
    let mut t=i-i;
    for x in h{
        t+=x.join().unwrap();
    }
    print!("{:?}{:?}",t,i.elapsed());
}

Edit:
good old for loop is a bit shorter

JavaScript (ES6, using WebWorkers), 233 215 bytes

c=s=0;d=new Date();for(i=14;i-->0;)(new Worker(URL.createObjectURL(new Blob(['a=new Date();setTimeout(()=>postMessage(new Date()-a),5e3)'])))).onmessage=m=>{s+=m.data;if(++c>13)console.log((new Date()-d)/1e3,s/1e3)}

UPD: replaced the way a worker is executed from a string with a more compact and cross-browser one, in the aspect of cross-origin policies. Won't work in Safari, if it still have webkitURL object instead of URL, and in IE.

I'm getting an error when I run this: {   "message": "Uncaught SecurityError: Failed to construct 'Worker': Script at 'data:application/javascript,a%3Dnew%20Date()%3BsetTimeout(()%3D%3EpostMessage(new%20Date()-a)%2C5e3)' cannot be accessed from origin 'null'.",   "filename": "http://stacksnippets.net/js",   "lineno": 13,   "colno": 45 }

Perl 6, 72 71 bytes

There might be a shorter way to do this
say sum await map {start {sleep 7;now -ENTER now}},^9;say now -INIT now

this outputs
63.00660729694
7.0064013

PowerShell Core, 88 bytes
$u=date
1..9|% -Pa{$d=date
sleep 7
(date)-$d|% T*ls*}-Th 9|measure -su
(date)-$u|% T*ls*

Explained
$u=date                              # Execution start time
1..9|% -Pa{$d=date                   # Starts 9 threads
sleep 7                              # Sleeps for 7 seconds
(date)-$d|% T*ls*}-Th 9|measure -su  # Gets the (T)ota(ls)econds for the current thread and sum them
(date)-$u|% T*ls*                    # Gets the script time in seconds

Sample output

Mathematica, 109 bytes
a=AbsoluteTiming;LaunchKernels@7;Plus@@@a@ParallelTable[#&@@a@Pause@9,{7},Method->"EvaluationsPerKernel"->1]&

Anonymous function. Requires a license with 7+ sub-kernels to run. Takes 9 seconds realtime and 63 seconds kernel-time, not accounting for overhead. Make sure to only run the preceding statements once (so it doesn't try to re-launch kernels). Testing:
In[1]:= a=AbsoluteTiming;LaunchKernels@7;func=Plus@@@a@ParallelTable[#&@@a@Pause
@9,{7},Method->"EvaluationsPerKernel"->1]&;

In[2]:= func[]

Out[2]= {9.01498, 63.0068}

In[3]:= func[]

Out[3]= {9.01167, 63.0047}

In[4]:= func[]

Out[4]= {9.00587, 63.0051}

Leave it to Wolfram to put license restrictions on forking a child process.

C (with pthreads), 339 336 335 bytes
#include<stdio.h>
#include<sys/time.h>
#include<pthread.h>
#define d double
d s=0;int i;pthread_t p[14];d t(){struct timeval a;gettimeofday(&a,NULL);return a.tv_sec+a.tv_usec/1e6;}
h(){d b=t();sleep(5);s+=t()-b;}
main(){d g=t();for(i=14;i-->0;)pthread_create(&p[i],0,&h,0);for(i=14;i-->0;)pthread_join(p[i],0);printf("%f %f",t()-g,s);}

Javascript (ES6), 105 bytes

((t,c,d)=>{i=t();while(c--)setTimeout((c,s)=>{d+=t()-s;if(!c)alert([t()-i,d])},8e3,c,t())})(Date.now,8,0)

Updated version: 106 bytes
Borrowed from @Ismael Miguel as he had the great idea to lower sleep time and raise intervals.

((t,c,d)=>{i=t();while(c--)setTimeout((c,s)=>{d+=t()-s;if(!c)alert([t()-i,d])},610,c,t())})(Date.now,99,0)

Javascript Ungolfed, 167 bytes

(function(t, c, d){
 i = t();
 while(c--){
  setTimeout(function(c, s){
   d += t() - s;
   if (!c) alert([t() - i, d])
  }, 8e3, c, t())
 }
})(Date.now, 8, 0)

Instead of d+=t()-s;if(!c)alert([t()-i,d]), you can write d+=t()-s;c||alert([t()-i,d]), which will save a few bytes. Also, if you remove the function and rewrite it all, you can compete with my 92-byte long solution: for(c=8,i=(t=Date.now)(d=0);c--;)setTimeout((c,s)=>{d+=t()-s;c||alert([t()-i,d])},8e3,c,t()). And yes, this one is also 92 bytes long.

Common Lisp (SBCL) 166 bytes:
(do((m #1=(get-internal-real-time))(o(list 0)))((>(car o)60000)`(,(car o),(- #1#m)))(sb-thread:make-thread(lambda(&aux(s #1#))(sleep 1)(atomic-incf(car o)(- #1#s)))))

This just spawns threads that sleep and then atomically increment the time took, with an outer-loop that spins waiting for the total time to be more than 60000 ticks (i.e. 60s on sbcl).  The counter is stored in a list due to limitations to the types of places atomic-incf can modify.  This may run out of space before terminating on faster machines.
Ungolfed:
(do ((outer-start (get-internal-real-time))
       (total-inner (list 0)))
      ((> (car total-inner) 60000)
       `(,(car total-inner)
      ,(- (get-internal-real-time) outer-start)))
    (sb-thread:make-thread
     (lambda (&aux(start (get-internal-real-time)))
       (sleep 1)
       (atomic-incf (car total-inner) (- (get-internal-real-time) start)))))

Python 2, 130 bytes
import thread as H,time as T
m=T.clock;T.z=m()
def f(k):T.sleep(k);T.z+=m()
exec"H.start_new_thread(f,(7,));"*9
f(8);print m(),T.z

This is a derivation of Mego's answer, but it's sufficiently different that I thought it should be a separate answer. It is tested to work on Windows.
Basically, it forks off 9 threads, which sleep for 7 seconds while the parent sleeps for 8. Then it prints out the times. Sample output:
8.00059192923 71.0259046024

On Windows, time.clock measures wall time since the first call.

It's important to note that this only works on Windows - time.clock() behaves differently between Windows and UNIX/Linux platforms.

C90 (OpenMP), 131 Bytes (+ 17 for env variable) = 148 Bytes
#include <omp.h>
#define o omp_get_wtime()
n[4];main(t){t=o;
#pragma omp parallel
while(o-9<t);times(n);printf("%d,%f",n[0],o-t);}

Example Output:
7091,9.000014

Try it online!
Notes:
7091 is in cycles (100/sec), so the program ran for 70 seconds
Could be much shorter if I figured a way to get a timer to work other than omp_get_wtime() because then I could remove the include statement aswell.
Run with OMP_NUM_THREADS=9

You can set up the env var, but you would have to count the bytes to do so, except if the setting you choose is a common default.

@Adám Thanks, that's what I thought, it saves 6 or 7 bytes

Python 2, 132 bytes
Uses a process pool to spawn 9 processes and let each one sleep for 7 seconds.
import time as t,multiprocessing as m
def f(x):d=s();t.sleep(x);return s()-d
s=t.time
a=s()
print sum(m.Pool(9).map(f,[7]*9)),s()-a

Prints total accumulated sleeptime first, then the actual runtime:
$ python test.py
63.0631158352 7.04391384125

Matlab, 75 70 bytes
tic;parpool(9);b=1:9;parfor q=b
tic;pause(7);b(q)=toc;end
[sum(b);toc]

5 bytes saved as it turns out tic and toc are local to each worker process so they did not need to be assigned to a variable.
Quick explanation: parfor creates a parallel for-loop, distributed across the pool of workers. tic and toc measure time elapsed (and are in my opinion one of the best named functions in MATLAB). The last line (an array with the total time slept and the real time elapsed) is outputted since it's not terminated with a semicolon.
Note however that this creates a whopping 9 full-fledged MATLAB processes. Chances are then that this particular program this will not finish within the allotted 10 seconds on your machine. However, I think with a MATLAB installation that has no toolboxes except for the Parallel Computing toolbox installed -  installed on a high-end system with SSD - may just be able to finish within 10 seconds. If required, you can tweak the parameters to have less processes sleeping more.

The error about b is likely just because you had something in your workspace already. I have no issues on 2015b using parfor q=b

@Suever Oh hey, I had a script named b.m in my MATLAB folder.

Perl, 101 bytes
use Time::HiRes<time sleep>;pipe*1=\time,0;
print time-$1,eval<1>if open-print{fork&fork&fork}-sleep 9

Forks 7 child processes, each of which wait 9 seconds.
Sample Output:
perl wait-one-minute.pl
9.00925707817078-63.001741

Rust, 237 234 bytes
This is basically the same as @raggy's answer, just improved a bit.
use std::thread::*;fn main(){let n=std::time::Instant::now;let i=n();let mut t=i-i;for x in(0..8).map(|_|spawn(move||{let i=n();sleep_ms(9000);i.elapsed()})).collect::<Vec<_>>(){t+=x.join().unwrap();}print!("{:?}{:?}",t,i.elapsed());}

Ungolfed:
use std::thread::*;
fn main() {
    let n = std::time::Instant::now;
    let i = n();
    let mut t = i-i;
    for x in (0..8).map(|_| spawn(move || {
            let i = n();
            sleep_ms(9000);
            i.elapsed()
        })).collect::<Vec<_>>() {
            t += x.join().unwrap();
    }
    print!("{:?}{:?}", t, i.elapsed());
}

Improvements:
use std::thread::*;

at the beginning saves 7 bytes.
Not creating a new variable for a Vec of threads saves 5 bytes.
Removing the space in for x in (0..8) saves 1 byte.
The .collect::<Vec<_>>() hurts to look at though, but I can't think of a way to remove it because iterators are lazy in rust (so it won't even start the threads if we simply remove that part).

Ruby (with parallel gem), 123 116 bytes
require'parallel'
n=->{Time.now}
t=n[]
q=0
Parallel.each(1..10,:in_threads=>10){z=n[];sleep 6;q+=n[]-z}
puts n[]-t,q

Edit: Added the "Time.now" reference from the Ruby answer by histocrat.

Groovy, 158 143 characters
d={new Date().getTime()}
s=d(j=0)
8.times{Thread.start{b=d(m=1000)
sleep 8*m
synchronized(j){j+=d()-b}}}addShutdownHook{print([(d()-s)/m,j/m])}

Sample run:
bash-4.3$ groovy wait1minute.groovy
[8.031, 64.055]

Haskell, 278 271 262 246 bytes
import Control.Concurrent.Chan
import Data.Time
import GHC.Conc
t=getCurrentTime
b!a=b=<<flip diffUTCTime<$>t<*>(a>>t)
w=threadDelay$5^10
0#_=t
i#a=a>>(i-1)#a
main=print!do r<-newChan;9#(forkIO$writeChan r!w);getChanContents r>>=print.sum.take 9

! measures the time taken by action a (second argument) and applies b (first argument) to the result.
w is the sleep function.
main is measured itself, and result printed (print!...).
# is replicateM, repeating the given action N times (and returning t because golfing).
Inside the measured part, 9 threads (replicate 9 $ forkIO ...) sleep for 5^10 milliseconds (9.765625 seconds) and post the result (writeChan) to a pipe created by the main thread (newChan), which sums the 9 results up and prints the total (getChanContents >>= print . sum . take 9).
Output:
87.938546708s
9.772032144s

@Adám 6^9 > 10^7 (10 seconds).

Elixir, 168 bytes
import Task;import Enum;IO.puts elem(:timer.tc(fn->IO.puts(map(map(1..16,fn _->async(fn->:timer.tc(fn->:timer.sleep(4000)end)end)end),&(elem(await(&1),0)))|>sum)end),0)

Sample run:
$ elixir thing.exs
64012846
4007547

The output is the total time waited followed by the time the program has run for, in microseconds.
The program spawns 14 Tasks, and awaits each of them by mapping over them, and then finds the sum of their elapsed time.  It uses Erlang's timer for measuring time.

Welcome to the community!!

C#, 131 bytes
The following start 9 threads that each wait 6667 milliseconds.
The program run in 6.73 secondes and has the following output :  00:00:06.7116711|604140408
Where "604140408" is the number of tick.
There are 10 000ticks is a millisecond.
So this give ~60.414 seconds.
Total execution time and wait time don't have the same output format for golfing reason.
using t=DateTime;var s=t.Now;Task.WhenAll(new t[9].Select(y=>Task.Delay(6667))).Wait();Debug.Write(t.Now-s+"|"+(t.Now-s).Ticks*9);

Here is a fiddle that exceed the limit of execution of time of fiddle. Lower "6667" so that it fix fiddle's criteria if you want to run it.

I don't know C#, but it looks like you do not measure the elapsed sleep time, rather you use a hard-coded value.

@Adám, yes indeed I don't measure it because I might not understand something. If I tell all threads to wait for a total time of 60003 milli, what is the point of adding extra execution lines to count the time elapsed since I already know the time? If I add time checking, it's going to take longer only because of the execution time of extra line of code. Beside I wouldn't know how to accurately dissociate wait time from execution time. eg: execution time is 6722 milli and threads waits for 6667 each. So there is a 55milli left for code execution . [See next comment]

@Adám There may be a small amount of overhead waiting in these 55milli, but I don't understand what you really want about it. The only thing that I could easily calculate is the time it's took to launch all nice thread because first started thread will wait a little longer then the last one. But we are talking about few milliseconds here. So I didn't bother to do it, because yet again I thing I'm missing what you want exactly. I apologize  for not getting it, but may be you can shed some light on what is confusing me?

The point of this challenge is to start sleeping threads and keep track of their running time. One simple way to do this is take the time before launching the threads, and subtract that from the time when the last thread terminates.

I updated the answer to take the existing time differences between before launching threads and last thread terminates multiplied for the number of thread.

Great. Nice job.

Common Lisp (Lispworks), 457 bytes
(defun f(n)(labels((h(n b v)(mp:process-run-function nil nil #'(lambda(b v)(progn(let((s(get-internal-real-time)))(sleep 5)(setf(svref v n)(-(get-internal-real-time)s)))(mp:barrier-wait b :pass-through t)))b v)))(let((s(get-internal-real-time))(e 0)(q 0)(v(make-sequence 'vector n :initial-element 0))(b(mp:make-barrier(1+ n))))(dotimes(i n)(h i b v))(mp:barrier-wait b)(setf e(-(get-internal-real-time)s))(dotimes(p n)(setf q(+ q(svref v p))))(list e q))))

ungolfed:
    (defun f (n-thread)
      (labels ((my-process (process-name n barrier vec)
                 (mp:process-run-function
                  process-name
                  nil
                  #'(lambda (barrier vec)
                      (progn
                        (let ((start-time (get-internal-real-time)))
                          (sleep 5)
                          (setf (svref vec n)
                                (- (get-internal-real-time) start-time)))
                        (mp:barrier-wait barrier :pass-through t)))
                  barrier
                  vec)))

        (let ((total-start-time (get-internal-real-time))
              (total-time 0)
              (sum-per-process-time 0)
              (vector (make-sequence 'vector n-thread :initial-element 0))
              (barrier (mp:make-barrier (1+ n-thread))))
          (dotimes (i n-thread)
            (my-process
             (concatenate 'string "process-" (write-to-string i))
             i
             barrier
             vector))
          (mp:barrier-wait barrier)
          (setf total-time (- (get-internal-real-time) total-start-time))
          (dotimes (p n-thread)
            (setf sum-per-process-time
                  (+ sum-per-process-time (svref vector p))))
          (list total-time sum-per-process-time))))

Usage:
CL-USER 1 > (f 14)
(5028 70280)

c++, 332 358 357 bytes
Thanks Adám!
#include <iostream>
#include <chrono>
#include <thread>
#define n(x)auto x=chrono::steady_clock::now();
using namespace std;double t=0;void f(){n(s)this_thread::sleep_for(chrono::seconds(9));n(e)t+=(e-s).count()/1e9;}int main(){int i;n(s)thread*a[7];for(i=0;i<7;i++)a[i]=new thread(f);for(i=0;i<7;i++)a[i]->join();n(e)cout<<t<<","<<(e-s).count()/1e9<<"\n";}

Try it online

306 bytes

Julia -p 9, 48 bytes
@time show(sum(pmap(_->@elapsed(sleep(7)),1:9)))

Try it online!

the -p 9 option launches julia with 9 workers and with the Distributed standard library
pmap distributes the tasks over the available workers
@elapsed returns the time taken so that they can be sumed
@time prints the total time taken

Javascript, 81 bytes

for(M=(N=Date.now)(T=Y=i=0);i<350;)setTimeout("T+=k=N()-M,--i||alert([k,T])",++i)

From Ismael Miguel's

Uiua, 26 bytes
⊃/+/↥wait≡spawn⍜now&sl↯9 7

Spawns 9 threads, each waits 7 seconds.
Explanation:
⊃/+/↥wait≡spawn⍜now&sl↯9 7
                      ↯9 7  # Create a list of 9 7s.
         ≡spawn             # For each of these, spawn a thread which
               ⍜now         #   returns the time taken to
                   &sl      #   sleep 7 seconds.
     wait                   # Wait for all threads to finish.
⊃/+/↥                       # Push the maximum and the sum of this list.

Created with the help of Luminespire.

Go, 215 bytes
import."time"
type D=Duration
func f()(e,t D){N:=Now
s,c:=N(),make(chan D)
for i:=0;i<9;i++{go func(C chan D){s:=N();Sleep(7*Second);C<-N().Sub(s)}(c)}
for i:=0;i<9;i++{select{case a:=<-c:t+=a}}
return N().Sub(s),t}

Attempt This Online!
Spawns 9 threads of 7 seconds each. Returns in the ballpark of 7.000295677s 1m3.002016702s.
Ungolfed Explaination
import."time"
func f()(exec,total Duration){
    start:=Now()                  // start time
    duration:=7*Second            // duration per thread
    c:=make(chan Duration)        // channel to get time elapsed from
    for i:=0;i<9;i++{             // for 0 to 9...
        go func(C chan Duration){ // spawn a thread that...
            s:=Now()              // gets its start time
            Sleep(duration)       // sleeps for the duration
            C<-Now().Sub(s)       // returns the time slept
        }(c)                      // actually run the thread
    }
    for i:=0;i<9;i++{             // for each thread...
        select {                  // wait for...
        case amt:=<-c:            // something to come in on the channel
            total+=amt            // add it to the total slept time
        }
    }
    return Now().Sub(start),total // return elapsed time, and slept time
}

Attempt This Online!

R + Snowfall, 67 UTF-8 bytes
library(snowfall)
sfInit(T,8)
sfSapply(1:8,function(j)Sys.sleep(8))

Hello, and welcome to PPCG! This is [tag:code-golf] so you must include your byte count. If you accept my edit, you don't have to worry about it.

You also need to include in your header Snowfall.

How does the output look?

What is a "UTF-8 byte"?

@Adám  There is no such thing. But the byte count is correct (For all usual western encodings, such as ASCII, UTF-8 or CP1252)

@AlexR Good thing I don't use score collecting scripts, as this would probably evaluate to 8.

@Adám: The byte counting userscript I use says "Winner: JDL's answer at -8 bytes".


text:
Golf the repeated totient function
You will take two positive integers n and x as input, and output Euler's totient function (number of positive integers less than x co-prime to x) applied n times.
Testcases
n x   result
1 10  4
2 10  2
3 10  1
1 100 40
2 100 16
3 100 8
4 100 4
5 100 2
6 100 1

Extremely closely related, almost as closely related.

You know, people who does not use the proper name (totient) makes it hard to find.

I found both of those by searching for totient

@PeterTaylor I see. I only searched the question.

The repeated application is completely unnecessary for this challenge, 2) That's a sigma, not a phi, right?

@Sp3000 Oops... let's assume that it is a phi, lol.

His avatar is actually the sum of divisors function - OEIS sequence A000203

05AB1E, 2 bytes
Code:
FÕ

Explanation:
F   # Do the following n times:
 Õ  #   ..Calculate the totient

Uses the CP-1252 encoding. Try it online!.

You beat me by 30 seconds. Should have done the explanation faster :P

@Emigna First post a minimal answer, then add the explanation :-)

We have a winner here...

Python 2, 84 78 70 bytes
n,x=input();exec('k=m=1;'+'x-=(x%k<m%k)*x/k;m*=k*k;k+=1;'*x)*n;print x

Thanks to @xnor for golfing off 8 bytes!
Test it on Ideone.
Background
By Euler's product formula,

where φ denotes Euler's totient function and p varies only over prime numbers.
To identify primes, we use a corollary of Wilson's theorem:

How it works
After reading the input, we construct and execute a certain string. The executed code is roughly equivalent to the following.
r = range(x)
for _ in range(n):
    k = 1
    m = 1
    for _ in r:
        x -= (x % k < m % k) * x / k
        m *= k**2
        k += 1

The inner loop will set x = φ(x), so executing it n times stores the desired output in x.
At all times, the variable m will be equal to the square of the factorial of k - 1. In fact, we set k = 1 and m = 0!2 = 1 at the beginning of the inner loop.
k varies from its initial value 1 to the initial value of x and is incremented each time the sinner loop is executed. m is updated accordingly by multiplying it by the "old" value of k2.
For the actual calculation of x, recall that m%k will yield 1 if m is prime and 0 if not. This means that x%k<m%k will yield True if and only if both k is a prime number and x is divisible by k.
In this case, (x%k<m%k)*x/k yields x / k, and subtracting it from x replaces its previous value with x(1 - 1/k), as in Euler's product formula. Otherwise, (x%k<m%k)*x/k yields 0 and x remains unchanged.

That nested string execution looks neat... do you mind adding an explanation?

I've edited my answer.

Another beautiful mathematical solution! It looks like you can do x-=x/k*(x%k<m%k) for x=[x,x/k*~-k][x%k<m%k].

The exec should work as exec("..."+"..."*x)*n, since there's no harm in using the too-high initial x as the count for each inner loop.

@xnor That's very clever and saved a lot of bytes. Thank you!

Actually, 4 bytes
`▒`n

Try it online!
This program takes x as the first input, and n as the second input.
Explanation:
`▒`n
`▒`n  call the following function n times:
 ▒      totient(x)

This messes with my brain ▒_▒

Is this actually 4 bytes? >_>

@Geobits You're seriously very funny.

MATL, 5 bytes
:"_Zp

Try it online!
:        % Take n implicitly. Generate vector [1 2 ... n]
"        % For each loop, that is, repeat n times
  _Zp    %   Euler's totient function. Takes x implicitly first time
         % End for. Display implicitly

Without using Euler's totient function: 9 bytes
:"t:Zd1=s

Try it online!
:        % Take n implicitly. Generate range [1 2 ... n]
"        % For each loop, that is, repeat n times
  t      %   Duplicate. Takes x implicitly first time. Call that t
  :      %   Range [1 2 ... t]
  Zd     %   GCD of t and [1 2 ... t], elementwise
  1=s    %   How many times the result equals 1: Euler's totient
         % End for. Display implicitly

Mathematica, 17 bytes
EulerPhi~Nest~##&

An unnamed function which takes x as the first argument and n as the second. Here EulerPhi~Nest~## is short for Nest[EulerPhi, ##] and then ## expands to a sequence of both arguments so we get Nest[EulerPhi, x, n]. And EulerPhi is of course the totient function.

Jelly, 3 bytes
ÆṪ¡

Expects x as the first argument and n as the second.
Try it online!
This is as straightforward as it gets: ÆṪ is the built-in totient function and ¡ applies this function as many times as the second argument.

J, 6 4 bytes
5&p:

Straight-forward approach. Nests the totient function n times on an initial value of x.
Usage
   f =: 5&p:
   5 f 100
2

Explanation
Normally, 5&p: is a monad that computes the totient of its argument. However, when used dyadically, it nests itself on an initial value of its LHS according to the number of times on its RHS.

Haskell, 49 46 44 40 bytes
Thanks @xnor for another again named solution:
x%0=x
x%n=sum[1|1<-gcd x<$>[1..x]]%(n-1)

Old version:
The following is an unnamed pointless function that takes two arguments: (Thanks @Lynn for another two bytes!)
(!!).iterate(\y->sum[1|t<-[1..y],gcd y t<2])

To use it, you can e.g. assign it a name (f=(!!).(...) and then call it via f 10 1 (as an example for the first test case).
Explanation: The lambda function (\y->sum[1|t<-[1..y],gcd y t<2]) is the totient function. iterate f x produces an infinite list [x,f(x),f(f(x)),f(f(f(x))),...] and !! is just for accessing this list at a specific index.
Older version:
x#n=(iterate(\y->sum[1|t<-[1..y],gcd y t<2])x)!!n

Usage e.g. for the first test case: 10#1.

It's shorter to recurse than to iterate x%0=x;x%n=sum[1|t<-[1..x],gcd x t<2]%(n-1). The list comp can be done as [1|1<-gcd x<$>[1..x]].

Ah I always forget about the <$>, thanks!

PARI/GP, 33 bytes
Straightforward iteration:
f(n,x)=for(i=1,x,n=eulerphi(n));n

Straightforward recursion:
f(n,x)=if(x,n,f(eulerphi(n),x-1))

CJam, 20 bytes
q~{_mf1|1-{1$\/-}/}*

Try it online!
How it works
q~                    Read and evaluate all input. Pushes x and n.
  {               }*  Repeat n times:
   _mf                  Compute the prime factorization of a copy of x.
      1|1-              Add and remove 1 from the prime factorization.
                        | deduplicates and - handles the edge case 1mf -> [1].
          {     }/      For each remaining prime p:
           1$             Push a copy of x.
             \/           Swap with p and divide, pushing x/p.
               -          Subtract from x, pushing x-x/p.

Hoon, 84 bytes
|*((pair) ?~(p q $(p (dec p), q (lent (skim (gulf 1 q) |=(@ =(1 d:(egcd +< q))))))))

Ungolfed:
|*  (pair)
  ?~  p
    q
  %=  $
    p  (dec p)
    q  (lent (skim (gulf 1 q) |=(@ =(1 d:(egcd +< q)))))
  ==

Julia, 36 bytes
n\x=n>0?~-n\sum(k->gcd(k,x)<2,1:x):x

Try it online!

Perl 6,  47 45 44 43 42 41  39 bytes
{($^x,{+(^$^x .grep: {$_ gcd$x==1})}...*)[$^n]}
{($^x,{+(^$^x Xgcd $x).grep: *==1}...*)[$^n]}
{($^x,{+grep *==1,(^$^x Xgcd $x)}...*)[$^n]}
{($^x,{+grep *==1,(^$^x Xgcd$x)}...*)[$^n]}
{($^x,{+grep 2>*,(^$^x Xgcd$x)}...*)[$^n]}
{($^x,{+grep 2>*,(^$_ Xgcd$_)}...*)[$^n]}
{($^x,{sum 2 X>(^$_ Xgcd$_)}...*)[$^n]}
Explanation:
{ # parameters are $n,$x ( declared as placeholder parameters )
  (

    $^x, # seed sequence generator with second argument

    { # parameter is $_
      sum
        2
        X[>] # crossed compared using &infix«>»
        (
          0 ..^ $_ # from 0 up to and excluding the parameter
          X[gcd]   # cross apply &infix:<gcd> with:
          $_       # the parameter
        )
    }

    ...  # keep applying that block

    *    # forever

  )[ $^n ] # grab the one at the index indicated by the first argument
}

Test:
use v6.c;
use Test;

my @tests = (
  (1, 10) =>  4,
  (2, 10) =>  2,
  (3, 10) =>  1,
  (1,100) => 40,
  (2,100) => 16,
  (3,100) =>  8,
  (4,100) =>  4,
  (5,100) =>  2,
  (6,100) =>  1,
);

plan +@tests;

my &repeated-totient = {($^x,{sum 2 X>(^$_ Xgcd$_)}...*)[$^n]}

for @tests -> $_ ( :key(@input), :value($expected) ) {
  is repeated-totient(|@input), $expected, .gist
}

1..9
ok 1 - (1 10) => 4
ok 2 - (2 10) => 2
ok 3 - (3 10) => 1
ok 4 - (1 100) => 40
ok 5 - (2 100) => 16
ok 6 - (3 100) => 8
ok 7 - (4 100) => 4
ok 8 - (5 100) => 2
ok 9 - (6 100) => 1

So just to confirm... I shouldn't have to cite PPCG in my production Perl?

@NoOneIsHere Please tell me that you aren't going to use this in production. Also this is Perl 6, usually Perl means Perl 5. I would probably use sub φ ( Int \n ) { sum ^n .race.map: -> \k { k gcd n == 1  } } say φ 36 # 12 ( I'm sure there is a better algorithm though )

I was joking. I can't read or comprehend Perl.

@NoOneIsHere Why not? Perl 6 is easier to read and comprehend than Python

Javascript, 88 95
g=(a,b)=>b?g(b,a%b):a==1
t=(x,n=x,o=0)=>n?t(x,--n,o+g(x,n)):o
f=(n,x)=>n?f(n-1,t(x)):x

The first function returns true/false if the greatest commom divisor is 1. The second function calculates the totient. The third function is a simple recursion to do the totient n times.
I took this idea from the wikipedia link:

It can be defined more formally as the number of integers k in the range 1 ≤ k ≤ n for which the greatest common divisor gcd(n, k) = 1;

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Excludivisible numbers
Given an integer N, output the Nth positive number K with the following property in decimal base:
For each digit I at position P of K, the number formed from K by removing the Pth digit (i.e. I) is divisible by I.
Example and remarks
324 is such a number:

3 divides 24
2 divides 34
4 divides 32

Note 1: we assume that the empty number is divisible by anything, like 0. Therefore 1, 2, 3, 4, 5, 6, 7, 8 and 9 are valid.
Note 2: K cannot contain the digit 0, since you cannot divide by 0.
Inputs and outputs

You may take the input as a function argument, through STDIN, etc.
You may return the output from a function, through STDOUT, etc.
You may index those numbers starting from 0 (in which case N >= 0) or from 1 (in which case N > 0), whichever suits you more.

Test cases
Those examples are indexed from 0, so if you indexed from 1, then add 1 to the numbers in the N column.
N    Output
0    1
4    5
8    9
15   77
16   88
23   155
42   742
47   1113
121  4244
144  6888
164  9999

Scoring
This is code-golf, so the shortest answer in bytes wins.

Here are an implementation by @LeakyNun and by @FryAmTheEggman (both in Python) if you want more test cases.

The first 10000 excludivisible numbers.

The first 100000 (1e5) excludivisible numbers.

Related.

Jelly, 21 19 bytes
DLR©œ^€®ịDḌḍ@DPȧµ#Ṫ

Input is 1-indexed. Try it online!
How it works
DLR©œ^€®ịDḌḍ@DPȧµ#Ṫ  Main link. No arguments.

                µ    Convert the chain to the left into a link.
                 #   Read n from STDIN and execute the link to the left for
                     k = 0, 1, 2, ... until n value return a truthy value.
D                      Convert D to base 10 (digit array).
 LR                    Construct the range from 1 to the length of the digit array.
   ©                   Copy the range to the register.
       ®               Yield the value of the register.
    œ^€                Take the multiset difference of each element of the range
                       and the range itself.
        ịD             Index into the digit array.
          Ḍ            Convert each list of digits to integer.
                       This yields all numbers with one suppressed digit.
           ḍ@D         Test each of these numbers for divisibility by the
                       suppressed digit from the digit array.
              P        Take the product of the resulting Booleans.
               ȧ       Logical AND with k (k would return 1).
                  Ṫ  Tail; extract the last (nth) element.

Pyth, 20
e.f!s.e.x%s.D`Zksb1`

Try it here or run the Test Suite
N is 1-indexed for this answer.
Uses largely the same logic as my python script. Notable differences are using .D to delete the digit from the string during the test and using exception handling to deal with zero digits.

Pyth, 26 bytes
e.f&!/J`Z\0!s%VsM.DLJUJjZT

Test suite.
e.f&!/J`Z\0!s%VsM.DLJUJjZT
e.f                          The n-th number (Z) where:
    !/J`Z\0                      Z does not contain "0"
   &                             and
           !s                    the following does not contain zero:
               sM.DLJUJ              generate the set of the digits removed
                       jZT           all the digits
             %V                      modulus in parallel
                                     if Z is 324,
                                     the first set would be [24,34,32]
                                     the second set would be [3,2,4]
                                     the third set would be [24%3, 34%2, 32%4]

JavaScript (ES6), 82 78 76 bytes
f=(n,k=0)=>n?f(n-!eval(/0/.test(++k)+`${k}`.replace(/./g,"|'$`$''%$&")),k):k

Input is 1-indexed. Works by building up a string of the form false|'24'%3|'34'%2|'32'%4 and evaluating it. Strings are used because they are still syntactically valid in the single-digit case.
The recursion limits this to about n=119. Iterative version for 88 84 82 bytes:
n=>{for(k=0;n;n-=!eval(/0/.test(++k)+`${k}`.replace(/./g,"|'$`$''%$&")));return l}

Edit: Saved 2 bytes thanks to @Dennis♦.

"|'$`$''%$&" saves two bytes.

@Dennis Thanks, I knew there had to be a better way to handle that edge case.

Python 2, 93 bytes
n=input();r=0
while n:r+=1;k=t=1;exec't&=(r/k/10*k+r%k)%(r/k%10or r)<1;k*=10;'*r;n-=t
print r

Very inefficient. Input is 1-indexed. Test it on Ideone.
Alternate version, 100 bytes
The above code performs roughly 10x divisibility tests where only x are required. At the cost of only 7 extra bytes, efficiency can be improved dramatically, either by replacing *r with *len(`r`) or by refactoring the code as follows.
n=input();r=0
while n:
 r+=1;k=t=1
 for _ in`r`:t&=(r/k/10*k+r%k)%(r/k%10or r)<1;k*=10
 n-=t
print r

This handles all test cases with ease, even on Ideone.

Ruby, 90
f=->n,s=?0{0while s.next![?0]||s[1]&&/t/=~s.gsub(/\d/){eval"#$`#$'%#$&>0"};n<1?s:f[n-1,s]}

Similar approach to Neil's Javascript answer, but significantly longer due to a lack of implicit type conversion (except that booleans do get converted into strings by gsub, which is nice).

Ruby, 109 bytes
->n{i=s=1;n.times{s=?0;s="#{i+=1}"while s[?0]||(0...x=s.size).any?{|i|(s[0,i]+s[i+1,x]).to_i%s[i].to_i>0}};s}

Hoon, 246 bytes
=+
x=0
|=
n/@
=+
k=<x>
=+
%+
levy
%+
turn
(gulf 0 (dec (lent k)))
|=
a/@
=+
(trim +(a) k)
=+
(rash (snag a p) dit)
?:
=(- 0)
|
=(0 (mod (fall (rust (weld (scag a p) q) dem) x) -))
(curr test &)
?:
=(- &)
?:
=(0 n)
x
$(n (dec n), x +(x))
$(x +(x))

Ungolfed:
=+  x=0
|=  n/@
=+  k=<x>
=+  %+  levy
  %+  turn  (gulf 0 (dec (lent k)))
  |=  a/@
  =+  (trim +(a) k)
  =+  (rash (snag a p) dit)
  ?:  =(- 0)
    |
  =(0 (mod (fall (rust (weld (scag a p) q) dem) x) -))
(curr test &)
?:  =(- &)
  ?:  =(0 n)
    x
  $(n (dec n), x +(x))
$(x +(x))

This...is really terrible. I feel dirty for posting this.
Set k to the string form of the current number, map over the list [0...(length k)-1] splitting the string at that index (a). Get the a character, parse it to a number, and if it's 0 return no. Get the prefix of a and weld it to the other half of the split, parse to a number, check if the index divides it evenly.
++levy returns yes iff calling the function on all the elements of the list is also yes. In this case, the function ++test curried with yes, so it checks that all of the characters in k work.
If we're at the 0th value, we return the current number, or else we recurse with n decremented (and increment x)

Lua, 199 bytes
n,m=1,...function e(n)for i=1,#n do x=n:sub(1,i-1)..n:sub(i+1)s=n:sub(i,i)if x==""or s=="0"or x%s~=0 then return x==""end end return true end while m+0>0 do n=n+1 m=m-(e(""..n)and 1 or 0)end print(n)

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Define a field with 256 elements
A field in mathematics is a set of numbers, with addition and multiplication operations defined on it, such that they satisfy certain axioms (described in Wikipedia; see also below).
A finite field can have pn elements, where p is a prime number, and n is a natural number. In this challenge, let's take p = 2 and n = 8, so let's make a field with 256 elements.
The elements of the field should be consecutive integers in a range that contains 0 and 1:

-128 ... 127
0 ... 255
or any other such range

Define two functions (or programs, if that is easier), a(x,y) for abstract "addition", and m(x,y) for abstract "multiplication", such that they satisfy the field axioms:

Consistency: a(x,y) and m(x,y) produce the same result when called with same arguments
Closedness: The result of a and m is an integer in the relevant range
Associativity: for any x, y and z in the range, a(a(x,y),z) is equal to a(x,a(y,z)); the same for m
Commutativity: for any x and y in the range, a(x,y) is equal to a(y,x); the same for m
Distributivity: for any x, y and z in the range, m(x,a(y,z)) is equal to a(m(x,y),m(x,z))
Neutral elements: for any x in the range, a(0,x) is equal to x, and m(1,x) is equal to x
Negation: for any x in the range, there exists such y that a(x,y) is 0
Inverse: for any x≠0 in the range, there exists such y that m(x,y) is 1

The names a and m are just examples; you can use other names, or unnamed functions. The score of your answer is the sum of byte-lengths for a and m.
If you use a built-in function, please also describe in words which result it produces (e.g. provide a multiplication table).

@LeakyNun "addition" is just an abstract operation here that satisfies the above properties. There is no need for a(2,1) = 3, you could have a(2,1) = 5 as long as the above axioms are satisfied. a doesn't have to do anything with the usual addition you're used to e.g. from the field of rational numbers.

A commutative ring is trivial. A field... not so easy.

Is there anything wrong with a=+ m=×?

@Adám Yes - 2 wouldn't have an inverse if m=×

Related

I am eagerly waiting for an INTERCAL example.

Well, I know what addition is, it's just multiplication that's the problem

Intel x86-64 + AVX-512 + GFNI, 11 bytes
add:
    C5 F0 57 C0     # vxorps     xmm0, xmm1, xmm0
    C3              # ret
mul:
    C4 E2 79 CF C1  # vgf2p8mulb xmm0, xmm0, xmm1
    C3              # ret

Uses the new GF2P8MULB instruction on Ice Lake CPUs.

The instruction multiplies elements in the finite field GF(28), operating on a byte (field element) in the first source operand and the corresponding byte in a second source operand. The field GF(28) is represented in polynomial representation with the reduction polynomial x8 + x4 + x3 + x + 1.

Python 2, 11 + 45 = 56 bytes
Addition (11 bytes):
int.__xor__

Multiplication (45 bytes):
m=lambda x,y:y and m(x*2^x/128*283,y/2)^y%2*x

Takes input numbers in the range [0 ... 255]. Addition is just bitwise XOR, multiplication is multiplication of polynomials with coefficients in GF2 with Russian peasant.
And for checking:
a=int.__xor__
m=lambda x,y:y and m(x*2^x/128*283,y/2)^y%2*x

for x in range(256):
    assert a(0,x) == a(x,0) == x
    assert m(1,x) == m(x,1) == x

    assert any(a(x,y) == 0 for y in range(256))

    if x != 0:
        assert any(m(x,y) == 1 for y in range(256))

    for y in range(256):
        assert 0 <= a(x,y) < 256
        assert 0 <= m(x,y) < 256
        assert a(x,y) == a(y,x)
        assert m(x,y) == m(y,x)

        for z in range(256):
            assert a(a(x,y),z) == a(x,a(y,z))
            assert m(m(x,y),z) == m(x,m(y,z))
            assert m(x,a(y,z)) == a(m(x,y), m(x,z))

One of us is going to have to change :P

@Mego Hah, well... I'll try and see if I can find any other approaches. Might be hard to beat though.

No worries. I'm actually going to delete mine, since this is golfier, and I trust that you actually came up with this solution on your own and weren't trying to steal my solution :P

Which polynomial is it based on?

@feersum, indeed, I guess that 283 in the definition of the multiplication is encoding the polynomial somehow, but I'd be very interested to know whence it came!

@LSpice Now I realize that I can easily find the polynomial by running m(2,128) which results in 27 = 283 - 256, so you are correct and the polynomial is x^8 + x^4 + x^3 + x + 1.

@feersum, clever!  I guess that this polynomial must be published somewhere as the 'standard' one for GF(256), since it seems that @Neil is using the same one.

@LSpice In Neil's answer he gives a Wikipedia page as a source for the algorithm, so maybe everyone read that. But it is anyway the most obvious choice for code golf since it the smallest irreducible polynomial of degree 8 in this representation.

@feersum I got 283 from the Wikipedia page too, but I also ran a search for a shorter modulus. There are no moduli for GF(256) that are shorter than 3 digits (unless I did something wrong in my calculations), so 283 is as good of a modulus as any.

@Mego Surely all moduli for GF(256) must lie between 256 and 512?

JavaScript (ES6), 10 + 49 = 59 bytes
a=(x,y)=>x^y
m=(x,y,p=0)=>x?m(x>>1,2*y^283*(y>>7),p^y*(x&1)):p

Domain is 0 ... 255. Source.

You should probably specify the range you're using.

Hoon, 22 bytes
[dif pro]:(ga 8 283 3)

Hoon already has a function ++ga that creates Galois Fields, for use in the AES implementation. This returns a tuple of two functions, instead of using two programs.
Operates in the domain [0...255]
Testsuite:
=+  f=(ga 8 283 3)
=+  n=(gulf 0 255)

=+  a=dif:f
=+  m=pro:f

=+  %+  turn  n
    |=  x/@
    ?>  =((a 0 x) x)
    ?>  =((m 1 x) x)
    ~&  outer+x

    %+  turn  n
      |=  y/@
      ?>  =((a x y) (a y x))
      ?>  &((lte 0 (a x y)) (lte (a x y) 255))
      ?>  &((lte 0 (m x y)) (lte (m x y) 255))

      %+  turn  n
        |=  z/@
        ?>  =((a (a x y) z) (a x (a y z)))
        ?>  =((m x (a y z)) (a (m x y) (m x z)))
        ~
"ok"

Posting a multiplication table would be gigantic, so here are some random testcases:
20x148=229
61x189=143
111x239=181
163x36=29
193x40=1

IA-32 machine code, 22 bytes
"Multiplication", 18 bytes:
33 c0 92 d1 e9 73 02 33 d0 d0 e0 73 02 34 1b 41
e2 f1

"Addition", 4 bytes:
92 33 c1 c3

This stretches rules a bit: the "multiplication" code lacks function exit code; it relies on the "addition" code being in memory right afterwards, so it can "fall-through". I did it to decrease code size by 1 byte.
Source code (can be assembled by ml of MS Visual Studio):
    TITLE   x

PUBLIC @m@8
PUBLIC @a@8

_TEXT   SEGMENT USE32
@m@8    PROC
    xor eax, eax;
    xchg eax, edx;
myloop:
    shr ecx, 1
    jnc sk1
    xor edx, eax
sk1:
    shl al, 1
    jnc sk2
    xor al, 1bh
sk2:
    inc ecx
    loop myloop
@m@8 endp

@a@8 proc
    xchg eax, edx;
    xor eax, ecx
    ret
@a@8    ENDP
_text ENDS
END

The algorithm is the standard one, involving the usual polynomial x^8 + x^4 + x^3 + x + 1, represented by the hexadecimal number 1b. The "multiplication" code accumulates the result in edx. When done, it falls through to the addition code, which moves it to eax (conventional register to hold return value); the xor with ecx is a no-op, because at that point ecx is cleared.
One peculiar feature is the loop. Instead of checking for zero
cmp ecx, 0
jne myloop

it uses the dedicated loop instruction. But this instruction decreases the loop "counter" before comparing it to 0. To compensate for this, the code increases it before using the loop instruction.

Mathematica 155 bytes
f[y_]:=Total[x^Reverse@Range[0,Log[2,y]]*RealDigits[y,2][[1]]];o[q_,c_,d_]:=FromDigits[Reverse@Mod[CoefficientList[PolynomialMod[q[f@c,f@d],f@283],x],2],2]

Implementation
(*
  in: o[Times, 202, 83]    out: 1
  in: o[Plus, 202, 83]     out: 153
*)

addition check:
(*
  in: BitXor[202, 83]      out: 153
*)

More:
(*
  in: o[Times, #, #2] & @@@ {{20, 148}, {61, 189}, {111, 239}, {163, 36}, {193, 40}}
  out: {229, 143, 181, 29, 1}
*)

NB Should be able to use any of {283, 285, 299, 301, 313, 319, 333, 351, 355, 357, 361, 369, 375, 379, 391, 395, 397, 415, 419, 425, 433, 445, 451, 463, 471, 477, 487, 499, 501, 505} in place of 283.

Well, here's 13 bytes less: ±y_:=Total[#&@@y~RealDigits~2x^Reverse@Range[0,2~Log~y]];p[q_,c_,d_]:=Fold[#+##&,Reverse@CoefficientList[q[±c,±d]~PolynomialMod~±283,x]~Mod~2] (assumes that the source is encoded in ISO 8859-1)

@MartinEnder not quite sure how to implement your suggestion

@martin You can use it exactly like before, I've just used ± instead of f and p instead of o (of course you can keep that as o, I just used p so I could test both of them), and then saved a few more bytes with standard syntactic sugar tricks.

@MartinEnder can get ± to work same as f, but not p ... not sure where I am going wrong

If you copy it straight from the comment, there might be some unprintable characters wherever your browser displays the line break in the comment. Delete the characters around that position after copying and the retype them. If that doesn't do it, I'm not sure where the problem is..


text:
Calculate the relativistic velocity
In special relativity, the velocity of a moving object relative to another object that is moving in the opposite direction is given by the formula:
\begin{align}s = \frac{v+u}{1+vu/c^2}.\end{align}
s = ( v + u ) / ( 1 + v * u / c ^ 2)

In this formula, \$v\$ and \$u\$ are the magnitudes of the velocities of the objects, and \$c\$ is the speed of light (which is approximately \$3.0 \times 10^8 \,\mathrm m/\mathrm s\$, a close enough approximation for this challenge).
For example, if one object was moving at v = 50,000 m/s, and another object was moving at u = 60,000 m/s, the velocity of each object relative to the other would be approximately s = 110,000 m/s. This is what you would expect under Galilean relativity (where velocities simply add). However, if v = 50,000,000 m/s and u = 60,000,000 m/s, the relative velocity would be approximately 106,451,613 m/s, which is significantly different than the 110,000,000 m/s predicted by Galilean relativity.
The Challenge
Given two integers v and u such that 0 <= v,u < c, calculate the relativistic additive velocity, using the above formula, with c = 300000000. Output must be either a decimal value or a reduced fraction. The output must be within 0.001 of the actual value for a decimal value, or exact for a fraction.
Test Cases
Format: v, u -> exact fraction (float approximation)
50000, 60000 -> 3300000000000/30000001 (109999.99633333346)
50000000, 60000000 -> 3300000000/31 (106451612.90322581)
20, 30 -> 7500000000000000/150000000000001 (49.999999999999666)
0, 20051 -> 20051 (20051.0)
299999999, 299999999 -> 53999999820000000000000000/179999999400000001 (300000000.0)
20000, 2000000 -> 4545000000000/2250001 (2019999.1022226212)
2000000, 2000000 -> 90000000000/22501 (3999822.2301231055)
1, 500000 -> 90000180000000000/180000000001 (500000.9999972222)
1, 50000000 -> 90000001800000000/1800000001 (50000000.972222224)
200000000, 100000000 -> 2700000000/11 (245454545.45454547)

s/velocity/Velocity of an Unladen Swallow/g

"Gallilean relativity"?  Gaillilean mechanics, perhaps, but I'd call your phrase an oxymoron (possibly an anachronistic retronym, too).  Good PPCG question, though!

@TobySpeight https://en.wikipedia.org/wiki/Galilean_invariance

MATL, 9 bytes
sG3e8/pQ/

Try it online!
s      % Take array [u, v] implicitly. Compute its sum: u+v
G      % Push [u, v] again
3e8    % Push 3e8
/      % Divide. Gives [u/c, v/c]
p      % Product of array. Gives u*v/c^2
Q      % Add 1
/      % Divide. Display implicitly

Mathematica, 17 bytes
+##/(1+##/9*^16)&

An unnamed function taking two integers and returning an exact fraction.
Explanation
This uses two nice tricks with the argument sequence ##, which allows me to avoid referencing the individual arguments u and v separately. ## expands to a sequence of all arguments, which is sort of an "unwrapped list". Here is a simple example:
{x, ##, y}&[u, v]

gives
{x, u, v, y}

The same works inside arbitrary functions (since {...} is just shorthand for List[...]):
f[x, ##, y]&[u, v]

gives
f[x, u, v, y]

Now we can also hand ## to operators which will first treat them as a single operand as far as the operator is concerned. Then the operator will be expanded to its full form f[...], and only then is the sequence expanded. In this case +## is Plus[##] which is Plus[u, v], i.e. the numerator we want.
In the denominator on the other hand, ## appears as the left-hand operator of /. The reason this multiplies u and v is rather subtle. / is implemented in terms of Times:
FullForm[a/b]
(* Times[a, Power[b, -1]] *)

So when a is ##, it gets expanded afterwards and we end up with
Times[u, v, Power[9*^16, -1]]

Here, *^ is just Mathematica's operator for scientific notation.

Jelly, 9 bytes
÷3ȷ8P‘÷@S

Try it online! Alternatively, if you prefer fractions, you can execute the same code with M.
How it works
÷3ȷ8P‘÷@S  Main link. Argument: [u, v]

÷3ȷ8       Divide u and v by 3e8.
    P      Take the product of the quotients, yielding uv ÷ 9e16.
     ‘     Increment, yielding 1 + uv ÷ 9e16.
        S  Sum; yield u + v.
      ÷@   Divide the result to the right by the result to the left.

Python3, 55 31 29 bytes
Python is awful for getting inputs as each input needs int(input())
but here is my solution anyway:
v,u=int(input()),int(input());print((v+u)/(1+v*u/9e16))
Thanks to @Jakube I don't actually need the whole prgrame, just the function. Hence:
lambda u,v:(v+u)/(1+v*u/9e16)

Rather self explanatory, get inputs, computes. I've used c^2 and simplified that as 9e16 is shorter than (3e8**2).
Python2, 42 bytes
v,u=input(),input();print(v+u)/(1+v*u/9e16)

Thanks to @muddyfish

If you use python2, you can drop the int(input()) and replace it with input(), you can also drop the brackets round the print statement

@Jakube How would you get the inputs though? OP says "Given two integers v and u"

@Jakube Yes that would be how I would use lambda in it, but OP is asking implicitly for the whole program not just a function. i.e it has an input and an output

@Jakube well in that case I golf it down a bit. Cheers!

You can have lambda u,v:(v+u)/(1+v*u/9e16), and this works for both Python 2 and 3.

J, 13 11 bytes
+%1+9e16%~*

Usage
>> f =: +%1+9e16%~*
>> 5e7 f 6e7
<< 1.06452e8

Where >> is STDIN and << is STDOUT.

Matlab, 24 bytes
@(u,v)(u+v)/(1+v*u/9e16)

Anonymous function that takes two inputs. Nothing fancy, just submitted for completeness.

I suggest you remove "regular" from the title. If a toolbox were used it would have to be mentioned; so you can safely just say "Matlab". Oh and welcome to PPCG!

CJam, 16 Bytes
q~_:+\:*9.e16/)/

I'm still sure there are bytes to be saved here

Here's two of those bytes: q~d]_:+\:*9e16/)/

@MartinEnder Thanks, didn't know about d working like that but can't believe i missed the increment operator....

1 byte fewer with array input: q~_:+\:*9.e16/)/

Dyalog APL, 11 bytes
+÷1+9E16÷⍨×

The fraction of the sum and [the increment of the divides of ninety quadrillion and the product]:
┌─┼───┐
+ ÷ ┌─┼──────┐
    1 + ┌────┼──┐
        9E16 ÷⍨ ×

÷⍨ is "divides", as in "ninety quadrillion divides n" i.e equivalent to n divided by ninety quadrillion.

Surely that's 11 characters, not bytes, as I'm pretty sure some of those symbols aren't in ASCII?

@Jules In UTF-8, certainly, but APL has its own code pages, which predate Unicode by a few decades.

Haskell, 24 bytes
As a single function that can provide either a floating point or fractional number, depending on the context in which it's used...
r u v=(u+v)/(1+v*u/9e16)

Example usage in REPL:
*Main> r 20 30
49.999999999999666
*Main> default (Rational)
*Main> r 20 30
7500000000000000 % 150000000000001

Save two bytes by defining u#v instead of r u v.

Noether, 24 bytes
Non-competing
I~vI~u+1vu*10 8^3*2^/+/P

Try it here!
Noether seems to be an appropriate language for the challenge given that Emmy Noether pioneered the ideas of symmetry which lead to Einstein's equations (this, E = mc^2 etc.)
Anyway, this is basically a translation of the given equation to reverse polish notation.

Pyth, 14 bytes
csQhc*FQ*9^T16

Test suite.
Formula: sum(input) / (1 + (product(input) / 9e16))
Bonus: click here!

It's really unnecessary to include "FGITW" on every solution that is the first on a challenge.

Sorry, I have deleted it.

Javascript 24 bytes
Shaved off 4 bytes thanks to @LeakyNun
v=>u=>(v+u)/(1+v*u/9e16)

Pretty straightforward

Would v=>u=>(v+u)/(1+v*u/9e16) be ok?

@LeakyNun yes it would according to this meta post

Pyke, 12 bytes
sQB9T16^*/h/

Try it here!

Julia, 22 bytes
u\v=(u+v)/(1+u*v/9e16)

Try it online!

TI-Basic, 21 bytes
Prompt U,V:(U+V)/(1+UV/9ᴇ16

Isn't the E worth 2 bytes?

Please check for yourself first... http://tibasicdev.wikidot.com/e-ten

TI-BASIC, 12 bytes
:sum(Ans/(1+prod(Ans/3ᴇ8

Takes input as a list of {U,V} on Ans.

Microscript II, 28 bytes
1s16Es9*s>Fs>Fs<d*</+s<o<+</

dc, 21 bytes
svddlv+rlv*9/I16^/1+/

This assumes that the precision has already been set, e.g. with 20k.  Add 3 bytes if you can't make that assumption.
A more accurate version is
svdlv+9I16^*dsc*rlv*lc+/

at 24 bytes.
Both of them are reasonably faithful transcriptions of the formula, with the only notable golfing being the use of 9I16^* for c².

PHP, 44 45 bytes
Anonymous function, pretty straightforward.
function($v,$u){echo ($v+$u)/(1+$v*$u/9e16);}

You need c^2 in the denominator ... i.e., 9e16 or equivalent.

PowerShell, 34 bytes
param($u,$v)($u+$v)/(1+$v*$u/9e16)

Extremely straightforward implementation. No hope of catching up with anyone, though, thanks to the 6 $ required.

Oracle SQL 11.2, 39 bytes
SELECT (:v+:u)/(1+:v*:u/9e16)FROM DUAL;

T-SQL, 38 bytes
DECLARE @U REAL=2000000, @ REAL=2000000;
PRINT FORMAT((@U+@)/(1+@*@U/9E16),'g')

Try it online!
Straightforward formula implementation.

ForceLang, 116 bytes
def r io.readnum()
set s set
s u r
s v r
s w u+v
s c 3e8
s u u.mult v.mult c.pow -2
s u 1+u
io.write w.mult u.pow -1

Actually, 12 bytes
;8╤3*ì*πu@Σ/

Try it online!
Explanation:
;8╤3*ì*πu@Σ/
;             dupe input
 8╤3*ì*       multiply each element by 1/(3e8)
       πu     product, increment
         @Σ/  sum input, divide sum by product

Java (JDK), 24 bytes
u->v->(u+v)/(1+u*v/9e16)

Try it online!

Forth (gforth), 39 bytes
: f 2dup + s>f * s>f 9e16 f/ 1e f+ f/ ;

Try it online!
Code Explanation
: f            \ start a new work definition
  2dup +       \ get the sum of u and v
  s>f          \ move to top of floating point stack
  * s>f        \ get the product of u and v and move to top of floating point stack
  9e16 f/      \ divide product by 9e16 (c^2)
  1e f+        \ add 1
  f/           \ divide the sum of u and v by the result
;              \ end word definition

Math++, 26 bytes
?>u
?>v
(v+u)/(1+v*u/9e16)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Find operations required to get result
So task is simple, given array of numbers and result, you need to find what operations you need to use on numbers from array , to obtain requested result.
Let's make it simple for start, and allow only basic operations such as: addition, subtraction, multiplication and division.
Example:
Input  : [5,5,5,5,5] 100
Output : 5*5*5-5*5

To give some advantage to languages like Java, request is to implement function, not entire program, and result can be return via parameter or print to console.
Code is scored based on amount bytes, and as it's golf code challenge, lowest score wins.
Another requirment is You can get additional -10 points if for array contains only digids, support solutions where you could construct numbers from following digits.
Ie
Input  : [1,2,3,4,5] 0
Output : 12-3-4-5

Note that, provided outputs are proposed outputs, some cases might have more than one solution. It's up to you will you provide one or more solutions for given task.
EDIT:
Result has to be valid from mathematical point of view, hence division is rational division, not integer, and operation precedence is same as in classical math (first multiplication and division then addition and subtraction).

Does * and / have precendence over + and -? Your two examples contradict each other.

@LeakyNun well spotted, let me fix it

Please, in the future, make sure you create percentage-based bounties, for a language, like java, -10 bytes isn't as good as for jelly

@Bálint thanks for suggestion, i will remember about this in future.

Or even avoid bonuses altogether

I'm sure there have been other very similar questions too: the dupe target I chose was the easiest one to find.

@PeterTaylor as its duplicate, shall i delete it?

I'm not sure that you can now that it has an answer.

@PeterTaylor from the other hand, we could argue is it duplicate of one which you mark at. seems like it's similar task, but thera are different winning conditions. that one is code-challenge this one is cod-golf.

I have closed the dupe target, because it didn't contain a winning criterion at all. Before I reopen this though, could you clarify whether division is integer division or rational division? Also a word on the order of operations would be good. And as Luis Mendo mentioned, I recommend getting rid of the bonuses. Either require concatenation or don't. (In either case, there's a good chance someone might close it as a dupe of something else, because we've had a lot of these challenges, but they're very tricky to find, due to lack of good keywords.)

As an example, there's http://codegolf.stackexchange.com/q/6417/8478, which doesn't require concatenation but does ask for parentheses.

@MartinEnder I added suggested changes,  will you reopen it, or shall o accept provided answer?

I'm reopening it for now, but there's a chance that some people will think that the lack of support for parentheses doesn't make a sufficient difference over the challenge I linked (or that someone finds something more similar than that one).

Do the numbers need to be used in order? Also, for future challenges, I heartily recommend using the Sandbox where these sorts of issues can be ironed out before posting to Main.

Are numerical inputs only single digits or can they be multiple digits long?

Possible duplicate of Two-zero-one-five puzzle. Also maybe a duplicate of Official Dyalog APL 2016 Year Game

@mbomb007 it's not a duplicate of either of those. These are arbitrary numerical inputs, and only basic mathematical operations are allowed, they are not supposed to output actual programs.

@mbomb007 I would say it's not, since that challenge has some serious scoring issues. For example: Solutions are scored first by the number of expressions they produce and then by their code length in bytes. Hence, a 1000 byte program that produce 80 results will beat a 100 byte program that produces only 79 (though the latter could easily be extended to include the missing results).

May I take the arguments in reverse order?

Pyth, 23 bytes
Due to security reasons, * and / won't evaluate online, but they theoretically work.
fqeQvTms.ihQd^"+-*/"lth

Test suite with only + and -.

Oracle SQL 11.2, 322 304 270 bytes
SELECT o FROM(SELECT REPLACE(SUBSTR(:1,1,1)||REPLACE(SYS_CONNECT_BY_PATH(a||SUBSTR(:1,LEVEL*2+1,1),','),','),'_')o,LEVEL l FROM(SELECT SUBSTR('+-*/_',LEVEL,1)a FROM DUAL CONNECT BY LEVEL<6)CONNECT BY LEVEL<LENGTH(:1)/2)WHERE:2=dbms_aw.eval_number(o)AND l>LENGTH(:1)/2-1;

:1 is the list of digits
:2 is the result searched
Un-golfed :
SELECT o
FROM   (
         SELECT REPLACE(SUBSTR(:1,1,1)||REPLACE(SYS_CONNECT_BY_PATH(a||SUBSTR(:1,LEVEL*2+1,1),','),','),'_')o,LEVEL l
         FROM ( -- Create one row per operator
                SELECT SUBSTR('+-*/_',LEVEL,1)a FROM DUAL CONNECT BY LEVEL<6
              ) CONNECT BY LEVEL<LENGTH(:1)/2  -- Create every combination of operators, one per ','
)
WHERE :2=dbms_aw.eval_number(o)  -- filter on result = evaluation
  AND l>LENGTH(:1)/2-1           -- keep only expressions using every digits

TSQL(sqlserver 2016) 310 294 280 bytes
What a wonderful opportunity to write ugly code:
Golfed:
DECLARE @ varchar(max)= '5,5,5'
DECLARE @a varchar(20) = '125'

,@ varchar(max)='';WITH D as(SELECT @a a UNION ALL SELECT STUFF(a,charindex(',',a),1,value)FROM STRING_SPLIT('*,+,./,-,',',')x,d WHERE a like'%,%')SELECT @+=a+','''+REPLACE(a,'.','')+'''),('FROM D WHERE a not like'%,%'EXEC('SELECT y FROM(values('+@+'null,null))g(x,y)WHERE x='+@b)

Try it online
Readable:(insertion of decimal point(.) and removal of the same is necessary in order for sql to accept that 4/5 is not 0 - well removal is for the people testing it)
DECLARE @a varchar(max)= '5,5,5'
DECLARE @b varchar(20) = '5'

,@ varchar(max)=''
;WITH D as
(
  SELECT @a a
  UNION ALL
  SELECT STUFF(a,charindex(',',a),1,value)
  FROM STRING_SPLIT('*,+,./,-,',',')x,d
  WHERE a like'%,%'
)
SELECT @+=a+','''+REPLACE(a,',','')+'''),('
FROM D
WHERE a not like'%,%'

EXEC('SELECT y FROM(values('+@+'null,null))g(x,y)WHERE x='+@b)

This solution can also handle these types of input:

Input :[1,2,3,4,5] 0 Output : 12-3-4-5

JavaScript (ES6), 165 147 bytes
a=>o=>(c=[],i=c=>{for(j=0;!((c[j]?++c[j]:c[j]=1)%5);)c[j++]=0},eval(`while(eval(e=(a+'').replace(/,/g,(_,j)=>'+-*/'.charAt(c[~-j/2])))!=o)i(c);e`))

Nested eval... lovely.

f=a=>o=>(c=[],i=c=>{for(j=0;!((c[j]?++c[j]:c[j]=1)%5);)c[j++]=0},eval(`while(eval(e=(a+'').replace(/,/g,(_,j)=>'+-*/'.charAt(c[~-j/2])))!=o)i(c);e`))
console.log(f([5,5,5,5,5])(100))
console.log(f([1,2,3,4,5])(0))
console.log(f([3,4])(0.75))
console.log(f([3,4,5,6])(339))

Python 3, 170 155 bytes
from itertools import*
def f(n,o):print({k for k in[''.join(map(str,sum(j,())))[1:]for j in[zip(x,n)for x in product('+-*/',repeat=len(n))]]if eval(k)==o})

Create a generator with all possible orders of the operators, combine that with the numbers, then eval until we get the answer.
https://repl.it/C2F5

You could save a few characters by replacing ['+','-','*','/'] with '+-*/'; since strings are iterable, it will treat it just like an array with each element being each character in the string - so it will act just like you provided it with the array you currently have.

Matlab, 234 238 258 bytes
I'm assuming based on the limitations of the other answers that the number order of the input array is maintained by fiat.
n=length(x)-1
k=n*2+2
p=unique(nchoosek(repmat('*-+/',1,n),n),'rows')
p=[p char(' '*~~p(:,1))]'
c=char(x'*~~p(1,:))
o=p(:,r==cellfun(@eval,mat2cell(reshape([c(:) p(:)]',k,[]),k,0|p(1,:))))
reshape([repmat(x',size(o,2),1) o(:)]',k,[])'

This code takes a string of numbers x, say x = '12345' and a result r, say r = 15 and returns all of the strings of expressions you can evaluate to get r from x using the four operators.
I've used two different length-equivalent ways of avoiding using ones(length())-type or repmat(length())-type expressions: ~~p(1,:) which returns not-not values in p (i.e., a list of 1s the samelength as the first dimension of p) and 0|p(:,1) which returns 0 or is-there-a-value-in-p (i.e., a list of 1s the same length as the second dimension of p).
Matlab doesn't have an nchoosek with replacement method, so I've duplicated the operators the correct number of times, computed the whole space of nchoosek for that larger selection of operators, and then used a unique call to pare the result down to what it should be (removing equivalent combinations like '***+' and '***+'). I add a trailing space to match the length of the input vector for concatenation purposes and then compose the operator strings with the input strings into the columns of a matrix. I then evaluate the expressions columnwise to get results and find the order of operators that corresponds to those columns with results that match our input r.
Test: x = '12345', r = 15:
1*2*3+4+5
1+2+3+4+5
1-2*3+4*5

If I had to take an array of double precision values, I'd need x = num2str(x,'%d'); in order to convert the digits to a string, adding 21 (20 without the ;) to my score. *The extra bytes were semicolons I left in purely so that anyone running this code won't see their command prompt blow up with long arrays. Since my edit produces a giant pile of warnings about logicals and colon-operands now anyway, I've removed the semicolons in the new version.
Edit 2: Forgot to replace a 2*n+2 with k.
Old answer:
n=length(x)-1;
p=unique(nchoosek(repmat(['*','-','+','/'],1,n),n),'rows');
l=length(p);
p=[p repmat(' ',l,1)]';
c=reshape([repmat(x',l,1) p(:)]',n*2+2,[]);
o = p(:,r == cellfun(@eval, mat2cell(c,n*2+2,ones(l,1))));
reshape([repmat(x',size(o,2),1) o(:)]',n*2+2,[])'

Python, 195 186 bytes
Here's an atrocious way of doing it.
def x(i,r):
 t=""
 from random import choice as c
 while True:
  for j in i:
   t+=str(j)
   if c([0,1]):t+="."+c("+-/*")
  t=t.strip("+-*/.")+"."
  v=eval(t)
  if v == r:print t
  t=""

The function x accepts an argument of a list and a result - x([1,2,3,4,5], 15) for example.
The program begins a loop where we begin randomly selecting if we should append "+", "-", "*", or "/" between each number, or if we should concatenate them together. This seemed like a more concise option than actually going through permutations and trying every combination to find every result, and although it takes longer to run and is much less efficient. (Fortunately that's not a concern in this context!)
It also appends "." to each number to avoid doing integer-rounded operations like 6/4 = 1. It then evals our expression and determines if the result equal to what we are expecting, and if so, outputs the expression.
This program never exits - it will keep continually outputting results until killed.
EDIT 1: Remove unnecessary newlines where one-line if statements can be used.

really funny implementation. but easy to save some more bytes Try it online! (176 bytes)

JavaScript (ES6), 88 bytes
a=>o=>eval(`while(eval(e=(a+'').replace(/,/g,_=>'+-*/'.charAt(Math.random()*5)))!=o);e`)

Threw in a little randomness to the mix. Much easier than systematically iterating through the combinations.
Test Suite

f=a=>o=>eval(`while(eval(e=(a+'').replace(/,/g,_=>'+-*/'.charAt(Math.random()*5)))!=o);e`)
console.log(f([5,5,5,5,5])(100))
console.log(f([1,2,3,4,5])(0))
console.log(f([3,4])(0.75))
console.log(f([3,4,5,6])(339))

PHP, 108 bytes
for(;$i=$argc;eval("$s-$argv[1]?:die(\$s);"))for($s="",$x=$p++;--$i>1;$x/=4)$s.="+-*/"[$s?$x&3:4].$argv[$i];

takes input from command line arguments in reverse order. Run with -r.
breakdown
for(;                   # infinite loop:
    $i=$argc;               # 1. init $i to argument count
    eval("$s-$argv[1]?:"    # 3. if first argument equals expression value,
        ."die(\$s);")       #    print expression and exit
    )
    for($s="",              # 2. create expression:
        $x=$p++;            #    init map
        --$i>1;                 # loop from last to second argument
        $x/=4)                  # C: shift map by two bits
        $s.="+-*/"[$s?$x&3:4]   # A: append operator (none for first operand)
            .$argv[$i];         # B: append operand

Perl 5 with -pa, 46 bytes
$"="{,\\*,/,+,-}";$x=<>;($_)=grep$x==eval,<@F>

Try it online!