r8_softplus <- function ( x ) #*****************************************************************************80 # ## r8_softplus() evaluates the softplus function of an R8. # # Discussion: # # An R8 is a double precision real value. # # The softplus function is a smoothed (differentiable) version of # the ReLU (Rectified Linear Unit) activation. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 06 September 2026 # # Author: # # John Burkardt # # Input: # # real x: the argument. # # Output: # # real VALUE: the function value. # { if ( x <= -36.841 ) { value = 0.0 } else if ( +36.841 <= x ) { value = x } else { value = log ( 1.0 + exp ( x ) ) } return ( value ) }