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