Path: csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Karl Ratzsch Newsgroups: comp.graphics.apps.gnuplot Subject: Re: latest change on fit.c Date: Thu, 5 May 2016 13:40:17 +0200 Organization: solani.org Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1462448410 30214 eJwFwYEBwCAIA7CXdNDCO1XW/08wQXDzVhJMGGZBNTJbN1ZPGFPfGFi/LlPaliNxsvqUHiuXEcI= (5 May 2016 11:40:10 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 5 May 2016 11:40:10 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 X-User-ID: eJwFwYEBwCAIA7CXJtiC51gY/59gAudixSa4MRhGHzUFyS9hMDusNdjsSgUsP8ct/dGR3Q8bbRE+ In-Reply-To: Cancel-Lock: sha1:Ld+/4zXfi+2EfQQ0lvo3MMJdv2U= X-NNTP-Posting-Host: eJwFwQERADEIAzBLY1C6yuHh8C/hE3haNiORgcXOd8yvAt4jTOxr0rYOOVJU7+jiqTCWVP4W0RDC Xref: csiph.com comp.graphics.apps.gnuplot:3323 Am 02.05.2016 um 05:36 schrieb Ethan A Merritt: > Karl Ratzsch wrote: > >> I'm intrigued what this change >> >> http://gnuplot.cvs.sourceforge.net/viewvc/gnuplot/gnuplot/src/fit.c?r1=1.163&r2=1.164 >> >> does to my fit. Is there a test case to show the difference? > > I do have a test case, but it's real data in the process of real analysis and > not really in a form I can share. The long and short of it is that for > whatever reason the fit goes bad during iterative refinement and triggers > an attempt to calculate the log of a negative number. The old code attempted > to trap such a case and print out diagnotic information by doing this: > > data[i] = real(&v); > if (undefined || isnan(real(&v))) { > ... print stuff ... > > The problem I ran into was that the call to real(&v) failed immediately > with error "unknown type in real()" so it never got as far as the > diagnostic printout. After the change the test for "undefined" is done > first, so the diagnostic printout is triggered before any attempt to > call real(&v). > > Anyhow, the only change is that now you get the intended diagnostic > printout rather than an "unknown type" error. Ah. I think i've never run into that one, don't remember ever fitting a function with a log in it. Thanks for the explanation! Karl