Bug 17178 - Problem in "qbeta" Results
Summary: Problem in "qbeta" Results
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Accuracy (show other bugs)
Version: R 3.3.0
Hardware: Other Other
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2016-11-08 20:46 UTC by Mark Powell
Modified: 2017-01-28 17:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Powell 2016-11-08 20:46:56 UTC
I have observed what seems to be anomalous behavior with the function "qbeta".
 
Here are the commands and results I used to demonstrate the behavior.
 
> qbeta(1-1e-9,1.5,8485.5)
[1] 0.002638664
> qbeta(1-1e-10,1.5,8485.5)
[1] 1.112537e-308
> qbeta(1-9.99999999999999999e-10,1.5,8485.5)
[1] 0.002638664
> qbeta(1-1e-10,1.5,8486.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,8484.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,1000.5)
[1] 0.0244487
> qbeta(1-1e-10,1.5,5000.5)
[1] 0.004941224
> qbeta(1-1e-10,1.5,8000.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,7000.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,6000.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,5000.5)
[1] 0.004941224
> qbeta(1-1e-10,1.5,5500.5)
[1] 0.004493094
> qbeta(1-1e-10,1.5,5800.5)
[1] 0.004261219
> qbeta(1-1e-10,1.5,5900.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,5850.5)
[1] 0.00422488
> qbeta(1-1e-10,1.5,5880.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,5870.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,5860.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,5855.5)
[1] 1.112537e-308
> qbeta(1-1e-10,1.5,5852.5)
[1] 0.004223439
> qbeta(1-1e-10,1.5,5853.5)
[1] 0.004222719
> qbeta(1-1e-10,1.5,5854.5)
[1] 1.112537e-308
> qbeta(1-1e-9,1.5,5854.5)
[1] 0.003822155
> 

I believe the result "1.112537e-308" is incorrect in all cases.

Windows 7 and 10, 64 bit i7 computers
Comment 1 Martin Maechler 2017-01-17 16:14:52 UTC
Thank you for the report, including the reproducible example.

You are right that this is bugous.. and I will work on this.
Comment 2 Martin Maechler 2017-01-28 17:46:51 UTC
This has now been fixed in R-devel svn r 72042 ..
I plan to port the fix to R-patched within few days.