Skip to content

Commit

Permalink
retune log
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn committed Jul 10, 2021
1 parent eb13d4b commit 5023a68
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ __global__ void kernel_classifyTracks(HitContainer const *__restrict__ tuples,
// compute a pT-dependent chi2 cut

auto roughLog = [](float x) {
// max diff [0.5,12] at 1.25 0.16143
// average diff 0.0662998
union IF {
uint32_t i;
float f;
Expand All @@ -461,8 +463,9 @@ __global__ void kernel_classifyTracks(HitContainer const *__restrict__ tuples,
auto f = z.i & 3;
int ex = int(z.i >> 2) - 127;

// is this faster than 0.25f*float(f)?
const float frac[4] = {0.f, 0.25f, 0.5f, 0.75f};
// log2(1+0.25*f)
// averaged over bins
const float frac[4] = {0.160497f, 0.452172f, 0.694562f, 0.901964f};
return float(ex) + frac[f];
};

Expand Down

0 comments on commit 5023a68

Please sign in to comment.