Average Error: 13.4 → 8.2
Time: 25.3s
Precision: 64
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
\[w0 \cdot \sqrt{1 - \frac{\left(D \cdot M\right) \cdot \frac{1}{2 \cdot d}}{\frac{\ell}{\frac{1}{\frac{2 \cdot d}{D \cdot M}} \cdot h}}}\]
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
w0 \cdot \sqrt{1 - \frac{\left(D \cdot M\right) \cdot \frac{1}{2 \cdot d}}{\frac{\ell}{\frac{1}{\frac{2 \cdot d}{D \cdot M}} \cdot h}}}
double f(double w0, double M, double D, double h, double l, double d) {
        double r4899804 = w0;
        double r4899805 = 1.0;
        double r4899806 = M;
        double r4899807 = D;
        double r4899808 = r4899806 * r4899807;
        double r4899809 = 2.0;
        double r4899810 = d;
        double r4899811 = r4899809 * r4899810;
        double r4899812 = r4899808 / r4899811;
        double r4899813 = pow(r4899812, r4899809);
        double r4899814 = h;
        double r4899815 = l;
        double r4899816 = r4899814 / r4899815;
        double r4899817 = r4899813 * r4899816;
        double r4899818 = r4899805 - r4899817;
        double r4899819 = sqrt(r4899818);
        double r4899820 = r4899804 * r4899819;
        return r4899820;
}

double f(double w0, double M, double D, double h, double l, double d) {
        double r4899821 = w0;
        double r4899822 = 1.0;
        double r4899823 = D;
        double r4899824 = M;
        double r4899825 = r4899823 * r4899824;
        double r4899826 = 2.0;
        double r4899827 = d;
        double r4899828 = r4899826 * r4899827;
        double r4899829 = r4899822 / r4899828;
        double r4899830 = r4899825 * r4899829;
        double r4899831 = l;
        double r4899832 = r4899828 / r4899825;
        double r4899833 = r4899822 / r4899832;
        double r4899834 = h;
        double r4899835 = r4899833 * r4899834;
        double r4899836 = r4899831 / r4899835;
        double r4899837 = r4899830 / r4899836;
        double r4899838 = r4899822 - r4899837;
        double r4899839 = sqrt(r4899838);
        double r4899840 = r4899821 * r4899839;
        return r4899840;
}

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. Initial program 13.4

    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\]
  2. Simplified11.6

    \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{\frac{\ell}{h}}{\frac{M \cdot D}{2 \cdot d}}}} \cdot w0}\]
  3. Using strategy rm
  4. Applied associate-/l/8.2

    \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{\ell}{\frac{M \cdot D}{2 \cdot d} \cdot h}}}} \cdot w0\]
  5. Using strategy rm
  6. Applied clear-num8.1

    \[\leadsto \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{\color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}} \cdot h}}} \cdot w0\]
  7. Using strategy rm
  8. Applied div-inv8.2

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

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

Reproduce

herbie shell --seed 2019141 +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))))))