Average Error: 13.4 → 7.8
Time: 2.8m
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}\;\frac{M \cdot D}{2 \cdot d} \cdot \left(h \cdot \frac{M \cdot D}{2 \cdot d}\right) \le -3.4790670620477553 \cdot 10^{+245} \lor \neg \left(\frac{M \cdot D}{2 \cdot d} \cdot \left(h \cdot \frac{M \cdot D}{2 \cdot d}\right) \le 1.629810084747972 \cdot 10^{+111}\right):\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M}{d} \cdot \left(\frac{1}{2} \cdot D\right)}{\ell} \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{2} \cdot h\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 - \frac{1}{\ell} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \left(h \cdot \frac{M \cdot D}{2 \cdot d}\right)\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 (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) < -3.4790670620477553e+245

    1. Initial program 54.8

      \[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-inv54.8

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

      \[\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 unpow257.9

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

      \[\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. Taylor expanded around 0 56.0

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

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

    if -3.4790670620477553e+245 < (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) < 1.629810084747972e+111

    1. Initial program 6.3

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

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

      \[\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 unpow21.9

      \[\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*0.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}}\]

    if 1.629810084747972e+111 < (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h))

    1. Initial program 44.8

      \[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-inv44.7

      \[\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*47.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 unpow247.0

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

      \[\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. Taylor expanded around 0 42.5

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

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

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

Runtime

Time bar (total: 2.8m)Debug logProfile

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