close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

Opened 10 years ago

Closed 10 years ago

#106 closed defect (fixed)

(exp 1d0) is rounded incorrectly

Reported by: Raymond Toy Owned by: somebody
Priority: major Milestone:
Component: Core Version: 2014-08
Keywords: Cc:

Description

Currently (exp 1d0) gives 2.7182818284590455d0. The correctly rounded value is 2.718281828459045d0. This can be seen here:

* (format nil "~B" (integer-decode-float (exp 1d0)))
"10101101111110000101010001011000101000101011101101010"
* (format nil "~B" (integer-decode-float (exp 1w0)))
"10101101111110000101010001011000101000101011101101001010100110101010111111011100010101100010000000100111010"

While fdlibm only guarantees exp to be accurate to < 1 ulp, it would be nice to have (exp 1d0) give the correctly rounded value.

Change History (1)

comment:1 Changed 10 years ago by toy.raymond@…

Resolution: fixed
Status: newclosed

commit 375ce218ab639fbc0b433942dbb7398a0bcd0177 Author: Raymond Toy <toy.raymond@…> Date: Thu Aug 14 21:06:20 2014 -0700

Fix ticket:106 by returning the correctly rounded value.

  • src/lisp/e_exp.c:
    • Add special case to return the correctly rounded value of exp(1).
  • tests/trac.lisp:
    • Add test that the correct value is returned.
    • Add test that exp(x) is still monotonic around x = 1.
  • src/general-info/release-20f.txt:
    • Update.
Note: See TracTickets for help on using tickets.