From 9d6ebef42b74943dd77617a2140c7bf6a3f85b79 Mon Sep 17 00:00:00 2001 From: Lakshmi Krishnamurthy Date: Sat, 20 Jan 2024 11:10:55 -0500 Subject: [PATCH] Features: Bug Fixes/Re-organization: - Special Function Bessel Second NIST Series Estimator - Kind (1, 2) - Special Function Bessel Second NIST Series Estimator - First Kind (3, 4) - Special Function Bessel Second NIST Series Estimator - Big Y (5) - Special Function Bessel Second NIST Series Estimator - Constructor (6, 7) - Special Function Bessel Second NIST Series Estimator - Standard (8, 9) - Special Function Bessel Second Watson Integral Estimator (10, 11, 12) - Special Function Bessel Second Watson Integral Estimator - Quadrature Count (13, 14) - Special Function Bessel Second Watson Integral Estimator - Constructor (15, 16) - Special Function Bessel Second Watson Integral Estimator - Integer Form #1 (17, 18) - Special Function Bessel Second Watson Integral Estimator - Integer Form #2 (19, 20) - Special Function Bessel Second Weber Estimator (21, 22, 23) - Special Function Bessel Second Weber Estimator - First Kind (24, 25) - Special Function Bessel Second Weber Estimator - Big Y (26, 27) - Special Function Bessel Second Weber Estimator - Constructor (28, 29) - Special Function Bessel Spherical First Estimator (30, 31, 32) - Special Function Bessel Spherical First Estimator - Kind (33, 34) - Special Function Bessel Spherical First Estimator - Small J (35) - Special Function Bessel Spherical First Estimator - Constructor (36, 37) - Special Function Bessel Spherical First Estimator - Order Minus Four (38, 39) - Special Function Bessel Spherical First Estimator - Order Minus Three (40, 41) - Special Function Bessel Spherical First Estimator - Order Plus Three (42, 43) - Special Function Bessel Spherical First Estimator - Order Minus Two (44, 45) - Special Function Bessel Spherical First Estimator - Order Plus Two (46, 47) - Special Function Bessel Spherical First Estimator - Order Minus One (48, 49) - Special Function Bessel Spherical First Estimator - Order Plus One (50, 51) - Special Function Bessel Spherical First Estimator - Order Zero (52, 53) - Special Function Bessel Spherical Second Estimator (54, 55, 56) - Special Function Bessel Spherical Second Estimator - Kind (57, 58) - Special Function Bessel Spherical Second Estimator - Small Y (59) - Special Function Bessel Spherical Second Estimator - Constructor (60) Samples: IdeaDRIP: --- ReleaseNotes/05_23_2023.txt | 40 ++++ ScheduleSheet.xlsx | Bin 50772 -> 50794 bytes .../bessel/SecondWatsonIntegralEstimator.java | 105 ++++----- .../bessel/SecondWeberEstimator.java | 70 +++--- .../bessel/SphericalFirstEstimator.java | 208 +++++++++--------- .../bessel/SphericalSecondEstimator.java | 61 +++-- 6 files changed, 276 insertions(+), 208 deletions(-) create mode 100644 ReleaseNotes/05_23_2023.txt diff --git a/ReleaseNotes/05_23_2023.txt b/ReleaseNotes/05_23_2023.txt new file mode 100644 index 000000000000..b641e9480095 --- /dev/null +++ b/ReleaseNotes/05_23_2023.txt @@ -0,0 +1,40 @@ + +Features: + +Bug Fixes/Re-organization: + + - Special Function Bessel Second NIST Series Estimator - Kind (1, 2) + - Special Function Bessel Second NIST Series Estimator - First Kind (3, 4) + - Special Function Bessel Second NIST Series Estimator - Big Y (5) + - Special Function Bessel Second NIST Series Estimator - Constructor (6, 7) + - Special Function Bessel Second NIST Series Estimator - Standard (8, 9) + - Special Function Bessel Second Watson Integral Estimator (10, 11, 12) + - Special Function Bessel Second Watson Integral Estimator - Quadrature Count (13, 14) + - Special Function Bessel Second Watson Integral Estimator - Constructor (15, 16) + - Special Function Bessel Second Watson Integral Estimator - Integer Form #1 (17, 18) + - Special Function Bessel Second Watson Integral Estimator - Integer Form #2 (19, 20) + - Special Function Bessel Second Weber Estimator (21, 22, 23) + - Special Function Bessel Second Weber Estimator - First Kind (24, 25) + - Special Function Bessel Second Weber Estimator - Big Y (26, 27) + - Special Function Bessel Second Weber Estimator - Constructor (28, 29) + - Special Function Bessel Spherical First Estimator (30, 31, 32) + - Special Function Bessel Spherical First Estimator - Kind (33, 34) + - Special Function Bessel Spherical First Estimator - Small J (35) + - Special Function Bessel Spherical First Estimator - Constructor (36, 37) + - Special Function Bessel Spherical First Estimator - Order Minus Four (38, 39) + - Special Function Bessel Spherical First Estimator - Order Minus Three (40, 41) + - Special Function Bessel Spherical First Estimator - Order Plus Three (42, 43) + - Special Function Bessel Spherical First Estimator - Order Minus Two (44, 45) + - Special Function Bessel Spherical First Estimator - Order Plus Two (46, 47) + - Special Function Bessel Spherical First Estimator - Order Minus One (48, 49) + - Special Function Bessel Spherical First Estimator - Order Plus One (50, 51) + - Special Function Bessel Spherical First Estimator - Order Zero (52, 53) + - Special Function Bessel Spherical Second Estimator (54, 55, 56) + - Special Function Bessel Spherical Second Estimator - Kind (57, 58) + - Special Function Bessel Spherical Second Estimator - Small Y (59) + - Special Function Bessel Spherical Second Estimator - Constructor (60) + + +Samples: + +IdeaDRIP: diff --git a/ScheduleSheet.xlsx b/ScheduleSheet.xlsx index 3ecc97151771b2b13a95368aa0a405fa8c51e38c..59a81a317274d47ed9ed0f55bf84f7d0787f60b0 100644 GIT binary patch delta 2817 zcmV+c3;y)fj05V71F-A{1y(1SwgHpz1{{A~Z<{a_eV?@dfc#Fugg`*0RT6?0soSEg zYhNl=4miOIU}l>pRn`B#YZB75dFk3k3I5FSIrko4&M&uRVLVVF8LuLQ&unDSD&-lg zRuTGrotOh;NJXlQ6uhDldZZFvUVQy>zTslM;CyWWKqVuTD^-V^H<-LGm`_pI`tkrrYgy4M; zt$*O=po{Y*E9lM6x(2E1AEeZoDv(hSsU{gyG>ecAL%yM}CPY(@8dkun<73A|*2Tfj zGht+ONt!}kgONLUxEY=oIDNenj4><}6%|o*%qs;x-0S+R=UVJ>&cWfvoc@1ln4oa6 zz+a#ho+J&)Le7ZFjYbp^8i#jRWG(ZO#q*!DyCXl6Q}h3WBT1@dTA*{sW!HbJ87PUc zbKOh{1NzhW3L^iDJU|{G+u8n_P9e~^cVDF<#P?65Am}Ga(ldjek4@KceKQz&BhyU= z$>Pm2G=L-;=mWP1U^?wzAq=0vD#LDDt6spfP!A`(p3 zs<(hIc(!A0b^p5f3jmWcx)ZY*3Q7VBe&Me$OM(CZC-#$V3^W0Cv!V<;0e{{rUf=Q_ zupP0H4PDj8vsBse0p(SEc8@;UotHUX}jQn>w67 zBD$A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L79%%ct8TdD}+ZXPO`5yqq8Ze=={*Puq6>{IquC?&mare?5)k^6(q8(T?#g z1&j(pNK~`Oye0vEQA@)x6ouaf|3k@po1}H3q3b|pFK!@MQG5%@-5S=UCCS|S?@ha{ zZYVzHo|7-&)>HIW&f_~2InRycbz@+PI&f%KTwmp) zWume0Vw)DMSKy*RGLDIMiYo70hOrYBXzr5WFhN{3R&yVJj&_Y(E;f7(I3?s3Yw%oh z&v6fo+mVQlNGV2SyS4QIkOD&u8jN?CCKUg8Jy`Ajyf7$dPOW^`hEB)0=WHns;^^Kx zH5zxjU9!uD7$HB!AIrt-P&HPj-<1GV+(D zoovywRjx8lTyL$fx*Y#D2KG?p@Bqjtgky&)C*?hRd@ARtNJ*N;!#V*plQzUb0v558%ETL!l*BXv z7?a7wPy!pXlW@f(lRw2T0jZO3#Z&<|lf=a%8;lAlLE#*0V|V1#v=yq!2kdN0EBH{MgRZ+ diff --git a/src/main/java/org/drip/specialfunction/bessel/SecondWatsonIntegralEstimator.java b/src/main/java/org/drip/specialfunction/bessel/SecondWatsonIntegralEstimator.java index 3fb6e34dc02f..ac60c2a44bca 100644 --- a/src/main/java/org/drip/specialfunction/bessel/SecondWatsonIntegralEstimator.java +++ b/src/main/java/org/drip/specialfunction/bessel/SecondWatsonIntegralEstimator.java @@ -1,11 +1,19 @@ package org.drip.specialfunction.bessel; +import org.drip.function.definition.R1ToR1; +import org.drip.numerical.common.NumberUtil; +import org.drip.numerical.integration.NewtonCotesQuadratureGenerator; +import org.drip.specialfunction.definition.BesselSecondKindEstimator; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -78,7 +86,7 @@ /** * SecondWatsonIntegralEstimator implements the Integral Estimator for the Cylindrical Bessel Function - * of the Second Kind. The References are: + * of the Second Kind. The References are: * *

*
    @@ -102,20 +110,32 @@ * Wikipedia (2019): Bessel Function https://en.wikipedia.org/wiki/Bessel_function * *
+ * + * It provides the following functionality: * - *

* * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Special Function Implementation and Analysis
Package Ordered Bessel Function Variant Estimators
+ * * @author Lakshmi Krishnamurthy */ -public abstract class SecondWatsonIntegralEstimator extends - org.drip.specialfunction.definition.BesselSecondKindEstimator +public abstract class SecondWatsonIntegralEstimator extends BesselSecondKindEstimator { private int _quadratureCount = -1; @@ -130,71 +150,59 @@ public abstract class SecondWatsonIntegralEstimator extends public static final SecondWatsonIntegralEstimator IntegerForm ( final int quadratureCount) { - try - { - return new SecondWatsonIntegralEstimator (quadratureCount) - { + try { + return new SecondWatsonIntegralEstimator (quadratureCount) { @Override public double bigY ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (!org.drip.numerical.common.NumberUtil.IsInteger (alpha) || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { + if (!NumberUtil.IsInteger (alpha) || !NumberUtil.IsValid (z)) { throw new java.lang.Exception ("SecondWatsonIntegralEstimator::IntegerForm::evaluate => Invalid Inputs " + alpha); } - return (org.drip.numerical.integration.NewtonCotesQuadratureGenerator.Zero_PlusOne ( - 0., - java.lang.Math.PI, - quadratureCount - ).integrate ( - new org.drip.function.definition.R1ToR1 (null) - { - @Override public double evaluate ( - final double theta) - throws java.lang.Exception - { - if (java.lang.Double.isInfinite (theta)) + return ( + NewtonCotesQuadratureGenerator.Zero_PlusOne ( + 0., + Math.PI, + quadratureCount + ).integrate ( + new R1ToR1 (null) { + @Override public double evaluate ( + final double theta) + throws Exception { - return 0.; + return Double.isInfinite (theta) ? 0. : + Math.sin (z * Math.sin (theta) - alpha * theta); } - - return java.lang.Math.sin (z * java.lang.Math.sin (theta) - alpha * theta); } - } - ) / java.lang.Math.PI) - - org.drip.numerical.integration.NewtonCotesQuadratureGenerator.GaussLaguerreLeftDefinite ( + ) / Math.PI + ) - NewtonCotesQuadratureGenerator.GaussLaguerreLeftDefinite ( 0., quadratureCount ).integrate ( - new org.drip.function.definition.R1ToR1 (null) - { + new R1ToR1 (null) { @Override public double evaluate ( final double t) - throws java.lang.Exception + throws Exception { - if (java.lang.Double.isInfinite (t)) - { + if (Double.isInfinite (t)) { return 0.; } - double ePowerAlphaT = java.lang.Math.exp (alpha * t); + double ePowerAlphaT = Math.exp (alpha * t); double expPrefix = 0 == (alpha % 2) ? ePowerAlphaT + 1. / ePowerAlphaT : ePowerAlphaT - 1. / ePowerAlphaT; - return expPrefix * java.lang.Math.exp (-z * java.lang.Math.sinh (t)); + return expPrefix * Math.exp (-z * Math.sinh (t)); } } - ) / java.lang.Math.PI; + ) / Math.PI; } }; - } - catch (java.lang.Exception e) - { + } catch (Exception e) { e.printStackTrace(); } @@ -203,11 +211,10 @@ public static final SecondWatsonIntegralEstimator IntegerForm ( protected SecondWatsonIntegralEstimator ( final int quadratureCount) - throws java.lang.Exception + throws Exception { - if (0 >= (_quadratureCount = quadratureCount)) - { - throw new java.lang.Exception ("SecondWatsonIntegralEstimator Constructor => Invalid Inputs"); + if (0 >= (_quadratureCount = quadratureCount)) { + throw new Exception ("SecondWatsonIntegralEstimator Constructor => Invalid Inputs"); } } diff --git a/src/main/java/org/drip/specialfunction/bessel/SecondWeberEstimator.java b/src/main/java/org/drip/specialfunction/bessel/SecondWeberEstimator.java index 0fcb322e6c93..b2e139bdf503 100644 --- a/src/main/java/org/drip/specialfunction/bessel/SecondWeberEstimator.java +++ b/src/main/java/org/drip/specialfunction/bessel/SecondWeberEstimator.java @@ -1,11 +1,18 @@ package org.drip.specialfunction.bessel; +import org.drip.numerical.common.NumberUtil; +import org.drip.specialfunction.definition.BesselFirstKindEstimator; +import org.drip.specialfunction.definition.BesselSecondKindEstimator; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -78,7 +85,7 @@ /** * SecondWeberEstimator implements the Weber Estimation for the Cylindrical Bessel Function of the - * Second Kind. The References are: + * Second Kind. The References are: * *

*
    @@ -102,37 +109,49 @@ * Wikipedia (2019): Bessel Function https://en.wikipedia.org/wiki/Bessel_function * *
+ * + * It provides the following functionality: * - *

* * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Special Function Implementation and Analysis
Package Ordered Bessel Function Variant Estimators
+ * * @author Lakshmi Krishnamurthy */ -public class SecondWeberEstimator extends org.drip.specialfunction.definition.BesselSecondKindEstimator +public class SecondWeberEstimator extends BesselSecondKindEstimator { - private org.drip.specialfunction.definition.BesselFirstKindEstimator _besselFirstKindEstimator = null; + private BesselFirstKindEstimator _besselFirstKindEstimator = null; /** - * SecondWeberEstimator Constructor + * SecondWeberEstimator Constructor * * @param besselFirstKindEstimator Bessel Function First Kind Estimator * - * @throws java.lang.Exception Thrown if the Inputs are Invalid + * @throws Exception Thrown if the Inputs are Invalid */ public SecondWeberEstimator ( - final org.drip.specialfunction.definition.BesselFirstKindEstimator besselFirstKindEstimator) - throws java.lang.Exception + final BesselFirstKindEstimator besselFirstKindEstimator) + throws Exception { - if (null == (_besselFirstKindEstimator = besselFirstKindEstimator)) - { - throw new java.lang.Exception ("SecondWeberEstimator Constructor => Invalid Inputs"); + if (null == (_besselFirstKindEstimator = besselFirstKindEstimator)) { + throw new Exception ("SecondWeberEstimator Constructor => Invalid Inputs"); } } @@ -142,7 +161,7 @@ public SecondWeberEstimator ( * @return The Bessel Function First Kind Estimator */ - public org.drip.specialfunction.definition.BesselFirstKindEstimator besselFirstKindEstimator() + public BesselFirstKindEstimator besselFirstKindEstimator() { return _besselFirstKindEstimator; } @@ -150,22 +169,15 @@ public org.drip.specialfunction.definition.BesselFirstKindEstimator besselFirstK @Override public double bigY ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (!org.drip.numerical.common.NumberUtil.IsValid (alpha) || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception ("SecondWeberEstimator::bigY => Invalid Inputs"); + if (!NumberUtil.IsValid (alpha) || !NumberUtil.IsValid (z)) { + throw new Exception ("SecondWeberEstimator::bigY => Invalid Inputs"); } return ( - java.lang.Math.cos (java.lang.Math.PI * alpha) * _besselFirstKindEstimator.bigJ ( - alpha, - z - ) - _besselFirstKindEstimator.bigJ ( - -1. * alpha, - z - ) - ) / java.lang.Math.sin (java.lang.Math.PI * alpha); + Math.cos (Math.PI * alpha) * _besselFirstKindEstimator.bigJ (alpha, z) - + _besselFirstKindEstimator.bigJ (-1. * alpha, z) + ) / Math.sin (Math.PI * alpha); } } diff --git a/src/main/java/org/drip/specialfunction/bessel/SphericalFirstEstimator.java b/src/main/java/org/drip/specialfunction/bessel/SphericalFirstEstimator.java index 87c468ed5536..c70db9a06e15 100644 --- a/src/main/java/org/drip/specialfunction/bessel/SphericalFirstEstimator.java +++ b/src/main/java/org/drip/specialfunction/bessel/SphericalFirstEstimator.java @@ -1,11 +1,18 @@ package org.drip.specialfunction.bessel; +import org.drip.numerical.common.NumberUtil; +import org.drip.specialfunction.definition.BesselFirstKindEstimator; +import org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -78,7 +85,7 @@ /** * SphericalFirstEstimator implements the Integral Estimator for the Spherical Bessel Function of the - * First Kind. The References are: + * First Kind. The References are: * *

*
    @@ -102,22 +109,43 @@ * Wikipedia (2019): Bessel Function https://en.wikipedia.org/wiki/Bessel_function * *
+ * + * It provides the following functionality: * - *

*
    - *
  • Module = Computational Core Module
  • - *
  • Library = Function Analysis Library
  • - *
  • Project = Special Function Implementation Analysis
  • - *
  • Package = Ordered Bessel Function Variant Estimators
  • + *
  • Retrieve the Order 0 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order -1 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order +1 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order -1 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order +2 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order -2 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order +3 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order -3 Spherical Bessel First Kind Estimator
  • + *
  • Retrieve the Order -4 Spherical Bessel First Kind Estimator
  • + *
  • SphericalFirstEstimator Constructor
  • + *
  • Retrieve the Bessel Function First Kind Estimator
  • *
* + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Special Function Implementation and Analysis
Package Ordered Bessel Function Variant Estimators
+ * * @author Lakshmi Krishnamurthy */ -public class SphericalFirstEstimator extends - org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator +public class SphericalFirstEstimator extends SphericalBesselFirstKindEstimator { - private org.drip.specialfunction.definition.BesselFirstKindEstimator _besselFirstKindEstimator = null; + private BesselFirstKindEstimator _besselFirstKindEstimator = null; /** * Retrieve the Order 0 Spherical Bessel First Kind Estimator @@ -125,23 +153,19 @@ public class SphericalFirstEstimator extends * @return The Order 0 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator OrderZero() + public static final SphericalBesselFirstKindEstimator OrderZero() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (0. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderZero::smallJ => Invalid Inputs"); + if (0. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ("SphericalFirstEstimator::OrderZero::smallJ => Invalid Inputs"); } - return 0. == z ? 1. : java.lang.Math.sin (z) / z; + return 0. == z ? 1. : Math.sin (z) / z; } }; } @@ -152,23 +176,19 @@ public static final org.drip.specialfunction.definition.SphericalBesselFirstKind * @return The Order +1 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator OrderPlusOne() + public static final SphericalBesselFirstKindEstimator OrderPlusOne() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (1. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderPlusOne::smallJ => Invalid Inputs"); + if (1. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ("SphericalFirstEstimator::OrderPlusOne::smallJ => Invalid Inputs"); } - return java.lang.Math.sin (z) / (z * z) - java.lang.Math.cos (z) / z; + return Math.sin (z) / (z * z) - Math.cos (z) / z; } }; } @@ -179,23 +199,19 @@ public static final org.drip.specialfunction.definition.SphericalBesselFirstKind * @return The Order -1 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator OrderMinusOne() + public static final SphericalBesselFirstKindEstimator OrderMinusOne() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (-1. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderMinusOne::smallJ => Invalid Inputs"); + if (-1. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ("SphericalFirstEstimator::OrderMinusOne::smallJ => Invalid Inputs"); } - return java.lang.Math.cos (z) / z; + return Math.cos (z) / z; } }; } @@ -206,27 +222,22 @@ public static final org.drip.specialfunction.definition.SphericalBesselFirstKind * @return The Order +2 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator OrderPlusTwo() + public static final SphericalBesselFirstKindEstimator OrderPlusTwo() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (2. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderPlusTwo::smallJ => Invalid Inputs"); + if (2. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ("SphericalFirstEstimator::OrderPlusTwo::smallJ => Invalid Inputs"); } double oneOverZ = 1. / z; double oneOverZ2 = oneOverZ * oneOverZ; - return (3. * oneOverZ2 - 1.) * java.lang.Math.sin (z) * oneOverZ - - 3. * java.lang.Math.cos (z) * oneOverZ2; + return (3. * oneOverZ2 - 1.) * Math.sin (z) * oneOverZ - 3. * Math.cos (z) * oneOverZ2; } }; } @@ -237,26 +248,21 @@ public static final org.drip.specialfunction.definition.SphericalBesselFirstKind * @return The Order -2 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator OrderMinusTwo() + public static final SphericalBesselFirstKindEstimator OrderMinusTwo() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (-2. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderMinusTwo::smallJ => Invalid Inputs"); + if (-2. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ("SphericalFirstEstimator::OrderMinusTwo::smallJ => Invalid Inputs"); } double oneOverZ = 1. / z; - return -1. * java.lang.Math.cos (z) * oneOverZ * oneOverZ - - java.lang.Math.sin (z) * oneOverZ; + return -1. * Math.cos (z) * oneOverZ * oneOverZ - Math.sin (z) * oneOverZ; } }; } @@ -267,28 +273,25 @@ public static final org.drip.specialfunction.definition.SphericalBesselFirstKind * @return The Order +3 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator - OrderPlusThree() + public static final SphericalBesselFirstKindEstimator OrderPlusThree() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (3. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderPlusThree::smallJ => Invalid Inputs"); + if (3. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ( + "SphericalFirstEstimator::OrderPlusThree::smallJ => Invalid Inputs" + ); } double oneOverZ = 1. / z; double oneOverZ2 = oneOverZ * oneOverZ; - return (15. * oneOverZ2 * oneOverZ - 6. * oneOverZ) * java.lang.Math.sin (z) * oneOverZ - - (15. * oneOverZ2 - 1.) * java.lang.Math.cos (z) * oneOverZ; + return (15. * oneOverZ2 * oneOverZ - 6. * oneOverZ) * Math.sin (z) * oneOverZ - + (15. * oneOverZ2 - 1.) * Math.cos (z) * oneOverZ; } }; } @@ -299,28 +302,24 @@ public static final org.drip.specialfunction.definition.SphericalBesselFirstKind * @return The Order -3 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator - OrderMinusThree() + public static final SphericalBesselFirstKindEstimator OrderMinusThree() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) throws java.lang.Exception { - if (-3. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderMinusThree::smallJ => Invalid Inputs"); + if (-3. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ( + "SphericalFirstEstimator::OrderMinusThree::smallJ => Invalid Inputs" + ); } double oneOverZ = 1. / z; double oneOverZ2 = oneOverZ * oneOverZ; - return (1. - 3. * oneOverZ2) * java.lang.Math.cos (z) * oneOverZ - - 3. * java.lang.Math.sin (z) * oneOverZ2; + return (1. - 3. * oneOverZ2) * Math.cos (z) * oneOverZ - 3. * Math.sin (z) * oneOverZ2; } }; } @@ -331,59 +330,52 @@ public static final org.drip.specialfunction.definition.SphericalBesselFirstKind * @return The Order -4 Spherical Bessel First Kind Estimator */ - public static final org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator - OrderMinusFour() + public static final SphericalBesselFirstKindEstimator OrderMinusFour() { - return new org.drip.specialfunction.definition.SphericalBesselFirstKindEstimator() - { + return new SphericalBesselFirstKindEstimator() { @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - if (-4. != alpha || - !org.drip.numerical.common.NumberUtil.IsValid (z)) - { - throw new java.lang.Exception - ("SphericalFirstEstimator::OrderOrderMinusFour::smallJ => Invalid Inputs"); + if (-4. != alpha || !NumberUtil.IsValid (z)) { + throw new Exception ( + "SphericalFirstEstimator::OrderOrderMinusFour::smallJ => Invalid Inputs" + ); } double oneOverZ = 1. / z; double oneOverZ2 = oneOverZ * oneOverZ; - return (6. * oneOverZ - 15. * oneOverZ2 * oneOverZ) * java.lang.Math.cos (z) * oneOverZ - - (15. * oneOverZ2 - 1.) * java.lang.Math.sin (z) * oneOverZ; + return (6. * oneOverZ - 15. * oneOverZ2 * oneOverZ) * Math.cos (z) * oneOverZ - + (15. * oneOverZ2 - 1.) * Math.sin (z) * oneOverZ; } }; } /** - * SphericalFirstEstimator Constructor + * SphericalFirstEstimator Constructor * * @param besselFirstKindEstimator Bessel Function First Kind Estimator * - * @throws java.lang.Exception Thrown if Inputs are Invalid + * @throws Exception Thrown if Inputs are Invalid */ public SphericalFirstEstimator ( - final org.drip.specialfunction.definition.BesselFirstKindEstimator besselFirstKindEstimator) + final BesselFirstKindEstimator besselFirstKindEstimator) throws java.lang.Exception { - if (null == (_besselFirstKindEstimator = besselFirstKindEstimator)) - { - throw new java.lang.Exception ("SphericalFirstEstimator Constructor => Invalid Inputs"); + if (null == (_besselFirstKindEstimator = besselFirstKindEstimator)) { + throw new Exception ("SphericalFirstEstimator Constructor => Invalid Inputs"); } } @Override public double smallJ ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - return java.lang.Math.sqrt (0.5 * java.lang.Math.PI / z) * _besselFirstKindEstimator.bigJ ( - alpha + 0.5, - z - ); + return Math.sqrt (0.5 * Math.PI / z) * _besselFirstKindEstimator.bigJ (alpha + 0.5, z); } /** @@ -392,7 +384,7 @@ public SphericalFirstEstimator ( * @return Bessel Function First Kind Estimator */ - public org.drip.specialfunction.definition.BesselFirstKindEstimator besselFirstKindEstimator() + public BesselFirstKindEstimator besselFirstKindEstimator() { return _besselFirstKindEstimator; } diff --git a/src/main/java/org/drip/specialfunction/bessel/SphericalSecondEstimator.java b/src/main/java/org/drip/specialfunction/bessel/SphericalSecondEstimator.java index 2766af3e1e85..7fc9d5230d40 100644 --- a/src/main/java/org/drip/specialfunction/bessel/SphericalSecondEstimator.java +++ b/src/main/java/org/drip/specialfunction/bessel/SphericalSecondEstimator.java @@ -1,11 +1,17 @@ package org.drip.specialfunction.bessel; +import org.drip.specialfunction.definition.BesselSecondKindEstimator; +import org.drip.specialfunction.definition.SphericalBesselSecondKindEstimator; + /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! + * Copyright (C) 2025 Lakshmi Krishnamurthy + * Copyright (C) 2024 Lakshmi Krishnamurthy + * Copyright (C) 2023 Lakshmi Krishnamurthy * Copyright (C) 2022 Lakshmi Krishnamurthy * Copyright (C) 2021 Lakshmi Krishnamurthy * Copyright (C) 2020 Lakshmi Krishnamurthy @@ -78,7 +84,7 @@ /** * SphericalSecondEstimator implements the Integral Estimator for the Spherical Bessel Function of the - * Second Kind. The References are: + * Second Kind. The References are: * *

*
    @@ -102,22 +108,37 @@ * Wikipedia (2019): Bessel Function https://en.wikipedia.org/wiki/Bessel_function * *
+ * + * It provides the following functionality: * - *

* * + *
+ * + * + * + * + * + * + * + *
Module Product Core Module
Library Fixed Income Analytics
Project Special Function Implementation and Analysis
Package Ordered Bessel Function Variant Estimators
+ * * @author Lakshmi Krishnamurthy */ -public class SphericalSecondEstimator extends - org.drip.specialfunction.definition.SphericalBesselSecondKindEstimator +public class SphericalSecondEstimator extends SphericalBesselSecondKindEstimator { - private org.drip.specialfunction.definition.BesselSecondKindEstimator _besselSecondKindEstimator = null; + private BesselSecondKindEstimator _besselSecondKindEstimator = null; /** * Retrieve the Order 0 Spherical Bessel Second Kind Estimator @@ -240,32 +261,28 @@ public static final org.drip.specialfunction.definition.SphericalBesselSecondKin } /** - * SphericalSecondEstimator Constructor + * SphericalSecondEstimator Constructor * * @param besselSecondKindEstimator Bessel Function Second Kind Estimator * - * @throws java.lang.Exception Thrown if Inputs are Invalid + * @throws Exception Thrown if Inputs are Invalid */ public SphericalSecondEstimator ( - final org.drip.specialfunction.definition.BesselSecondKindEstimator besselSecondKindEstimator) - throws java.lang.Exception + final BesselSecondKindEstimator besselSecondKindEstimator) + throws Exception { - if (null == (_besselSecondKindEstimator = besselSecondKindEstimator)) - { - throw new java.lang.Exception ("SphericalSecondEstimator Constructor => Invalid Inputs"); + if (null == (_besselSecondKindEstimator = besselSecondKindEstimator)) { + throw new Exception ("SphericalSecondEstimator Constructor => Invalid Inputs"); } } @Override public double smallY ( final double alpha, final double z) - throws java.lang.Exception + throws Exception { - return java.lang.Math.sqrt (0.5 * java.lang.Math.PI / z) * _besselSecondKindEstimator.bigY ( - alpha + 0.5, - z - ); + return Math.sqrt (0.5 * Math.PI / z) * _besselSecondKindEstimator.bigY (alpha + 0.5, z); } /** @@ -274,7 +291,7 @@ public SphericalSecondEstimator ( * @return Bessel Function Second Kind Estimator */ - public org.drip.specialfunction.definition.BesselSecondKindEstimator besselSecondKindEstimator() + public BesselSecondKindEstimator besselSecondKindEstimator() { return _besselSecondKindEstimator; }