Average Error: 59.3 → 33.8
Time: 28.6s
Precision: 64
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)\]
\[0\]
\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
0
double f(double c0, double w, double h, double D, double d, double M) {
        double r193733 = c0;
        double r193734 = 2.0;
        double r193735 = w;
        double r193736 = r193734 * r193735;
        double r193737 = r193733 / r193736;
        double r193738 = d;
        double r193739 = r193738 * r193738;
        double r193740 = r193733 * r193739;
        double r193741 = h;
        double r193742 = r193735 * r193741;
        double r193743 = D;
        double r193744 = r193743 * r193743;
        double r193745 = r193742 * r193744;
        double r193746 = r193740 / r193745;
        double r193747 = r193746 * r193746;
        double r193748 = M;
        double r193749 = r193748 * r193748;
        double r193750 = r193747 - r193749;
        double r193751 = sqrt(r193750);
        double r193752 = r193746 + r193751;
        double r193753 = r193737 * r193752;
        return r193753;
}

double f(double __attribute__((unused)) c0, double __attribute__((unused)) w, double __attribute__((unused)) h, double __attribute__((unused)) D, double __attribute__((unused)) d, double __attribute__((unused)) M) {
        double r193754 = 0.0;
        return r193754;
}

Error

Bits error versus c0

Bits error versus w

Bits error versus h

Bits error versus D

Bits error versus d

Bits error versus M

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 59.3

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)\]
  2. Taylor expanded around inf 35.7

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt35.7

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\sqrt{0} \cdot \sqrt{0}\right)}\]
  5. Applied associate-*r*35.7

    \[\leadsto \color{blue}{\left(\frac{c0}{2 \cdot w} \cdot \sqrt{0}\right) \cdot \sqrt{0}}\]
  6. Simplified33.8

    \[\leadsto \color{blue}{0} \cdot \sqrt{0}\]
  7. Final simplification33.8

    \[\leadsto 0\]

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(FPCore (c0 w h D d M)
  :name "Henrywood and Agarwal, Equation (13)"
  :precision binary64
  (* (/ c0 (* 2 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))