?

Average Accuracy: 6.9% → 68.9%
Time: 35.2s
Precision: binary64
Cost: 13572

?

\[\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} \mathbf{if}\;h \leq -5 \cdot 10^{-309}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{D \cdot 0.5}{\frac{\frac{d}{\sqrt{h}}}{M}}\right)}^{2}\\ \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
 (if (<= h -5e-309)
   (* M (* (/ (* (* h M) (/ D d)) d) (* 0.25 D)))
   (pow (/ (* D 0.5) (/ (/ d (sqrt h)) M)) 2.0)))
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 tmp;
	if (h <= -5e-309) {
		tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D));
	} else {
		tmp = pow(((D * 0.5) / ((d / sqrt(h)) / M)), 2.0);
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = (c0 / (2.0d0 * w)) * (((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) + sqrt(((((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d)))) - (m * m))))
end function
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if (h <= (-5d-309)) then
        tmp = m * ((((h * m) * (d / d_1)) / d_1) * (0.25d0 * d))
    else
        tmp = ((d * 0.5d0) / ((d_1 / sqrt(h)) / m)) ** 2.0d0
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (h <= -5e-309) {
		tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D));
	} else {
		tmp = Math.pow(((D * 0.5) / ((d / Math.sqrt(h)) / M)), 2.0);
	}
	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):
	tmp = 0
	if h <= -5e-309:
		tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D))
	else:
		tmp = math.pow(((D * 0.5) / ((d / math.sqrt(h)) / M)), 2.0)
	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)
	tmp = 0.0
	if (h <= -5e-309)
		tmp = Float64(M * Float64(Float64(Float64(Float64(h * M) * Float64(D / d)) / d) * Float64(0.25 * D)));
	else
		tmp = Float64(Float64(D * 0.5) / Float64(Float64(d / sqrt(h)) / M)) ^ 2.0;
	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)
	tmp = 0.0;
	if (h <= -5e-309)
		tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D));
	else
		tmp = ((D * 0.5) / ((d / sqrt(h)) / M)) ^ 2.0;
	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_] := If[LessEqual[h, -5e-309], N[(M * N[(N[(N[(N[(h * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(D * 0.5), $MachinePrecision] / N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision], 2.0], $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}
\mathbf{if}\;h \leq -5 \cdot 10^{-309}:\\
\;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{D \cdot 0.5}{\frac{\frac{d}{\sqrt{h}}}{M}}\right)}^{2}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if h < -4.9999999999999995e-309

    1. Initial program 6.8%

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

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

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

      times-frac [=>]5.4

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

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

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

      \[ \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 5.1%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Simplified31.5%

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

      [Start]5.1

      \[ -0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \]
    5. Taylor expanded in w around 0 44.3%

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

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

      [Start]44.3

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

      associate-/r* [=>]48.6

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

      associate-/r/ [=>]49.9

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

      associate-*r* [=>]49.9

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

      *-commutative [=>]49.9

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

      associate-/l* [=>]53.3

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

      associate-/l/ [=>]56.1

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

      \[\leadsto 0 + \color{blue}{\left(0.25 \cdot \frac{{D}^{2} \cdot \left(M \cdot h\right)}{{d}^{2}}\right)} \cdot M \]
    8. Simplified66.1%

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

      [Start]50.6

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

      associate-*r/ [=>]50.6

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

      associate-*r* [=>]50.6

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

      *-commutative [<=]50.6

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

      unpow2 [=>]50.6

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

      associate-*r* [<=]50.6

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

      *-commutative [=>]50.6

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

      associate-*l* [=>]54.9

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

      associate-*r/ [<=]57.3

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

      *-commutative [=>]57.3

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

      unpow2 [=>]57.3

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

      associate-/r* [=>]64.0

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

      associate-*l/ [<=]66.1

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

      *-commutative [=>]66.1

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

    if -4.9999999999999995e-309 < h

    1. Initial program 7.1%

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

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

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

      times-frac [=>]5.4

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

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

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

      \[ \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 5.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Simplified31.6%

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

      [Start]5.5

      \[ -0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \]
    5. Taylor expanded in w around 0 43.4%

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

      \[\leadsto 0 + \color{blue}{{\left(\frac{D \cdot 0.5}{\frac{\frac{d}{\sqrt{h}}}{M}}\right)}^{2}} \]
      Proof

      [Start]43.4

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

      add-sqr-sqrt [=>]43.4

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

      pow2 [=>]43.4

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

      sqrt-div [=>]43.4

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

      *-commutative [=>]43.4

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

      sqrt-prod [=>]43.4

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

      sqrt-prod [=>]24.2

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

      add-sqr-sqrt [<=]47.8

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

      metadata-eval [=>]47.8

      \[ 0 + {\left(\frac{D \cdot \color{blue}{0.5}}{\sqrt{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}^{2} \]

      sqrt-div [=>]49.2

      \[ 0 + {\left(\frac{D \cdot 0.5}{\color{blue}{\frac{\sqrt{\frac{d \cdot d}{h}}}{\sqrt{M \cdot M}}}}\right)}^{2} \]

      sqrt-prod [=>]29.4

      \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\sqrt{\frac{d \cdot d}{h}}}{\color{blue}{\sqrt{M} \cdot \sqrt{M}}}}\right)}^{2} \]

      add-sqr-sqrt [<=]57.3

      \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\sqrt{\frac{d \cdot d}{h}}}{\color{blue}{M}}}\right)}^{2} \]

      sqrt-div [=>]60.9

      \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h}}}}{M}}\right)}^{2} \]

      sqrt-prod [=>]35.9

      \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h}}}{M}}\right)}^{2} \]

      add-sqr-sqrt [<=]71.8

      \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\frac{\color{blue}{d}}{\sqrt{h}}}{M}}\right)}^{2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-309}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{D \cdot 0.5}{\frac{\frac{d}{\sqrt{h}}}{M}}\right)}^{2}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy69.9%
Cost42636
\[\begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\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 -4 \cdot 10^{-206}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{h \cdot w} \cdot \frac{\frac{d}{D}}{\frac{D}{d}}\right)\right)\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;M \cdot \left(\frac{D \cdot \left(0.25 \cdot D\right)}{\frac{d}{M}} \cdot \frac{h}{d}\right)\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;{\left(\frac{d \cdot \frac{c0}{D}}{\sqrt{h} \cdot w}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \end{array} \]
Alternative 2
Accuracy69.0%
Cost13572
\[\begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-309}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(M \cdot \frac{D \cdot 0.5}{\frac{d}{\sqrt{h}}}\right)}^{2}\\ \end{array} \]
Alternative 3
Accuracy64.0%
Cost2000
\[\begin{array}{l} t_0 := \left(c0 \cdot c0\right) \cdot \frac{0}{w}\\ \mathbf{if}\;c0 \leq 5.8 \cdot 10^{-156}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{elif}\;c0 \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{d}{D} \cdot \left(\frac{\frac{d}{D}}{h \cdot w} \cdot \left(c0 \cdot c0\right)\right)}{w}\\ \mathbf{elif}\;c0 \leq 10^{-17}:\\ \;\;\;\;t_0 + D \cdot \left(M \cdot \left(h \cdot \frac{\frac{D \cdot \left(0.25 \cdot M\right)}{d}}{d}\right)\right)\\ \mathbf{elif}\;c0 \leq 9.4 \cdot 10^{+57}:\\ \;\;\;\;t_0 + D \cdot \left(h \cdot \frac{0.25 \cdot \frac{D \cdot M}{d}}{\frac{d}{M}}\right)\\ \mathbf{else}:\\ \;\;\;\;M \cdot \left(\frac{0.25 \cdot D}{d} \cdot \frac{D}{\frac{d}{h \cdot M}}\right)\\ \end{array} \]
Alternative 4
Accuracy63.9%
Cost1868
\[\begin{array}{l} \mathbf{if}\;c0 \leq 5.2 \cdot 10^{-156}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{elif}\;c0 \leq 8 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{d}{D} \cdot \left(\frac{\frac{d}{D}}{h \cdot w} \cdot \left(c0 \cdot c0\right)\right)}{w}\\ \mathbf{elif}\;c0 \leq 1.16 \cdot 10^{+60}:\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \frac{0}{w} + D \cdot \left(M \cdot \left(h \cdot \frac{\frac{D \cdot \left(0.25 \cdot M\right)}{d}}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;M \cdot \left(\frac{0.25 \cdot D}{d} \cdot \frac{D}{\frac{d}{h \cdot M}}\right)\\ \end{array} \]
Alternative 5
Accuracy63.5%
Cost1353
\[\begin{array}{l} \mathbf{if}\;c0 \leq 5.8 \cdot 10^{-156} \lor \neg \left(c0 \leq 5 \cdot 10^{-95}\right):\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \left(\frac{d}{D \cdot w} \cdot \frac{\frac{\frac{d}{w}}{D}}{h}\right)\\ \end{array} \]
Alternative 6
Accuracy48.2%
Cost1352
\[\begin{array}{l} \mathbf{if}\;c0 \leq 5.8 \cdot 10^{-156}:\\ \;\;\;\;0\\ \mathbf{elif}\;c0 \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \left(\frac{d}{D \cdot w} \cdot \frac{\frac{\frac{d}{w}}{D}}{h}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 7
Accuracy63.7%
Cost1352
\[\begin{array}{l} \mathbf{if}\;c0 \leq 5.8 \cdot 10^{-156}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{elif}\;c0 \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\left(c0 \cdot c0\right) \cdot \left(\frac{d}{D \cdot w} \cdot \frac{\frac{\frac{d}{w}}{D}}{h}\right)\\ \mathbf{else}:\\ \;\;\;\;M \cdot \left(\frac{0.25 \cdot D}{d} \cdot \frac{D}{\frac{d}{h \cdot M}}\right)\\ \end{array} \]
Alternative 8
Accuracy63.7%
Cost1352
\[\begin{array}{l} t_0 := D \cdot \frac{w}{d}\\ \mathbf{if}\;c0 \leq 5.8 \cdot 10^{-156}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{elif}\;c0 \leq 5.3 \cdot 10^{-95}:\\ \;\;\;\;\frac{c0 \cdot c0}{t_0 \cdot \left(h \cdot t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;M \cdot \left(\frac{0.25 \cdot D}{d} \cdot \frac{D}{\frac{d}{h \cdot M}}\right)\\ \end{array} \]
Alternative 9
Accuracy64.1%
Cost1352
\[\begin{array}{l} \mathbf{if}\;c0 \leq 5.8 \cdot 10^{-156}:\\ \;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\ \mathbf{elif}\;c0 \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{d}{D} \cdot \left(\frac{\frac{d}{D}}{h \cdot w} \cdot \left(c0 \cdot c0\right)\right)}{w}\\ \mathbf{else}:\\ \;\;\;\;M \cdot \left(\frac{0.25 \cdot D}{d} \cdot \frac{D}{\frac{d}{h \cdot M}}\right)\\ \end{array} \]
Alternative 10
Accuracy58.8%
Cost1220
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 0:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;D \cdot \left(\left(0.25 \cdot \left(D \cdot M\right)\right) \cdot \frac{h \cdot M}{d \cdot d}\right)\\ \end{array} \]
Alternative 11
Accuracy49.5%
Cost64
\[0 \]

Error

Reproduce?

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