Math.Asinh is wrong with negative arguments
-------------------------------------------

                 Key: JRUBY-1592
                 URL: http://jira.codehaus.org/browse/JRUBY-1592
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: Ubuntu Linux 7.10
ruby 1.8.5 (2007-11-20 rev 4842) [i386-jruby1.1b1]

            Reporter: Vladimir Sizikov


MRI:

Math.asinh -2 => -1.44363547517881
Math.asinh -3 => -1.81844645923207

Jruby:

Math.asinh -2 => 1.4436354751788103
Math.asinh -3 => 1.8184464592320668

Looking at the asinh graph, it seems that the function never should be positive 
on negative arguments.

Also, looking at the JRuby's tests 
(externals/ruby_test/test/core/Math/class/tc_asinh.rb), they don't catch this 
problem,
since they never test for values smaller than -1. Adding the test case for -2.0 
would've exposed the problem as well.

This issue triggers a Rubinius spec test failure:

Math.asinh returns the inverse hyperbolic sin of the argument FAILED
Expected 1.8089166921396953 to be close to -1.8089166921397:
/opt/work/rubinius/./spec/core/math/../../spec_helper.rb:138:in 
`should_be_close'
/opt/work/rubinius/./spec/core/math/asinh_spec.rb:11:in `should_be_close'
/opt/work/rubinius/./spec/core/math/asinh_spec.rb:9:in `it'
/opt/work/rubinius/spec/mini_rspec.rb:403:in `it'
/opt/work/rubinius/./spec/core/math/asinh_spec.rb:9:in `it'
/opt/work/rubinius/./spec/core/math/asinh_spec.rb:9:in `describe'
/opt/work/rubinius/spec/mini_rspec.rb:399:in `describe'
/opt/work/rubinius/./spec/core/math/asinh_spec.rb:4:in `describe'
/opt/work/rubinius/./spec/core/math/asinh_spec.rb:4:in `load'
last_mspec.rb:11:in `load'
last_mspec.rb:1:in `each'
last_mspec.rb:6:in `each'


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to