





from collections.abc import Callable

UpperCAmelCase__  :	Tuple     =Callable[[float], float]  # type alias for a real -> real function





def    _lowercase    (  _UpperCAmelCase	,					_UpperCAmelCase	,					_UpperCAmelCase	,					)  ->     float:
				lowerCamelCase		       =float(_UpperCAmelCase )
				while True:
								try:
												lowerCamelCase		       =prev_guess - function(_UpperCAmelCase ) / derivative(_UpperCAmelCase )
								except ZeroDivisionError:
												raise ZeroDivisionError("""Could not find root""" ) from None
								if abs(prev_guess - next_guess ) < 10**-5:
												return next_guess
								lowerCamelCase		       =next_guess





def    _lowercase    (  _UpperCAmelCase )  ->     float:
				return (x**3) - (2 * x) - 5





def    _lowercase    (  _UpperCAmelCase )  ->     float:
				return 3 * (x**2) - 2


if __name__ == "__main__":
							print(newton(f, fa, 3))







'''simple docstring'''

import unittest

from transformers import is_torch_available, load_tool

from .test_tools_common import ToolTesterMixin


if is_torch_available():
   import torch







class 	__lowerCAmelCase    (  unittest.TestCase       ,					__a				):



     def     snake_case_ (self	):
          _UpperCAmelCase					:  Tuple         =    load_tool("""speech-to-text"""	)
          self.tool.setup()



     def     snake_case_ (self	):
          _UpperCAmelCase					:  str         =    self.tool(torch.ones(3_0_0_0	)	)
          self.assertEqual(lowerCAmelCase__						,	""" you"""	)



     def     snake_case_ (self	):
          _UpperCAmelCase					:  Union[str, Any]         =    self.tool(audio=torch.ones(3_0_0_0	)	)
          self.assertEqual(lowerCAmelCase__						,	""" you"""	)


