Average Error: 13.6 → 8.3
Time: 3.1m
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(D \cdot M\right) \cdot \left(D \cdot M\right) \le 1.398603720103554 \cdot 10^{-148}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot h\right)\right) \cdot \frac{1}{\ell}}\\ \mathbf{if}\;\left(D \cdot M\right) \cdot \left(D \cdot M\right) \le 5.210436688546639 \cdot 10^{+243}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\frac{d}{\frac{h}{2}}}}{\left(2 \cdot d\right) \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \left(\left(\frac{M}{2} \cdot \frac{D}{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

Derivation

  1. Split input into 2 regimes
  2. if (* (* D M) (* D M)) < 1.398603720103554e-148 or 5.210436688546639e+243 < (* (* D M) (* D M))

    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 div-inv13.5

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

      \[\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 times-frac9.3

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

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

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

    if 1.398603720103554e-148 < (* (* D M) (* D M)) < 5.210436688546639e+243

    1. Initial program 13.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 div-inv14.0

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

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

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

      \[\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 associate-*l/10.1

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

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

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

Runtime

Time bar (total: 3.1m)Debug logProfile

herbie shell --seed '#(1071821486 549052472 3784827256 1559736200 3548510075 881134285)' +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))))))