blib/lib/Math/Business/BlackScholes/Binaries/Greeks/Math.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 26 CC 1 SCAR 6.9
CC
1
Cov
0%
dgauss
2.0
ddgauss
2.0
BEGIN
2.0
CRAP 2.0
1 package Math::Business::BlackScholes::Binaries::Greeks::Math;
2 use strict;
3 use warnings;
4  
5 our $VERSION = '0.05'; ## 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 use base qw( Exporter );
18 our @EXPORT_OK = qw( ddgauss dgauss );
19  
20 =head2 dgauss
21  
22 normal density
23  
24 =cut
25  
26 use constant PI => 4 * atan2(1, 1);
27  
28 sub dgauss {
29 my $x = shift;
30  
31 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 my $x = shift;
42  
43 return -1 * $x * dgauss($x);
44 }
45  
46 1;