Average Error: 13.3 → 8.2
Time: 31.9s
Precision: 64
Internal Precision: 128
\[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:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M}{\frac{d \cdot 2}{D}}\right)}^{2}}{\ell}}\\ \mathbf{elif}\;\frac{h}{\ell} \le -5.9288345222629984 \cdot 10^{-251}:\\ \;\;\;\;\sqrt{1 - \left(\frac{D \cdot M}{d \cdot 2} \cdot \frac{h}{\ell}\right) \cdot \frac{D \cdot M}{d \cdot 2}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 - \sqrt[3]{\frac{\left(\frac{D \cdot M}{d \cdot 2} \cdot h\right) \cdot \frac{D \cdot M}{d \cdot 2}}{\ell}} \cdot \left(\sqrt[3]{\frac{\left(\frac{D \cdot M}{d \cdot 2} \cdot h\right) \cdot \frac{D \cdot M}{d \cdot 2}}{\ell}} \cdot \sqrt[3]{\frac{\left(\frac{D \cdot M}{d \cdot 2} \cdot h\right) \cdot \frac{D \cdot M}{d \cdot 2}}{\ell}}\right)} \cdot 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 associate-*r/26.2

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

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

    if -inf.0 < (/ h l) < -5.9288345222629984e-251

    1. Initial program 13.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 unpow213.4

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

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

    if -5.9288345222629984e-251 < (/ h l)

    1. Initial program 7.9

      \[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/5.1

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

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

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

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

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

Reproduce

herbie shell --seed 2019030 +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))))))