Average Error: 59.6 → 17.1
Time: 29.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 := h \cdot \left(D \cdot M\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)\\ t_3 := 2 \cdot \left(\frac{\frac{d}{w}}{D} \cdot \frac{c0}{\frac{D}{d}}\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{-218}:\\ \;\;\;\;\frac{t_3}{h \cdot \frac{w}{c0 \cdot 0.5}}\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;0.25 \cdot \frac{M}{\frac{d}{D} \cdot \frac{d}{t_0}}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\frac{t_3 \cdot \left(c0 \cdot \frac{0.5}{w}\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\left(D \cdot M\right) \cdot \frac{t_0}{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 (* h (* D M)))
        (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_2 (* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M M))))))
        (t_3 (* 2.0 (* (/ (/ d w) D) (/ c0 (/ D d))))))
   (if (<= t_2 -5e-218)
     (/ t_3 (* h (/ w (* c0 0.5))))
     (if (<= t_2 0.0)
       (* 0.25 (/ M (* (/ d D) (/ d t_0))))
       (if (<= t_2 INFINITY)
         (/ (* t_3 (* c0 (/ 0.5 w))) h)
         (* 0.25 (/ (* (* D M) (/ t_0 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 = h * (D * M);
	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 t_3 = 2.0 * (((d / w) / D) * (c0 / (D / d)));
	double tmp;
	if (t_2 <= -5e-218) {
		tmp = t_3 / (h * (w / (c0 * 0.5)));
	} else if (t_2 <= 0.0) {
		tmp = 0.25 * (M / ((d / D) * (d / t_0)));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = (t_3 * (c0 * (0.5 / w))) / h;
	} else {
		tmp = 0.25 * (((D * M) * (t_0 / 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 = h * (D * M);
	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 t_3 = 2.0 * (((d / w) / D) * (c0 / (D / d)));
	double tmp;
	if (t_2 <= -5e-218) {
		tmp = t_3 / (h * (w / (c0 * 0.5)));
	} else if (t_2 <= 0.0) {
		tmp = 0.25 * (M / ((d / D) * (d / t_0)));
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = (t_3 * (c0 * (0.5 / w))) / h;
	} else {
		tmp = 0.25 * (((D * M) * (t_0 / 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 = h * (D * M)
	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))))
	t_3 = 2.0 * (((d / w) / D) * (c0 / (D / d)))
	tmp = 0
	if t_2 <= -5e-218:
		tmp = t_3 / (h * (w / (c0 * 0.5)))
	elif t_2 <= 0.0:
		tmp = 0.25 * (M / ((d / D) * (d / t_0)))
	elif t_2 <= math.inf:
		tmp = (t_3 * (c0 * (0.5 / w))) / h
	else:
		tmp = 0.25 * (((D * M) * (t_0 / 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(h * Float64(D * M))
	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)))))
	t_3 = Float64(2.0 * Float64(Float64(Float64(d / w) / D) * Float64(c0 / Float64(D / d))))
	tmp = 0.0
	if (t_2 <= -5e-218)
		tmp = Float64(t_3 / Float64(h * Float64(w / Float64(c0 * 0.5))));
	elseif (t_2 <= 0.0)
		tmp = Float64(0.25 * Float64(M / Float64(Float64(d / D) * Float64(d / t_0))));
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(t_3 * Float64(c0 * Float64(0.5 / w))) / h);
	else
		tmp = Float64(0.25 * Float64(Float64(Float64(D * M) * Float64(t_0 / 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 = h * (D * M);
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_2 = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
	t_3 = 2.0 * (((d / w) / D) * (c0 / (D / d)));
	tmp = 0.0;
	if (t_2 <= -5e-218)
		tmp = t_3 / (h * (w / (c0 * 0.5)));
	elseif (t_2 <= 0.0)
		tmp = 0.25 * (M / ((d / D) * (d / t_0)));
	elseif (t_2 <= Inf)
		tmp = (t_3 * (c0 * (0.5 / w))) / h;
	else
		tmp = 0.25 * (((D * M) * (t_0 / 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[(h * N[(D * M), $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]}, Block[{t$95$3 = N[(2.0 * N[(N[(N[(d / w), $MachinePrecision] / D), $MachinePrecision] * N[(c0 / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-218], N[(t$95$3 / N[(h * N[(w / N[(c0 * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(0.25 * N[(M / N[(N[(d / D), $MachinePrecision] * N[(d / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(t$95$3 * N[(c0 * N[(0.5 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(0.25 * N[(N[(N[(D * M), $MachinePrecision] * N[(t$95$0 / d), $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 := h \cdot \left(D \cdot M\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)\\
t_3 := 2 \cdot \left(\frac{\frac{d}{w}}{D} \cdot \frac{c0}{\frac{D}{d}}\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{-218}:\\
\;\;\;\;\frac{t_3}{h \cdot \frac{w}{c0 \cdot 0.5}}\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;0.25 \cdot \frac{M}{\frac{d}{D} \cdot \frac{d}{t_0}}\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{t_3 \cdot \left(c0 \cdot \frac{0.5}{w}\right)}{h}\\

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


\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))))) < -5.00000000000000041e-218

    1. Initial program 49.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 44.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. Simplified41.2

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

      [Start]44.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.0

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

      *-commutative [=>]45.0

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

      unpow2 [=>]45.0

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

      associate-*r* [=>]42.2

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

      unpow2 [=>]42.2

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

      associate-*l/ [<=]40.2

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

      *-commutative [=>]40.2

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

      associate-*l/ [<=]40.6

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

      associate-/r* [=>]42.5

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

      associate-*l/ [=>]41.2

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

      *-commutative [=>]41.2

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

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

    if -5.00000000000000041e-218 < (*.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 30.5

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

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

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

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

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

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

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

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

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

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

      \[\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. Simplified25.2

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

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

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

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

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

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

      unpow2 [=>]26.6

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

      unpow2 [=>]26.6

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

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

      *-commutative [<=]25.5

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

      unpow2 [=>]25.5

      \[ 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. Applied egg-rr20.4

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

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

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

    1. Initial program 47.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 42.1

      \[\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. Simplified39.3

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

      [Start]42.1

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

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

      *-commutative [=>]43.7

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

      unpow2 [=>]43.7

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

      associate-*r* [=>]40.2

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

      unpow2 [=>]40.2

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

      associate-*l/ [<=]38.1

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

      *-commutative [=>]38.1

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

      associate-*l/ [<=]37.4

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

      associate-/r* [=>]39.8

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

      associate-*l/ [=>]39.3

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

      *-commutative [=>]39.3

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

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

    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 64.0

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Simplified63.7

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

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

      associate-*l/ [<=]64.0

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

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

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

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

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

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

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

      \[\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. Simplified32.2

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

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

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

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

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

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

      unpow2 [=>]33.3

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

      unpow2 [=>]33.3

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

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

      *-commutative [<=]31.1

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

      unpow2 [=>]31.1

      \[ 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. Applied egg-rr18.4

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

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

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

Alternatives

Alternative 1
Error21.8
Cost1864
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-69}:\\ \;\;\;\;0.25 \cdot \frac{\left(D \cdot M\right) \cdot \frac{h \cdot \left(D \cdot M\right)}{d}}{d}\\ \mathbf{elif}\;D \cdot D \leq 10^{+301}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot M}{\frac{d}{D \cdot D} \cdot \frac{d}{M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d}{D}}{\frac{D}{d} \cdot \frac{w \cdot h}{c0}}\right)\\ \end{array} \]
Alternative 2
Error19.8
Cost1481
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-69} \lor \neg \left(D \cdot D \leq 5 \cdot 10^{+282}\right):\\ \;\;\;\;0.25 \cdot \frac{\left(D \cdot M\right) \cdot \frac{h \cdot \left(D \cdot M\right)}{d}}{d}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot M}{\frac{d}{D \cdot D} \cdot \frac{d}{M}}\\ \end{array} \]
Alternative 3
Error22.5
Cost1480
\[\begin{array}{l} t_0 := h \cdot \left(D \cdot M\right)\\ \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-140}:\\ \;\;\;\;0.25 \cdot \frac{M}{\frac{d}{D} \cdot \frac{d}{t_0}}\\ \mathbf{elif}\;d \cdot d \leq 10^{+237}:\\ \;\;\;\;0.25 \cdot \frac{D}{d \cdot \frac{d}{M \cdot t_0}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot M\right) \cdot \frac{M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \end{array} \]
Alternative 4
Error20.0
Cost1480
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 5 \cdot 10^{-181}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{d}{D \cdot M}}\\ \mathbf{elif}\;M \cdot M \leq 10^{+273}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D}}\right)\right)\\ \end{array} \]
Alternative 5
Error26.5
Cost1220
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 4.2 \cdot 10^{+282}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h}{d} \cdot \frac{M}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 6
Error22.3
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 10^{+274}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h}{d} \cdot \frac{M}{d}\right)\right)\right)\\ \end{array} \]
Alternative 7
Error20.1
Cost960
\[0.25 \cdot \left(\frac{D}{d} \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D}}\right)\right) \]
Alternative 8
Error31.7
Cost64
\[0 \]

Error

Reproduce

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