Average Error: 13.4 → 7.8
Time: 2.7m
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}\;\sqrt{1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}} \le 3.430291816913143 \cdot 10^{+117}:\\ \;\;\;\;w0 \cdot \sqrt{1 - {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;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}}\\ \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 2 regimes
  2. if (sqrt (- 1 (* (pow (* (/ M 2) (/ D d)) 2) (/ h l)))) < 3.430291816913143e+117

    1. Initial program 0.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 times-frac0.1

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

    if 3.430291816913143e+117 < (sqrt (- 1 (* (pow (* (/ M 2) (/ D d)) 2) (/ h l))))

    1. Initial program 57.1

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
    2. Using strategy rm
    3. Applied associate-*r/41.4

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}}\]
    4. Using strategy rm
    5. Applied unpow241.4

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

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\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 '#(1072743783 989954326 4239155542 3782239461 3602631542 1719177920)' 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))