Average Error: 59.7 → 21.0
Time: 35.1s
Precision: binary64
Cost: 13704
\[\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 -2.15 \cdot 10^{-110}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(h \cdot M\right)\right)\right)\\ \mathbf{elif}\;h \leq 2 \cdot 10^{-287}:\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{M \cdot \left(h \cdot M\right)} \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot {\left(M \cdot \left(\frac{D}{d} \cdot \sqrt{h}\right)\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 -2.15e-110)
   (* 0.25 (* M (* (pow (/ D d) 2.0) (* h M))))
   (if (<= h 2e-287)
     (* 0.25 (/ D (* (/ d (* M (* h M))) (/ d D))))
     (* 0.25 (pow (* M (* (/ D d) (sqrt h))) 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 <= -2.15e-110) {
		tmp = 0.25 * (M * (pow((D / d), 2.0) * (h * M)));
	} else if (h <= 2e-287) {
		tmp = 0.25 * (D / ((d / (M * (h * M))) * (d / D)));
	} else {
		tmp = 0.25 * pow((M * ((D / d) * sqrt(h))), 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 <= (-2.15d-110)) then
        tmp = 0.25d0 * (m * (((d / d_1) ** 2.0d0) * (h * m)))
    else if (h <= 2d-287) then
        tmp = 0.25d0 * (d / ((d_1 / (m * (h * m))) * (d_1 / d)))
    else
        tmp = 0.25d0 * ((m * ((d / d_1) * sqrt(h))) ** 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 <= -2.15e-110) {
		tmp = 0.25 * (M * (Math.pow((D / d), 2.0) * (h * M)));
	} else if (h <= 2e-287) {
		tmp = 0.25 * (D / ((d / (M * (h * M))) * (d / D)));
	} else {
		tmp = 0.25 * Math.pow((M * ((D / d) * Math.sqrt(h))), 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 <= -2.15e-110:
		tmp = 0.25 * (M * (math.pow((D / d), 2.0) * (h * M)))
	elif h <= 2e-287:
		tmp = 0.25 * (D / ((d / (M * (h * M))) * (d / D)))
	else:
		tmp = 0.25 * math.pow((M * ((D / d) * math.sqrt(h))), 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 <= -2.15e-110)
		tmp = Float64(0.25 * Float64(M * Float64((Float64(D / d) ^ 2.0) * Float64(h * M))));
	elseif (h <= 2e-287)
		tmp = Float64(0.25 * Float64(D / Float64(Float64(d / Float64(M * Float64(h * M))) * Float64(d / D))));
	else
		tmp = Float64(0.25 * (Float64(M * Float64(Float64(D / d) * sqrt(h))) ^ 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 <= -2.15e-110)
		tmp = 0.25 * (M * (((D / d) ^ 2.0) * (h * M)));
	elseif (h <= 2e-287)
		tmp = 0.25 * (D / ((d / (M * (h * M))) * (d / D)));
	else
		tmp = 0.25 * ((M * ((D / d) * sqrt(h))) ^ 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, -2.15e-110], N[(0.25 * N[(M * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2e-287], N[(0.25 * N[(D / N[(N[(d / N[(M * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[Power[N[(M * N[(N[(D / d), $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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}
\mathbf{if}\;h \leq -2.15 \cdot 10^{-110}:\\
\;\;\;\;0.25 \cdot \left(M \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(h \cdot M\right)\right)\right)\\

\mathbf{elif}\;h \leq 2 \cdot 10^{-287}:\\
\;\;\;\;0.25 \cdot \frac{D}{\frac{d}{M \cdot \left(h \cdot M\right)} \cdot \frac{d}{D}}\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if h < -2.15000000000000012e-110

    1. Initial program 59.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. Simplified62.2

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

      associate-*l/ [<=]60.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 [=>]60.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 [=>]61.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* [=>]61.2

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

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

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

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

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

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

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

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

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

      *-commutative [<=]35.7

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

      associate-/l* [=>]35.7

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

      unpow2 [=>]35.7

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

      unpow2 [=>]35.7

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

      *-commutative [=>]35.7

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

      unpow2 [=>]35.7

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

      associate-*r* [<=]35.2

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

      associate-/r/ [=>]35.3

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

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

      \[ 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. Taylor expanded in D around 0 35.7

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

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

      [Start]35.7

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

      *-commutative [<=]35.7

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

      associate-/l* [=>]35.7

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

      unpow2 [=>]35.7

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

      unpow2 [=>]35.7

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

      unpow2 [=>]35.7

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

      associate-*r* [<=]35.2

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

      associate-*l/ [<=]33.4

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

      times-frac [=>]28.4

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

      *-rgt-identity [<=]28.4

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

      *-commutative [=>]28.4

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

      metadata-eval [<=]28.4

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

      times-frac [<=]28.4

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

      neg-mul-1 [<=]28.4

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

      neg-mul-1 [<=]28.4

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

      times-frac [<=]33.4

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

      associate-*l/ [=>]35.2

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

      associate-/r/ [=>]35.3

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

    if -2.15000000000000012e-110 < h < 2.00000000000000004e-287

    1. Initial program 60.2

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

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

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

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

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

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

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

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

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

      \[\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.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 [=>]60.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 34.5

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

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

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

      *-commutative [<=]34.5

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

      associate-/l* [=>]34.6

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

      unpow2 [=>]34.6

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

      unpow2 [=>]34.6

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

      *-commutative [=>]34.6

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

      unpow2 [=>]34.6

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

      associate-*r* [<=]31.1

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

      associate-/r/ [=>]31.0

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

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

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

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

    if 2.00000000000000004e-287 < h

    1. Initial program 59.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. Simplified61.8

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

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

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

      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 59.9

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

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

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

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

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

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

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

      *-commutative [<=]36.4

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

      associate-/l* [=>]36.6

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

      unpow2 [=>]36.6

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

      unpow2 [=>]36.6

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

      *-commutative [=>]36.6

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

      unpow2 [=>]36.6

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

      associate-*r* [<=]34.9

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

      associate-/r/ [=>]34.7

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

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

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

      \[\leadsto 0.25 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({\left(\frac{D}{d} \cdot \left(M \cdot \sqrt{h}\right)\right)}^{2}\right)} - 1\right)} \]
    8. Simplified17.3

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

      [Start]27.7

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

      expm1-def [=>]17.6

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

      expm1-log1p [=>]17.2

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

      *-commutative [=>]17.2

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

      associate-*l* [=>]17.3

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

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

Alternatives

Alternative 1
Error25.8
Cost8656
\[\begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ \mathbf{if}\;M \leq -4.1 \cdot 10^{+164}:\\ \;\;\;\;t_0 \cdot \mathsf{fma}\left(0.5, \frac{\left(M \cdot \frac{w}{d}\right) \cdot \left(D \cdot \left(D \cdot \frac{h \cdot M}{d}\right)\right)}{c0}, c0 \cdot 0\right)\\ \mathbf{elif}\;M \leq -3.1 \cdot 10^{+23}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot {\left(\frac{D}{d}\right)}^{2}\right)\right)\\ \mathbf{elif}\;M \leq 4 \cdot 10^{+124}:\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{M \cdot \left(h \cdot M\right)} \cdot \frac{d}{D}}\\ \mathbf{elif}\;M \leq 9 \cdot 10^{+242}:\\ \;\;\;\;t_0 \cdot \mathsf{fma}\left(0.5, \frac{D \cdot \left(\frac{w}{d} \cdot \frac{M}{\frac{\frac{d}{h \cdot D}}{M}}\right)}{c0}, c0 \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(D \cdot \left(M \cdot \left(\frac{h}{\frac{c0}{M}} \cdot \left(\frac{D}{d} \cdot \frac{w}{d}\right)\right)\right)\right) \cdot \frac{0.25 \cdot c0}{w}\\ \end{array} \]
Alternative 2
Error25.8
Cost8656
\[\begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ \mathbf{if}\;M \leq -4.1 \cdot 10^{+164}:\\ \;\;\;\;t_0 \cdot \mathsf{fma}\left(0.5, \frac{\left(M \cdot \frac{w}{d}\right) \cdot \left(D \cdot \left(D \cdot \frac{h \cdot M}{d}\right)\right)}{c0}, c0 \cdot 0\right)\\ \mathbf{elif}\;M \leq -1.8 \cdot 10^{+26}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot M\right) \cdot \left(h \cdot {\left(\frac{D}{d}\right)}^{2}\right)\right)\\ \mathbf{elif}\;M \leq 1.25 \cdot 10^{+125}:\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{M \cdot \left(h \cdot M\right)} \cdot \frac{d}{D}}\\ \mathbf{elif}\;M \leq 2.6 \cdot 10^{+207}:\\ \;\;\;\;t_0 \cdot \mathsf{fma}\left(0.5, \frac{D \cdot \left(\frac{w}{d} \cdot \frac{M}{\frac{\frac{d}{h \cdot D}}{M}}\right)}{c0}, c0 \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \mathsf{fma}\left(0.5, \frac{\left(D \cdot \frac{M \cdot w}{d}\right) \cdot \frac{h \cdot M}{\frac{d}{D}}}{c0}, c0 \cdot 0\right)\\ \end{array} \]
Alternative 3
Error26.0
Cost8392
\[\begin{array}{l} \mathbf{if}\;c0 \leq -4 \cdot 10^{-266}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(h \cdot M\right)\right)\right)\\ \mathbf{elif}\;c0 \leq 1.95 \cdot 10^{+107}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot \left(\frac{w}{d} \cdot \frac{M}{\frac{\frac{d}{h \cdot D}}{M}}\right)}{c0}, c0 \cdot 0\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{M \cdot \left(h \cdot M\right)} \cdot \frac{d}{D}}\\ \end{array} \]
Alternative 4
Error24.0
Cost7433
\[\begin{array}{l} \mathbf{if}\;h \leq -4.9 \cdot 10^{-110} \lor \neg \left(h \leq 8 \cdot 10^{-155}\right):\\ \;\;\;\;0.25 \cdot \left(M \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(h \cdot M\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{M \cdot \left(h \cdot M\right)} \cdot \frac{d}{D}}\\ \end{array} \]
Alternative 5
Error27.6
Cost1225
\[\begin{array}{l} \mathbf{if}\;c0 \leq -1.75 \cdot 10^{-275} \lor \neg \left(c0 \leq 2.3 \cdot 10^{+114}\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 6
Error26.5
Cost1225
\[\begin{array}{l} \mathbf{if}\;c0 \leq -1.35 \cdot 10^{-275} \lor \neg \left(c0 \leq 4.5 \cdot 10^{-100}\right):\\ \;\;\;\;0.25 \cdot \frac{D}{\frac{d}{M \cdot \left(h \cdot M\right)} \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 7
Error32.1
Cost64
\[0 \]

Error

Reproduce

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