Average Error: 59.6 → 18.4
Time: 17.3s
Precision: binary64
\[\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} t_0 := c0 \cdot \left(d \cdot d\right)\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := \frac{t_0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_3 := \sqrt{t_2 \cdot t_2 - M \cdot M}\\ t_4 := t_1 \cdot \left(t_2 + t_3\right)\\ \mathbf{if}\;t_4 \leq -6.542250497973475 \cdot 10^{-192}:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)\\ \mathbf{elif}\;t_4 \leq 1.2437690935092787 \cdot 10^{-234}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(D \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)}{d}\\ \mathbf{elif}\;t_4 \leq 6.010296328010264 \cdot 10^{+168}:\\ \;\;\;\;t_1 \cdot \left(t_3 + t_0 \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}{\frac{d}{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
 (let* ((t_0 (* c0 (* d d)))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (/ t_0 (* (* w h) (* D D))))
        (t_3 (sqrt (- (* t_2 t_2) (* M M))))
        (t_4 (* t_1 (+ t_2 t_3))))
   (if (<= t_4 -6.542250497973475e-192)
     (* t_1 (* 2.0 (* (* (/ d D) (/ d D)) (/ c0 (* w h)))))
     (if (<= t_4 1.2437690935092787e-234)
       (* 0.25 (/ (* M (* D (* M (* h (/ D d))))) d))
       (if (<= t_4 6.010296328010264e+168)
         (* t_1 (+ t_3 (* t_0 (/ 1.0 (* w (* h (* D D)))))))
         (* 0.25 (/ (* (* M (/ D d)) (* h M)) (/ 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 t_0 = c0 * (d * d);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_0 / ((w * h) * (D * D));
	double t_3 = sqrt(((t_2 * t_2) - (M * M)));
	double t_4 = t_1 * (t_2 + t_3);
	double tmp;
	if (t_4 <= -6.542250497973475e-192) {
		tmp = t_1 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
	} else if (t_4 <= 1.2437690935092787e-234) {
		tmp = 0.25 * ((M * (D * (M * (h * (D / d))))) / d);
	} else if (t_4 <= 6.010296328010264e+168) {
		tmp = t_1 * (t_3 + (t_0 * (1.0 / (w * (h * (D * D))))));
	} else {
		tmp = 0.25 * (((M * (D / d)) * (h * M)) / (d / D));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = (c0 / (2.0d0 * w)) * (((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) + sqrt(((((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d)))) - (m * m))))
end function
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = c0 * (d_1 * d_1)
    t_1 = c0 / (2.0d0 * w)
    t_2 = t_0 / ((w * h) * (d * d))
    t_3 = sqrt(((t_2 * t_2) - (m * m)))
    t_4 = t_1 * (t_2 + t_3)
    if (t_4 <= (-6.542250497973475d-192)) then
        tmp = t_1 * (2.0d0 * (((d_1 / d) * (d_1 / d)) * (c0 / (w * h))))
    else if (t_4 <= 1.2437690935092787d-234) then
        tmp = 0.25d0 * ((m * (d * (m * (h * (d / d_1))))) / d_1)
    else if (t_4 <= 6.010296328010264d+168) then
        tmp = t_1 * (t_3 + (t_0 * (1.0d0 / (w * (h * (d * d))))))
    else
        tmp = 0.25d0 * (((m * (d / d_1)) * (h * m)) / (d_1 / d))
    end if
    code = tmp
end function
public static 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))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 * (d * d);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_0 / ((w * h) * (D * D));
	double t_3 = Math.sqrt(((t_2 * t_2) - (M * M)));
	double t_4 = t_1 * (t_2 + t_3);
	double tmp;
	if (t_4 <= -6.542250497973475e-192) {
		tmp = t_1 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
	} else if (t_4 <= 1.2437690935092787e-234) {
		tmp = 0.25 * ((M * (D * (M * (h * (D / d))))) / d);
	} else if (t_4 <= 6.010296328010264e+168) {
		tmp = t_1 * (t_3 + (t_0 * (1.0 / (w * (h * (D * D))))));
	} else {
		tmp = 0.25 * (((M * (D / d)) * (h * M)) / (d / D));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))))
def code(c0, w, h, D, d, M):
	t_0 = c0 * (d * d)
	t_1 = c0 / (2.0 * w)
	t_2 = t_0 / ((w * h) * (D * D))
	t_3 = math.sqrt(((t_2 * t_2) - (M * M)))
	t_4 = t_1 * (t_2 + t_3)
	tmp = 0
	if t_4 <= -6.542250497973475e-192:
		tmp = t_1 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))))
	elif t_4 <= 1.2437690935092787e-234:
		tmp = 0.25 * ((M * (D * (M * (h * (D / d))))) / d)
	elif t_4 <= 6.010296328010264e+168:
		tmp = t_1 * (t_3 + (t_0 * (1.0 / (w * (h * (D * D))))))
	else:
		tmp = 0.25 * (((M * (D / d)) * (h * M)) / (d / D))
	return tmp
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M)))))
end
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 * Float64(d * d))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(t_0 / Float64(Float64(w * h) * Float64(D * D)))
	t_3 = sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M)))
	t_4 = Float64(t_1 * Float64(t_2 + t_3))
	tmp = 0.0
	if (t_4 <= -6.542250497973475e-192)
		tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 / Float64(w * h)))));
	elseif (t_4 <= 1.2437690935092787e-234)
		tmp = Float64(0.25 * Float64(Float64(M * Float64(D * Float64(M * Float64(h * Float64(D / d))))) / d));
	elseif (t_4 <= 6.010296328010264e+168)
		tmp = Float64(t_1 * Float64(t_3 + Float64(t_0 * Float64(1.0 / Float64(w * Float64(h * Float64(D * D)))))));
	else
		tmp = Float64(0.25 * Float64(Float64(Float64(M * Float64(D / d)) * Float64(h * M)) / Float64(d / D)));
	end
	return tmp
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (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))));
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 * (d * d);
	t_1 = c0 / (2.0 * w);
	t_2 = t_0 / ((w * h) * (D * D));
	t_3 = sqrt(((t_2 * t_2) - (M * M)));
	t_4 = t_1 * (t_2 + t_3);
	tmp = 0.0;
	if (t_4 <= -6.542250497973475e-192)
		tmp = t_1 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
	elseif (t_4 <= 1.2437690935092787e-234)
		tmp = 0.25 * ((M * (D * (M * (h * (D / d))))) / d);
	elseif (t_4 <= 6.010296328010264e+168)
		tmp = t_1 * (t_3 + (t_0 * (1.0 / (w * (h * (D * D))))));
	else
		tmp = 0.25 * (((M * (D / d)) * (h * M)) / (d / D));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -6.542250497973475e-192], N[(t$95$1 * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 1.2437690935092787e-234], N[(0.25 * N[(N[(M * N[(D * N[(M * N[(h * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 6.010296328010264e+168], N[(t$95$1 * N[(t$95$3 + N[(t$95$0 * N[(1.0 / N[(w * N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * M), $MachinePrecision]), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\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}
t_0 := c0 \cdot \left(d \cdot d\right)\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{t_0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := \sqrt{t_2 \cdot t_2 - M \cdot M}\\
t_4 := t_1 \cdot \left(t_2 + t_3\right)\\
\mathbf{if}\;t_4 \leq -6.542250497973475 \cdot 10^{-192}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)\\

\mathbf{elif}\;t_4 \leq 1.2437690935092787 \cdot 10^{-234}:\\
\;\;\;\;0.25 \cdot \frac{M \cdot \left(D \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)}{d}\\

\mathbf{elif}\;t_4 \leq 6.010296328010264 \cdot 10^{+168}:\\
\;\;\;\;t_1 \cdot \left(t_3 + t_0 \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right)\\

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


\end{array}

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. Split input into 4 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -6.5422504979734752e-192

    1. Initial program 50.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 in c0 around inf 44.7

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)} \]

    if -6.5422504979734752e-192 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 1.24376909350927869e-234

    1. Initial program 29.7

      \[\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 in c0 around -inf 27.4

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

      \[\leadsto \color{blue}{0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)} \]
    4. Applied egg-rr22.6

      \[\leadsto 0.25 \cdot \color{blue}{\frac{\frac{D}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}} \]
    5. Taylor expanded in D around 0 27.4

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

      \[\leadsto 0.25 \cdot \color{blue}{\left(M \cdot \left(\frac{D}{d} \cdot \left(\frac{h}{\frac{d}{D}} \cdot M\right)\right)\right)} \]
    7. Applied egg-rr16.9

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

    if 1.24376909350927869e-234 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 6.0102963280102637e168

    1. Initial program 5.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. Applied egg-rr8.1

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(c0 \cdot \left(d \cdot d\right)\right) \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\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) \]

    if 6.0102963280102637e168 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 63.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 in c0 around -inf 34.8

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

      \[\leadsto \color{blue}{0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)} \]
    4. Applied egg-rr25.4

      \[\leadsto 0.25 \cdot \color{blue}{\frac{\frac{D}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}} \]
    5. Taylor expanded in D around 0 34.8

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

      \[\leadsto 0.25 \cdot \color{blue}{\left(M \cdot \left(\frac{D}{d} \cdot \left(\frac{h}{\frac{d}{D}} \cdot M\right)\right)\right)} \]
    7. Applied egg-rr17.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq -6.542250497973475 \cdot 10^{-192}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)\\ \mathbf{elif}\;\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) \leq 1.2437690935092787 \cdot 10^{-234}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(D \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)}{d}\\ \mathbf{elif}\;\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) \leq 6.010296328010264 \cdot 10^{+168}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\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} + \left(c0 \cdot \left(d \cdot d\right)\right) \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}{\frac{d}{D}}\\ \end{array} \]

Reproduce

herbie shell --seed 2022150 
(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))))))