php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59292 Error in stats package (stats_cdf_t function)
Submitted: 2010-07-03 13:57 UTC Modified: 2016-05-28 05:22 UTC
Votes:8
Avg. Score:4.0 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (14.3%)
From: mr dot schyte at gmail dot com Assigned: uchiyama (profile)
Status: Closed Package: stats (PECL)
PHP Version: 5.3.2 OS: Linux 2.6.34
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mr dot schyte at gmail dot com
New email:
PHP Version: OS:

 

 [2010-07-03 13:57 UTC] mr dot schyte at gmail dot com
Description:
------------
The stats_cdf_t function doesn't work with values of 2 and 3 for the $which parameter. This is a problem in the supplied version of dcdflib. Replacing it with a newer version solves the problem.

Reproduce code:
---------------
<?php
    echo stats_cdf_t(3.0, 5.0, 1); // this one works
    echo stats_cdf_t(0.984950, 5.0, 2); // fails on this
    echo stats_cdf_t(0.984950, 3.0, 3); // and this
?>

Expected result:
----------------
0.984950376051272.99997825390794.9999004981548

Actual result:
--------------
0.98495037605127 SMALL, X, BIG not monotone in INVR


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-17 01:42 UTC] wendellp at operamail dot com
This has not been fixed in v1.0.3.
 [2014-03-02 09:15 UTC] phoenix dot mstu at gmail dot com
i've fixed it using other version of dcdflib.c from here: 

http://cpansearch.perl.org/src/CALLAHAN/Math-CDF-0.1/cdflib/dcdflib.c

the problem is becouse of this C file is very old - 1997 year i guess. and all variables in its' function must have prefix static. 

example: 
static double c2 = .793650666825390e-03;
except of:
double c2 = .793650666825390e-03;

the code is really ugly, and im surprised its still alive...
 [2014-05-15 11:59 UTC] y dot uchiyama dot 1015 at gmail dot com
I also solved this problem by replacing DCDFLIB, RANDLIB, and FDLIBM with versions distributed at Netlib.  Bugs #57830, #57831, and #58394 were also solved.

I uploaded my instruction to solve the problem as a shell script.
https://github.com/y-uti/update-pecl-stats
 [2016-05-28 00:25 UTC] uchiyama@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: uchiyama
 [2016-05-28 05:22 UTC] uchiyama@php.net
-Status: Assigned +Status: Closed
 [2016-05-28 05:22 UTC] uchiyama@php.net
Fixed in version 1.0.4/2.0.2
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Dec 01 21:01:23 2020 UTC