Average Error: 59.8 → 33.9
Time: 27.7s
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 r213191 = c0;
        double r213192 = 2.0;
        double r213193 = w;
        double r213194 = r213192 * r213193;
        double r213195 = r213191 / r213194;
        double r213196 = d;
        double r213197 = r213196 * r213196;
        double r213198 = r213191 * r213197;
        double r213199 = h;
        double r213200 = r213193 * r213199;
        double r213201 = D;
        double r213202 = r213201 * r213201;
        double r213203 = r213200 * r213202;
        double r213204 = r213198 / r213203;
        double r213205 = r213204 * r213204;
        double r213206 = M;
        double r213207 = r213206 * r213206;
        double r213208 = r213205 - r213207;
        double r213209 = sqrt(r213208);
        double r213210 = r213204 + r213209;
        double r213211 = r213195 * r213210;
        return r213211;
}

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 r213212 = c0;
        double r213213 = 0.0;
        double r213214 = r213212 * r213213;
        return r213214;
}

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

    \[\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 36.0

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

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

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

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

    \[\leadsto c0 \cdot 0\]

Reproduce

herbie shell --seed 2019195 +o rules:numerics
(FPCore (c0 w h D d M)
  :name "Henrywood and Agarwal, Equation (13)"
  (* (/ c0 (* 2.0 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))))))