Average Error: 13.8 → 7.6
Time: 2.7m
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}\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)}{\ell}} \le -3.245701205059172 \cdot 10^{+301}:\\ \;\;\;\;w0 \cdot \sqrt{(\left(\frac{M}{2} \cdot \left(-\frac{D}{d}\right)\right) \cdot \left(\left(\frac{M}{d} \cdot \left(\frac{1}{2} \cdot D\right)\right) \cdot \frac{h}{\ell}\right) + 1)_*}\\ \mathbf{if}\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)}{\ell}} \le 4.1769564408861524 \cdot 10^{+276}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{(\left(\frac{M}{2} \cdot \left(-\frac{D}{d}\right)\right) \cdot \left(\left(\frac{M}{d} \cdot \left(\frac{1}{2} \cdot D\right)\right) \cdot \frac{h}{\ell}\right) + 1)_*}\\ \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 (* w0 (sqrt (- 1 (/ (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) l)))) < -3.245701205059172e+301 or 4.1769564408861524e+276 < (* w0 (sqrt (- 1 (/ (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) l))))

    1. Initial program 47.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-inv47.9

      \[\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*51.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 unpow251.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*50.8

      \[\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 50.8

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

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

    if -3.245701205059172e+301 < (* w0 (sqrt (- 1 (/ (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) h)) l)))) < 4.1769564408861524e+276

    1. Initial program 6.6

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

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

      \[\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 un-div-inv0.2

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

Runtime

Time bar (total: 2.7m)Debug logProfile

herbie shell --seed 2018193 +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))))))