Average Error: 59.8 → 17.6
Time: 37.8s
Precision: binary64
Cost: 36556
\[\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 -5 \cdot 10^{-143}:\\ \;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \frac{\frac{d}{h} \cdot \frac{d}{w}}{w}\\ \mathbf{elif}\;t_2 \leq 10^{-291}:\\ \;\;\;\;\mathsf{fma}\left(0.25, h \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}, 0\right)\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot h}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \frac{D}{\frac{\frac{d}{M}}{h}}, 0\right)\\ \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 -5e-143)
     (* (* (/ c0 D) (/ c0 D)) (/ (* (/ d h) (/ d w)) w))
     (if (<= t_2 1e-291)
       (fma 0.25 (* h (pow (* M (/ D d)) 2.0)) 0.0)
       (if (<= t_2 INFINITY)
         (* t_0 (* 2.0 (* c0 (/ (* (/ d D) (/ d D)) (* w h)))))
         (fma 0.25 (* (/ D (/ d M)) (/ D (/ (/ d M) h))) 0.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 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 <= -5e-143) {
		tmp = ((c0 / D) * (c0 / D)) * (((d / h) * (d / w)) / w);
	} else if (t_2 <= 1e-291) {
		tmp = fma(0.25, (h * pow((M * (D / d)), 2.0)), 0.0);
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_0 * (2.0 * (c0 * (((d / D) * (d / D)) / (w * h))));
	} else {
		tmp = fma(0.25, ((D / (d / M)) * (D / ((d / M) / h))), 0.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)
	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 <= -5e-143)
		tmp = Float64(Float64(Float64(c0 / D) * Float64(c0 / D)) * Float64(Float64(Float64(d / h) * Float64(d / w)) / w));
	elseif (t_2 <= 1e-291)
		tmp = fma(0.25, Float64(h * (Float64(M * Float64(D / d)) ^ 2.0)), 0.0);
	elseif (t_2 <= Inf)
		tmp = Float64(t_0 * Float64(2.0 * Float64(c0 * Float64(Float64(Float64(d / D) * Float64(d / D)) / Float64(w * h)))));
	else
		tmp = fma(0.25, Float64(Float64(D / Float64(d / M)) * Float64(D / Float64(Float64(d / M) / h))), 0.0);
	end
	return 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, -5e-143], N[(N[(N[(c0 / D), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(d / h), $MachinePrecision] * N[(d / w), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-291], N[(0.25 * N[(h * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$0 * N[(2.0 * N[(c0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(D / N[(N[(d / M), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.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}
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 -5 \cdot 10^{-143}:\\
\;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \frac{\frac{d}{h} \cdot \frac{d}{w}}{w}\\

\mathbf{elif}\;t_2 \leq 10^{-291}:\\
\;\;\;\;\mathsf{fma}\left(0.25, h \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}, 0\right)\\

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

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


\end{array}

Error

Derivation

  1. Split input into 4 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -5.0000000000000002e-143

    1. Initial program 50.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. Applied egg-rr51.2

      \[\leadsto \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 \color{blue}{\left(\frac{d \cdot d}{w \cdot \left(h \cdot D\right)} \cdot \frac{c0}{D}\right)} - M \cdot M}\right) \]
    3. Taylor expanded in c0 around inf 45.4

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(2 \cdot \left(c0 \cdot \left(\frac{d}{\left(D \cdot D\right) \cdot w} \cdot \frac{d}{h}\right)\right)\right)} \]
      Proof
      (*.f64 2 (*.f64 c0 (*.f64 (/.f64 d (*.f64 (*.f64 D D) w)) (/.f64 d h)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 c0 (*.f64 (/.f64 d (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) w)) (/.f64 d h)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 c0 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 (*.f64 (pow.f64 D 2) w) h))))): 34 points increase in error, 13 points decrease in error
      (*.f64 2 (*.f64 c0 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 d 2)) (*.f64 (*.f64 (pow.f64 D 2) w) h)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 c0 (/.f64 (pow.f64 d 2) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 D 2) (*.f64 w h)))))): 10 points increase in error, 7 points decrease in error
      (*.f64 2 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 c0 (pow.f64 d 2)) (*.f64 (pow.f64 D 2) (*.f64 w h))))): 21 points increase in error, 7 points decrease in error
      (*.f64 2 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 d 2) c0)) (*.f64 (pow.f64 D 2) (*.f64 w h)))): 0 points increase in error, 0 points decrease in error
    5. Taylor expanded in c0 around 0 54.0

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

      \[\leadsto \color{blue}{\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \frac{\frac{d}{h} \cdot \frac{d}{w}}{w}} \]
      Proof
      (*.f64 (*.f64 (/.f64 c0 D) (/.f64 c0 D)) (/.f64 (*.f64 (/.f64 d h) (/.f64 d w)) w)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 c0 c0) (*.f64 D D))) (/.f64 (*.f64 (/.f64 d h) (/.f64 d w)) w)): 43 points increase in error, 6 points decrease in error
      (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 c0 2)) (*.f64 D D)) (/.f64 (*.f64 (/.f64 d h) (/.f64 d w)) w)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 c0 2) (Rewrite<= unpow2_binary64 (pow.f64 D 2))) (/.f64 (*.f64 (/.f64 d h) (/.f64 d w)) w)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 c0 2) (pow.f64 D 2)) (/.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 h w))) w)): 13 points increase in error, 8 points decrease in error
      (*.f64 (/.f64 (pow.f64 c0 2) (pow.f64 D 2)) (/.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 d 2)) (*.f64 h w)) w)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 c0 2) (pow.f64 D 2)) (/.f64 (/.f64 (pow.f64 d 2) (Rewrite<= *-commutative_binary64 (*.f64 w h))) w)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 c0 2) (pow.f64 D 2)) (Rewrite=> associate-/l/_binary64 (/.f64 (pow.f64 d 2) (*.f64 w (*.f64 w h))))): 4 points increase in error, 3 points decrease in error
      (*.f64 (/.f64 (pow.f64 c0 2) (pow.f64 D 2)) (/.f64 (pow.f64 d 2) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 w w) h)))): 3 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 (pow.f64 c0 2) (pow.f64 D 2)) (/.f64 (pow.f64 d 2) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 w 2)) h))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (pow.f64 c0 2) (pow.f64 d 2)) (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 w 2) h)))): 8 points increase in error, 7 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 d 2) (pow.f64 c0 2))) (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 w 2) h))): 0 points increase in error, 0 points decrease in error

    if -5.0000000000000002e-143 < (*.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))))) < 9.99999999999999962e-292

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

      \[\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}}} \]
    3. Simplified22.8

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.25, \left(\frac{D}{d \cdot d} \cdot D\right) \cdot \left(M \cdot \left(M \cdot h\right)\right), 0\right)} \]
      Proof
      (fma.f64 1/4 (*.f64 (*.f64 (/.f64 D (*.f64 d d)) D) (*.f64 M (*.f64 M h))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (*.f64 (/.f64 D (Rewrite<= unpow2_binary64 (pow.f64 d 2))) D) (*.f64 M (*.f64 M h))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (Rewrite<= associate-/r/_binary64 (/.f64 D (/.f64 (pow.f64 d 2) D))) (*.f64 M (*.f64 M h))) 0): 4 points increase in error, 3 points decrease in error
      (fma.f64 1/4 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 D D) (pow.f64 d 2))) (*.f64 M (*.f64 M h))) 0): 34 points increase in error, 6 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (pow.f64 d 2)) (*.f64 M (*.f64 M h))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 M M) h))) 0): 13 points increase in error, 3 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 M 2)) h)) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= *-commutative_binary64 (*.f64 h (pow.f64 M 2)))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 D 2) (/.f64 (pow.f64 d 2) (*.f64 h (pow.f64 M 2))))) 0): 4 points increase in error, 9 points decrease in error
      (fma.f64 1/4 (/.f64 (pow.f64 D 2) (/.f64 (pow.f64 d 2) (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 M 2) h)))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2))) 0): 5 points increase in error, 5 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (Rewrite<= div0_binary64 (/.f64 0 (/.f64 w (pow.f64 c0 2))))): 52 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (Rewrite<= metadata-eval (*.f64 -1/2 0)) (/.f64 w (pow.f64 c0 2)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (*.f64 -1/2 (Rewrite<= mul0-lft_binary64 (*.f64 0 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))))) (/.f64 w (pow.f64 c0 2)))): 79 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (*.f64 -1/2 (*.f64 (Rewrite<= metadata-eval (+.f64 -1 1)) (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (/.f64 w (pow.f64 c0 2)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (*.f64 -1/2 (Rewrite<= distribute-rgt1-in_binary64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))))) (/.f64 w (pow.f64 c0 2)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (Rewrite<= associate-*r/_binary64 (*.f64 -1/2 (/.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (/.f64 w (pow.f64 c0 2)))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (*.f64 -1/2 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (pow.f64 c0 2)) w)))): 0 points increase in error, 2 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2))) (*.f64 -1/2 (/.f64 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (pow.f64 c0 2)) w)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1/2 (/.f64 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (pow.f64 c0 2)) w)) (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2))))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr16.8

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

    if 9.99999999999999962e-292 < (*.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 50.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. Taylor expanded in c0 around inf 42.8

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(2 \cdot \left(\frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot h} \cdot c0\right)\right)} \]
      Proof
      (*.f64 2 (*.f64 (/.f64 (*.f64 (/.f64 d D) (/.f64 d D)) (*.f64 w h)) c0)): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 (/.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 D D))) (*.f64 w h)) c0)): 53 points increase in error, 15 points decrease in error
      (*.f64 2 (*.f64 (/.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 d 2)) (*.f64 D D)) (*.f64 w h)) c0)): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 (/.f64 (/.f64 (pow.f64 d 2) (Rewrite<= unpow2_binary64 (pow.f64 D 2))) (*.f64 w h)) c0)): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 (Rewrite<= associate-/r*_binary64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))) c0)): 11 points increase in error, 7 points decrease in error
      (*.f64 2 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 d 2) (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w h)) c0)))): 12 points increase in error, 12 points decrease in error
      (*.f64 2 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 d 2) c0) (*.f64 (pow.f64 D 2) (*.f64 w h))))): 21 points increase in error, 8 points decrease in error

    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. Taylor expanded in c0 around -inf 63.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}}} \]
    3. Simplified28.7

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.25, \left(\frac{D}{d \cdot d} \cdot D\right) \cdot \left(M \cdot \left(M \cdot h\right)\right), 0\right)} \]
      Proof
      (fma.f64 1/4 (*.f64 (*.f64 (/.f64 D (*.f64 d d)) D) (*.f64 M (*.f64 M h))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (*.f64 (/.f64 D (Rewrite<= unpow2_binary64 (pow.f64 d 2))) D) (*.f64 M (*.f64 M h))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (Rewrite<= associate-/r/_binary64 (/.f64 D (/.f64 (pow.f64 d 2) D))) (*.f64 M (*.f64 M h))) 0): 4 points increase in error, 3 points decrease in error
      (fma.f64 1/4 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 D D) (pow.f64 d 2))) (*.f64 M (*.f64 M h))) 0): 34 points increase in error, 6 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (pow.f64 d 2)) (*.f64 M (*.f64 M h))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 M M) h))) 0): 13 points increase in error, 3 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 M 2)) h)) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= *-commutative_binary64 (*.f64 h (pow.f64 M 2)))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 D 2) (/.f64 (pow.f64 d 2) (*.f64 h (pow.f64 M 2))))) 0): 4 points increase in error, 9 points decrease in error
      (fma.f64 1/4 (/.f64 (pow.f64 D 2) (/.f64 (pow.f64 d 2) (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 M 2) h)))) 0): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2))) 0): 5 points increase in error, 5 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (Rewrite<= div0_binary64 (/.f64 0 (/.f64 w (pow.f64 c0 2))))): 52 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (Rewrite<= metadata-eval (*.f64 -1/2 0)) (/.f64 w (pow.f64 c0 2)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (*.f64 -1/2 (Rewrite<= mul0-lft_binary64 (*.f64 0 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))))) (/.f64 w (pow.f64 c0 2)))): 79 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (*.f64 -1/2 (*.f64 (Rewrite<= metadata-eval (+.f64 -1 1)) (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (/.f64 w (pow.f64 c0 2)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (/.f64 (*.f64 -1/2 (Rewrite<= distribute-rgt1-in_binary64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))))) (/.f64 w (pow.f64 c0 2)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (Rewrite<= associate-*r/_binary64 (*.f64 -1/2 (/.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (/.f64 w (pow.f64 c0 2)))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)) (*.f64 -1/2 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (pow.f64 c0 2)) w)))): 0 points increase in error, 2 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2))) (*.f64 -1/2 (/.f64 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (pow.f64 c0 2)) w)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 -1/2 (/.f64 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) (pow.f64 c0 2)) w)) (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2))))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in D around 0 34.0

      \[\leadsto \mathsf{fma}\left(0.25, \color{blue}{\frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}}, 0\right) \]
    5. Simplified13.9

      \[\leadsto \mathsf{fma}\left(0.25, \color{blue}{\frac{D}{\frac{d}{M}} \cdot \frac{D}{\frac{\frac{d}{M}}{h}}}, 0\right) \]
      Proof
      (*.f64 (/.f64 D (/.f64 d M)) (/.f64 D (/.f64 (/.f64 d M) h))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 D (/.f64 d M)) (/.f64 D (Rewrite<= associate-/r*_binary64 (/.f64 d (*.f64 M h))))): 18 points increase in error, 11 points decrease in error
      (Rewrite<= times-frac_binary64 (/.f64 (*.f64 D D) (*.f64 (/.f64 d M) (/.f64 d (*.f64 M h))))): 56 points increase in error, 10 points decrease in error
      (/.f64 (*.f64 D D) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 M (*.f64 M h))))): 47 points increase in error, 4 points decrease in error
      (/.f64 (*.f64 D D) (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 d 2)) (*.f64 M (*.f64 M h)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 D D) (/.f64 (pow.f64 d 2) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 M M) h)))): 16 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 D D) (/.f64 (pow.f64 d 2) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 M 2)) h))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 D D) (/.f64 (pow.f64 d 2) (Rewrite<= *-commutative_binary64 (*.f64 h (pow.f64 M 2))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (/.f64 (pow.f64 d 2) (*.f64 h (pow.f64 M 2)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (pow.f64 d 2))): 5 points increase in error, 5 points decrease in error
  3. Recombined 4 regimes into one program.
  4. Final simplification17.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq -5 \cdot 10^{-143}:\\ \;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \frac{\frac{d}{h} \cdot \frac{d}{w}}{w}\\ \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 10^{-291}:\\ \;\;\;\;\mathsf{fma}\left(0.25, h \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}, 0\right)\\ \mathbf{elif}\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq \infty:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot h}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \frac{D}{\frac{\frac{d}{M}}{h}}, 0\right)\\ \end{array} \]

Alternatives

Alternative 1
Error17.5
Cost36556
\[\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 -5 \cdot 10^{-143}:\\ \;\;\;\;\left(\frac{c0}{D} \cdot \frac{c0}{D}\right) \cdot \frac{\frac{d}{h} \cdot \frac{d}{w}}{w}\\ \mathbf{elif}\;t_2 \leq 10^{-291}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot D\right)\right)\right)\right)\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot h}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \frac{D}{\frac{\frac{d}{M}}{h}}, 0\right)\\ \end{array} \]
Alternative 2
Error20.2
Cost7624
\[\begin{array}{l} \mathbf{if}\;D \leq -5 \cdot 10^{-237}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot D\right)\right)\right)\right)\\ \mathbf{elif}\;D \leq 1.7 \cdot 10^{-128}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}}{d}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(\frac{D}{d} \cdot \left(h \cdot M\right)\right), 0\right)\\ \end{array} \]
Alternative 3
Error21.5
Cost7564
\[\begin{array}{l} t_0 := {\left(D \cdot M\right)}^{2}\\ \mathbf{if}\;d \leq 6.8 \cdot 10^{-130}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(D \cdot \left(\frac{D}{d} \cdot \left(h \cdot \frac{M}{d}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq 4.5 \cdot 10^{+15}:\\ \;\;\;\;0.25 \cdot \frac{\frac{t_0}{d}}{\frac{d}{h}}\\ \mathbf{elif}\;d \leq 1.05 \cdot 10^{+135}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot D\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{t_0 \cdot \frac{h}{d}}{d}\\ \end{array} \]
Alternative 4
Error20.8
Cost7432
\[\begin{array}{l} \mathbf{if}\;D \leq -5 \cdot 10^{-237}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot D\right)\right)\right)\right)\\ \mathbf{elif}\;D \leq 1.7 \cdot 10^{-128}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \frac{{\left(D \cdot M\right)}^{2}}{d}}{d}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(D \cdot \left(\frac{D}{d} \cdot \left(h \cdot \frac{M}{d}\right)\right)\right)\right)\\ \end{array} \]
Alternative 5
Error26.8
Cost1480
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 0:\\ \;\;\;\;0\\ \mathbf{elif}\;D \cdot D \leq 2.6 \cdot 10^{+283}:\\ \;\;\;\;h \cdot \left(\left(0.25 \cdot \frac{D \cdot D}{d}\right) \cdot \frac{M}{\frac{d}{M}}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 6
Error23.2
Cost1480
\[\begin{array}{l} t_0 := 0.25 \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot \frac{D}{d \cdot \frac{d}{D}}\right)\right)\\ \mathbf{if}\;D \cdot D \leq 5 \cdot 10^{-250}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \cdot D \leq 10^{+174}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot \left(D \cdot \frac{D}{d}\right)\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error21.3
Cost1480
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-74}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot \frac{D}{d \cdot \frac{d}{D}}\right)\right)\\ \mathbf{elif}\;d \cdot d \leq 4 \cdot 10^{+299}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot D\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{h}{d} \cdot \left(M \cdot \left(D \cdot \frac{D \cdot M}{d}\right)\right)\right)\\ \end{array} \]
Alternative 8
Error24.8
Cost1224
\[\begin{array}{l} t_0 := 0.25 \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot \left(D \cdot \frac{D}{d}\right)\right)}{d}\\ \mathbf{if}\;M \leq -1.0617770232417161 \cdot 10^{-166}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M \leq 7.793804500218217 \cdot 10^{-201}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error21.3
Cost1224
\[\begin{array}{l} t_0 := 0.25 \cdot \left(\frac{M}{d} \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot D\right)\right)\right)\right)\\ \mathbf{if}\;d \leq -9.5 \cdot 10^{-36}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 2.2 \cdot 10^{-129}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot \frac{D}{d \cdot \frac{d}{D}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error21.6
Cost960
\[0.25 \cdot \left(M \cdot \left(D \cdot \left(\frac{D}{d} \cdot \left(h \cdot \frac{M}{d}\right)\right)\right)\right) \]
Alternative 11
Error32.0
Cost64
\[0 \]

Error

Reproduce

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