Average Error: 13.7 → 8.6
Time: 2.8m
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{\left(\left(\frac{M}{d} \cdot \frac{D}{2}\right) \cdot \left(\frac{M}{d} \cdot \frac{D}{2}\right)\right) \cdot h}{\ell}} = -\infty:\\ \;\;\;\;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{if}\;w0 \cdot \sqrt{1 - \frac{\left(\left(\frac{M}{d} \cdot \frac{D}{2}\right) \cdot \left(\frac{M}{d} \cdot \frac{D}{2}\right)\right) \cdot h}{\ell}} \le -1.100318452722152 \cdot 10^{-36}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\left(\left(\frac{M}{d} \cdot \frac{D}{2}\right) \cdot \left(\frac{M}{d} \cdot \frac{D}{2}\right)\right) \cdot h}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;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}}\\ \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) (/ D 2)) (* (/ M d) (/ D 2))) h) l)))) < -inf.0

    1. Initial program 56.0

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

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

      \[\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 -inf.0 < (* w0 (sqrt (- 1 (/ (* (* (* (/ M d) (/ D 2)) (* (/ M d) (/ D 2))) h) l)))) < -1.100318452722152e-36

    1. Initial program 6.0

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

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

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

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

      \[\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 associate-*r/0.9

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

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

    if -1.100318452722152e-36 < (* w0 (sqrt (- 1 (/ (* (* (* (/ M d) (/ D 2)) (* (/ M d) (/ D 2))) h) l))))

    1. Initial program 11.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 div-inv11.3

      \[\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*8.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 unpow28.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*6.7

      \[\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}}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 2.8m)Debug logProfile

herbie shell --seed '#(1072840222 1305617769 1692503039 1353360431 4178980589 1488672652)' +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))))))