Commit 60b25a5d authored by Jonathan Drechsel's avatar Jonathan Drechsel
Browse files

Improved calculation of hyperdual sqrt

parent 695efe89
Pipeline #29983 passed with stage
in 4 minutes and 19 seconds
......@@ -460,7 +460,12 @@ hyperdual atan(hyperdual x)
}
hyperdual sqrt(hyperdual x)
{
return pow(x,0.5);
hyperdual temp;
temp.f0 = std::sqrt(x.f0);
temp.f1 = 0.5*x.f1/temp.f0;
temp.f2 = 0.5*x.f2/temp.f0;
temp.f12 = 0.5*(x.f12 - 2.*temp.f1*temp.f2)/temp.f0;
return temp;
}
hyperdual fabs(hyperdual x)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment