Average Error: 59.4 → 18.5
Time: 41.3s
Precision: binary64
Cost: 26884
\[\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}\;D \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \left(\sqrt[3]{M} \cdot \left(\frac{D}{d} \cdot {\left(\sqrt[3]{M}\right)}^{2}\right)\right) \cdot \left(\left(\frac{D}{d} \cdot M\right) \cdot h\right), 0\right)\\ \mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{c0}{2}}{w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h \cdot w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(\frac{M}{d} \cdot \left(D \cdot h\right)\right), 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
 (if (<= D 9.8e+51)
   (fma
    0.25
    (* (* (cbrt M) (* (/ D d) (pow (cbrt M) 2.0))) (* (* (/ D d) M) h))
    0.0)
   (if (<= D 2.1e+98)
     (* (/ (/ c0 2.0) w) (* 2.0 (* c0 (/ (* (/ d D) (/ d D)) (* h w)))))
     (fma 0.25 (* (/ D (/ d M)) (* (/ M d) (* D 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 tmp;
	if (D <= 9.8e+51) {
		tmp = fma(0.25, ((cbrt(M) * ((D / d) * pow(cbrt(M), 2.0))) * (((D / d) * M) * h)), 0.0);
	} else if (D <= 2.1e+98) {
		tmp = ((c0 / 2.0) / w) * (2.0 * (c0 * (((d / D) * (d / D)) / (h * w))));
	} else {
		tmp = fma(0.25, ((D / (d / M)) * ((M / d) * (D * 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)
	tmp = 0.0
	if (D <= 9.8e+51)
		tmp = fma(0.25, Float64(Float64(cbrt(M) * Float64(Float64(D / d) * (cbrt(M) ^ 2.0))) * Float64(Float64(Float64(D / d) * M) * h)), 0.0);
	elseif (D <= 2.1e+98)
		tmp = Float64(Float64(Float64(c0 / 2.0) / w) * Float64(2.0 * Float64(c0 * Float64(Float64(Float64(d / D) * Float64(d / D)) / Float64(h * w)))));
	else
		tmp = fma(0.25, Float64(Float64(D / Float64(d / M)) * Float64(Float64(M / d) * Float64(D * 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_] := If[LessEqual[D, 9.8e+51], N[(0.25 * N[(N[(N[Power[M, 1/3], $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[Power[N[Power[M, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D / d), $MachinePrecision] * M), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], If[LessEqual[D, 2.1e+98], N[(N[(N[(c0 / 2.0), $MachinePrecision] / w), $MachinePrecision] * N[(2.0 * N[(c0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(h * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D / N[(d / M), $MachinePrecision]), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(D * 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}
\mathbf{if}\;D \leq 9.8 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(0.25, \left(\sqrt[3]{M} \cdot \left(\frac{D}{d} \cdot {\left(\sqrt[3]{M}\right)}^{2}\right)\right) \cdot \left(\left(\frac{D}{d} \cdot M\right) \cdot h\right), 0\right)\\

\mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\
\;\;\;\;\frac{\frac{c0}{2}}{w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h \cdot w}\right)\right)\\

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


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if D < 9.79999999999999967e51

    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. Taylor expanded in c0 around -inf 60.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. Simplified29.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): 1 points increase in error, 6 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): 33 points increase in error, 1 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): 22 points increase in error, 0 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): 5 points increase in error, 6 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): 7 points increase in error, 8 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))))): 42 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)))): 90 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, 1 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 33.9

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

      \[\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))))): 15 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))))): 61 points increase in error, 7 points decrease in error
      (/.f64 (*.f64 D D) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 M (*.f64 M h))))): 45 points increase in error, 3 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)))): 14 points increase in error, 4 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))): 8 points increase in error, 7 points decrease in error
    6. Applied egg-rr17.3

      \[\leadsto \mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot h\right)}, 0\right) \]
    7. Applied egg-rr16.2

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

    if 9.79999999999999967e51 < D < 2.10000000000000004e98

    1. Initial program 57.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. Simplified59.5

      \[\leadsto \color{blue}{\frac{\frac{c0}{2}}{w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{4}, M \cdot \left(-M\right)\right)}\right)} \]
      Proof
      (*.f64 (/.f64 (/.f64 c0 2) w) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 w (*.f64 h (*.f64 D D)))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (pow.f64 (/.f64 d D) 4)) (*.f64 M (neg.f64 M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= associate-/r*_binary64 (/.f64 c0 (*.f64 2 w))) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 w (*.f64 h (*.f64 D D)))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (pow.f64 (/.f64 d D) 4)) (*.f64 M (neg.f64 M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 w h) (*.f64 D D)))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (pow.f64 (/.f64 d D) 4)) (*.f64 M (neg.f64 M)))))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (pow.f64 (/.f64 d D) (Rewrite<= metadata-eval (+.f64 3 1)))) (*.f64 M (neg.f64 M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (Rewrite<= pow-plus_binary64 (*.f64 (pow.f64 (/.f64 d D) 3) (/.f64 d D)))) (*.f64 M (neg.f64 M)))))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (Rewrite=> unpow3_binary64 (*.f64 (*.f64 (/.f64 d D) (/.f64 d D)) (/.f64 d D))) (/.f64 d D))) (*.f64 M (neg.f64 M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 D D))) (/.f64 d D)) (/.f64 d D))) (*.f64 M (neg.f64 M)))))): 3 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (Rewrite<= associate-*r*_binary64 (*.f64 (/.f64 (*.f64 d d) (*.f64 D D)) (*.f64 (/.f64 d D) (/.f64 d D))))) (*.f64 M (neg.f64 M)))))): 2 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 (*.f64 d d) (*.f64 D D)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 D D))))) (*.f64 M (neg.f64 M)))))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 (*.f64 d d) (*.f64 D D)) (/.f64 (*.f64 d d) (*.f64 D D)))) (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 M M))))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 c0 (*.f64 w h)) (*.f64 (/.f64 (*.f64 d d) (*.f64 D D)) (/.f64 (*.f64 d d) (*.f64 D D))))) (*.f64 M M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (/.f64 (*.f64 d d) (*.f64 D D)) (/.f64 (*.f64 d d) (*.f64 D D))))) (*.f64 M M))))): 1 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (Rewrite<= swap-sqr_binary64 (*.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 (*.f64 d d) (*.f64 D D))) (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 (*.f64 d d) (*.f64 D D))))) (*.f64 M M))))): 0 points increase in error, 7 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 (*.f64 d d) (*.f64 D D)))) (*.f64 M M))))): 5 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))))) (*.f64 M M))))): 0 points increase in error, 10 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (*.f64 d d) (/.f64 c0 (*.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)))))): 2 points increase in error, 6 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (*.f64 d d))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))): 0 points increase in error, 3 points decrease in error
    3. Taylor expanded in d around inf 57.2

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

      \[\leadsto \frac{\frac{c0}{2}}{w} \cdot \color{blue}{\left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{w \cdot h}\right)\right)} \]
      Proof
      (*.f64 2 (*.f64 c0 (/.f64 (*.f64 (/.f64 d D) (/.f64 d D)) (*.f64 w h)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 c0 (/.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 D D))) (*.f64 w h)))): 38 points increase in error, 11 points decrease in error
      (*.f64 2 (*.f64 c0 (/.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 d 2)) (*.f64 D D)) (*.f64 w h)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 c0 (/.f64 (/.f64 (pow.f64 d 2) (Rewrite<= unpow2_binary64 (pow.f64 D 2))) (*.f64 w h)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (*.f64 c0 (Rewrite<= associate-/r*_binary64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))))): 10 points increase in error, 5 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))))): 13 points increase in error, 9 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

    if 2.10000000000000004e98 < D

    1. Initial program 60.6

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

      \[\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. Simplified40.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): 1 points increase in error, 6 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): 33 points increase in error, 1 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): 22 points increase in error, 0 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): 5 points increase in error, 6 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): 7 points increase in error, 8 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))))): 42 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)))): 90 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, 1 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 53.3

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

      \[\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))))): 15 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))))): 61 points increase in error, 7 points decrease in error
      (/.f64 (*.f64 D D) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 d d) (*.f64 M (*.f64 M h))))): 45 points increase in error, 3 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)))): 14 points increase in error, 4 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))): 8 points increase in error, 7 points decrease in error
    6. Taylor expanded in D around 0 29.6

      \[\leadsto \mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \color{blue}{\frac{D \cdot \left(h \cdot M\right)}{d}}, 0\right) \]
    7. Simplified29.6

      \[\leadsto \mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \color{blue}{\left(\frac{M}{d} \cdot \left(D \cdot h\right)\right)}, 0\right) \]
      Proof
      (*.f64 (/.f64 M d) (*.f64 D h)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (/.f64 M d) D) h)): 32 points increase in error, 40 points decrease in error
      (*.f64 (Rewrite<= associate-/r/_binary64 (/.f64 M (/.f64 d D))) h): 31 points increase in error, 32 points decrease in error
      (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 M h) (/.f64 d D))): 38 points increase in error, 29 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 h M)) (/.f64 d D)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (*.f64 h M) D) d)): 42 points increase in error, 32 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 D (*.f64 h M))) d): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification18.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \left(\sqrt[3]{M} \cdot \left(\frac{D}{d} \cdot {\left(\sqrt[3]{M}\right)}^{2}\right)\right) \cdot \left(\left(\frac{D}{d} \cdot M\right) \cdot h\right), 0\right)\\ \mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{c0}{2}}{w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h \cdot w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(\frac{M}{d} \cdot \left(D \cdot h\right)\right), 0\right)\\ \end{array} \]

Alternatives

Alternative 1
Error22.0
Cost7756
\[\begin{array}{l} t_0 := \mathsf{fma}\left(0.25, M \cdot \left(M \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot h\right)\right)\right), 0\right)\\ \mathbf{if}\;D \leq -5.5 \cdot 10^{+78}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq -1.1 \cdot 10^{-214}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{D}{\frac{d}{M} \cdot \left(\frac{d}{M} \cdot \frac{1}{h}\right)}\right)\\ \mathbf{elif}\;D \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{c0}{2}}{w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h \cdot w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{\frac{d}{D}} \cdot \frac{M}{\frac{d}{D \cdot h}}\right)\\ \end{array} \]
Alternative 2
Error21.0
Cost7696
\[\begin{array}{l} t_0 := 0.25 \cdot \left(\frac{M}{\frac{d}{D}} \cdot \frac{M}{\frac{d}{D \cdot h}}\right)\\ \mathbf{if}\;d \leq -7 \cdot 10^{-123}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{-182}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{D}{\frac{d}{M} \cdot \left(\frac{d}{M} \cdot \frac{1}{h}\right)}\right)\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{+119}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 10^{+249}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(h \cdot \left(D \cdot {\left(\frac{M}{d}\right)}^{2}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error19.2
Cost7624
\[\begin{array}{l} t_0 := \mathsf{fma}\left(0.25, \frac{D \cdot \left(h \cdot \frac{D}{\frac{d}{M}}\right)}{\frac{d}{M}}, 0\right)\\ \mathbf{if}\;w \leq -8.4 \cdot 10^{-142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;w \leq -1 \cdot 10^{-276}:\\ \;\;\;\;\mathsf{fma}\left(0.25, M \cdot \left(M \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot h\right)\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error19.0
Cost7624
\[\begin{array}{l} \mathbf{if}\;D \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \left(\left(\frac{D}{d} \cdot M\right) \cdot h\right) \cdot \frac{D \cdot M}{d}, 0\right)\\ \mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{c0}{2}}{w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h \cdot w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D \cdot \left(h \cdot \frac{D}{\frac{d}{M}}\right)}{\frac{d}{M}}, 0\right)\\ \end{array} \]
Alternative 5
Error19.3
Cost7624
\[\begin{array}{l} \mathbf{if}\;D \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \left(\left(\frac{D}{d} \cdot M\right) \cdot h\right) \cdot \frac{D \cdot M}{d}, 0\right)\\ \mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{c0}{2}}{w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h \cdot w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(\frac{M}{d} \cdot \left(D \cdot h\right)\right), 0\right)\\ \end{array} \]
Alternative 6
Error21.7
Cost1872
\[\begin{array}{l} t_0 := 0.25 \cdot \left(\frac{M}{\frac{d}{D}} \cdot \frac{M}{\frac{d}{D \cdot h}}\right)\\ \mathbf{if}\;D \leq -3 \cdot 10^{+92}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq -1.4 \cdot 10^{-215}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{D}{\frac{d}{M} \cdot \left(\frac{d}{M} \cdot \frac{1}{h}\right)}\right)\\ \mathbf{elif}\;D \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{c0}{2}}{w} \cdot \left(2 \cdot \left(c0 \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h \cdot w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error21.3
Cost1352
\[\begin{array}{l} t_0 := 0.25 \cdot \left(\frac{M}{\frac{d}{D}} \cdot \frac{M}{\frac{d}{D \cdot h}}\right)\\ \mathbf{if}\;h \leq -0.00095:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq -6 \cdot 10^{-222}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{D}{\frac{d}{M} \cdot \left(\frac{d}{M} \cdot \frac{1}{h}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error25.1
Cost1224
\[\begin{array}{l} t_0 := 0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot \frac{D}{d \cdot \frac{d}{h}}\right)\right)\right)\\ \mathbf{if}\;D \leq -8.2 \cdot 10^{-239}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 1.26 \cdot 10^{-266}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error24.4
Cost1224
\[\begin{array}{l} \mathbf{if}\;d \leq -2.6 \cdot 10^{-124}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot \frac{D}{d \cdot \frac{d}{h}}\right)\right)\right)\\ \mathbf{elif}\;d \leq 4.1 \cdot 10^{-222}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{D}{d \cdot \frac{\frac{d}{h}}{M \cdot M}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(\frac{D}{d \cdot \frac{d}{M}} \cdot \left(M \cdot h\right)\right)\right)\\ \end{array} \]
Alternative 10
Error23.9
Cost1224
\[\begin{array}{l} \mathbf{if}\;M \leq -1.2 \cdot 10^{+152}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot \frac{D}{d \cdot \frac{d}{h}}\right)\right)\right)\\ \mathbf{elif}\;M \leq 1.95 \cdot 10^{+105}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{M \cdot M}{\frac{d}{\frac{D}{\frac{d}{h}}}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(\frac{D}{d \cdot \frac{d}{M}} \cdot \left(M \cdot h\right)\right)\right)\\ \end{array} \]
Alternative 11
Error23.8
Cost1224
\[\begin{array}{l} \mathbf{if}\;M \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;0.25 \cdot \left(M \cdot \left(D \cdot \left(M \cdot \frac{D}{d \cdot \frac{d}{h}}\right)\right)\right)\\ \mathbf{elif}\;M \leq 2.7 \cdot 10^{+145}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot M}{\frac{d}{D} \cdot \frac{d}{D \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(\frac{D}{d \cdot \frac{d}{M}} \cdot \left(M \cdot h\right)\right)\right)\\ \end{array} \]
Alternative 12
Error20.9
Cost960
\[0.25 \cdot \left(\frac{M}{\frac{d}{D}} \cdot \frac{M}{\frac{d}{D \cdot h}}\right) \]
Alternative 13
Error31.7
Cost64
\[0 \]

Error

Reproduce

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