Average Error: 13.4 → 8.6
Time: 2.2m
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}\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{h}{\ell}\right)} \le -1.0320886596690345 \cdot 10^{-229}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \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}}\\ \mathbf{if}\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{h}{\ell}\right)} \le 1.970276917376408 \cdot 10^{+287}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{h}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left({\left(\sqrt[3]{{\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{3}}\right)}^{2} \cdot h\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 3 regimes
  2. if (* w0 (sqrt (- 1 (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) (/ h l)))))) < -1.0320886596690345e-229

    1. Initial program 11.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-inv11.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.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 unpow210.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*9.3

      \[\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.0320886596690345e-229 < (* w0 (sqrt (- 1 (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) (/ h l)))))) < 1.970276917376408e+287

    1. Initial program 2.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 unpow22.8

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

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

    if 1.970276917376408e+287 < (* w0 (sqrt (- 1 (* (/ (* M D) (* 2 d)) (* (/ (* M D) (* 2 d)) (/ h l))))))

    1. Initial program 54.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-inv54.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*32.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 add-cbrt-cube36.8

      \[\leadsto w0 \cdot \sqrt{1 - \left({\left(\frac{M \cdot D}{\color{blue}{\sqrt[3]{\left(\left(2 \cdot d\right) \cdot \left(2 \cdot d\right)\right) \cdot \left(2 \cdot d\right)}}}\right)}^{2} \cdot h\right) \cdot \frac{1}{\ell}}\]
    7. Applied add-cbrt-cube37.7

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

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

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

Runtime

Time bar (total: 2.2m)Debug logProfile

herbie shell --seed '#(1071852389 864846987 1238109217 3425890003 4124793586 650694553)' 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))