ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/norm.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: rad3R7P2, rad3R7P1, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 {
2 Normal Distribution Functions
3
4 10/20/87
5
6 Z(u) - normal probability density function
7
8 Q(u) - Z(u) integrated from u to infinity
9
10 u(p) - u for known value p = Q(u)
11 }
12
13 NORMF : 1/sqrt(2*PI) ;
14
15 Z(u) = NORMF * exp(-u*u/2) ;
16
17 Q(u) = if( u, Q1(u), 1-Q1(-u) ) ;
18
19 Q1(u) = Z(u) * Q2(1/(1+.2316419*u)) ;
20
21 Q2(t) = t*(.31938153+t*(-.356563782+t*(1.781477937+
22 t*(-1.821255978+t*1.330274429)))) ;
23
24 u(p) = if( .5-p, u1(p), -u1(1-p) ) ;
25
26 u1(p) = u2(sqrt(log(1/p/p))) ;
27
28 u2(t) = t - (2.515517+t*(.802853+t*.010328))/
29 (1+t*(1.432788+t*(.189269+t*.001308))) ;