Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ hypot() [8/10]

var stan::math::hypot ( const var a,
const var b 
)
inline

Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99).

The partial derivatives are given by

\(\frac{\partial}{\partial x} \sqrt{x^2 + y^2} = \frac{x}{\sqrt{x^2 + y^2}}\), and

\(\frac{\partial}{\partial y} \sqrt{x^2 + y^2} = \frac{y}{\sqrt{x^2 + y^2}}\).

Parameters
[in]aLength of first side.
[in]bLength of second side.
Returns
Length of hypotenuse.

Definition at line 27 of file hypot.hpp.