Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!ucbvax!pasteur!aldebaran!carlton From: carlton@aldebaran (Mike Carlton) Newsgroups: comp.sys.next Subject: Re: Bug in the 68040 chip Message-ID: <11654@pasteur.Berkeley.EDU> Date: 4 Mar 91 19:12:12 GMT References: <1991Mar4.042515.4740@math.ucla.edu> Sender: news@pasteur.Berkeley.EDU Reply-To: carlton@aldebaran (Mike Carlton) Organization: University of California at Berkeley Lines: 47 In article <1991Mar4.042515.4740@math.ucla.edu> barry@pico.math.ucla.edu (Barry Merriman) writes: >Don't be alarmed---but there appears to be a bug in the 68040 >chip. It does not compute the hyperbolic tangent function >correctly. > >To see this for yourself, run the following bit of C code >(donated by Steve Wolfram) on a 68040 Next: > >printf("%g %g\n", tanh(-1.73287), tanh(-1.73288)); > >and you will see a clear discontinuity in the values. > >At best this would indicate the C math library for the 68040 >has a bad tanh(x). But I think (not sure though) that the >68040 itself computes the tanh(x)---in which case the bug >is at a deeper level. ... >Barry Merriman >UCLA Dept. of Math >UCLA Inst. for Fusion and Plasma Research >barry@math.ucla.edu (Internet) I believe that tanh is handled in software, not hardware, so at least it is possible to fix this. The following came across comp.sys.next a while ago: --The 040 floating point hardware instructions are -- FADD, FSUB, FMUL, FDIV, FSQRT, FMOVE (most addressing modes), -- FABS, FNEG, FMOVEM, FCMP, FSAVE, FScc, FDBcc, FBcc, FRESTORE -- --The 040 floating point software instructions are -- FACOS, FASIN, FATAN, FATANH, FCOS, FCOSH, FETOX, FETOXL, FGETEXP, -- FGETMAN, FINT, FINTRZ, FLOG10, FLOG2, FLOGN, FLOGNP1, FMOD, FMOVECR, -- FREM, FSCALE, FSIN, FSINCOS, FSINH, FTAN, FTANH, FTENTOX, FTWOTOX -- --Hope this helps. -- -- --morris -- --Morris Meyer NeXT, Inc. --Software Engineer 900 Chesapeake Drive --NeXT OS Group Redwood City, CA 94063 --mmeyer@next.com Cheers, --mike Mike Carlton carlton@cs.berkeley.edu