?

Average Error: 59.6 → 17.2
Time: 50.4s
Precision: binary64
Cost: 30540

?

\[\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 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_2 := t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{-214}:\\ \;\;\;\;d \cdot \frac{\frac{\frac{c0}{w}}{\frac{D}{\frac{c0}{\frac{D}{d}}}}}{w \cdot h}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+142}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d \cdot d}{D}}{w \cdot \left(h \cdot D\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \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 (* 2.0 w)))
        (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_2 (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
   (if (<= t_2 -5e-214)
     (* d (/ (/ (/ c0 w) (/ D (/ c0 (/ D d)))) (* w h)))
     (if (<= t_2 0.0)
       (* 0.25 (/ (* (/ D d) (* h M)) (/ (/ d D) M)))
       (if (<= t_2 2e+142)
         (* t_0 (* 2.0 (* c0 (/ (/ (* d d) D) (* w (* h D))))))
         (* 0.25 (* (/ (* h (* D M)) d) (/ (* D M) 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 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
	double tmp;
	if (t_2 <= -5e-214) {
		tmp = d * (((c0 / w) / (D / (c0 / (D / d)))) / (w * h));
	} else if (t_2 <= 0.0) {
		tmp = 0.25 * (((D / d) * (h * M)) / ((d / D) / M));
	} else if (t_2 <= 2e+142) {
		tmp = t_0 * (2.0 * (c0 * (((d * d) / D) / (w * (h * D)))));
	} else {
		tmp = 0.25 * (((h * (D * M)) / d) * ((D * M) / 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) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (m * m))))
    if (t_2 <= (-5d-214)) then
        tmp = d_1 * (((c0 / w) / (d / (c0 / (d / d_1)))) / (w * h))
    else if (t_2 <= 0.0d0) then
        tmp = 0.25d0 * (((d / d_1) * (h * m)) / ((d_1 / d) / m))
    else if (t_2 <= 2d+142) then
        tmp = t_0 * (2.0d0 * (c0 * (((d_1 * d_1) / d) / (w * (h * d)))))
    else
        tmp = 0.25d0 * (((h * (d * m)) / d_1) * ((d * m) / d_1))
    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 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_2 = t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
	double tmp;
	if (t_2 <= -5e-214) {
		tmp = d * (((c0 / w) / (D / (c0 / (D / d)))) / (w * h));
	} else if (t_2 <= 0.0) {
		tmp = 0.25 * (((D / d) * (h * M)) / ((d / D) / M));
	} else if (t_2 <= 2e+142) {
		tmp = t_0 * (2.0 * (c0 * (((d * d) / D) / (w * (h * D)))));
	} else {
		tmp = 0.25 * (((h * (D * M)) / d) * ((D * M) / 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 / (2.0 * w)
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_2 = t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M * M))))
	tmp = 0
	if t_2 <= -5e-214:
		tmp = d * (((c0 / w) / (D / (c0 / (D / d)))) / (w * h))
	elif t_2 <= 0.0:
		tmp = 0.25 * (((D / d) * (h * M)) / ((d / D) / M))
	elif t_2 <= 2e+142:
		tmp = t_0 * (2.0 * (c0 * (((d * d) / D) / (w * (h * D)))))
	else:
		tmp = 0.25 * (((h * (D * M)) / d) * ((D * M) / 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(2.0 * w))
	t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_2 = Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M)))))
	tmp = 0.0
	if (t_2 <= -5e-214)
		tmp = Float64(d * Float64(Float64(Float64(c0 / w) / Float64(D / Float64(c0 / Float64(D / d)))) / Float64(w * h)));
	elseif (t_2 <= 0.0)
		tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(h * M)) / Float64(Float64(d / D) / M)));
	elseif (t_2 <= 2e+142)
		tmp = Float64(t_0 * Float64(2.0 * Float64(c0 * Float64(Float64(Float64(d * d) / D) / Float64(w * Float64(h * D))))));
	else
		tmp = Float64(0.25 * Float64(Float64(Float64(h * Float64(D * M)) / d) * Float64(Float64(D * M) / 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 / (2.0 * w);
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_2 = t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
	tmp = 0.0;
	if (t_2 <= -5e-214)
		tmp = d * (((c0 / w) / (D / (c0 / (D / d)))) / (w * h));
	elseif (t_2 <= 0.0)
		tmp = 0.25 * (((D / d) * (h * M)) / ((d / D) / M));
	elseif (t_2 <= 2e+142)
		tmp = t_0 * (2.0 * (c0 * (((d * d) / D) / (w * (h * D)))));
	else
		tmp = 0.25 * (((h * (D * M)) / d) * ((D * M) / 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[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-214], N[(d * N[(N[(N[(c0 / w), $MachinePrecision] / N[(D / N[(c0 / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(h * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+142], N[(t$95$0 * N[(2.0 * N[(c0 * N[(N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision] / N[(w * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(N[(h * N[(D * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] / 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 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_2 := t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{-214}:\\
\;\;\;\;d \cdot \frac{\frac{\frac{c0}{w}}{\frac{D}{\frac{c0}{\frac{D}{d}}}}}{w \cdot h}\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+142}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d \cdot d}{D}}{w \cdot \left(h \cdot D\right)}\right)\right)\\

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


\end{array}

Error?

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))))) < -4.9999999999999998e-214

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

      \[\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. Simplified45.6

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

      [Start]45.2

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

      associate-*r/ [=>]45.2

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

      *-commutative [=>]45.2

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

      unpow2 [=>]45.2

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

      *-commutative [=>]45.2

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

      unpow2 [=>]45.2

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

      associate-*r* [=>]40.7

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

      associate-*r* [<=]41.1

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

      *-commutative [<=]41.1

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

      associate-*r/ [<=]41.1

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

      associate-*r/ [<=]43.0

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

      *-commutative [=>]43.0

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

      associate-*r* [=>]42.5

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

      associate-*r* [<=]46.8

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

      associate-/l/ [<=]48.0

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

      associate-/r* [<=]46.8

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

      times-frac [=>]45.0

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

      associate-/r* [=>]45.6

      \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \left(\frac{d}{D \cdot D} \cdot \color{blue}{\frac{\frac{d}{w}}{h}}\right)\right)\right) \]
    4. Applied egg-rr39.7

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \color{blue}{\frac{\frac{d}{D}}{\left(h \cdot \frac{w}{d}\right) \cdot D}}\right)\right) \]
    5. Applied egg-rr61.5

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\frac{c0}{D} \cdot \left(\frac{\frac{d}{D}}{w \cdot h} \cdot d\right)\right) \cdot \left(1 \cdot \frac{c0}{w}\right)\right)} - 1} \]
    6. Simplified35.8

      \[\leadsto \color{blue}{\frac{\frac{\frac{c0}{w}}{\frac{D}{\frac{c0}{\frac{D}{d}}}}}{w \cdot h} \cdot d} \]
      Proof

      [Start]61.5

      \[ e^{\mathsf{log1p}\left(\left(\frac{c0}{D} \cdot \left(\frac{\frac{d}{D}}{w \cdot h} \cdot d\right)\right) \cdot \left(1 \cdot \frac{c0}{w}\right)\right)} - 1 \]

      expm1-def [=>]54.0

      \[ \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\frac{c0}{D} \cdot \left(\frac{\frac{d}{D}}{w \cdot h} \cdot d\right)\right) \cdot \left(1 \cdot \frac{c0}{w}\right)\right)\right)} \]

      expm1-log1p [=>]36.1

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

      associate-/r/ [<=]37.8

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

      associate-*l/ [=>]40.3

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

      *-commutative [<=]40.3

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

      associate-/r/ [<=]41.0

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

      associate-/l* [<=]40.4

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

      associate-/l* [<=]34.9

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

      associate-*r* [<=]31.1

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

      associate-/r* [=>]34.1

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

      associate-/r/ [=>]33.3

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

    if -4.9999999999999998e-214 < (*.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))))) < 0.0

    1. Initial program 28.9

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    3. Simplified27.7

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{c0 \cdot \left(d \cdot d\right)} \cdot \left(w \cdot \left(M \cdot \left(M \cdot h\right)\right)\right), c0 \cdot 0\right)} \]
      Proof

      [Start]30.9

      \[ \frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right) \]

      fma-def [=>]30.9

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0}, -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    4. Taylor expanded in c0 around 0 24.8

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

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

      [Start]24.8

      \[ 0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}} \]

      *-commutative [=>]24.8

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

      associate-/l* [=>]24.2

      \[ 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]

      unpow2 [=>]24.2

      \[ 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]

      unpow2 [=>]24.2

      \[ 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]

      unpow2 [=>]24.2

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

      associate-*r* [<=]21.4

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

      associate-/r/ [=>]22.0

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

      times-frac [=>]19.2

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

      *-commutative [=>]19.2

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

      *-commutative [=>]19.2

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

      associate-*r* [<=]23.0

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

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

    if 0.0 < (*.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))))) < 2.0000000000000001e142

    1. Initial program 11.9

      \[\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-rr26.7

      \[\leadsto \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)} + \color{blue}{\sqrt[3]{{\left({\left(\frac{c0}{w \cdot \left(h \cdot D\right)} \cdot \frac{d \cdot d}{D}\right)}^{2} - M \cdot M\right)}^{1.5}}}\right) \]
    3. Taylor expanded in c0 around inf 6.5

      \[\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)} \]
    4. Simplified14.8

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

      [Start]6.5

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

      associate-/l* [=>]10.0

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

      associate-/r/ [=>]13.3

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

      associate-/r* [=>]17.0

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

      associate-/l/ [<=]21.3

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

      unpow2 [=>]21.3

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

      associate-/r* [=>]21.0

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

      unpow2 [=>]21.0

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

      associate-*l/ [<=]20.9

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

      associate-/r/ [<=]20.8

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

      associate-/l/ [=>]19.7

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

      associate-/l/ [=>]14.7

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

      associate-/r/ [=>]14.6

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

      associate-*l/ [=>]14.8

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

      *-commutative [=>]14.8

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

    if 2.0000000000000001e142 < (*.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.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 62.6

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{c0 \cdot \left(d \cdot d\right)} \cdot \left(w \cdot \left(M \cdot \left(M \cdot h\right)\right)\right), c0 \cdot 0\right)} \]
      Proof

      [Start]62.6

      \[ \frac{c0}{2 \cdot w} \cdot \left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right) \]

      fma-def [=>]62.6

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0}, -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    4. Taylor expanded in c0 around 0 34.9

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

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

      [Start]34.9

      \[ 0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}} \]

      *-commutative [=>]34.9

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

      associate-*r* [=>]34.3

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

      *-commutative [=>]34.3

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

      unpow2 [=>]34.3

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

      unpow2 [=>]34.3

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

      unswap-sqr [=>]25.9

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

      unpow2 [=>]25.9

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

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

    \[\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 -5 \cdot 10^{-214}:\\ \;\;\;\;d \cdot \frac{\frac{\frac{c0}{w}}{\frac{D}{\frac{c0}{\frac{D}{d}}}}}{w \cdot h}\\ \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 0:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \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 2 \cdot 10^{+142}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d \cdot d}{D}}{w \cdot \left(h \cdot D\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error18.4
Cost1864
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 0.05:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+16}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \left(\frac{d}{D \cdot D} \cdot \frac{\frac{d}{w}}{h}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 2
Error18.4
Cost1608
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 0.05:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+16}:\\ \;\;\;\;c0 \cdot \frac{\left(\frac{d}{D} \cdot \frac{d}{w}\right) \cdot \frac{\frac{c0}{D}}{h}}{w}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 3
Error18.4
Cost1608
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 0.05:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+16}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{w}\right) \cdot \frac{c0}{h \cdot D}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 4
Error18.4
Cost1608
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 0.05:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+16}:\\ \;\;\;\;\frac{c0}{D} \cdot \left(\frac{\frac{\frac{d}{w}}{h}}{D} \cdot \left(d \cdot \frac{c0}{w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 5
Error18.4
Cost1608
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 0.05:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+16}:\\ \;\;\;\;\frac{c0}{\frac{h \cdot \frac{w}{d}}{\frac{d}{D \cdot D}} \cdot \frac{w}{c0}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 6
Error18.7
Cost1481
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 10^{-262} \lor \neg \left(d \cdot d \leq 5 \cdot 10^{+302}\right):\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot M\right) \cdot \left(\frac{D}{d} \cdot \left(M \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot M\right) \cdot \frac{h}{\frac{d \cdot d}{D \cdot M}}\right)\\ \end{array} \]
Alternative 7
Error23.6
Cost1225
\[\begin{array}{l} \mathbf{if}\;M \leq -1.2 \cdot 10^{+135} \lor \neg \left(M \leq 1.1 \cdot 10^{+199}\right):\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot M\right) \cdot \left(\frac{D}{d} \cdot \left(M \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \frac{\frac{D}{d}}{d}\right) \cdot \left(M \cdot \left(D \cdot M\right)\right)\right)\\ \end{array} \]
Alternative 8
Error17.3
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 2 \cdot 10^{+72}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \end{array} \]
Alternative 9
Error17.3
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 2 \cdot 10^{+72}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \end{array} \]
Alternative 10
Error20.6
Cost960
\[0.25 \cdot \left(\left(h \cdot M\right) \cdot \left(\frac{D}{d} \cdot \left(M \cdot \frac{D}{d}\right)\right)\right) \]
Alternative 11
Error18.6
Cost960
\[0.25 \cdot \left(\frac{h \cdot \left(D \cdot M\right)}{d} \cdot \frac{D \cdot M}{d}\right) \]
Alternative 12
Error31.7
Cost64
\[0 \]

Error

Reproduce?

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