Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!caen!sol.ctr.columbia.edu!hamblin.math.byu.edu!news From: smithw@hamblin.math.byu.edu (Dr. William V. Smith) Newsgroups: comp.sys.next Subject: Re: NeXT Mathematica Bug(really 68040 BUG) Message-ID: Date: 5 Mar 91 18:32:26 GMT References: <1991Mar3.053006.2986@math.ucla.edu> <1991Mar4.035543.19802@wam.umd.edu> <13048@helios.TAMU.EDU> Sender: news@hamblin.math.byu.edu (Usenet News) Organization: Brigham Young University Lines: 51 In-Reply-To: smithw@hamblin.math.byu.edu's message of 5 Mar 91 10:28:21 mcguire@cs.tamu.edu (Tim McGuire): writes: >The problem is apparently not with the 68040. Some helpful person on the >Mathematica mailing list (whose name slips me) reports the problem >occurs when the #include directive is omitted, but disappears The test was done on an '030 cube (2.0 software, 1.2 mma). It is true that when math.h is not included there appears to be a problem on '030 and the "problem" goes away when you insert #include . However, when math.h is included *on the '040 NeXT* there is still a real discontinuity in tanh(). Since tanh() is trapped and computed in software, this is a software fix (hope, hope, hope). There is a code error which gives the correct asymptotic value of tanh(x) as x-> minus infinity, but switches formulas for computing tanh at about x=-1.8. Witness: (this file "test2.c") #include main() { printf("%g %g\n", tanh(-1.73287), tanh(-1.73288)); } yields the result (this is on *the '040 cube*) ^^^^^^^^^^^^^ Venus%% cc test2.c -o mathtest Venus%% mathtest -0.939394 -1.060605 -1.060605 is NOT the correct value for tanh(-1.73288) which is in fact this is the result of the same program on an '030 cube: ^^^^^^^^ zuni$ cc test2.c -o mathtest zuni$ mathtest -0.939394 -0.939395 -0.939395 *is* (approximately of course) the correct value of tanh(-1.73288). This is an '040 specific problem, and has nothing to do with mathematica except that mathematica does use machine coded functions to do numerical work with elementary functions. (If the #include is left out, then both platforms yield errors since this function is called as a double, and the compiler doesn't know what to do with it without math.h) So, NeXT, please include the fix in 2.1 ok??? -Bill -- EMail: smithw@hamblin.math.byu.edu or uunet!hamblin.math.byu.edu!smithw SMail: Math Dept. -- 314 TMCB; BYU; Provo, UT 84602 (USA) NeXTmail: smithw@mathnx.math.byu.edu Phone: +1 801 378 2061 FAX: +1 801 378 2800