\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)\begin{array}{l}
\mathbf{if}\;d \le -9.149099578267195 \cdot 10^{+66}:\\
\;\;\;\;0\\
\mathbf{elif}\;d \le -3.0984117268558066 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{c0 \cdot \left(\sqrt{\left(\frac{\frac{\frac{d}{D}}{\frac{h}{c0}}}{\frac{w}{\frac{d}{D}}} - M\right) \cdot \left(M + \frac{\frac{\frac{d}{D}}{\frac{h}{c0}}}{\frac{w}{\frac{d}{D}}}\right)} + \frac{\frac{\frac{d}{D}}{\frac{h}{c0}}}{\frac{w}{\frac{d}{D}}}\right)}{w}}{2}\\
\mathbf{elif}\;d \le -4.661221006329722 \cdot 10^{-176}:\\
\;\;\;\;0\\
\mathbf{elif}\;d \le 4.6238459383082094 \cdot 10^{-126}:\\
\;\;\;\;\frac{\frac{\frac{\frac{d}{D} \cdot \left(c0 \cdot \frac{d}{D}\right)}{w \cdot h} + \sqrt{\left(\frac{\frac{d}{D} \cdot \left(c0 \cdot \frac{d}{D}\right)}{w \cdot h} + M\right) \cdot \left(\frac{\frac{d}{D} \cdot \left(c0 \cdot \frac{d}{D}\right)}{w \cdot h} - M\right)}}{\frac{w}{c0}}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}double f(double c0, double w, double h, double D, double d, double M) {
double r81896121 = c0;
double r81896122 = 2.0;
double r81896123 = w;
double r81896124 = r81896122 * r81896123;
double r81896125 = r81896121 / r81896124;
double r81896126 = d;
double r81896127 = r81896126 * r81896126;
double r81896128 = r81896121 * r81896127;
double r81896129 = h;
double r81896130 = r81896123 * r81896129;
double r81896131 = D;
double r81896132 = r81896131 * r81896131;
double r81896133 = r81896130 * r81896132;
double r81896134 = r81896128 / r81896133;
double r81896135 = r81896134 * r81896134;
double r81896136 = M;
double r81896137 = r81896136 * r81896136;
double r81896138 = r81896135 - r81896137;
double r81896139 = sqrt(r81896138);
double r81896140 = r81896134 + r81896139;
double r81896141 = r81896125 * r81896140;
return r81896141;
}
double f(double c0, double w, double h, double D, double d, double M) {
double r81896142 = d;
double r81896143 = -9.149099578267195e+66;
bool r81896144 = r81896142 <= r81896143;
double r81896145 = 0.0;
double r81896146 = -3.0984117268558066e-57;
bool r81896147 = r81896142 <= r81896146;
double r81896148 = c0;
double r81896149 = D;
double r81896150 = r81896142 / r81896149;
double r81896151 = h;
double r81896152 = r81896151 / r81896148;
double r81896153 = r81896150 / r81896152;
double r81896154 = w;
double r81896155 = r81896154 / r81896150;
double r81896156 = r81896153 / r81896155;
double r81896157 = M;
double r81896158 = r81896156 - r81896157;
double r81896159 = r81896157 + r81896156;
double r81896160 = r81896158 * r81896159;
double r81896161 = sqrt(r81896160);
double r81896162 = r81896161 + r81896156;
double r81896163 = r81896148 * r81896162;
double r81896164 = r81896163 / r81896154;
double r81896165 = 2.0;
double r81896166 = r81896164 / r81896165;
double r81896167 = -4.661221006329722e-176;
bool r81896168 = r81896142 <= r81896167;
double r81896169 = 4.6238459383082094e-126;
bool r81896170 = r81896142 <= r81896169;
double r81896171 = r81896148 * r81896150;
double r81896172 = r81896150 * r81896171;
double r81896173 = r81896154 * r81896151;
double r81896174 = r81896172 / r81896173;
double r81896175 = r81896174 + r81896157;
double r81896176 = r81896174 - r81896157;
double r81896177 = r81896175 * r81896176;
double r81896178 = sqrt(r81896177);
double r81896179 = r81896174 + r81896178;
double r81896180 = r81896154 / r81896148;
double r81896181 = r81896179 / r81896180;
double r81896182 = r81896181 / r81896165;
double r81896183 = r81896170 ? r81896182 : r81896145;
double r81896184 = r81896168 ? r81896145 : r81896183;
double r81896185 = r81896147 ? r81896166 : r81896184;
double r81896186 = r81896144 ? r81896145 : r81896185;
return r81896186;
}



Bits error versus c0



Bits error versus w



Bits error versus h



Bits error versus D



Bits error versus d



Bits error versus M
Results
if d < -9.149099578267195e+66 or -3.0984117268558066e-57 < d < -4.661221006329722e-176 or 4.6238459383082094e-126 < d Initial program 58.6
Simplified53.9
rmApplied associate-*r*54.8
rmApplied *-un-lft-identity54.8
Applied *-un-lft-identity54.8
Applied distribute-lft-out54.8
Simplified51.6
Taylor expanded around -inf 31.6
if -9.149099578267195e+66 < d < -3.0984117268558066e-57Initial program 52.6
Simplified51.7
rmApplied associate-*r*52.6
rmApplied *-un-lft-identity52.6
Applied *-un-lft-identity52.6
Applied distribute-lft-out52.6
Simplified49.0
rmApplied associate-*r/48.9
Simplified49.3
if -4.661221006329722e-176 < d < 4.6238459383082094e-126Initial program 60.9
Simplified41.7
rmApplied associate-*r*43.7
rmApplied *-un-lft-identity43.7
Applied *-un-lft-identity43.7
Applied distribute-lft-out43.7
Simplified40.9
rmApplied pow140.9
Applied pow140.9
Applied pow-prod-down40.9
Simplified43.0
Final simplification34.9
herbie shell --seed 2019125
(FPCore (c0 w h D d M)
:name "Henrywood and Agarwal, Equation (13)"
(* (/ c0 (* 2 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))