DigammaInequalityLemma.java

  1. package org.drip.specialfunction.property;

  2. /*
  3.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  4.  */

  5. /*!
  6.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  7.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  8.  *
  9.  *  This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
  10.  *      asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
  11.  *      analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
  12.  *      equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
  13.  *      numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
  14.  *      and computational support.
  15.  *  
  16.  *      https://lakshmidrip.github.io/DROP/
  17.  *  
  18.  *  DROP is composed of three modules:
  19.  *  
  20.  *  - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
  21.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  22.  *  - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
  23.  *
  24.  *  DROP Product Core implements libraries for the following:
  25.  *  - Fixed Income Analytics
  26.  *  - Loan Analytics
  27.  *  - Transaction Cost Analytics
  28.  *
  29.  *  DROP Portfolio Core implements libraries for the following:
  30.  *  - Asset Allocation Analytics
  31.  *  - Asset Liability Management Analytics
  32.  *  - Capital Estimation Analytics
  33.  *  - Exposure Analytics
  34.  *  - Margin Analytics
  35.  *  - XVA Analytics
  36.  *
  37.  *  DROP Computational Core implements libraries for the following:
  38.  *  - Algorithm Support
  39.  *  - Computation Support
  40.  *  - Function Analysis
  41.  *  - Model Validation
  42.  *  - Numerical Analysis
  43.  *  - Numerical Optimizer
  44.  *  - Spline Builder
  45.  *  - Statistical Learning
  46.  *
  47.  *  Documentation for DROP is Spread Over:
  48.  *
  49.  *  - Main                     => https://lakshmidrip.github.io/DROP/
  50.  *  - Wiki                     => https://github.com/lakshmiDRIP/DROP/wiki
  51.  *  - GitHub                   => https://github.com/lakshmiDRIP/DROP
  52.  *  - Repo Layout Taxonomy     => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
  53.  *  - Javadoc                  => https://lakshmidrip.github.io/DROP/Javadoc/index.html
  54.  *  - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
  55.  *  - Release Versions         => https://lakshmidrip.github.io/DROP/version.html
  56.  *  - Community Credits        => https://lakshmidrip.github.io/DROP/credits.html
  57.  *  - Issues Catalog           => https://github.com/lakshmiDRIP/DROP/issues
  58.  *  - JUnit                    => https://lakshmidrip.github.io/DROP/junit/index.html
  59.  *  - Jacoco                   => https://lakshmidrip.github.io/DROP/jacoco/index.html
  60.  *
  61.  *  Licensed under the Apache License, Version 2.0 (the "License");
  62.  *      you may not use this file except in compliance with the License.
  63.  *  
  64.  *  You may obtain a copy of the License at
  65.  *      http://www.apache.org/licenses/LICENSE-2.0
  66.  *  
  67.  *  Unless required by applicable law or agreed to in writing, software
  68.  *      distributed under the License is distributed on an "AS IS" BASIS,
  69.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  70.  *  
  71.  *  See the License for the specific language governing permissions and
  72.  *      limitations under the License.
  73.  */

  74. /**
  75.  * <i>DigammaInequalityLemma</i> contains the Verifiable Inequality Lemmas for the Digamma Function. The
  76.  * References are:
  77.  *
  78.  * <br><br>
  79.  *  <ul>
  80.  *      <li>
  81.  *          Blagouchine, I. V. (2014): Re-discovery of Malmsten's Integrals, their Evaluation by Contour
  82.  *              Integration Methods, and some Related Results <i>Ramanujan Journal</i> <b>35 (1)</b> 21-110
  83.  *      </li>
  84.  *      <li>
  85.  *          Borwein, J. M., and R. M. Corless (2017): Gamma Function and the Factorial in the Monthly
  86.  *              https://arxiv.org/abs/1703.05349 <b>arXiv</b>
  87.  *      </li>
  88.  *      <li>
  89.  *          Davis, P. J. (1959): Leonhard Euler's Integral: A Historical Profile of the Gamma Function
  90.  *              <i>American Mathematical Monthly</i> <b>66 (10)</b> 849-869
  91.  *      </li>
  92.  *      <li>
  93.  *          Whitaker, E. T., and G. N. Watson (1996): <i>A Course on Modern Analysis</i> <b>Cambridge
  94.  *              University Press</b> New York
  95.  *      </li>
  96.  *      <li>
  97.  *          Wikipedia (2019): Gamma Function https://en.wikipedia.org/wiki/Gamma_function
  98.  *      </li>
  99.  *  </ul>
  100.  *
  101.  *  <br><br>
  102.  *  <ul>
  103.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li>
  104.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FunctionAnalysisLibrary.md">Function Analysis Library</a></li>
  105.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/README.md">Special Function Implementation Analysis</a></li>
  106.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/property/README.md">Special Function Property Lemma Verifiers</a></li>
  107.  *  </ul>
  108.  *
  109.  * @author Lakshmi Krishnamurthy
  110.  */

  111. public class DigammaInequalityLemma
  112. {

  113.     /**
  114.      * Generate the Digamma Asymptotic Left Inequality Verifier
  115.      *
  116.      * @return The Digamma Asymptotic Left Inequality Verifier
  117.      */

  118.     public static final org.drip.function.definition.R1ToR1Property LeftAsymptote()
  119.     {
  120.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  121.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  122.         try
  123.         {
  124.             return new org.drip.function.definition.R1ToR1Property (
  125.                 org.drip.function.definition.R1ToR1Property.LT,
  126.                 new org.drip.function.definition.R1ToR1 (null)
  127.                 {
  128.                     @Override public double evaluate (
  129.                         final double z)
  130.                         throws java.lang.Exception
  131.                     {
  132.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  133.                         {
  134.                             throw new java.lang.Exception
  135.                                 ("DigammaInequalityLemma::LeftAsymptote::evaluate => Invalid Inputs");
  136.                         }

  137.                         return java.lang.Math.log (z - 0.5);
  138.                     }
  139.                 },
  140.                 new org.drip.function.definition.R1ToR1 (null)
  141.                 {
  142.                     @Override public double evaluate (
  143.                         final double z)
  144.                         throws java.lang.Exception
  145.                     {
  146.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  147.                         {
  148.                             throw new java.lang.Exception
  149.                                 ("DigammaInequalityLemma::LeftAsymptote::evaluate => Invalid Inputs");
  150.                         }

  151.                         return abramowitzStegun2007.evaluate (z);
  152.                     }
  153.                 },
  154.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  155.             );
  156.         }
  157.         catch (java.lang.Exception e)
  158.         {
  159.             e.printStackTrace();
  160.         }

  161.         return null;
  162.     }

  163.     /**
  164.      * Generate the Digamma Asymptotic Right Inequality Verifier
  165.      *
  166.      * @return The Digamma Asymptotic Right Inequality Verifier
  167.      */

  168.     public static final org.drip.function.definition.R1ToR1Property RightAsymptote()
  169.     {
  170.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  171.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  172.         try
  173.         {
  174.             return new org.drip.function.definition.R1ToR1Property (
  175.                 org.drip.function.definition.R1ToR1Property.GT,
  176.                 new org.drip.function.definition.R1ToR1 (null)
  177.                 {
  178.                     @Override public double evaluate (
  179.                         final double z)
  180.                         throws java.lang.Exception
  181.                     {
  182.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  183.                         {
  184.                             throw new java.lang.Exception
  185.                                 ("DigammaInequalityLemma::RightAsymptote::evaluate => Invalid Inputs");
  186.                         }

  187.                         return java.lang.Math.log (z);
  188.                     }
  189.                 },
  190.                 new org.drip.function.definition.R1ToR1 (null)
  191.                 {
  192.                     @Override public double evaluate (
  193.                         final double z)
  194.                         throws java.lang.Exception
  195.                     {
  196.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  197.                         {
  198.                             throw new java.lang.Exception
  199.                                 ("DigammaInequalityLemma::RightAsymptote::evaluate => Invalid Inputs");
  200.                         }

  201.                         return abramowitzStegun2007.evaluate (z);
  202.                     }
  203.                 },
  204.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  205.             );
  206.         }
  207.         catch (java.lang.Exception e)
  208.         {
  209.             e.printStackTrace();
  210.         }

  211.         return null;
  212.     }

  213.     /**
  214.      * Generate the Digamma (0, 1) Left Bound Inequality Verifier
  215.      *
  216.      * @return The Digamma (0, 1) Left Bound Inequality Verifier
  217.      */

  218.     public static final org.drip.function.definition.R1ToR1Property ZeroOneLeftBound()
  219.     {
  220.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  221.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  222.         try
  223.         {
  224.             return new org.drip.function.definition.R1ToR1Property (
  225.                 org.drip.function.definition.R1ToR1Property.LT,
  226.                 new org.drip.function.definition.R1ToR1 (null)
  227.                 {
  228.                     @Override public double evaluate (
  229.                         final double z)
  230.                         throws java.lang.Exception
  231.                     {
  232.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  233.                         {
  234.                             throw new java.lang.Exception
  235.                                 ("DigammaInequalityLemma::ZeroOneLeftBound::evaluate => Invalid Inputs");
  236.                         }

  237.                         return -1. / z - org.drip.specialfunction.gamma.Definitions.EULER_MASCHERONI;
  238.                     }
  239.                 },
  240.                 new org.drip.function.definition.R1ToR1 (null)
  241.                 {
  242.                     @Override public double evaluate (
  243.                         final double z)
  244.                         throws java.lang.Exception
  245.                     {
  246.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  247.                         {
  248.                             throw new java.lang.Exception
  249.                                 ("DigammaInequalityLemma::ZeroOneLeftBound::evaluate => Invalid Inputs");
  250.                         }

  251.                         return abramowitzStegun2007.evaluate (z);
  252.                     }
  253.                 },
  254.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  255.             );
  256.         }
  257.         catch (java.lang.Exception e)
  258.         {
  259.             e.printStackTrace();
  260.         }

  261.         return null;
  262.     }

  263.     /**
  264.      * Generate the Digamma (0, 1) Right Bound Verifier
  265.      *
  266.      * @return The Digamma (0, 1) Right Bound Verifier
  267.      */

  268.     public static final org.drip.function.definition.R1ToR1Property ZeroOneRightBound()
  269.     {
  270.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  271.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  272.         try
  273.         {
  274.             return new org.drip.function.definition.R1ToR1Property (
  275.                 org.drip.function.definition.R1ToR1Property.GT,
  276.                 new org.drip.function.definition.R1ToR1 (null)
  277.                 {
  278.                     @Override public double evaluate (
  279.                         final double z)
  280.                         throws java.lang.Exception
  281.                     {
  282.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  283.                         {
  284.                             throw new java.lang.Exception
  285.                                 ("DigammaInequalityLemma::ZeroOneRightBound::evaluate => Invalid Inputs");
  286.                         }

  287.                         return 1. - 1. / z - org.drip.specialfunction.gamma.Definitions.EULER_MASCHERONI;
  288.                     }
  289.                 },
  290.                 new org.drip.function.definition.R1ToR1 (null)
  291.                 {
  292.                     @Override public double evaluate (
  293.                         final double z)
  294.                         throws java.lang.Exception
  295.                     {
  296.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  297.                         {
  298.                             throw new java.lang.Exception
  299.                                 ("DigammaInequalityLemma::ZeroOneRightBound::evaluate => Invalid Inputs");
  300.                         }

  301.                         return abramowitzStegun2007.evaluate (z);
  302.                     }
  303.                 },
  304.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  305.             );
  306.         }
  307.         catch (java.lang.Exception e)
  308.         {
  309.             e.printStackTrace();
  310.         }

  311.         return null;
  312.     }

  313.     /**
  314.      * Generate the Bernstein-Binet Left Bound Inequality Verifier
  315.      *
  316.      * @return The Bernstein-Binet Left Bound Inequality Verifier
  317.      */

  318.     public static final org.drip.function.definition.R1ToR1Property BernsteinBinetLeftBound()
  319.     {
  320.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  321.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  322.         try
  323.         {
  324.             return new org.drip.function.definition.R1ToR1Property (
  325.                 org.drip.function.definition.R1ToR1Property.LT,
  326.                 new org.drip.function.definition.R1ToR1 (null)
  327.                 {
  328.                     @Override public double evaluate (
  329.                         final double z)
  330.                         throws java.lang.Exception
  331.                     {
  332.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  333.                         {
  334.                             throw new java.lang.Exception
  335.                                 ("DigammaInequalityLemma::BernsteinBinetLeftBound::evaluate => Invalid Inputs");
  336.                         }

  337.                         return java.lang.Math.log (z) - 1. / z;
  338.                     }
  339.                 },
  340.                 new org.drip.function.definition.R1ToR1 (null)
  341.                 {
  342.                     @Override public double evaluate (
  343.                         final double z)
  344.                         throws java.lang.Exception
  345.                     {
  346.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  347.                         {
  348.                             throw new java.lang.Exception
  349.                                 ("DigammaInequalityLemma::BernsteinBinetLeftBound::evaluate => Invalid Inputs");
  350.                         }

  351.                         return abramowitzStegun2007.evaluate (z);
  352.                     }
  353.                 },
  354.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  355.             );
  356.         }
  357.         catch (java.lang.Exception e)
  358.         {
  359.             e.printStackTrace();
  360.         }

  361.         return null;
  362.     }

  363.     /**
  364.      * Generate the Bernstein-Binet Right Bound Inequality Verifier
  365.      *
  366.      * @return The Bernstein-Binet Right Bound Inequality Verifier
  367.      */

  368.     public static final org.drip.function.definition.R1ToR1Property BernsteinBinetRightBound()
  369.     {
  370.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  371.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  372.         try
  373.         {
  374.             return new org.drip.function.definition.R1ToR1Property (
  375.                 org.drip.function.definition.R1ToR1Property.GT,
  376.                 new org.drip.function.definition.R1ToR1 (null)
  377.                 {
  378.                     @Override public double evaluate (
  379.                         final double z)
  380.                         throws java.lang.Exception
  381.                     {
  382.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  383.                         {
  384.                             throw new java.lang.Exception
  385.                                 ("DigammaInequalityLemma::BernsteinBinetRightBound::evaluate => Invalid Inputs");
  386.                         }

  387.                         return java.lang.Math.log (z) - 0.5 / z;
  388.                     }
  389.                 },
  390.                 new org.drip.function.definition.R1ToR1 (null)
  391.                 {
  392.                     @Override public double evaluate (
  393.                         final double z)
  394.                         throws java.lang.Exception
  395.                     {
  396.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  397.                         {
  398.                             throw new java.lang.Exception
  399.                                 ("DigammaInequalityLemma::BernsteinBinetRightBound::evaluate => Invalid Inputs");
  400.                         }

  401.                         return abramowitzStegun2007.evaluate (z);
  402.                     }
  403.                 },
  404.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  405.             );
  406.         }
  407.         catch (java.lang.Exception e)
  408.         {
  409.             e.printStackTrace();
  410.         }

  411.         return null;
  412.     }

  413.     /**
  414.      * Generate the Elezovic-Giordano-Pecaric Left Bound Inequality Verifier
  415.      *
  416.      * @return The Elezovic-Giordano-Pecaric Left Bound Inequality Verifier
  417.      */

  418.     public static final org.drip.function.definition.R1ToR1Property ElezovicGiordanoPecaricLeftBound()
  419.     {
  420.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  421.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  422.         try
  423.         {
  424.             return new org.drip.function.definition.R1ToR1Property (
  425.                 org.drip.function.definition.R1ToR1Property.LT,
  426.                 new org.drip.function.definition.R1ToR1 (null)
  427.                 {
  428.                     @Override public double evaluate (
  429.                         final double z)
  430.                         throws java.lang.Exception
  431.                     {
  432.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  433.                         {
  434.                             throw new java.lang.Exception
  435.                                 ("DigammaInequalityLemma::ElezovicGiordanoPecaricLeftBound::evaluate => Invalid Inputs");
  436.                         }

  437.                         return java.lang.Math.log (z + 0.5) - 1. / z;
  438.                     }
  439.                 },
  440.                 new org.drip.function.definition.R1ToR1 (null)
  441.                 {
  442.                     @Override public double evaluate (
  443.                         final double z)
  444.                         throws java.lang.Exception
  445.                     {
  446.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  447.                         {
  448.                             throw new java.lang.Exception
  449.                                 ("DigammaInequalityLemma::ElezovicGiordanoPecaricLeftBound::evaluate => Invalid Inputs");
  450.                         }

  451.                         return abramowitzStegun2007.evaluate (z);
  452.                     }
  453.                 },
  454.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  455.             );
  456.         }
  457.         catch (java.lang.Exception e)
  458.         {
  459.             e.printStackTrace();
  460.         }

  461.         return null;
  462.     }

  463.     /**
  464.      * Generate the Elezovic-Giordano-Pecaric Right Bound Inequality Verifier
  465.      *
  466.      * @return The Elezovic-Giordano-Pecaric Right Bound Inequality Verifier
  467.      */

  468.     public static final org.drip.function.definition.R1ToR1Property ElezovicGiordanoPecaricRightBound()
  469.     {
  470.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  471.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  472.         try
  473.         {
  474.             return new org.drip.function.definition.R1ToR1Property (
  475.                 org.drip.function.definition.R1ToR1Property.GT,
  476.                 new org.drip.function.definition.R1ToR1 (null)
  477.                 {
  478.                     @Override public double evaluate (
  479.                         final double z)
  480.                         throws java.lang.Exception
  481.                     {
  482.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  483.                         {
  484.                             throw new java.lang.Exception
  485.                                 ("DigammaInequalityLemma::ElezovicGiordanoPecaricRightBound::evaluate => Invalid Inputs");
  486.                         }

  487.                         return java.lang.Math.log (
  488.                             z + java.lang.Math.exp (
  489.                                 -org.drip.specialfunction.gamma.Definitions.EULER_MASCHERONI
  490.                             )
  491.                         ) - 1. / z;
  492.                     }
  493.                 },
  494.                 new org.drip.function.definition.R1ToR1 (null)
  495.                 {
  496.                     @Override public double evaluate (
  497.                         final double z)
  498.                         throws java.lang.Exception
  499.                     {
  500.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  501.                         {
  502.                             throw new java.lang.Exception
  503.                                 ("DigammaInequalityLemma::ElezovicGiordanoPecaricRightBound::evaluate => Invalid Inputs");
  504.                         }

  505.                         return abramowitzStegun2007.evaluate (z);
  506.                     }
  507.                 },
  508.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  509.             );
  510.         }
  511.         catch (java.lang.Exception e)
  512.         {
  513.             e.printStackTrace();
  514.         }

  515.         return null;
  516.     }

  517.     /**
  518.      * Generate the Alzer (1997) Digamma Difference Lemma Verifier
  519.      *
  520.      * @param s s
  521.      *
  522.      * @return The Alzer (1997) Digamma Difference Lemma Verifier
  523.      */

  524.     public static final org.drip.function.definition.R1ToR1Property AlzerDifference1997 (
  525.         final double s)
  526.     {
  527.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  528.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  529.         try
  530.         {
  531.             return new org.drip.function.definition.R1ToR1Property (
  532.                 org.drip.function.definition.R1ToR1Property.LT,
  533.                 new org.drip.function.definition.R1ToR1 (null)
  534.                 {
  535.                     @Override public double evaluate (
  536.                         final double z)
  537.                         throws java.lang.Exception
  538.                     {
  539.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  540.                         {
  541.                             throw new java.lang.Exception
  542.                                 ("DigammaInequalityLemma::AlzerDifference1997::evaluate => Invalid Inputs");
  543.                         }

  544.                         return (1. - s) / (z + s);
  545.                     }
  546.                 },
  547.                 new org.drip.function.definition.R1ToR1 (null)
  548.                 {
  549.                     @Override public double evaluate (
  550.                         final double z)
  551.                         throws java.lang.Exception
  552.                     {
  553.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  554.                         {
  555.                             throw new java.lang.Exception
  556.                                 ("DigammaInequalityLemma::AlzerDifference1997::evaluate => Invalid Inputs");
  557.                         }

  558.                         return abramowitzStegun2007.evaluate (z + 1) - abramowitzStegun2007.evaluate (z + s);
  559.                     }
  560.                 },
  561.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  562.             );
  563.         }
  564.         catch (java.lang.Exception e)
  565.         {
  566.             e.printStackTrace();
  567.         }

  568.         return null;
  569.     }

  570.     /**
  571.      * Generate the Alzer-Jameson (2017) Inequality Verifier
  572.      *
  573.      * @return The Alzer-Jameson (2017) Inequality Verifier
  574.      */

  575.     public static final org.drip.function.definition.R1ToR1Property AlzerJameson2017()
  576.     {
  577.         final org.drip.specialfunction.digamma.CumulativeSeriesEstimator abramowitzStegun2007 =
  578.             org.drip.specialfunction.digamma.CumulativeSeriesEstimator.AbramowitzStegun2007 (1638400);

  579.         try
  580.         {
  581.             return new org.drip.function.definition.R1ToR1Property (
  582.                 org.drip.function.definition.R1ToR1Property.LTE,
  583.                 new org.drip.function.definition.R1ToR1 (null)
  584.                 {
  585.                     @Override public double evaluate (
  586.                         final double z)
  587.                         throws java.lang.Exception
  588.                     {
  589.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  590.                         {
  591.                             throw new java.lang.Exception
  592.                                 ("DigammaInequalityLemma::AlzerJameson2017::evaluate => Invalid Inputs");
  593.                         }

  594.                         return -1. * org.drip.specialfunction.gamma.Definitions.EULER_MASCHERONI;
  595.                     }
  596.                 },
  597.                 new org.drip.function.definition.R1ToR1 (null)
  598.                 {
  599.                     @Override public double evaluate (
  600.                         final double z)
  601.                         throws java.lang.Exception
  602.                     {
  603.                         if (!org.drip.numerical.common.NumberUtil.IsValid (z))
  604.                         {
  605.                             throw new java.lang.Exception
  606.                                 ("DigammaInequalityLemma::AlzerJameson2017::evaluate => Invalid Inputs");
  607.                         }

  608.                         double digammaZ = abramowitzStegun2007.evaluate (z);

  609.                         double digammaZInverse = abramowitzStegun2007.evaluate (1. / z);

  610.                         return 2. * digammaZ * digammaZInverse / (digammaZ + digammaZInverse);
  611.                     }
  612.                 },
  613.                 org.drip.function.definition.R1ToR1Property.MISMATCH_TOLERANCE
  614.             );
  615.         }
  616.         catch (java.lang.Exception e)
  617.         {
  618.             e.printStackTrace();
  619.         }

  620.         return null;
  621.     }
  622. }