Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!usenetcore.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.eclipse.net.uk!news.eclipse.net.uk.POSTED!not-for-mail NNTP-Posting-Date: Fri, 09 May 2014 18:00:45 -0500 From: David Hume Newsgroups: comp.misc Subject: Re: Calculator Accuracy References: <83k39w1tnl.fsf@example.com> X-No-Archive: Yes Date: Sat, 10 May 2014 00:00:44 +0100 Message-ID: <7zy4yapnfn.fsf@example.com> Organization: Linux Private Site User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:ENHU0DgmF8DuqtCWWONuiKMwaJk= MIME-Version: 1.0 Content-Type: text/plain Lines: 41 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 81.168.48.70 X-Trace: sv3-TBRv1Eo6hdt+LE5vxvABvVyOlPwRwrZeJ6VOLDRka1rzrSyNH/eMKP92/xjzgriij/zqYZ3DvWDBwTu!tbcXH5XDAERMNPQkjGQSyrg7BcRyXS1N2Mfn8humfl8+lp5c2uiGrTXR6c2crY9bmpE= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2149 Xref: csiph.com comp.misc:2731 Eric Pozharski writes: > with Hils wrote: > > *SKIP* >> R version 3.1.0: >> >> asin(acos(atan(tan(cos(sin(45*pi/180))))))*180/pi-45 >> [1] -7.105427e-15 >> >> Gnuplot 4.6: >> >> print asin(acos(atan(tan(cos(sin(45*pi/180))))))*180/pi-45 >> -7.105427357601e-15 >> >> I'm guessing a common library at work here... > > libc, maybe: > > % perl -MMath::Trig -wle ' > print rad2deg( asin acos atan tan cos sin deg2rad 45 ) - 45' > 7.105427357601e-15 > > Math::BigFloat looks promising (if I would mind to compete with windopws > calculator), however resourceful. But it's a way too much hassle for > now -- it doesn't have btan() and bacos() methods, so those must be > constructed in place. gforth: : PIE 3.1415926535897932385E0 ; : DEG2RAD PI F* 180E0 F/ ; : RAD2DEG 180E0 F* PI F/ ; : TEST 45E0 DEG2RAD FSIN FCOS FTAN FATAN FACOS FASIN RAD2DEG 45E0 F- F. ; TEST -0.000000000000007105427357601