?

Average Error: 59.7 → 16.7
Time: 31.2s
Precision: binary64
Cost: 10820

?

\[\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 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \leq -4 \cdot 10^{+235}:\\ \;\;\;\;\frac{d \cdot \left(\frac{d}{D} \cdot \left(\frac{c0}{w \cdot w} \cdot \frac{c0}{h}\right)\right)}{D}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(D \cdot \frac{M}{d}\right)}{\frac{\frac{d}{M}}{D}}\\ \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (*
  (/ c0 (* 2.0 w))
  (+
   (/ (* c0 (* d d)) (* (* w h) (* D D)))
   (sqrt
    (-
     (*
      (/ (* c0 (* d d)) (* (* w h) (* D D)))
      (/ (* c0 (* d d)) (* (* w h) (* D D))))
     (* M M))))))
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<= (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M))))) -4e+235)
     (/ (* d (* (/ d D) (* (/ c0 (* w w)) (/ c0 h)))) D)
     (* 0.25 (/ (* h (* D (/ M d))) (/ (/ d M) D))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= -4e+235) {
		tmp = (d * ((d / D) * ((c0 / (w * w)) * (c0 / h)))) / D;
	} else {
		tmp = 0.25 * ((h * (D * (M / d))) / ((d / M) / D));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = (c0 / (2.0d0 * w)) * (((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) + sqrt(((((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d)))) - (m * m))))
end function
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    if (((c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))) <= (-4d+235)) then
        tmp = (d_1 * ((d_1 / d) * ((c0 / (w * w)) * (c0 / h)))) / d
    else
        tmp = 0.25d0 * ((h * (d * (m / d_1))) / ((d_1 / m) / d))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double tmp;
	if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= -4e+235) {
		tmp = (d * ((d / D) * ((c0 / (w * w)) * (c0 / h)))) / D;
	} else {
		tmp = 0.25 * ((h * (D * (M / d))) / ((d / M) / D));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))))
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	tmp = 0
	if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= -4e+235:
		tmp = (d * ((d / D) * ((c0 / (w * w)) * (c0 / h)))) / D
	else:
		tmp = 0.25 * ((h * (D * (M / d))) / ((d / M) / D))
	return tmp
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M)))))
end
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	tmp = 0.0
	if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= -4e+235)
		tmp = Float64(Float64(d * Float64(Float64(d / D) * Float64(Float64(c0 / Float64(w * w)) * Float64(c0 / h)))) / D);
	else
		tmp = Float64(0.25 * Float64(Float64(h * Float64(D * Float64(M / d))) / Float64(Float64(d / M) / D)));
	end
	return tmp
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = 0.0;
	if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= -4e+235)
		tmp = (d * ((d / D) * ((c0 / (w * w)) * (c0 / h)))) / D;
	else
		tmp = 0.25 * ((h * (D * (M / d))) / ((d / M) / D));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -4e+235], N[(N[(d * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision] * N[(c0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision], N[(0.25 * N[(N[(h * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \leq -4 \cdot 10^{+235}:\\
\;\;\;\;\frac{d \cdot \left(\frac{d}{D} \cdot \left(\frac{c0}{w \cdot w} \cdot \frac{c0}{h}\right)\right)}{D}\\

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


\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 (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -4.0000000000000002e235

    1. Initial program 63.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. Taylor expanded in c0 around inf 58.8

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

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

      [Start]58.8

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

      times-frac [=>]58.7

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

      unpow2 [=>]58.7

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

      unpow2 [=>]58.7

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

      associate-/r* [=>]56.6

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

      associate-*r/ [<=]56.2

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

      associate-*l/ [<=]55.5

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

      unpow2 [=>]55.5

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

      associate-/l* [=>]54.5

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

      *-commutative [=>]54.5

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

      unpow2 [=>]54.5

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

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

    if -4.0000000000000002e235 < (*.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 59.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. Simplified61.9

      \[\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]59.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/ [<=]60.1

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

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

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

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

      \[ \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* [=>]61.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 [=>]61.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 60.1

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

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

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

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

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

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

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

      unpow2 [=>]34.6

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

      unpow2 [=>]34.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* [<=]32.6

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

      *-commutative [<=]32.6

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

      unpow2 [=>]32.6

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

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

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

      [Start]34.6

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

      *-commutative [=>]34.6

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

      unpow2 [=>]34.6

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

      unpow2 [=>]34.6

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

      unpow2 [=>]34.6

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

      associate-*l/ [<=]34.5

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

      associate-*r* [=>]31.5

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

      associate-/r/ [<=]31.1

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

      associate-/r/ [<=]31.8

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

      associate-*r/ [<=]28.6

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

      associate-*l/ [<=]27.4

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

      associate-*r/ [<=]27.0

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

      times-frac [=>]18.4

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

      associate-/l* [<=]19.3

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

      *-commutative [=>]19.3

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

      associate-/l* [=>]19.1

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

      associate-/l* [<=]19.3

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

      *-commutative [=>]19.3

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

      associate-/l* [=>]18.4

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

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

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

Alternatives

Alternative 1
Error21.0
Cost1356
\[\begin{array}{l} \mathbf{if}\;D \leq 6.5 \cdot 10^{-154}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \left(\frac{D \cdot M}{d} \cdot \frac{D}{\frac{d}{M}}\right)\right)\\ \mathbf{elif}\;D \leq 8.2 \cdot 10^{+30}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d}\right)\\ \mathbf{elif}\;D \leq 3 \cdot 10^{+112}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \frac{h}{d}}{\frac{d}{M}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{\left(D \cdot M\right) \cdot \left(h \cdot M\right)}{d}\right)\\ \end{array} \]
Alternative 2
Error17.3
Cost1353
\[\begin{array}{l} \mathbf{if}\;w \leq -1.6 \cdot 10^{+122} \lor \neg \left(w \leq -9 \cdot 10^{+99}\right):\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(D \cdot \frac{M}{d}\right)}{\frac{\frac{d}{M}}{D}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot \left(\frac{c0}{w \cdot w} \cdot \frac{c0}{h}\right)}{D \cdot \frac{D}{d}}\\ \end{array} \]
Alternative 3
Error25.6
Cost1225
\[\begin{array}{l} \mathbf{if}\;D \leq -4 \cdot 10^{-216} \lor \neg \left(D \leq 3 \cdot 10^{-218}\right):\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \left(\frac{h}{d} \cdot \left(M \cdot \frac{M}{d}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 4
Error20.1
Cost1225
\[\begin{array}{l} t_0 := \frac{D}{\frac{d}{M}}\\ \mathbf{if}\;D \leq 4.1 \cdot 10^{-154} \lor \neg \left(D \leq 5 \cdot 10^{+118}\right):\\ \;\;\;\;0.25 \cdot \left(h \cdot \left(t_0 \cdot t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \frac{h}{d}}{\frac{d}{M}}\right)\right)\\ \end{array} \]
Alternative 5
Error20.8
Cost1225
\[\begin{array}{l} \mathbf{if}\;D \leq 6 \cdot 10^{-154} \lor \neg \left(D \leq 5.4 \cdot 10^{+118}\right):\\ \;\;\;\;0.25 \cdot \left(h \cdot \left(\frac{D \cdot M}{d} \cdot \frac{D}{\frac{d}{M}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \frac{h}{d}}{\frac{d}{M}}\right)\right)\\ \end{array} \]
Alternative 6
Error20.8
Cost1225
\[\begin{array}{l} \mathbf{if}\;D \leq 3 \cdot 10^{-156} \lor \neg \left(D \leq 9.5 \cdot 10^{+19}\right):\\ \;\;\;\;0.25 \cdot \left(h \cdot \left(\frac{D \cdot M}{d} \cdot \frac{D}{\frac{d}{M}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d}\right)\\ \end{array} \]
Alternative 7
Error20.9
Cost1224
\[\begin{array}{l} \mathbf{if}\;D \leq 5.6 \cdot 10^{-154}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \left(\frac{D \cdot M}{d} \cdot \frac{D}{\frac{d}{M}}\right)\right)\\ \mathbf{elif}\;D \leq 2.7 \cdot 10^{+145}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d}\right)\\ \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 8
Error20.9
Cost1224
\[\begin{array}{l} \mathbf{if}\;D \leq 4 \cdot 10^{-155}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \left(\frac{D \cdot M}{d} \cdot \frac{D}{\frac{d}{M}}\right)\right)\\ \mathbf{elif}\;D \leq 4.2 \cdot 10^{+145}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \end{array} \]
Alternative 9
Error24.5
Cost1092
\[\begin{array}{l} \mathbf{if}\;d \leq -1.5 \cdot 10^{+130}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{D}{d \cdot \frac{\frac{\frac{d}{M}}{M}}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M}{\frac{\frac{d}{h}}{\frac{M}{d}}}\right)\right)\\ \end{array} \]
Alternative 10
Error24.3
Cost960
\[0.25 \cdot \left(D \cdot \left(D \cdot \frac{M}{\frac{\frac{d}{h}}{\frac{M}{d}}}\right)\right) \]
Alternative 11
Error23.8
Cost960
\[0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \frac{h}{d}}{\frac{d}{M}}\right)\right) \]
Alternative 12
Error16.7
Cost960
\[0.25 \cdot \frac{h \cdot \left(D \cdot \frac{M}{d}\right)}{\frac{\frac{d}{M}}{D}} \]
Alternative 13
Error31.5
Cost64
\[0 \]

Error

Reproduce?

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