Commit 675d1c3c authored by Theresa Schollenberger's avatar Theresa Schollenberger Committed by Timo Koch
Browse files

[brookscorey] more efficient implementation of dkrn_dswe

parent 70c9905f
...@@ -269,8 +269,10 @@ public: ...@@ -269,8 +269,10 @@ public:
swe = min(max(swe, 0.0), 1.0); // the equation below is only defined for 0.0 <= sw <= 1.0 swe = min(max(swe, 0.0), 1.0); // the equation below is only defined for 0.0 <= sw <= 1.0
return 2.0*(swe - 1)*(1 + (0.5 + 1/params.lambda())*pow(swe, 2.0/params.lambda()) const auto lambdaInv = 1.0/params.lambda();
- (3.0/2.0 + 1/params.lambda())*pow(swe, 2.0/params.lambda()+1)); const auto swePow = pow(swe, 2*lambdaInv);
return 2*(swe - 1.0)*(1.0 + (0.5 + lambdaInv)*swePow - (1.5 + lambdaInv)*swePow*swe);
} }
}; };
......
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