From e0737c56c1e384e05064a0c6e1ac46979371041b Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 19 Dec 2018 22:58:32 +0100 Subject: New upstream version 2.0.0+repack --- .../math/doc/html/math_toolkit/powers/hypot.html | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 boost/libs/math/doc/html/math_toolkit/powers/hypot.html (limited to 'boost/libs/math/doc/html/math_toolkit/powers/hypot.html') diff --git a/boost/libs/math/doc/html/math_toolkit/powers/hypot.html b/boost/libs/math/doc/html/math_toolkit/powers/hypot.html new file mode 100644 index 00000000..171f221b --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/powers/hypot.html @@ -0,0 +1,91 @@ + + + +hypot + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+hypot +

+
template <class T1, class T2>
+calculated-result-type hypot(T1 x, T2 y);
+
+template <class T1, class T2, class Policy>
+calculated-result-type hypot(T1 x, T2 y, const Policy&);
+
+

+ Effects: computes +in such a way + as to avoid undue underflow and overflow. +

+

+ The return type of this function is computed using the result + type calculation rules when T1 and T2 are of different + types. +

+

+ The final Policy argument is optional and can + be used to control the behaviour of the function: how it handles errors, + what level of precision to use etc. Refer to the policy + documentation for more details. +

+

+ When calculating it's quite easy for the intermediate terms to + either overflow or underflow, even though the result is in fact perfectly + representable. +

+
+ + Implementation +
+

+ The function is even and symmetric in x and y, so first take assume x,y + > 0 and x > y (we can permute the arguments + if this is not the case). +

+

+ Then if x * ε   >= y we can simply return x. +

+

+ Otherwise the result is given by: +

+

+ +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + -- cgit v1.2.3