blib/lib/Math/Business/Lookback/Common.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 10 | 10 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 3 | 3 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 14 | 14 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | |||||||
2 | use strict; | ||||||
3 | 3 | 3 | 19 | use warnings; | |||
3 | 8 | ||||||
3 | 87 | ||||||
4 | 3 | 3 | 16 | ||||
3 | 6 | ||||||
3 | 282 | ||||||
5 | our $VERSION = '0.01'; ## VERSION | ||||||
6 | |||||||
7 | =head2 dnorm | ||||||
8 | |||||||
9 | Standard normal density function | ||||||
10 | |||||||
11 | =cut | ||||||
12 | |||||||
13 | my $x = shift; | ||||||
14 | my $pi = 3.14159265359; | ||||||
15 | 8 | 8 | 1 | 16 | |||
16 | 8 | 12 | my $value = exp(-$x**2 / 2) / sqrt(2.0 * $pi); | ||||
17 | |||||||
18 | 8 | 24 | return $value; | ||||
19 | } | ||||||
20 | 8 | 33 | |||||
21 | 1; |