Average Error: 59.6 → 27.7
Time: 24.6s
Precision: binary64
Cost: 21314
\[\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)\]
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 5.8123201035385834 \cdot 10^{+51}:\\ \;\;\;\;0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{D \cdot \left(D \cdot h\right)}{d}}{d}\\ \mathbf{elif}\;M \cdot M \leq 1.1046437598229507 \cdot 10^{+252}:\\ \;\;\;\;0.25 \cdot \frac{\left(\left(M \cdot M\right) \cdot \frac{h}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D \cdot D}{\sqrt[3]{d}}}{d}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(M \cdot \frac{h \cdot \left(D \cdot D\right)}{d}\right)}{d}\\ \end{array}\]
\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)
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 5.8123201035385834 \cdot 10^{+51}:\\
\;\;\;\;0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{D \cdot \left(D \cdot h\right)}{d}}{d}\\

\mathbf{elif}\;M \cdot M \leq 1.1046437598229507 \cdot 10^{+252}:\\
\;\;\;\;0.25 \cdot \frac{\left(\left(M \cdot M\right) \cdot \frac{h}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D \cdot D}{\sqrt[3]{d}}}{d}\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{M \cdot \left(M \cdot \frac{h \cdot \left(D \cdot D\right)}{d}\right)}{d}\\

\end{array}
(FPCore (c0 w h D d M)
 :precision binary64
 (*
  (/ 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))))))
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* M M) 5.8123201035385834e+51)
   (* 0.25 (/ (* (* M M) (/ (* D (* D h)) d)) d))
   (if (<= (* M M) 1.1046437598229507e+252)
     (*
      0.25
      (/ (* (* (* M M) (/ h (* (cbrt d) (cbrt d)))) (/ (* D D) (cbrt d))) d))
     (* 0.25 (/ (* M (* M (/ (* h (* D D)) d))) d)))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (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)));
}
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((M * M) <= 5.8123201035385834e+51) {
		tmp = 0.25 * (((M * M) * ((D * (D * h)) / d)) / d);
	} else if ((M * M) <= 1.1046437598229507e+252) {
		tmp = 0.25 * ((((M * M) * (h / (cbrt(d) * cbrt(d)))) * ((D * D) / cbrt(d))) / d);
	} else {
		tmp = 0.25 * ((M * (M * ((h * (D * D)) / d))) / d);
	}
	return tmp;
}

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

Alternatives

Alternative 1
Error60.4
Cost30656
\[\frac{c0}{2 \cdot w} \cdot \left(\sqrt[3]{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}} \cdot \left(\sqrt[3]{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}} \cdot \sqrt[3]{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}}\right) + \sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - M \cdot M}\right)\]
Alternative 2
Error62.8
Cost28736
\[\frac{c0}{2 \cdot w} \cdot \left(\sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - M \cdot M} + e^{\log \left(\frac{c0}{h \cdot w}\right) + 2 \cdot \log \left(\frac{d}{D}\right)}\right)\]
Alternative 3
Error62.8
Cost28736
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} + \sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot e^{\log \left(\frac{c0}{h \cdot w}\right) + 2 \cdot \log \left(\frac{d}{D}\right)} - M \cdot M}\right)\]
Alternative 4
Error57.0
Cost26304
\[0.25 \cdot e^{\log h + 2 \cdot \left(\log \left(M \cdot D\right) - \log d\right)}\]
Alternative 5
Error41.8
Cost23104
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \left(\sqrt[3]{\frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0}} \cdot \left(\sqrt[3]{\frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0}} \cdot \sqrt[3]{\frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0}}\right)\right)\right)\]
Alternative 6
Error62.6
Cost22464
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} + \sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \log \left(e^{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}}\right) - M \cdot M}\right)\]
Alternative 7
Error49.2
Cost22080
\[\frac{c0}{2 \cdot w} \cdot \frac{M \cdot M}{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - \sqrt{\frac{c0}{h \cdot w} \cdot \frac{c0 \cdot {d}^{4}}{\left(h \cdot w\right) \cdot {D}^{4}} - M \cdot M}}\]
Alternative 8
Error36.0
Cost21952
\[0.25 \cdot \left(\sqrt[3]{\frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}} \cdot \left(\sqrt[3]{\frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}} \cdot \sqrt[3]{\frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}}\right)\right)\]
Alternative 9
Error41.8
Cost21568
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\sqrt[3]{\left(d \cdot d\right) \cdot c0} \cdot \left(\sqrt[3]{\left(d \cdot d\right) \cdot c0} \cdot \sqrt[3]{\left(d \cdot d\right) \cdot c0}\right)}\right)\]
Alternative 10
Error39.1
Cost20608
\[\log \left({\left(e^{\frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0}}\right)}^{\left(0.25 \cdot \frac{c0}{w}\right)}\right)\]
Alternative 11
Error32.4
Cost20416
\[0.25 \cdot \frac{\left(\left(M \cdot M\right) \cdot \frac{h}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D \cdot D}{\sqrt[3]{d}}}{d}\]
Alternative 12
Error32.9
Cost20416
\[0.25 \cdot \frac{\frac{h \cdot \left(D \cdot D\right)}{d} \cdot \frac{M \cdot M}{\sqrt[3]{d} \cdot \sqrt[3]{d}}}{\sqrt[3]{d}}\]
Alternative 13
Error33.1
Cost20416
\[0.25 \cdot \left(\frac{M \cdot M}{\sqrt[3]{d} \cdot \sqrt[3]{d}} \cdot \frac{\frac{h \cdot \left(D \cdot D\right)}{d}}{\sqrt[3]{d}}\right)\]
Alternative 14
Error52.8
Cost20032
\[0.25 \cdot \frac{e^{\log h + 2 \cdot \log \left(M \cdot D\right)}}{d \cdot d}\]
Alternative 15
Error48.5
Cost20032
\[0.25 \cdot \frac{e^{2 \cdot \log \left(M \cdot D\right) + \log \left(\frac{h}{d}\right)}}{d}\]
Alternative 16
Error47.9
Cost20032
\[0.25 \cdot e^{\log \left(h \cdot \left(D \cdot D\right)\right) + 2 \cdot \log \left(\frac{M}{d}\right)}\]
Alternative 17
Error61.7
Cost15616
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} + \sqrt{\frac{c0}{h \cdot w} \cdot \left(\frac{c0}{h \cdot w} \cdot \left(\frac{d}{D} \cdot {\left(\frac{d}{D}\right)}^{3}\right)\right) - M \cdot M}\right)\]
Alternative 18
Error37.4
Cost14656
\[0.25 \cdot \left(\sqrt{\frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}}\right)\]
Alternative 19
Error52.5
Cost14528
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot \sqrt{c0}\right) \cdot \left(d \cdot \sqrt{c0}\right)}\right)\]
Alternative 20
Error43.2
Cost14400
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot e^{\log \left(\frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0}\right)}\right)\]
Alternative 21
Error36.1
Cost14272
\[0.25 \cdot \frac{\left(M \cdot \sqrt{\frac{h \cdot \left(D \cdot D\right)}{d}}\right) \cdot \left(M \cdot \sqrt{\frac{h \cdot \left(D \cdot D\right)}{d}}\right)}{d}\]
Alternative 22
Error47.3
Cost13888
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{\left(D \cdot \sqrt{h}\right) \cdot \left(D \cdot \sqrt{h}\right)}{d}}{d}\]
Alternative 23
Error48.2
Cost13888
\[0.25 \cdot \frac{\left(\left(M \cdot M\right) \cdot \frac{h}{\sqrt{d}}\right) \cdot \frac{D \cdot D}{\sqrt{d}}}{d}\]
Alternative 24
Error48.2
Cost13888
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(\frac{h}{\sqrt{d}} \cdot \frac{D \cdot D}{\sqrt{d}}\right)}{d}\]
Alternative 25
Error49.3
Cost13888
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(\left(D \cdot \sqrt{h}\right) \cdot \left(D \cdot \sqrt{h}\right)\right)}{d \cdot d}\]
Alternative 26
Error34.9
Cost13824
\[0.25 \cdot \frac{\sqrt[3]{{\left(\left(M \cdot M\right) \cdot \frac{h \cdot \left(D \cdot D\right)}{d}\right)}^{3}}}{d}\]
Alternative 27
Error39.0
Cost13760
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot e^{\log \left(\frac{h \cdot \left(D \cdot D\right)}{d}\right)}}{d}\]
Alternative 28
Error40.5
Cost13760
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{e^{\log \left(h \cdot \left(D \cdot D\right)\right)}}{d}}{d}\]
Alternative 29
Error42.9
Cost13760
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot e^{\log \left(h \cdot \left(D \cdot D\right)\right)}}{d \cdot d}\]
Alternative 30
Error60.3
Cost9664
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} + \sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot \frac{c0}{h \cdot w}}{D \cdot D} - M \cdot M}\right)\]
Alternative 31
Error60.3
Cost9664
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} + \sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \left(\frac{c0}{h \cdot w} \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)\]
Alternative 32
Error59.6
Cost9664
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} + \sqrt{\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} - M \cdot M}\right)\]
Alternative 33
Error62.6
Cost7936
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)} + \sqrt{-M \cdot M}\right)\]
Alternative 34
Error52.0
Cost7040
\[\frac{c0}{2 \cdot w} \cdot \sqrt{-M \cdot M}\]
Alternative 35
Error41.8
Cost1600
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0}\right)\]
Alternative 36
Error41.2
Cost1600
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{d \cdot \left(d \cdot c0\right)}\right)\]
Alternative 37
Error38.5
Cost1600
\[\frac{c0 \cdot \left(0.5 \cdot \frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0}\right)}{2 \cdot w}\]
Alternative 38
Error39.7
Cost1600
\[\frac{c0 \cdot \left(0.5 \cdot \left(\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w\right)\right)}{\left(2 \cdot w\right) \cdot \left(\left(d \cdot d\right) \cdot c0\right)}\]
Alternative 39
Error39.7
Cost1600
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{w \cdot \left(M \cdot \left(M \cdot \left(h \cdot \left(D \cdot D\right)\right)\right)\right)}{\left(d \cdot d\right) \cdot c0}\right)\]
Alternative 40
Error43.6
Cost1600
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{w}{c0}}{d \cdot d}\right)\]
Alternative 41
Error40.5
Cost1600
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{w}{\frac{c0}{\frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}}}\right)\]
Alternative 42
Error43.3
Cost1600
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \left(\frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d} \cdot \frac{w}{c0}\right)\right)\]
Alternative 43
Error41.9
Cost1600
\[\frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{w \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot c0}\right)\]
Alternative 44
Error38.5
Cost1472
\[c0 \cdot \left(\frac{\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w}{\left(d \cdot d\right) \cdot c0} \cdot \frac{0.25}{w}\right)\]
Alternative 45
Error41.8
Cost1472
\[\frac{\left(\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot w\right) \cdot \left(0.25 \cdot \frac{c0}{w}\right)}{\left(d \cdot d\right) \cdot c0}\]
Alternative 46
Error59.6
Cost1344
\[\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\left(d \cdot d\right) \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right)\]
Alternative 47
Error36.2
Cost1088
\[0.25 \cdot \left(\left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\]
Alternative 48
Error32.9
Cost1088
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{1}{\frac{d}{h \cdot \left(D \cdot D\right)}}}{d}\]
Alternative 49
Error35.5
Cost960
\[\frac{h \cdot \left(\left(M \cdot M\right) \cdot \left(D \cdot D\right)\right)}{d \cdot d} \cdot 0.25\]
Alternative 50
Error32.9
Cost960
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{h \cdot \left(D \cdot D\right)}{d}}{d}\]
Alternative 51
Error33.7
Cost960
\[0.25 \cdot \frac{h \cdot \left(D \cdot D\right)}{\frac{d}{\frac{M \cdot M}{d}}}\]
Alternative 52
Error32.9
Cost960
\[0.25 \cdot \left(\frac{h \cdot \left(D \cdot D\right)}{d} \cdot \frac{M \cdot M}{d}\right)\]
Alternative 53
Error32.9
Cost960
\[0.25 \cdot \frac{\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{D \cdot D}{d}}{d}\]
Alternative 54
Error36.0
Cost960
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d \cdot d}\]
Alternative 55
Error32.1
Cost960
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{h}{\frac{d}{D \cdot D}}}{d}\]
Alternative 56
Error30.5
Cost960
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{D \cdot \left(h \cdot D\right)}{d}}{d}\]
Alternative 57
Error29.3
Cost960
\[0.25 \cdot \frac{M \cdot \left(M \cdot \frac{h \cdot \left(D \cdot D\right)}{d}\right)}{d}\]
Alternative 58
Error32.1
Cost960
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(h \cdot \frac{D \cdot D}{d}\right)}{d}\]
Alternative 59
Error34.1
Cost960
\[0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(D \cdot \left(h \cdot D\right)\right)}{d \cdot d}\]
Alternative 60
Error33.2
Cost960
\[0.25 \cdot \frac{M \cdot \left(M \cdot \left(h \cdot \left(D \cdot D\right)\right)\right)}{d \cdot d}\]
Alternative 61
Error61.9
Cost64
\[1\]
Alternative 62
Error32.3
Cost64
\[0\]
Alternative 63
Error61.9
Cost64
\[-1\]

Error

Derivation

  1. Split input into 3 regimes
  2. if (*.f64 M M) < 5.81232010353858337e51

    1. Initial program 57.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 37.5

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{w \cdot \left({M}^{2} \cdot \left({D}^{2} \cdot h\right)\right)}{c0 \cdot {d}^{2}}\right)}\]
    3. Simplified37.5

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{w \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right)}{c0 \cdot \left(d \cdot d\right)}\right)}\]
    4. Taylor expanded around 0 30.7

      \[\leadsto \color{blue}{0.25 \cdot \frac{{M}^{2} \cdot \left({D}^{2} \cdot h\right)}{{d}^{2}}}\]
    5. Simplified30.7

      \[\leadsto \color{blue}{\frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)}{d \cdot d} \cdot 0.25}\]
    6. Using strategy rm
    7. Applied associate-/r*_binary64_70427.5

      \[\leadsto \color{blue}{\frac{\frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)}{d}}{d}} \cdot 0.25\]
    8. Simplified27.1

      \[\leadsto \frac{\color{blue}{\left(M \cdot M\right) \cdot \frac{h \cdot \left(D \cdot D\right)}{d}}}{d} \cdot 0.25\]
    9. Using strategy rm
    10. Applied associate-*r*_binary64_70024.5

      \[\leadsto \frac{\left(M \cdot M\right) \cdot \frac{\color{blue}{\left(h \cdot D\right) \cdot D}}{d}}{d} \cdot 0.25\]
    11. Simplified24.5

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{D \cdot \left(h \cdot D\right)}{d}}{d}}\]

    if 5.81232010353858337e51 < (*.f64 M M) < 1.10464375982295069e252

    1. Initial program 62.6

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{w \cdot \left({M}^{2} \cdot \left({D}^{2} \cdot h\right)\right)}{c0 \cdot {d}^{2}}\right)}\]
    3. Simplified40.4

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{w \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right)}{c0 \cdot \left(d \cdot d\right)}\right)}\]
    4. Taylor expanded around 0 33.5

      \[\leadsto \color{blue}{0.25 \cdot \frac{{M}^{2} \cdot \left({D}^{2} \cdot h\right)}{{d}^{2}}}\]
    5. Simplified33.5

      \[\leadsto \color{blue}{\frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)}{d \cdot d} \cdot 0.25}\]
    6. Using strategy rm
    7. Applied associate-/r*_binary64_70431.3

      \[\leadsto \color{blue}{\frac{\frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)}{d}}{d}} \cdot 0.25\]
    8. Simplified29.9

      \[\leadsto \frac{\color{blue}{\left(M \cdot M\right) \cdot \frac{h \cdot \left(D \cdot D\right)}{d}}}{d} \cdot 0.25\]
    9. Using strategy rm
    10. Applied add-cube-cbrt_binary64_79530.1

      \[\leadsto \frac{\left(M \cdot M\right) \cdot \frac{h \cdot \left(D \cdot D\right)}{\color{blue}{\left(\sqrt[3]{d} \cdot \sqrt[3]{d}\right) \cdot \sqrt[3]{d}}}}{d} \cdot 0.25\]
    11. Applied times-frac_binary64_76628.8

      \[\leadsto \frac{\left(M \cdot M\right) \cdot \color{blue}{\left(\frac{h}{\sqrt[3]{d} \cdot \sqrt[3]{d}} \cdot \frac{D \cdot D}{\sqrt[3]{d}}\right)}}{d} \cdot 0.25\]
    12. Applied associate-*r*_binary64_70028.5

      \[\leadsto \frac{\color{blue}{\left(\left(M \cdot M\right) \cdot \frac{h}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D \cdot D}{\sqrt[3]{d}}}}{d} \cdot 0.25\]
    13. Simplified28.5

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(\left(M \cdot M\right) \cdot \frac{h}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D \cdot D}{\sqrt[3]{d}}}{d}}\]

    if 1.10464375982295069e252 < (*.f64 M M)

    1. Initial program 64.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)\]
    2. Taylor expanded around -inf 59.4

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{w \cdot \left({M}^{2} \cdot \left({D}^{2} \cdot h\right)\right)}{c0 \cdot {d}^{2}}\right)}\]
    3. Simplified59.4

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{w \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot \left(D \cdot D\right)\right)\right)}{c0 \cdot \left(d \cdot d\right)}\right)}\]
    4. Taylor expanded around 0 58.3

      \[\leadsto \color{blue}{0.25 \cdot \frac{{M}^{2} \cdot \left({D}^{2} \cdot h\right)}{{d}^{2}}}\]
    5. Simplified58.3

      \[\leadsto \color{blue}{\frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)}{d \cdot d} \cdot 0.25}\]
    6. Using strategy rm
    7. Applied associate-/r*_binary64_70457.8

      \[\leadsto \color{blue}{\frac{\frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)}{d}}{d}} \cdot 0.25\]
    8. Simplified57.6

      \[\leadsto \frac{\color{blue}{\left(M \cdot M\right) \cdot \frac{h \cdot \left(D \cdot D\right)}{d}}}{d} \cdot 0.25\]
    9. Using strategy rm
    10. Applied associate-*l*_binary64_70139.5

      \[\leadsto \frac{\color{blue}{M \cdot \left(M \cdot \frac{h \cdot \left(D \cdot D\right)}{d}\right)}}{d} \cdot 0.25\]
    11. Simplified39.5

      \[\leadsto \color{blue}{0.25 \cdot \frac{M \cdot \left(M \cdot \frac{h \cdot \left(D \cdot D\right)}{d}\right)}{d}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification27.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot M \leq 5.8123201035385834 \cdot 10^{+51}:\\ \;\;\;\;0.25 \cdot \frac{\left(M \cdot M\right) \cdot \frac{D \cdot \left(D \cdot h\right)}{d}}{d}\\ \mathbf{elif}\;M \cdot M \leq 1.1046437598229507 \cdot 10^{+252}:\\ \;\;\;\;0.25 \cdot \frac{\left(\left(M \cdot M\right) \cdot \frac{h}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D \cdot D}{\sqrt[3]{d}}}{d}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(M \cdot \frac{h \cdot \left(D \cdot D\right)}{d}\right)}{d}\\ \end{array}\]

Reproduce

herbie shell --seed 2021022 
(FPCore (c0 w h D d M)
  :name "Henrywood and Agarwal, Equation (13)"
  :precision binary64
  (* (/ 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))))))