line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::Business::BlackScholes::Binaries::Greeks::Math; |
2
|
1
|
|
|
1
|
|
3
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BOM::Utility::Math::Routines |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 DESCRIPTION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Misc math routines. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
3
|
use base qw( Exporter ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
94
|
|
17
|
|
|
|
|
|
|
our @EXPORT_OK = qw( ddgauss dgauss ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head2 dgauss |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
normal density |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
4
|
use constant PI => 4 * atan2(1, 1); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
119
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub dgauss { |
28
|
459
|
|
|
459
|
1
|
369
|
my $x = shift; |
29
|
|
|
|
|
|
|
|
30
|
459
|
|
|
|
|
1252
|
return exp(-1 * $x * $x / 2) / (2 * PI)**0.5; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 ddgauss |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
dnormal density |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub ddgauss { |
40
|
32
|
|
|
32
|
1
|
34
|
my $x = shift; |
41
|
|
|
|
|
|
|
|
42
|
32
|
|
|
|
|
52
|
return -1 * $x * dgauss($x); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |