Average Error: 14.0 → 8.5
Time: 20.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 \frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell}}}\]
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 \frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell}}}
(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 D) (* 2.0 d))) (* (cbrt l) (cbrt l)))
     (/ (/ (* M D) (* 2.0 d)) (cbrt l)))))))
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 * D) / (2.0 * d))) / (cbrt(l) * cbrt(l))) * (((M * D) / (2.0 * d)) / cbrt(l))));
}

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 14.0

    \[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_70210.8

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

    \[\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 sqr-pow_binary64_73210.8

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

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

    \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\left(h \cdot \frac{M \cdot D}{2 \cdot d}\right)} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{\left(\frac{2}{2}\right)}}{\ell}}\]
  9. Using strategy rm
  10. Applied add-cube-cbrt_binary64_7959.4

    \[\leadsto w0 \cdot \sqrt{1 - \frac{\left(h \cdot \frac{M \cdot D}{2 \cdot d}\right) \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{\left(\frac{2}{2}\right)}}{\color{blue}{\left(\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}\right) \cdot \sqrt[3]{\ell}}}}\]
  11. Applied times-frac_binary64_7668.5

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

    \[\leadsto w0 \cdot \sqrt{1 - \frac{h \cdot \frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell}}}\]

Alternatives

Reproduce

herbie shell --seed 2021102 
(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))))))