octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in


From: Rik
Subject: [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file
Date: Thu, 16 Mar 2017 16:19:19 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #6, bug #50561 (project octave):

I had already tried one optimization which was to declare min_double outside
the loop.


double min_double = std::numeric_limits<double>::min ();


This didn't seem to make any difference.  Maybe because the value there is
declared as a const and can be resolved at compile time.

I also tried substituting a function call


  epsval(i) = pow (2.0, -1074e0);


with a constant


  epsval(i) = 4.940656458412465e-324;


This made no difference either.  For test input I used


x = zeros (1e7, 1);


so the only path that was executed was the assignment above.  I was surprised
by that one, but that's why you have to benchmark because human intuition can
be faulty.








    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50561>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]