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/Math.pm ↑ Summary
1 package Math::Business::BlackScholes::Binaries::Greeks::Math;
2 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 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 ▶use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 our @EXPORT_OK = qw( ddgauss dgauss );
18  
19 =head2 dgauss
20  
21 normal density
22  
23 =cut
24  
25 1 ▶use constant PI => 4 * atan2(1, 1);
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 sub dgauss {
28 459 ▶ my $x = shift;
Subroutine dgauss: called CC=1 SCAR=0.0
Pod documented
29  
30 459 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 ▶ my $x = shift;
Subroutine ddgauss: called CC=1 SCAR=0.0
Pod documented
41  
42 32 return -1 * $x * dgauss($x);
43 }
44  
45 1 1;
« blib/lib/Math/Business/BlackScholes/Binaries/Greeks/Math.pm ↑ Summary