



'''simple docstring'''




import math
import random



def      a      (			lowerCamelCase__						,				lowerCamelCase__ = False   ):
			'''simple docstring'''





			if deriv:
						return value * (1 - value)
			return 1 / (1 + math.exp(-value   ))


# Initial Value
lowerCamelCase							:List[str]       = 0.02



def      a      (			lowerCamelCase__						,				lowerCamelCase__   ):
			'''simple docstring'''





			A_     :						List[str]     =					float(2 * (random.randint(1						,				1_00   )) - 1   )

			for _ in range(lowerCamelCase__   ):
						# Forward propagation
						A_     :						List[str]     =					sigmoid_function(INITIAL_VALUE * weight   )
						# How much did we miss?
						A_     :						Optional[int]     =					(expected / 1_00) - layer_a
						# Error delta
						A_     :						Tuple     =					layer_1_error * sigmoid_function(lowerCamelCase__						,				lowerCamelCase__   )
						# Update weight
						weight += INITIAL_VALUE * layer_1_delta

			return layer_a * 1_00


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						lowerCamelCase							:List[str]       = int(input('''Expected value: '''))
						lowerCamelCase							:Optional[Any]       = int(input('''Number of propagations: '''))
						print(forward_propagation(expected, number_propagations))




'''simple docstring'''




def      a      (			lowerCamelCase__						,				lowerCamelCase__   ):
			'''simple docstring'''





			if density <= 0:
						raise ValueError("""Impossible fluid density"""   )
			if bulk_modulus <= 0:
						raise ValueError("""Impossible bulk modulus"""   )

			return (bulk_modulus / density) ** 0.5


if __name__ == "__main__":
						import doctest

						doctest.testmod()