?

Average Error: 59.2 → 15.9
Time: 31.9s
Precision: binary64
Cost: 42636

?

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

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

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;{\left(\frac{c0}{w \cdot \sqrt{h}} \cdot \frac{d}{D}\right)}^{2}\\

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


\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))))) < -1.9999999999999998e-308

    1. Initial program 46.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 41.0

      \[\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. Simplified31.1

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

      [Start]41.0

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

      *-commutative [=>]41.0

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

      unpow2 [=>]41.0

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

      *-commutative [=>]41.0

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

      unpow2 [=>]41.0

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

      associate-*r* [<=]41.8

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

      associate-*l/ [<=]41.7

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

      associate-*r* [=>]36.8

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

      *-commutative [=>]36.8

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

      associate-/r* [=>]35.5

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

      associate-*l/ [=>]33.7

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

      *-commutative [=>]33.7

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

      associate-*l* [=>]31.1

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

    if -1.9999999999999998e-308 < (*.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.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. Simplified51.0

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

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

      associate-*l/ [<=]35.3

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

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

      \[ \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)} \]
    3. Taylor expanded in c0 around -inf 30.5

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

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

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

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

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

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

      [Start]25.6

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

      *-commutative [<=]25.6

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

      associate-/l* [=>]25.3

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

      unpow2 [=>]25.3

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

      unpow2 [=>]25.3

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

      *-commutative [=>]25.3

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

      unpow2 [=>]25.3

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

      associate-*r* [<=]22.9

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

      associate-/r/ [=>]22.8

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

      associate-/r* [=>]21.3

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

      associate-*r/ [<=]19.6

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

      \[\leadsto 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) \]
    8. Applied egg-rr13.9

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

    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.3

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

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

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

      [Start]53.0

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

      times-frac [=>]54.0

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

      unpow2 [=>]54.0

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

      unpow2 [=>]54.0

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

      associate-/r* [=>]52.9

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

      *-commutative [=>]52.9

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

      associate-/r* [=>]54.4

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

      unpow2 [=>]54.4

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

      unpow2 [=>]54.4

      \[ \frac{\frac{d \cdot d}{D}}{D} \cdot \frac{\frac{c0 \cdot c0}{h}}{\color{blue}{w \cdot w}} \]
    4. Applied egg-rr34.9

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\left(\frac{\frac{c0}{\sqrt{h}}}{w} \cdot \frac{d}{D}\right)}^{2}\right)} - 1} \]
    5. Simplified19.2

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

      [Start]34.9

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

      expm1-def [=>]24.0

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

      expm1-log1p [=>]21.7

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

      associate-/l/ [=>]19.2

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

    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.9

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

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

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

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

      [Start]33.7

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

      *-commutative [<=]33.7

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

      associate-/l* [=>]33.8

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

      unpow2 [=>]33.8

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

      unpow2 [=>]33.8

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

      *-commutative [=>]33.8

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

      unpow2 [=>]33.8

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

      associate-*r* [<=]31.8

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

      associate-/r/ [=>]31.9

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

      associate-/r* [=>]28.5

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

      associate-*r/ [<=]23.7

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

      \[\leadsto 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) \]
    8. Applied egg-rr14.5

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

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

Alternatives

Alternative 1
Error17.4
Cost38092
\[\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 -2 \cdot 10^{-308}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(d \cdot \frac{d \cdot \frac{c0}{w}}{D \cdot \left(h \cdot D\right)}\right)\right)\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;0.25 \cdot \frac{\frac{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}{d}}{\frac{1}{D}}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_0 \cdot \mathsf{fma}\left(2, \frac{\frac{c0}{D}}{h} \cdot \frac{d \cdot \frac{d}{D}}{w}, -0.5 \cdot \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 2
Error17.7
Cost13572
\[\begin{array}{l} \mathbf{if}\;h \leq 5 \cdot 10^{-301}:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot {\left(\sqrt{h} \cdot \frac{D \cdot M}{d}\right)}^{2}\\ \end{array} \]
Alternative 3
Error18.6
Cost7880
\[\begin{array}{l} \mathbf{if}\;D \leq -2.46 \cdot 10^{+154}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{D}{d}}{\frac{\frac{d}{D}}{h \cdot M}}\\ \mathbf{elif}\;D \leq 3.8 \cdot 10^{-252}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \left(\frac{M}{d} \cdot \left(h \cdot D\right)\right) \cdot \left(D \cdot \frac{M}{d}\right), c0 \cdot \left(c0 \cdot 0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 4
Error21.4
Cost1481
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-116} \lor \neg \left(M \cdot M \leq 5 \cdot 10^{+168}\right):\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D}}\right)\\ \end{array} \]
Alternative 5
Error24.9
Cost1356
\[\begin{array}{l} t_0 := 0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \mathbf{if}\;M \leq -7.4 \cdot 10^{+146}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M \leq 1.2 \cdot 10^{+128}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D}}\right)\\ \mathbf{elif}\;M \leq 3 \cdot 10^{+246}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 6
Error24.7
Cost1356
\[\begin{array}{l} t_0 := 0.25 \cdot \frac{D}{\frac{d}{D} \cdot \frac{d}{M \cdot \left(h \cdot M\right)}}\\ \mathbf{if}\;M \leq -4.3 \cdot 10^{+113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M \leq 1.45 \cdot 10^{+113}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D}}\right)\\ \mathbf{elif}\;M \leq 1.2 \cdot 10^{+246}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 7
Error26.6
Cost1225
\[\begin{array}{l} \mathbf{if}\;D \leq -4.6 \cdot 10^{-79} \lor \neg \left(D \leq 5 \cdot 10^{-290}\right):\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 8
Error21.3
Cost1092
\[\begin{array}{l} t_0 := \left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)\\ \mathbf{if}\;D \leq 2 \cdot 10^{-102}:\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{t_0}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_0}{d}\\ \end{array} \]
Alternative 9
Error19.0
Cost960
\[0.25 \cdot \frac{M \cdot \frac{D}{d}}{\frac{\frac{d}{D}}{h \cdot M}} \]
Alternative 10
Error31.7
Cost64
\[0 \]

Error

Reproduce?

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