r8_softplus_test <- function ( ) #*****************************************************************************80 # ## r8_softplus_test() tests r8_softplus(). # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 06 September 2026 # # Author: # # John Burkardt # { source ( "/home/john/public_html/r_src/r8lib/r8_softplus.R" ) cat ( '\n' ) cat ( 'r8_softplus_test():\n' ) cat ( ' r8_softplus() computes the soft plus function,\n' ) cat ( ' a smoothed version of f(x)=max(x,0.0)\n' ) cat ( '\n' ) cat ( ' X softplus(x)\n' ) cat ( '\n' ) x = -1.0 for ( i in 1 : 10 ) { y <- r8_softplus ( x ) cat ( ' ', x, ' ', y, '\n' ); x = x / 2.0 } y <- r8_softplus ( 0.0 ) cat ( ' ', 0.0, ' ', y, '\n' ); x = abs ( 2.0 * x ) for ( i in 1 : 10 ) { y <- r8_softplus ( x ) cat ( ' ', x, ' ', y, '\n' ); x = x * 2.0 } }