Average Error: 13.4 → 8.8
Time: 58.2s
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{M \cdot D}{2 \cdot d} \le -1.4481404470415318 \cdot 10^{-102}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\frac{1}{h}}}}\\ \mathbf{elif}\;\frac{M \cdot D}{2 \cdot d} \le 5.94522074091673 \cdot 10^{-160}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\frac{1}{h}}}}\\ \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

Derivation

  1. Split input into 2 regimes
  2. if (/ (* M D) (* 2 d)) < -1.4481404470415318e-102 or 5.94522074091673e-160 < (/ (* M D) (* 2 d))

    1. Initial program 21.2

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

      \[\leadsto \color{blue}{\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 add-cube-cbrt21.2

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

      \[\leadsto \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}}}}} \cdot w0\]
    6. Using strategy rm
    7. Applied div-inv18.0

      \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\color{blue}{\ell \cdot \frac{1}{h}}}}} \cdot w0\]
    8. Applied cbrt-prod18.0

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

    if -1.4481404470415318e-102 < (/ (* M D) (* 2 d)) < 5.94522074091673e-160

    1. Initial program 7.0

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

      \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}} \cdot w0}\]
    3. Taylor expanded around 0 1.3

      \[\leadsto \color{blue}{1} \cdot w0\]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \le -1.4481404470415318 \cdot 10^{-102}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\frac{1}{h}}}}\\ \mathbf{elif}\;\frac{M \cdot D}{2 \cdot d} \le 5.94522074091673 \cdot 10^{-160}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\frac{\ell}{h}} \cdot \sqrt[3]{\frac{\ell}{h}}} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\frac{1}{h}}}}\\ \end{array}\]

Reproduce

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