Average Error: 13.4 → 7.4
Time: 2.5m
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}\;\left(\frac{M}{d} \cdot \left(\left(h \cdot D\right) \cdot \frac{1}{2}\right)\right) \cdot \frac{\frac{D}{2} \cdot \frac{M}{d}}{\ell} \le -1.1725333614039173 \cdot 10^{+299}:\\ \;\;\;\;\left(\sqrt[3]{w0 \cdot \sqrt{1 - \left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \frac{h}{\ell}\right)}} \cdot \sqrt[3]{w0 \cdot \sqrt{1 - \left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \frac{h}{\ell}\right)}}\right) \cdot \sqrt[3]{w0 \cdot \sqrt{1 - \left(\left(\frac{M}{d} \cdot \frac{D}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left(\frac{M}{d} \cdot \frac{D}{2}\right)}}\\ \mathbf{if}\;\left(\frac{M}{d} \cdot \left(\left(h \cdot D\right) \cdot \frac{1}{2}\right)\right) \cdot \frac{\frac{D}{2} \cdot \frac{M}{d}}{\ell} \le 4.56519814000456 \cdot 10^{-79}:\\ \;\;\;\;\sqrt{1 - \left(\frac{M}{d} \cdot \left(\left(h \cdot D\right) \cdot \frac{1}{2}\right)\right) \cdot \frac{\frac{D}{2} \cdot \frac{M}{d}}{\ell}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \left(\left(\left(M \cdot D\right) \cdot \frac{1}{2 \cdot d}\right) \cdot h\right)\right) \cdot \frac{1}{\ell}}\\ \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 (* (* (/ M d) (* (* h D) 1/2)) (/ (* (/ D 2) (/ M d)) l)) < -1.1725333614039173e+299

    1. Initial program 52.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-inv52.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*54.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 unpow254.3

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

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

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

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

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

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

    if -1.1725333614039173e+299 < (* (* (/ M d) (* (* h D) 1/2)) (/ (* (/ D 2) (/ M d)) l)) < 4.56519814000456e-79

    1. Initial program 6.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 div-inv6.8

      \[\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*3.2

      \[\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 unpow23.2

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

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)\right)} \cdot \frac{1}{\ell}}\]
    8. Taylor expanded around 0 2.9

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

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

    if 4.56519814000456e-79 < (* (* (/ M d) (* (* h D) 1/2)) (/ (* (/ D 2) (/ M d)) l))

    1. Initial program 17.4

      \[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-inv17.4

      \[\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*10.9

      \[\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 unpow210.9

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

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)\right)} \cdot \frac{1}{\ell}}\]
    8. Using strategy rm
    9. Applied div-inv4.0

      \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \left(\color{blue}{\left(\left(M \cdot D\right) \cdot \frac{1}{2 \cdot d}\right)} \cdot h\right)\right) \cdot \frac{1}{\ell}}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 2.5m)Debug logProfile

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