!=============================================================================== ! RPL/2 (R) version 4.1.32 ! Copyright (C) 1989-2020 Dr. BERTRAND Joël ! ! This file is part of RPL/2. ! ! RPL/2 is free software; you can redistribute it and/or modify it ! under the terms of the CeCILL V2 License as published by the french ! CEA, CNRS and INRIA. ! ! RPL/2 is distributed in the hope that it will be useful, but WITHOUT ! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL V2 License ! for more details. ! ! You should have received a copy of the CeCILL License ! along with RPL/2. If not, write to info@cecill.info. !=============================================================================== #include "rplftypes-conv.inc" !=============================================================================== ! Fonction renvoyant le logarithme népérien de la fonction GAMMA(X). ! Le logarithme de GAMMA est bien plus facile à calculer que la fonction ! GAMMA. !=============================================================================== subroutine F90GAMMALN(X, RESULTAT, SIGNE, ERREUR) use iso_c_binding implicit none integer(rpl_integer8), intent(out), optional :: ERREUR integer(rpl_integer8) ERREUR_GAMMA real(rpl_real8), intent(in) :: X real(rpl_real8), intent(out) :: RESULTAT real(rpl_real8), intent(out), optional :: SIGNE real(rpl_real8) SIGNE_GAMMA type, bind(C) :: GSL_SF_RESULT real(c_double) VALEUR real(c_double) ERREUR end type type(GSL_SF_RESULT) STRUCT_RESULTAT interface integer(c_int) function gsl_sf_lngamma_sgn_e(X, & RESULTAT, SIGNE) bind(C, name='gsl_sf_lngamma_sgn_e') use iso_c_binding import :: GSL_SF_RESULT implicit none real(c_double), intent(in), value :: X type(GSL_SF_RESULT), intent(out) :: RESULTAT real(c_double), intent(out) :: SIGNE end function end interface ERREUR_GAMMA = gsl_sf_lngamma_sgn_e(X, STRUCT_RESULTAT, & SIGNE_GAMMA) RESULTAT = STRUCT_RESULTAT%VALEUR if (present(SIGNE)) then SIGNE = SIGNE_GAMMA end if if (present(ERREUR)) then ERREUR = ERREUR_GAMMA end if return end subroutine ! vim: ts=4