Average Error: 13.5 → 7.9
Time: 2.5m
Precision: 64
Internal Precision: 384
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[\begin{array}{l} \mathbf{if}\;{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \le 2.2540116605469143 \cdot 10^{-45}:\\ \;\;\;\;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{if}\;{\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \le 2.098295374361061 \cdot 10^{+266}:\\ \;\;\;\;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}}{2 \cdot \frac{\ell \cdot d}{M \cdot \left(D \cdot h\right)}}}\\ \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 (pow (* (/ M 2) (/ D d)) 2) < 2.2540116605469143e-45

    1. Initial program 6.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/0.9

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

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

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

    if 2.2540116605469143e-45 < (pow (* (/ M 2) (/ D d)) 2) < 2.098295374361061e+266

    1. Initial program 11.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 times-frac8.5

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

    if 2.098295374361061e+266 < (pow (* (/ M 2) (/ D d)) 2)

    1. Initial program 52.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 associate-*r/53.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 unpow253.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*45.5

      \[\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}}\]
    7. Using strategy rm
    8. Applied associate-/l*40.7

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{\frac{M \cdot D}{2 \cdot d} \cdot h}}}}\]
    9. Taylor expanded around 0 43.1

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

Runtime

Time bar (total: 2.5m)Debug logProfile

herbie shell --seed '#(1070864556 424010669 783715395 1203517814 4070606583 4107618214)' 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  (* w0 (sqrt (- 1 (* (pow (/ (* M D) (* 2 d)) 2) (/ h l))))))