Changeset 71
- Timestamp:
- 03/27/06 06:28:04 (3 years ago)
- Files:
-
- trunk/docs/mathextra (added)
- trunk/makeall.bat (modified) (1 diff)
- trunk/mathextra/bessel.d (moved) (moved from trunk/bessel.d) (1 diff)
- trunk/mathextra/betadist.d (moved) (moved from trunk/betadist.d) (2 diffs)
- trunk/mathextra/bitmanip.d (moved) (moved from trunk/bitmanip.d) (1 diff)
- trunk/mathextra/complex.d (moved) (moved from trunk/complex.d) (1 diff)
- trunk/mathextra/elliptic.d (moved) (moved from trunk/elliptic.d) (1 diff)
- trunk/mathextra/etcgamma.d (moved) (moved from trunk/etcgamma.d) (2 diffs)
- trunk/mathextra/findroot.d (moved) (moved from trunk/findroot.d) (1 diff)
- trunk/mathextra/gammadist.d (moved) (moved from trunk/gammadist.d) (2 diffs)
- trunk/mathextra/leastsqr.d (moved) (moved from trunk/leastsqr.d) (1 diff)
- trunk/mathextra/mathdiscrete.d (moved) (moved from trunk/mathdiscrete.d)
- trunk/mathextra/mathspecial.d (moved) (moved from trunk/mathspecial.d) (1 diff)
- trunk/mathextra/mathstat.d (moved) (moved from trunk/mathstat.d) (10 diffs)
- trunk/mathextra/mathtempl.d (moved) (moved from trunk/mathtempl.d) (1 diff)
- trunk/mathextra/mathutil.d (moved) (moved from trunk/mathutil.d) (1 diff)
- trunk/mathextra/minimize.d (moved) (moved from trunk/minimize.d) (1 diff)
- trunk/mathextra/normaldist.d (moved) (moved from trunk/normaldist.d) (1 diff)
- trunk/mathextra/realtest.d (moved) (moved from trunk/realtest.d) (1 diff)
- trunk/mathextra/student.d (moved) (moved from trunk/student.d) (1 diff)
- trunk/mathextra/testconsistency.d (moved) (moved from trunk/testconsistency.d) (2 diffs)
- trunk/test.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/makeall.bat
r69 r71 1 dmd -Dddocs -unittest -cov -debug test.d mathstat.d mathspecial.d realtest.d complex.d student.d gammadist.d betadist.d etcgamma.d normaldist.d bitmanip.d mathtempl.d bessel.d elliptic.d findroot.d minimize.d mathutil.d leastsqr.d testconsistency.d 2 del *.obj 1 build -Dddocs -unittest -cov -debug test trunk/mathextra/bessel.d
r61 r71 4 4 // Copyright 1994 by Stephen L. Moshier (moshier@world.std.com). 5 5 6 module bessel;6 module mathextra.bessel; 7 7 8 8 debug private import std.stdio; trunk/mathextra/betadist.d
r56 r71 41 41 * NAN = $(RED NAN) 42 42 */ 43 private import normaldist; 43 module mathextra.betadist; 44 45 private import std.math; 46 private import mathextra.normaldist; 44 47 debug import std.stdio; 45 48 … … 56 59 57 60 // There are still problems with std.math.tgamma. 58 private import etcgamma;59 alias etcgamma.tgamma gamma;60 alias etcgamma.lgamma loggamma;61 private import mathextra.etcgamma; 62 alias mathextra.etcgamma.tgamma gamma; 63 alias mathextra.etcgamma.lgamma loggamma; 61 64 62 65 /* trunk/mathextra/bitmanip.d
r53 r71 3 3 */ 4 4 // Author: Don Clugston. License: Public Domain. 5 module bitmanip;5 module mathextra.bitmanip; 6 6 7 7 import std.intrinsic; trunk/mathextra/complex.d
r64 r71 27 27 * faster than the complex equivalent. 28 28 */ 29 modulecomplex;29 module mathextra.complex; 30 30 private import std.math; 31 private import realtest;31 private import mathextra.realtest; 32 32 debug private import std.stdio; 33 33 trunk/mathextra/elliptic.d
r60 r71 29 29 * $(LINK http://www.netlib.org/cephes/ldoubdoc.html) 30 30 */ 31 module elliptic;31 module mathextra.elliptic; 32 32 33 33 import std.math; trunk/mathextra/etcgamma.d
r51 r71 14 14 * NAN = $(RED NAN) 15 15 */ 16 module etcgamma;16 module mathextra.etcgamma; 17 17 18 18 private import std.math; 19 importrealtest;19 private import mathextra.realtest; 20 20 debug import std.stdio; 21 21 … … 318 318 const real SQRT_PI = 1.77245385090551602729816748334114518279754945612238L; 319 319 320 assert(feqrel( etcgamma.tgamma(0.5L), SQRT_PI) == real.mant_dig);321 322 assert(feqrel( etcgamma.tgamma(1.0/3.L), 2.67893853470774763365569294097467764412868937795730L)>= real.mant_dig-2);323 assert(feqrel( etcgamma.tgamma(0.25L),320 assert(feqrel(tgamma(0.5L), SQRT_PI) == real.mant_dig); 321 322 assert(feqrel(tgamma(1.0/3.L), 2.67893853470774763365569294097467764412868937795730L)>= real.mant_dig-2); 323 assert(feqrel(tgamma(0.25L), 324 324 3.62560990822190831193068515586767200299516768288006)>= real.mant_dig-1); 325 assert(feqrel( etcgamma.tgamma(1.0/5.0L),325 assert(feqrel(tgamma(1.0/5.0L), 326 326 4.59084371199880305320475827592915200343410999829340L)>= real.mant_dig-1); 327 327 } trunk/mathextra/findroot.d
r64 r71 1 1 /** Algorithms for finding roots of functions. 2 2 */ 3 module findroot;3 module mathextra.findroot; 4 4 5 5 import std.math; trunk/mathextra/gammadist.d
r51 r71 1 1 // incomplete gamma functions 2 2 3 module gammadist;3 module mathextra.gammadist; 4 4 private import std.math; 5 private import normaldist;5 private import mathextra.normaldist; 6 6 debug import std.stdio; 7 7 … … 11 11 12 12 // There are still problems with std.math.tgamma. 13 private import etcgamma;14 alias etcgamma.tgamma gamma;15 alias etcgamma.lgamma loggamma;13 private import mathextra.etcgamma; 14 alias mathextra.etcgamma.tgamma gamma; 15 alias mathextra.etcgamma.lgamma loggamma; 16 16 17 17 trunk/mathextra/leastsqr.d
r66 r71 1 1 // Cholesky decomposition 2 2 module mathextra.leastsqr; 3 3 import std.math; 4 4 trunk/mathextra/mathspecial.d
r51 r71 20 20 */ 21 21 22 module math special;22 module mathextra.mathspecial; 23 23 24 24 private import std.math; trunk/mathextra/mathstat.d
r52 r71 50 50 * Copyright 1985, 1995 by Stephen L. Moshier 51 51 */ 52 module math stat;52 module mathextra.mathstat; 53 53 54 54 private import std.math; 55 55 // normalDistribution, normalDistributionInv() 56 private import normaldist;56 private import mathextra.normaldist; 57 57 // formerly betaIncomplete, betaIncompleteInv() 58 58 // betaDistribution, betaDistributionInv(). 59 private import betadist;59 private import mathextra.betadist; 60 60 // studentsDistribution(), studentsDistributionInv() 61 private import student;62 private import gammadist;61 private import mathextra.student; 62 private import mathextra.gammadist; 63 63 debug import std.stdio; 64 64 … … 291 291 real normalDistribution(real x) 292 292 { 293 return normaldist.normalDistribution(x);293 return mathextra.normaldist.normalDistribution(x); 294 294 } 295 295 … … 309 309 real normalDistributionInv(real y) 310 310 { 311 return normaldist.normalDistribution(y);311 return mathextra.normaldist.normalDistribution(y); 312 312 } 313 313 … … 390 390 real gammaIncomplete(real a, real x ) 391 391 { 392 return gammadist.gammaIncomplete(a, x);392 return mathextra.gammadist.gammaIncomplete(a, x); 393 393 } 394 394 … … 396 396 real gammaIncompleteCompl(real a, real x ) 397 397 { 398 return gammadist.gammaIncompleteCompl(a, x);398 return mathextra.gammadist.gammaIncompleteCompl(a, x); 399 399 } 400 400 … … 414 414 real gammaIncompleteComplInv(real a, real y0 ) 415 415 { 416 return gammadist.gammaIncompleteComplInv(a, y0);416 return mathextra.gammadist.gammaIncompleteComplInv(a, y0); 417 417 } 418 418 … … 625 625 real studentsDistribution(int nu, real t) 626 626 { 627 return student.studentsDistribution(nu, t);627 return mathextra.student.studentsDistribution(nu, t); 628 628 } 629 629 … … 644 644 real studentsDistributionInv(int nu, real p ) 645 645 { 646 return student.studentsDistributionInv(nu, p);646 return mathextra.student.studentsDistributionInv(nu, p); 647 647 } 648 648 … … 670 670 real betaDistribution(real a, real b, real x ) 671 671 { 672 return betadist.betaDistribution(a, b, x );672 return mathextra.betadist.betaDistribution(a, b, x ); 673 673 } 674 674 … … 676 676 real betaDistributionInv(real a, real b, real y) 677 677 { 678 return betadist.betaDistributionInv(a, b, y);679 } 678 return mathextra.betadist.betaDistributionInv(a, b, y); 679 } trunk/mathextra/mathtempl.d
r55 r71 26 26 */ 27 27 28 module math templ;28 module mathextra.mathtempl; 29 29 debug import std.stdio; 30 30 trunk/mathextra/mathutil.d
r64 r71 3 3 * 4 4 */ 5 module mathextra.mathutil; 5 6 6 7 import std.stdio; trunk/mathextra/minimize.d
r68 r71 1 1 module mathextra.minimize; 2 2 private import std.math; 3 3 debug private import std.stdio; trunk/mathextra/normaldist.d
r51 r71 9 9 * SUP = <span style="vertical-align:super;font-size:smaller">$0</span> 10 10 */ 11 module normaldist;11 module mathextra.normaldist; 12 12 private import std.math; 13 13 debug import std.stdio; trunk/mathextra/realtest.d
r51 r71 3 3 * Not intended for inclusion in a standard library. 4 4 */ 5 module realtest;5 module mathextra.realtest; 6 6 import std.stdio; 7 7 import std.math; trunk/mathextra/student.d
r51 r71 5 5 * POWER = $1<sup>$2</sup> 6 6 */ 7 module student;7 module mathextra.student; 8 8 private import std.math; 9 private import betadist;10 private import normaldist;9 private import mathextra.betadist; 10 private import mathextra.normaldist; 11 11 debug private import std.stdio; 12 12 trunk/mathextra/testconsistency.d
r51 r71 4 4 80-bit reals. 5 5 */ 6 module mathextra.testconsistency; 6 7 7 8 import std.stdio; 8 import realtest;9 import mathextra.realtest; 9 10 10 import math stat;11 import math special;11 import mathextra.mathstat; 12 import mathextra.mathspecial; 12 13 13 14 … … 18 19 real loggamma(real x) { return std.math.lgamma(x); } 19 20 20 import etcgamma;21 alias etcgamma.tgamma gamma;21 import mathextra.etcgamma; 22 alias mathextra.etcgamma.tgamma gamma; 22 23 //alias etcgamma.lgamma loggamma; 23 24 24 25 25 import complex;26 import mathextra.complex; 26 27 // do this just so it will compile. 27 28 real cosh(real x) { return std.math.cosh(x); } trunk/test.d
r69 r71 1 1 // Include everything for unit tests. 2 module mathextra;2 module test; 3 3 4 import mathstat; 5 import mathspecial; 6 import complex; 4 import mathextra.mathstat; 5 import mathextra.mathspecial; 6 import mathextra.complex; 7 import mathextra.student; 8 import mathextra.gammadist; 9 import mathextra.betadist; 10 import mathextra.etcgamma; 11 import mathextra.normaldist; 12 import mathextra.bitmanip; 13 import mathextra.mathtempl; 14 import mathextra.bessel; 15 import mathextra.elliptic; 16 import mathextra.findroot; 17 import mathextra.minimize; 18 import mathextra.mathutil; 19 import mathextra.leastsqr; 20 7 21 import std.stdio; 8 import testconsistency; 22 import mathextra.testconsistency; 23 import mathextra.realtest; 24 9 25 10 26 int main()
