Average Error: 13.3 → 9.0
Time: 56.1s
Precision: 64
Internal Precision: 320
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[\begin{array}{l} \mathbf{if}\;\frac{h}{\ell} = -\infty:\\ \;\;\;\;\sqrt{1 - \frac{1}{\ell} \cdot \left(\left(\sqrt[3]{\frac{\frac{D}{2}}{\frac{d}{M}}} \cdot \frac{\frac{D}{2}}{\frac{d}{M}}\right) \cdot \left(h \cdot {\left(\sqrt[3]{\frac{M \cdot D}{2 \cdot d}}\right)}^{2}\right)\right)} \cdot w0\\ \mathbf{elif}\;\frac{h}{\ell} \le -6.59422973005456 \cdot 10^{-181}:\\ \;\;\;\;\sqrt{1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array}\]

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. Split input into 3 regimes
  2. if (/ h l) < -inf.0

    1. Initial program 61.7

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 - \left(\color{blue}{\left({\left(\sqrt[3]{\frac{M \cdot D}{2 \cdot d}} \cdot \sqrt[3]{\frac{M \cdot D}{2 \cdot d}}\right)}^{2} \cdot {\left(\sqrt[3]{\frac{M \cdot D}{2 \cdot d}}\right)}^{2}\right)} \cdot h\right) \cdot \frac{1}{\ell}}\]
    8. Applied associate-*l*22.3

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

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

    if -inf.0 < (/ h l) < -6.59422973005456e-181

    1. Initial program 13.5

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

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

    if -6.59422973005456e-181 < (/ h l)

    1. Initial program 8.6

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Taylor expanded around 0 4.7

      \[\leadsto \color{blue}{w0}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} = -\infty:\\ \;\;\;\;\sqrt{1 - \frac{1}{\ell} \cdot \left(\left(\sqrt[3]{\frac{\frac{D}{2}}{\frac{d}{M}}} \cdot \frac{\frac{D}{2}}{\frac{d}{M}}\right) \cdot \left(h \cdot {\left(\sqrt[3]{\frac{M \cdot D}{2 \cdot d}}\right)}^{2}\right)\right)} \cdot w0\\ \mathbf{elif}\;\frac{h}{\ell} \le -6.59422973005456 \cdot 10^{-181}:\\ \;\;\;\;\sqrt{1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array}\]

Runtime

Time bar (total: 56.1s)Debug logProfile

herbie shell --seed 2018220 +o rules:numerics
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))