Average Error: 13.5 → 8.9
Time: 2.6m
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 \frac{\left(M \cdot D\right) \cdot h}{\left(2 \cdot d\right) \cdot \ell}} \le 4.20250586043146 \cdot 10^{+267}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \frac{\left(M \cdot D\right) \cdot h}{\left(2 \cdot d\right) \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - {\left(\sqrt[3]{{\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{3}}\right)}^{2} \cdot \frac{h}{\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 (* w0 (sqrt (- 1 (* (/ (* M D) (* 2 d)) (/ (* (* M D) h) (* (* 2 d) l)))))) < 4.20250586043146e+267

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

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

      \[\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)}}\]
    5. Using strategy rm
    6. Applied frac-times4.6

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

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

    1. Initial program 33.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 add-cbrt-cube46.8

      \[\leadsto w0 \cdot \sqrt{1 - {\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 \frac{h}{\ell}}\]
    4. Applied add-cbrt-cube50.9

      \[\leadsto w0 \cdot \sqrt{1 - {\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 \frac{h}{\ell}}\]
    5. Applied cbrt-undiv51.0

      \[\leadsto w0 \cdot \sqrt{1 - {\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 \frac{h}{\ell}}\]
    6. Applied simplify32.8

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

Runtime

Time bar (total: 2.6m)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' +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))))))