[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/
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, Rik, 2017/03/16
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, Rik, 2017/03/16
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, John W. Eaton, 2017/03/16
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, Rik, 2017/03/16
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, Dan Sebald, 2017/03/16
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, Dan Sebald, 2017/03/16
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file,
Rik <=
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, Dan Sebald, 2017/03/16
- [Octave-bug-tracker] [bug #50561] 350X slower code for eps() written in C++ rather than an m-file, Rik, 2017/03/16