Average Error: 13.8 → 8.2
Time: 15.0s
Precision: binary64
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[w0 \cdot \sqrt{1 - \frac{h \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}{\frac{\ell}{\frac{M}{2} \cdot \frac{D}{d}}}}\]
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
w0 \cdot \sqrt{1 - \frac{h \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}{\frac{\ell}{\frac{M}{2} \cdot \frac{D}{d}}}}
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
(FPCore (w0 M D h l d)
 :precision binary64
 (*
  w0
  (sqrt (- 1.0 (/ (* h (* (/ M 2.0) (/ D d))) (/ l (* (/ M 2.0) (/ D d))))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt(1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l)));
}
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt(1.0 - ((h * ((M / 2.0) * (D / d))) / (l / ((M / 2.0) * (D / d)))));
}

Error

Bits error versus w0

Bits error versus M

Bits error versus D

Bits error versus h

Bits error versus l

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.8

    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
  2. Using strategy rm
  3. Applied associate-*r/_binary64_104310.7

    \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}}\]
  4. Simplified10.7

    \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\ell}}\]
  5. Using strategy rm
  6. Applied times-frac_binary64_110710.6

    \[\leadsto w0 \cdot \sqrt{1 - \frac{h \cdot {\color{blue}{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}}^{2}}{\ell}}\]
  7. Using strategy rm
  8. Applied unpow2_binary64_116610.6

    \[\leadsto w0 \cdot \sqrt{1 - \frac{h \cdot \color{blue}{\left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)\right)}}{\ell}}\]
  9. Applied associate-*r*_binary64_10419.0

    \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\left(h \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)\right) \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}}{\ell}}\]
  10. Using strategy rm
  11. Applied associate-/l*_binary64_10468.2

    \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{h \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}{\frac{\ell}{\frac{M}{2} \cdot \frac{D}{d}}}}}\]
  12. Final simplification8.2

    \[\leadsto w0 \cdot \sqrt{1 - \frac{h \cdot \left(\frac{M}{2} \cdot \frac{D}{d}\right)}{\frac{\ell}{\frac{M}{2} \cdot \frac{D}{d}}}}\]

Reproduce

herbie shell --seed 2021032 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  :precision binary64
  (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))