Average Error: 59.4 → 33.8
Time: 9.2s
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 r250083 = c0;
        double r250084 = 2.0;
        double r250085 = w;
        double r250086 = r250084 * r250085;
        double r250087 = r250083 / r250086;
        double r250088 = d;
        double r250089 = r250088 * r250088;
        double r250090 = r250083 * r250089;
        double r250091 = h;
        double r250092 = r250085 * r250091;
        double r250093 = D;
        double r250094 = r250093 * r250093;
        double r250095 = r250092 * r250094;
        double r250096 = r250090 / r250095;
        double r250097 = r250096 * r250096;
        double r250098 = M;
        double r250099 = r250098 * r250098;
        double r250100 = r250097 - r250099;
        double r250101 = sqrt(r250100);
        double r250102 = r250096 + r250101;
        double r250103 = r250087 * r250102;
        return r250103;
}

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 r250104 = c0;
        double r250105 = 0.0;
        double r250106 = r250104 * r250105;
        return r250106;
}

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

    \[\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 div-inv35.7

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

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

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

    \[\leadsto c0 \cdot 0\]

Reproduce

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