|
From: | Michele Ginesi |
Subject: | [Octave-bug-tracker] [bug #53509] log1p: difference result in Octave and MATLAB. |
Date: | Thu, 29 Mar 2018 10:42:40 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0 |
Follow-up Comment #1, bug #53509 (project octave): I think this shouldn't be reported as a bug: the function log1p is used to compute in a more stable way when x is small in module. In fact in Octave log1p(x) is computed as log (1+x) when x < - 0.5 or x > 1: >> log1p(2.1) == log(3.1) ans = 1 >> log1p(2) == log(3) ans = 0 Probably Matlab simply uses a different threshold to decide when use the definition log1p(x)==log(1+x) and when an alternative expansion: >> log1p(0.3) == log(1.3) ans = logical 1 >> log1p(0.2) == log(1.2) ans = logical 0 _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?53509> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |