Average Error: 13.6 → 8.2
Time: 3.1m
Precision: 64
Internal Precision: 576
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[\begin{array}{l} \mathbf{if}\;\left(M \cdot D\right) \cdot \left(M \cdot D\right) \le 5.9727471906674 \cdot 10^{-312} \lor \neg \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right) \le 1.786835656659422 \cdot 10^{+240}\right):\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \left(h \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right)\right) \cdot \frac{1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\frac{d}{h}}}{\left(\left(d \cdot 2\right) \cdot 2\right) \cdot \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)) < 5.9727471906674e-312 or 1.786835656659422e+240 < (* (* D M) (* D M))

    1. Initial program 14.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-inv14.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*10.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-frac10.0

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

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

      \[\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 5.9727471906674e-312 < (* (* D M) (* D M)) < 1.786835656659422e+240

    1. Initial program 12.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-inv12.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*10.0

      \[\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-frac11.0

      \[\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 unpow211.0

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

      \[\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}}\]
    10. Using strategy rm
    11. Applied associate-*l/9.7

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

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

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

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

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

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

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;\left(M \cdot D\right) \cdot \left(M \cdot D\right) \le 5.9727471906674 \cdot 10^{-312} \lor \neg \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right) \le 1.786835656659422 \cdot 10^{+240}\right):\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \left(h \cdot \left(\frac{D}{d} \cdot \frac{M}{2}\right)\right)\right) \cdot \frac{1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\frac{d}{h}}}{\left(\left(d \cdot 2\right) \cdot 2\right) \cdot \ell}}\\ \end{array}}\]

Runtime

Time bar (total: 3.1m)Debug logProfile

herbie shell --seed '#(1071501266 3581234924 1086666455 2685055582 1243441566 1802958749)' 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))