Average Error: 59.1 → 33.5
Time: 9.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)\]
\[c0 \cdot 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)
c0 \cdot 0
double f(double c0, double w, double h, double D, double d, double M) {
        double r168607 = c0;
        double r168608 = 2.0;
        double r168609 = w;
        double r168610 = r168608 * r168609;
        double r168611 = r168607 / r168610;
        double r168612 = d;
        double r168613 = r168612 * r168612;
        double r168614 = r168607 * r168613;
        double r168615 = h;
        double r168616 = r168609 * r168615;
        double r168617 = D;
        double r168618 = r168617 * r168617;
        double r168619 = r168616 * r168618;
        double r168620 = r168614 / r168619;
        double r168621 = r168620 * r168620;
        double r168622 = M;
        double r168623 = r168622 * r168622;
        double r168624 = r168621 - r168623;
        double r168625 = sqrt(r168624);
        double r168626 = r168620 + r168625;
        double r168627 = r168611 * r168626;
        return r168627;
}

double f(double c0, double __attribute__((unused)) w, double __attribute__((unused)) h, double __attribute__((unused)) D, double __attribute__((unused)) d, double __attribute__((unused)) M) {
        double r168628 = c0;
        double r168629 = 0.0;
        double r168630 = r168628 * r168629;
        return r168630;
}

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

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

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0}\]
  3. Using strategy rm
  4. Applied div-inv35.3

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

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

    \[\leadsto c0 \cdot \color{blue}{0}\]
  7. Final simplification33.5

    \[\leadsto c0 \cdot 0\]

Reproduce

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