Average Error: 59.1 → 33.4
Time: 12.5s
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 r179952 = c0;
        double r179953 = 2.0;
        double r179954 = w;
        double r179955 = r179953 * r179954;
        double r179956 = r179952 / r179955;
        double r179957 = d;
        double r179958 = r179957 * r179957;
        double r179959 = r179952 * r179958;
        double r179960 = h;
        double r179961 = r179954 * r179960;
        double r179962 = D;
        double r179963 = r179962 * r179962;
        double r179964 = r179961 * r179963;
        double r179965 = r179959 / r179964;
        double r179966 = r179965 * r179965;
        double r179967 = M;
        double r179968 = r179967 * r179967;
        double r179969 = r179966 - r179968;
        double r179970 = sqrt(r179969);
        double r179971 = r179965 + r179970;
        double r179972 = r179956 * r179971;
        return r179972;
}

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 r179973 = c0;
        double r179974 = 0.0;
        double r179975 = r179973 * r179974;
        return r179975;
}

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

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

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

    \[\leadsto c0 \cdot 0\]

Reproduce

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