Average Error: 13.4 → 8.5
Time: 45.9s
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}\;h \le -5.6620037957448206 \cdot 10^{-176} \lor \neg \left(h \le 1.3449679921851795 \cdot 10^{+121}\right):\\ \;\;\;\;\sqrt{1 - \frac{h \cdot \frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{\frac{\frac{M}{\sqrt[3]{\frac{d}{D}} \cdot \sqrt[3]{\frac{d}{D}}}}{\sqrt[3]{\frac{d}{D}}}}{4}}}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{D \cdot M}{2 \cdot d}}{\frac{\frac{\ell}{h}}{\frac{D \cdot M}{2 \cdot d}}}}\\ \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 2 regimes
  2. if h < -5.6620037957448206e-176 or 1.3449679921851795e+121 < h

    1. Initial program 16.7

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

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}} \cdot w0\]
    3. Using strategy rm
    4. Applied associate-/r/10.2

      \[\leadsto \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell} \cdot h}} \cdot w0\]
    5. Using strategy rm
    6. Applied associate-*l/11.1

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

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

      \[\leadsto \sqrt{1 - \color{blue}{\frac{h \cdot \frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{\frac{M}{\frac{d}{D}}}{4}}}}} \cdot w0\]
    10. Using strategy rm
    11. Applied add-cube-cbrt9.1

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

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

    if -5.6620037957448206e-176 < h < 1.3449679921851795e+121

    1. Initial program 10.1

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Initial simplification9.9

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}} \cdot w0\]
    3. Using strategy rm
    4. Applied associate-/l*7.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \le -5.6620037957448206 \cdot 10^{-176} \lor \neg \left(h \le 1.3449679921851795 \cdot 10^{+121}\right):\\ \;\;\;\;\sqrt{1 - \frac{h \cdot \frac{M}{\frac{d}{D}}}{\frac{\ell}{\frac{\frac{\frac{M}{\sqrt[3]{\frac{d}{D}} \cdot \sqrt[3]{\frac{d}{D}}}}{\sqrt[3]{\frac{d}{D}}}}{4}}}} \cdot w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{D \cdot M}{2 \cdot d}}{\frac{\frac{\ell}{h}}{\frac{D \cdot M}{2 \cdot d}}}}\\ \end{array}\]

Runtime

Time bar (total: 45.9s)Debug logProfile

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