?

Average Error: 92.77% → 28.76%
Time: 31.7s
Precision: binary64
Cost: 30284

?

\[\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}{w} \cdot \left(\frac{d}{D} \cdot \left(\frac{c0}{w} \cdot \frac{d}{h \cdot D}\right)\right)\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_2 := \frac{c0}{2 \cdot w} \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{-264}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{\left(\left(h \cdot D\right) \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot 0.25}{\frac{d}{M}}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(h \cdot \left(D \cdot M\right)\right) \cdot \frac{M}{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
 (let* ((t_0 (* (/ c0 w) (* (/ d D) (* (/ c0 w) (/ d (* h D))))))
        (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_2 (* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
   (if (<= t_2 -1e-264)
     t_0
     (if (<= t_2 0.0)
       (/ (* (* (* h D) (* M (/ D d))) 0.25) (/ d M))
       (if (<= t_2 INFINITY)
         t_0
         (* 0.25 (/ (* D (* (* h (* D M)) (/ 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 / w) * ((d / D) * ((c0 / w) * (d / (h * D))));
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_2 = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
	double tmp;
	if (t_2 <= -1e-264) {
		tmp = t_0;
	} else if (t_2 <= 0.0) {
		tmp = (((h * D) * (M * (D / d))) * 0.25) / (d / M);
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_0;
	} else {
		tmp = 0.25 * ((D * ((h * (D * M)) * (M / d))) / d);
	}
	return tmp;
}
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 / w) * ((d / D) * ((c0 / w) * (d / (h * D))));
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_2 = (c0 / (2.0 * w)) * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
	double tmp;
	if (t_2 <= -1e-264) {
		tmp = t_0;
	} else if (t_2 <= 0.0) {
		tmp = (((h * D) * (M * (D / d))) * 0.25) / (d / M);
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = t_0;
	} else {
		tmp = 0.25 * ((D * ((h * (D * M)) * (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 / w) * ((d / D) * ((c0 / w) * (d / (h * D))))
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_2 = (c0 / (2.0 * w)) * (t_1 + math.sqrt(((t_1 * t_1) - (M * M))))
	tmp = 0
	if t_2 <= -1e-264:
		tmp = t_0
	elif t_2 <= 0.0:
		tmp = (((h * D) * (M * (D / d))) * 0.25) / (d / M)
	elif t_2 <= math.inf:
		tmp = t_0
	else:
		tmp = 0.25 * ((D * ((h * (D * M)) * (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(Float64(c0 / w) * Float64(Float64(d / D) * Float64(Float64(c0 / w) * Float64(d / Float64(h * D)))))
	t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_2 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M)))))
	tmp = 0.0
	if (t_2 <= -1e-264)
		tmp = t_0;
	elseif (t_2 <= 0.0)
		tmp = Float64(Float64(Float64(Float64(h * D) * Float64(M * Float64(D / d))) * 0.25) / Float64(d / M));
	elseif (t_2 <= Inf)
		tmp = t_0;
	else
		tmp = Float64(0.25 * Float64(Float64(D * Float64(Float64(h * Float64(D * M)) * Float64(M / 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 / w) * ((d / D) * ((c0 / w) * (d / (h * D))));
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_2 = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
	tmp = 0.0;
	if (t_2 <= -1e-264)
		tmp = t_0;
	elseif (t_2 <= 0.0)
		tmp = (((h * D) * (M * (D / d))) * 0.25) / (d / M);
	elseif (t_2 <= Inf)
		tmp = t_0;
	else
		tmp = 0.25 * ((D * ((h * (D * M)) * (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[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] * N[(d / N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 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, -1e-264], t$95$0, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(h * D), $MachinePrecision] * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$0, N[(0.25 * N[(N[(D * N[(N[(h * N[(D * M), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $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}{w} \cdot \left(\frac{d}{D} \cdot \left(\frac{c0}{w} \cdot \frac{d}{h \cdot D}\right)\right)\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_2 := \frac{c0}{2 \cdot w} \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{-264}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_0\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 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))))) < -1e-264 or -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))))) < +inf.0

    1. Initial program 74.54

      \[\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. Simplified76.5

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

      [Start]74.54

      \[ \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) \]

      times-frac [=>]78.6

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

      fma-neg [=>]78.6

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\color{blue}{\mathsf{fma}\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, -M \cdot M\right)}}\right) \]

      times-frac [=>]78.74

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}}, \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, -M \cdot M\right)}\right) \]

      times-frac [=>]76.5

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}}, -M \cdot M\right)}\right) \]
    3. Taylor expanded in c0 around inf 66.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. Simplified59.96

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

      [Start]66.5

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

      times-frac [=>]68.78

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

      unpow2 [=>]68.78

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

      unpow2 [=>]68.78

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

      associate-/r* [=>]66.21

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

      times-frac [<=]63.73

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

      *-commutative [<=]63.73

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

      associate-/l* [=>]63.83

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

      *-commutative [=>]63.83

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

      associate-*l* [=>]59.96

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

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

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

      [Start]83.57

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

      expm1-def [=>]72.83

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

      expm1-log1p [=>]56.85

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

      associate-/r/ [=>]56.84

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

      *-commutative [<=]56.84

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

      associate-*l* [=>]44.98

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

      associate-*l/ [=>]45.02

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

      *-commutative [=>]45.02

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

      associate-*r* [=>]45.02

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

      metadata-eval [=>]45.02

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

      associate-*r/ [<=]45.02

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

      *-lft-identity [=>]45.02

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

    if -1e-264 < (*.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 47.12

      \[\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. Simplified84.13

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

      [Start]47.12

      \[ \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) \]

      associate-*l/ [<=]55.67

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

      *-commutative [=>]55.67

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

      fma-def [=>]69.48

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(d \cdot d, \frac{c0}{\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)} \]

      associate-*l* [=>]74.27

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\color{blue}{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) \]

      associate-/r* [=>]74.67

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \color{blue}{\frac{\frac{c0}{w}}{h \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) \]

      associate-*r* [=>]76.37

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

      *-commutative [=>]76.37

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{\frac{c0}{w}}{\color{blue}{D \cdot \left(h \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) \]
    3. Taylor expanded in c0 around -inf 48.93

      \[\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)} \]
    4. Simplified37.89

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

      [Start]48.93

      \[ \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 [=>]48.93

      \[ \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)} \]
    5. Taylor expanded in c0 around 0 40.93

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

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

      [Start]40.93

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

      *-commutative [<=]40.93

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

      associate-*r* [=>]40.14

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

      unpow2 [=>]40.14

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

      unpow2 [=>]40.14

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

      times-frac [=>]35.61

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

      unpow2 [=>]35.61

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

      *-commutative [=>]35.61

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

      \[\leadsto 0.25 \cdot \color{blue}{\frac{\frac{h \cdot D}{\frac{d}{D}} \cdot M}{\frac{d}{M}}} \]
    8. Applied egg-rr19.86

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

    if +inf.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)))))

    1. Initial program 100

      \[\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. Simplified99.56

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

      [Start]100

      \[ \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) \]

      associate-*l/ [<=]100

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

      *-commutative [=>]100

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

      fma-def [=>]100

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(d \cdot d, \frac{c0}{\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)} \]

      associate-*l* [=>]100

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\color{blue}{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) \]

      associate-/r* [=>]100

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \color{blue}{\frac{\frac{c0}{w}}{h \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) \]

      associate-*r* [=>]100

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

      *-commutative [=>]100

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{\frac{c0}{w}}{\color{blue}{D \cdot \left(h \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) \]
    3. Taylor expanded in c0 around -inf 98.07

      \[\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)} \]
    4. Simplified50.43

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

      [Start]98.07

      \[ \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 [=>]98.07

      \[ \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)} \]
    5. Taylor expanded in c0 around 0 53.31

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

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

      [Start]53.31

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

      unpow2 [=>]53.31

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

      unpow2 [=>]53.31

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

      associate-*r* [<=]49.93

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

      *-commutative [<=]49.93

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

      unpow2 [=>]49.93

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

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

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

      [Start]53.31

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

      associate-*r/ [=>]53.31

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

      *-commutative [=>]53.31

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

      unpow2 [=>]53.31

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

      associate-*l/ [<=]53.31

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

      unpow2 [=>]53.31

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

      unpow2 [=>]53.31

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

      associate-*r* [<=]49.93

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

      associate-*r/ [<=]50.1

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

      associate-*l* [=>]44.88

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

      associate-*l/ [<=]41.92

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

      *-commutative [=>]41.92

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

      *-commutative [=>]41.92

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

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

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

Alternatives

Alternative 1
Error36.87%
Cost1488
\[\begin{array}{l} t_0 := D \cdot \frac{D}{d}\\ t_1 := 0.25 \cdot \left(\frac{D}{d} \cdot \frac{\left(D \cdot M\right) \cdot \left(h \cdot M\right)}{d}\right)\\ t_2 := 0.25 \cdot \left(M \cdot \left(\frac{M}{d} \cdot \left(h \cdot t_0\right)\right)\right)\\ \mathbf{if}\;M \leq -3.8 \cdot 10^{+88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;M \leq 2.5 \cdot 10^{-121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;M \leq 1.18 \cdot 10^{+107}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \frac{M \cdot M}{d}\right) \cdot t_0\right)\\ \mathbf{elif}\;M \leq 1.7 \cdot 10^{+148}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error33.67%
Cost1357
\[\begin{array}{l} \mathbf{if}\;d \leq -8.3 \cdot 10^{+173}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(\frac{M}{d} \cdot \left(h \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq 2 \cdot 10^{+128} \lor \neg \left(d \leq 5 \cdot 10^{+254}\right):\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(M \cdot \left(\left(D \cdot \frac{M}{d}\right) \cdot \frac{h}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(h \cdot \left(D \cdot M\right)\right) \cdot \frac{M}{d}\right)}{d}\\ \end{array} \]
Alternative 3
Error34.11%
Cost1356
\[\begin{array}{l} t_0 := 0.25 \cdot \frac{D \cdot M}{\frac{d}{M} \cdot \frac{d}{h \cdot D}}\\ \mathbf{if}\;h \leq -1 \cdot 10^{+70}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq 3 \cdot 10^{-263}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{\left(D \cdot M\right) \cdot \left(h \cdot M\right)}{d}\right)\\ \mathbf{elif}\;h \leq 0.0056:\\ \;\;\;\;0.25 \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error33.91%
Cost1356
\[\begin{array}{l} \mathbf{if}\;D \leq -1.12 \cdot 10^{-45}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{h \cdot D}{\frac{d}{D}}}{\frac{d}{M}}\\ \mathbf{elif}\;D \leq 2 \cdot 10^{-98}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot M}{\frac{d}{M} \cdot \frac{d}{h \cdot D}}\\ \mathbf{elif}\;D \leq 5.2 \cdot 10^{+141}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(D \cdot D\right)}{\frac{d}{M} \cdot \frac{d}{M}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \end{array} \]
Alternative 5
Error32.93%
Cost1356
\[\begin{array}{l} \mathbf{if}\;D \leq -4.9 \cdot 10^{-191}:\\ \;\;\;\;\frac{\left(\left(h \cdot D\right) \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot 0.25}{\frac{d}{M}}\\ \mathbf{elif}\;D \leq 3.8 \cdot 10^{-111}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(h \cdot \left(D \cdot M\right)\right) \cdot \frac{M}{d}\right)}{d}\\ \mathbf{elif}\;D \leq 7.6 \cdot 10^{+140}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(D \cdot D\right)}{\frac{d}{M} \cdot \frac{d}{M}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \end{array} \]
Alternative 6
Error38.13%
Cost1225
\[\begin{array}{l} \mathbf{if}\;M \leq 5 \cdot 10^{-169} \lor \neg \left(M \leq 4.6 \cdot 10^{+122}\right):\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(\frac{M}{d} \cdot \left(h \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \frac{M \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \end{array} \]
Alternative 7
Error34.33%
Cost1224
\[\begin{array}{l} \mathbf{if}\;h \leq 10^{-290}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(M \cdot \left(\left(D \cdot \frac{M}{d}\right) \cdot \frac{h}{d}\right)\right)\right)\\ \mathbf{elif}\;h \leq 0.0068:\\ \;\;\;\;0.25 \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot M}{\frac{d}{M} \cdot \frac{d}{h \cdot D}}\\ \end{array} \]
Alternative 8
Error35.92%
Cost1220
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 5 \cdot 10^{+236}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(\frac{M}{d} \cdot \left(h \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \end{array} \]
Alternative 9
Error38.4%
Cost960
\[0.25 \cdot \left(M \cdot \left(\frac{M}{d} \cdot \left(h \cdot \left(D \cdot \frac{D}{d}\right)\right)\right)\right) \]
Alternative 10
Error50.46%
Cost64
\[0 \]

Error

Reproduce?

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