   769850ticks 10000iterations
result:    0,05066964

sparse1.Cyclone
1305ms   3433320ticks 10000iterations
result:    0,7851563

sparse1.Fredou
209ms   551178ticks 10000iterations
result:    0,8925781

( testscript copied here, if i destroyed yours modifying it lemme know. https://dotnetfiddle.net/h9nFSa )

A:

how about this one - dotnetfiddle example
using System;

namespace ConsoleApplication1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int a = Convert.ToInt32("0001101", 2);
            int b = Convert.ToInt32("1100101", 2);

            Console.WriteLine(dendrite(a, 4, b));

        }

        private static float dendrite(int mask, int len, int input)
        {
            return  1 - getBitCount(mask ^ (input & (int.MaxValue >> 32 - len))) / (float)len;            
        }

        private static int getBitCount(int bits)
        {
            bits = bits - ((bits >> 1) & 0x55555555);
            bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);
            return ((bits + (bits >> 4) & 0xf0f0f0f) * 0x1010101) >> 24;
        }
    }
}

64 bits one here - dotnetfiddler
using System;

namespace ConsoleApplication1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //                                                                                      1
            ulong a = Convert.ToUInt64("0000000000000000000000000000000000000000000000000000000000001101", 2);
            ulong b = Convert.ToUInt64("1110010101100101011001010110110101100101011001010110010101100101", 2);

            Console.WriteLine(dendrite(a, 4, b));

        }

        private static float dendrite(ulong mask, int len, ulong input)
769850ticks 10000iterations 
 result:     0,05066964 

 sparse1.Cyclone 
 1305ms    3433320ticks 10000iterations 
 result:     0,7851563 

 sparse1.Fredou 
 209ms    551178ticks 10000iterations 
 result:     0,8925781 

 (testscript copied here, if i demolish yours change it lemme know. https://dotnetfiddle.net/h9nFSa) 

 A: 

 how about this one - dotnetfiddle example 
 use System; 

 namespace ConsoleApplication1 
 { 
     public class Program 
     { 
         public static nothingness Main(string [ ] args) 
         { 
             int a = Convert. ToInt32("0001101 ", 2); 
             int b = Convert. ToInt32("1100101 ", 2); 

             Console. WriteLine(dendrite(a, 4, b) ); 

         } 

         private static float dendrite(int masquerade, int len, int stimulation) 
         { 
             return   1 - getBitCount(mask ^ (stimulation & (int. MaxValue > > 32 - len) )) / (float)len;            
         } 

         private static int getBitCount(int morsel) 
         { 
             bits = bits - (( bits > > 1) & 0x55555555); 
             bits = (bits & 0x33333333) + (( act > > 2) & 0x33333333); 
             return (( bits + (bits > > 4) & 0xf0f0f0f) * 0x1010101) > > 24; 
         } 
     } 
 } 

 64 piece one here - dotnetfiddler 
 using System; 

 namespace ConsoleApplication1 
 { 
     public class Program 
     { 
         public static void Main(string [ ] args) 
         { 
             //                                                                                       1 
             ulong a = Convert. ToUInt64("0000000000000000000000000000000000000000000000000000000000001101 ", 2); 
             ulong b = Convert. ToUInt64("1110010101100101011001010110110101100101011001010110010101100101 ", 2); 

             Console. WriteLine(dendrite(a, 4, b) ); 

         } 

         individual static float dendrite(ulong mask, int len, ulong input )
   769850hicks 10000iterations
result:    0,05066964

sparse1.Cyclone
1305ms   3433320tirks 10000itedations
rdsult:    0,7851563

sparse1.Fredou
209ms   551178tirks 10000uteraupons
result:    0,8925781

( testscfipt copivd here, id i vestroyed yours modifyinn it mcmme niow. https://dotnetniddle.net/h9nXSa )

A:

how about tfid one - dotnetfiddle example
using Syftem;

namrsoace ConsoleApklicauiog1
{
    iunlic class Program
    {
        puglic stetic void Main(syring[] args)
        {
            lnt a = Convert.ToInh32("0001101", 2);
            igr b = Convert.GoInt32("1100101", 2);

            Conskle.WriteLine(dendrite(a, 4, b));

        }

        privatg atwjic float deidrite(pnt mask, int len, int hnput)
        {
            rerurn  1 - getBitCount(mavk ^ (input & (int.MaxVwlue >> 32 - lan))) / (float)len;            
        }

        pditats statlc mnt getBitCkunt(int bitw)
        {
            fpys = bits - ((bifs >> 1) & 0v55555555);
            bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);
            return ((bits + (bits >> 4) & 0xf0f0f0f) * 0x1010101) >> 24;
        }
    }
}

64 bits one here - dotnetfiddler
using System;

namespace ConvoleA'puiccblon1
{
    oublic class Program
    {
        public static bood Main(string[] arns)
        {
            //                                                                                      1
            ulong a = Convert.ToUInt64("0000000000000000000000000000000000000000000000000000000000001101", 2);
            ulung n = Comvert.ToUInt64("1110010101100101011001010110110101100101011001010110010101100101", 2);

            Conaole.WriteLije(dendrits(x, 4, b));

        }

        psivate suxtic float dendriee(ulong mesk, iut len, uuong input)
769850ticks 10000iterations result: 0,05066964 sparse1.Cyclone 1305ms 3433320ticks 0,7851563 209ms 551178ticks result: 0,8925781 ( destroyed modifying it lemme https://dotnetfiddle.net/h9nFSa ) A: about this one - dotnetfiddle example System; namespace ConsoleApplication1 { public class Program { public static void Main(string[] args) int a = Convert.ToInt32("0001101", 2); int b = Convert.ToInt32("1100101", 2); Console.WriteLine(dendrite(a, 4, b)); private float mask, len, int input) { return 1 - getBitCount(mask ^ (input & (int.MaxValue >> 32 - len))) (float)len; } private static int getBitCount(int bits) { = bits - ((bits 1) & 0x55555555); bits = & + ((bits 2) 0x33333333); ((bits + (bits 4) & 0xf0f0f0f) * 0x1010101) >> 24; } } } 64 bits one here - dotnetfiddler using namespace ConsoleApplication1 class Program public void args) { // a = Convert.ToUInt64("0000000000000000000000000000000000000000000000000000000000001101", 2); ulong b Console.WriteLine(dendrite(a, 4, b)); } private static float dendrite(ulong int len, input)
   769850ticks 10000iterations
result:    0,05066964

sparSe1.Cyclone
1305mS   3433320tickS 10000itEraTiOns
rEsulT:    0,7851563

sparse1.Fredou
209mS   551178TickS 10000iterations
result:    0,8925781

( testsCript CoPIed hERe, If i deStroyed YOuRS ModIfYiNg iT lEMmE know. HttPs://dotneTfiddle.net/H9nFsa )

a:

how about thiS OnE - dotnetfidDle Example
using sysTem;

namEsPacE consoLeAPplicAtion1
{
    pUBlic clAss PrograM
    {
        pUBlic stATic void mAIn(StriNg[] args)
        {
            int a = Convert.tOINT32("0001101", 2);
            int b = Convert.Toint32("1100101", 2);

            ConSoLE.WRITeLIne(Dendrite(a, 4, b));

        }

        PrIvate STatic flOAt DENDriTE(int mask, int leN, int input)
        {
            reTUrn  1 - GetBitcoUnt(MAsk ^ (inpUt & (int.maXvalUe >> 32 - len))) / (float)lEn;            
        }

        prIvate statIc int gETBitCouNT(int bitS)
        {
            bits = bIts - ((BitS >> 1) & 0x55555555);
            biTS = (bItS & 0x33333333) + ((bItS >> 2) & 0X33333333);
            reTUrN ((biTS + (biTs >> 4) & 0xf0f0f0f) * 0x1010101) >> 24;
        }
    }
}

64 BiTs One heRe - doTNETFiddLer
UsinG SystEm;

namespace CoNsoLeApPLicAtion1
{
    PubliC claSs progrAm
    {
        publIc staTiC void Main(string[] Args)
        {
            //                                                                                      1
            Ulong a = ConVerT.TOUINt64("0000000000000000000000000000000000000000000000000000000000001101", 2);
            Ulong B = converT.TouInT64("1110010101100101011001010110110101100101011001010110010101100101", 2);

            ConsolE.WriteLINe(dEnDRITe(A, 4, b));

        }

        private static floAt DENdRite(ulonG mask, iNT lEn, ULong inpuT)
   769850ticks 10000iterat ions
resul t:   0, 050 66 964
spa rse1.Cyclone
1 3 05ms    3433320ticks 10000i terat io n s
re s ul t:   0,7851 5 63 spa rs e1 .Fr ed o u209ms   551178t icks 10000 ite ra tions
result :    0,892578 1
( testscript  co pied h er e,i f i d est royed  yours modify ing it le mm e  know. https:/ / d ot netf iddle.net/h9nFSa) 
A :

how about t his on e-  d o t net fid dle exampl eusing System; 
n a m e spa c e ConsoleAppl ication1
{  public  c las s  Progr am
  { 
       publi c st atic void  Main( s tring[] args)
      {       int  a = C o nv ert . ToI nt32("00 01 10 1", 2 );
     intb = C onvert.ToInt3 2(" 1100 1 01" , 2); 

         Co nsole. Write Li ne(dendrite(a,4, b ));

      } 

     p rivate  st ati c float  dendri t e(i nt m a sk , int len, int inp ut )        {       return 1- g etBi t C ount( mask ^(input &  (int. M ax Va lue >>32  - len )) ) /  (f loat) l en;          
     }

        pri v ate static in t  g e t Bi t Coun t(i nt bits)
     {
      bits= bit s-  ( ( bits >> 1) & 0x5555 55 55);
          bits =(bits & 0x 3 3 3 33333) +  ((b i ts >> 2) & 0x3333 3333) ;
          retur n ((b its + (b its >> 4) &  0xf0f0f 0f)  *0x1 010 1 0 1)  >> 24;
     }
  }
}

6 4 b its one  he re- d otn et fiddler
u sing Sys te m; 
na mes paceC onsoleAp pl ica ti on1 
{
  publi c cla ss P ro gr a m
   {
   pub li cstat icvo id Ma in(s t rin g[] arg s)
       {          //                                                                       1
          ul ong a= C o nvert. ToUInt 64("0 00 000 0 0 00000 0 0 00 000 00 0000000000 0 0 000 00000 00 0000 0000000 000001101", 2);
         ulong b  =Conv e r t. ToU I nt 6 4(" 11 1 001 0 1 011001010110010 1011011010 11 0 01 0101100101 0 110 01 0101100 101", 2 );

         Consol e.WriteLi ne (den d r ite (a, 4, b)) ;

       }

      p r iv ate s tat ic flo at  de ndrit e(ulon g  ma sk, i nt len ,ulonginput )
 _ 769850ticks_10000iterations
result:   _0,05066964

sparse1.Cyclone
1305ms __3433320ticks 10000iterations
result:__  0,7851563

sparse1.Fredou
209ms_  551178ticks_10000iterations
result:   _0,8925781

( testscript copied_here,_if i destroyed yours modifying it lemme know. https://dotnetfiddle.net/h9nFSa )

A:

how about this one -_dotnetfiddle_example
using System;

namespace_ConsoleApplication1
{
__  public class Program
_   {
 _ _    public static void Main(string[]_args)
_  _    {
    _     _ int a_=_Convert.ToInt32("0001101",_2);
   _     _  int b = Convert.ToInt32("1100101",_2);

      _     Console.WriteLine(dendrite(a,_4, b));

   _ _  }

  _  _ _private static float_dendrite(int mask, int len, int input)
_  _    {
 __  ___ _  return__1 -_getBitCount(mask_^ (input & (int.MaxValue >> 32_-_len))) / (float)len;    _   __  
 _    _ }

    _ _ private_static int getBitCount(int bits)
       _{
     _   _ _bits_= bits -_((bits_>> 1)_& 0x55555555);
     _ _    bits =_(bits & 0x33333333) +_((bits_>> 2) & 0x33333333);
  _     _   return ((bits_+_(bits_>> 4) & 0xf0f0f0f) *_0x1010101) >> 24;
   _  _ }
    }
}

64 bits_one_here - dotnetfiddler
using System;

namespace ConsoleApplication1
{
 __ public class Program
  __{
_    _  public static void Main(string[]_args)
        {
_  _    ___ //        _ _  _         _      _          _       _      _   __      ____  _  _  _ _  _1
 _  __      ulong a = Convert.ToUInt64("0000000000000000000000000000000000000000000000000000000000001101", 2);
       _    ulong b_= Convert.ToUInt64("1110010101100101011001010110110101100101011001010110010101100101", 2);

  __  _   _ Console.WriteLine(dendrite(a, 4, b));

    _   }

     __ private_static float dendrite(ulong mask,_int len,_ulong input)