Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An optimized implementation of the Heaviside function

Tags:

People also ask

How do you define a Heaviside function in Matlab?

H = heaviside( x ) evaluates the Heaviside step function (also known as the unit step function) at x . The Heaviside function is a discontinuous function that returns 0 for x < 0 , 1/2 for x = 0 , and 1 for x > 0 .

What is the Fourier transform of Heaviside function?

The Fourier transform of the Heaviside function: a tragedy. Let (1) H(t) = { 1, t > 0, 0, t < 0. This function is the unit step or Heaviside1 function.


I'm would like to (super)optimize an implementation of the Heaviside function.

I'm working on a numerical algorithm (in Fortran) where speed is particularly important. This employs the Heaviside function many times, currently implemented by the signum intrinsic function as follows:

heaviside = 0.5*sign(1,x)+1

I'm mainly interested in the case where x is a double precision real number on intel processors.

Is it possible to develop a more efficient implementation of the Heaviside function? Perhaps using assembly language, a superoptimizing code or call to an existing external library?