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 .
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With