anchor.diff:  #endif
     end function cos_mb
   
  -  real(kind=fPrec) function acos_mb(arg)
  -    implicit none
  -    real(kind=fPrec) arg
  -    intent(in) arg
  -
  -#ifndef CRLIBM
  -    !Input KIND = output KIND
  +  real(kind=fPrec) pure function acos_mb(arg)
  +    real(kind=fPrec), intent(in) :: arg
  +#ifndef CRLIBM
       acos_mb=acos(arg)
   #else
   #ifdef ROUND_NEAR
  
positive.code: #endif
    end function exp_mb
  
    real(kind=fPrec) function log_mb(arg)
      implicit none
      real(kind=fPrec) arg
      intent(in) arg
  
  #ifndef CRLIBM
      !Input KIND = output KIND
      log_mb=log(arg)
  #else
  #ifdef ROUND_NEAR
  
negative.code: #endif
        else
          atan2_rd=sign(mb_pi2,y)
        end if
      else
        if(y == 0d0) then
          if(x > 0d0) then
            ! Let the internal atan2 handle this case according to ieee
            atan2_rd=atan2(y,x)
          else
            atan2_rd=mb_pi
          end if
        else
          atan2_rd=atan_rd(y/x)
          if(x < 0d0) then
            atan2_rd=sign(mb_pi,y)+atan2_rd
          end if
        end if
      end if
    end function atan2_rd
  #endif
  
    ! ========================================================================== !
    !  ROUND ZERO SPEACIAL FUNCTIONS
    ! ========================================================================== !
  
  #ifdef ROUND_ZERO
    real(kind=real64) pure function acos_rz(x)
      use, intrinsic :: iso_fortran_env, only : real64
      real(kind=real64), intent(in) :: x
      if(x /= x) then ! Check if NaN
        acos_rz=x
      elseif(abs(x) == 0.0d0) then
        acos_rz=mb_pi2
      else
        acos_rz=atan_rz(sqrt((1.0d0-x)*(1.0d0+x))/x)
        if(x < 0d0) then
          acos_rz=mb_pi+acos_rz
        end if
      end if
    end function acos_rz
  
    real(kind=real64) pure function asin_rz(x)
      use, intrinsic :: iso_fortran_env, only : real64
      real(kind=real64), intent(in) :: x
      if(x /= x) then ! Check if NaN
        asin_rz=x
        return
      end if
      if(abs(x) == 1.0d0) then
        asin_rz=sign(mb_pi2,x)
      else
        asin_rz=atan_rz(x/sqrt((1.0d0-x)*(1.0d0+x)))
      end if
    end function asin_rz
  
    real(kind=real64) pure function atan2_rz(y,x)
      use, intrinsic :: iso_fortran_env, only : real64
      real(kind=real64), intent(in) :: x,y
      if(x == 0d0) then
        if(y == 0d0) then
  #ifdef NAGFOR
          atan2_rz=0d0
  #else
  