Average Error: 13.9 → 8.5
Time: 36.3s
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}\;\frac{h}{\ell} = -\infty:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\sqrt[3]{\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}} \cdot \sqrt[3]{\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}}\right) \cdot \sqrt[3]{\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}}}\\ \mathbf{elif}\;\frac{h}{\ell} \le 657036237264.0234:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{h}{\ell} \cdot \frac{M \cdot D}{2 \cdot d}\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt[3]{\left(\sqrt{1 - \frac{h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell}} \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell}}\right) \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\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 3 regimes
  2. if (/ h l) < -inf.0

    1. Initial program 61.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 associate-*r/25.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 unpow225.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*21.3

      \[\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 add-cube-cbrt21.4

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

    if -inf.0 < (/ h l) < 657036237264.0234

    1. Initial program 10.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 unpow210.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*9.1

      \[\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 657036237264.0234 < (/ h l)

    1. Initial program 11.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 associate-*r/0.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} = -\infty:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\sqrt[3]{\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}} \cdot \sqrt[3]{\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}}\right) \cdot \sqrt[3]{\frac{\left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{M \cdot D}{2 \cdot d}}{\ell}}}\\ \mathbf{elif}\;\frac{h}{\ell} \le 657036237264.0234:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{h}{\ell} \cdot \frac{M \cdot D}{2 \cdot d}\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt[3]{\left(\sqrt{1 - \frac{h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell}} \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell}}\right) \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell}}}\\ \end{array}\]

Runtime

Time bar (total: 36.3s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes9.38.57.51.840.8%
herbie shell --seed 2018295 +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))))))