﻿:o+=(a+b)%d*2^n+++(a/2+b/2)%d*2^n+++(a/4+b/4)%d*2^n++a/=8b/=8goto1/m--  // Loop body
x/=n>0:o+=(a+b)%d*2^n+++(a/2+b/2)%d*2^n++:done=1:o*=c					// Submit
c=1000a=:a/c b=:b/c d=2/c:o=0n=0m=4:o+=(a+b)%d*2^n++a/=2b/=2goto1		// Setup

// Current best: ^

:o+=(a+b)%d*x+(a/2+b/2)%d*x+(a/4+b/4)*x+(a/4+b/4)*x a/=8b/=8

/--------//--------//--------//--------//--------//--------//--------/


c=1000 a=:a/c b=:b/c d=2/c :o=0 n=0
:o+=(a+b)%d*2^n+++(a/2+b/2)%d*2^n++ a/=4b/=4goto3-(a+b>0)
:done=1 :o*=c goto1


:o+=(a+b)%d*n n*=2a/=2b/=2
:o+=(a+b)%d*2^n++ a/=2b/=2
o+=(:a/n+:b/n)%d*n n/=2

/--------//--------//--------//--------//--------//--------//--------/

c=1000d=2/c n=(2^15)*c o=(:a/n+:b/n)%d*n n/=2
o+=(:a/n+:b/n)%d*n n/=2o+=(:a/n+:b/n)%d*n n/=2o+=(:a/n+:b/n)%d*n n/=2
o+=(:a/n+:b/n)%d*n n/=2o+=(:a/n+:b/n)%d*n n/=2 goto2/(n>=c)
:o=o goto:done++

/--------//--------//--------//--------//--------//--------//--------/

// Second best: v

c=1000d=2/c:o=0n=(2^15)*c
:o+=(:a/n+:b/n)%d*n n/=2:o+=(:a/n+:b/n)%d*n n/=2f=n<c:done=f goto2-f


/--------//--------//--------//--------//--------//--------//--------/

c=1000d=2/c m=(2^15)*c f=1p=c/2n=p
n-=(p-m)*f:o*=1-f:o+=(:a/n+:b/n)%d*n n/=2f=n<c:done=f goto2



:o*=1-f n-=n*f-m*+m*f
n-=p*f-m*f--:o*=-f
n-=(p-m)*f--:o*=-f
n-=(p-m)*f:o*=1-f




/--------//--------//--------//--------//--------//--------//--------/

c=1000 d=2/c n=(2^15)*c
:o*=1-f f=0 :o+=(:a/n+:b/n)%d*n n/=2 f=n<1000:done=f goto2-f

/--------//--------//--------//--------//--------//--------//--------/

c=1000d=2/c n=2^15:o=0
e=c*n:o+=(:a/e+:b/e)%d*e n/=2f=n<1:done=f goto2-f

/--------//--------//--------//--------//--------//--------//--------/

a=:a b=:b c=1000 d=0.002 n=32768 :o=0
e=c*n :o += ((a/e)%d+(b/e)%d)%d*e n/=2 x/=n goto2
:o/=c :o*=c goto:done++

/--------//--------//--------//--------//--------//--------//--------/


a=:a b=:b
:o  = (((a/1 % 2) * (b/1 % 2)) * 1) / 1000 * 1000
:o += (((a/2 % 2) * (b/2 % 2)) * 2) / 1000 * 1000
:o += (((a/4 % 2) * (b/4 % 2)) * 4) / 1000 * 1000
:o += (((a/8 % 2) * (b/8 % 2)) * 8) / 1000 * 1000
:o += (((a/16 % 2) * (b/16 % 2)) * 16) / 1000 * 1000
:o += (((a/32 % 2) * (b/32 % 2)) * 32) / 1000 * 1000
:o += (((a/64 % 2) * (b/64 % 2)) * 64) / 1000 * 1000
:o += (((a/128 % 2) * (b/128 % 2)) * 128) / 1000 * 1000
:o += (((a/256 % 2) * (b/256 % 2)) * 256) / 1000 * 1000
:o += (((a/512 % 2) * (b/512 % 2)) * 512) / 1000 * 1000
:o += (((a/1024 % 2) * (b/1024 % 2)) * 1024) / 1000 * 1000
:o += (((a/2048 % 2) * (b/2048 % 2)) * 2048) / 1000 * 1000
:o += (((a/4096 % 2) * (b/4096 % 2)) * 4096) / 1000 * 1000
:o += (((a/8192 % 2) * (b/8192 % 2)) * 8192) / 1000 * 1000
:o += (((a/16384 % 2) * (b/16384 % 2)) * 16384) / 1000 * 1000
:o += (((a/32768 % 2) * (b/32768 % 2)) * 32768) / 1000 * 1000
:done=1