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

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 27 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Math/Business/BlackScholes/Binaries/Greeks.pm ↑ Summary
1 package Math::Business::BlackScholes::Binaries::Greeks::Math;
2 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 8 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 8 ▶use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
18 8 our @EXPORT_OK = qw( ddgauss dgauss );
19  
20 =head2 dgauss
21  
22 normal density
23  
24 =cut
25  
26 8 ▶use constant PI => 4 * atan2(1, 1);
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 459 ▶sub dgauss {
Subroutine dgauss: called CC=1 SCAR=0.0
Pod documented
29 459 my $x = shift;
30  
31 459 return exp(-1 * $x * $x / 2) / (2 * PI)**0.5;
32 }
33  
34 =head2 ddgauss
35  
36 dnormal density
37  
38 =cut
39  
40 32 ▶sub ddgauss {
Subroutine ddgauss: called CC=1 SCAR=0.0
Pod documented
41 32 my $x = shift;
42  
43 32 return -1 * $x * dgauss($x);
44 }
45  
46 8 1;
« blib/lib/Math/Business/BlackScholes/Binaries/Greeks.pm ↑ Summary