Henrywood and Agarwal, Equation (13)

?

Percentage Accurate: 24.4% → 61.9%
Time: 34.3s
Precision: binary64
Cost: 44484

?

\[\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}{w \cdot h}\\ t_1 := h \cdot \left(M \cdot M\right)\\ t_2 := t_0 \cdot {\left(\frac{d}{D}\right)}^{2}\\ t_3 := \frac{c0}{2 \cdot w}\\ t_4 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_5 := t_3 \cdot \left(t_4 + \sqrt{t_4 \cdot t_4 - M \cdot M}\right)\\ \mathbf{if}\;t_5 \leq -2 \cdot 10^{-304}:\\ \;\;\;\;t_3 \cdot \mathsf{fma}\left(t_0, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{M + t_2} \cdot \sqrt{t_2 - M}\right)\\ \mathbf{elif}\;t_5 \leq 0:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_1}{d \cdot \frac{d}{D}}\\ \mathbf{elif}\;t_5 \leq \infty:\\ \;\;\;\;\frac{{\left(c0 \cdot d\right)}^{2}}{w \cdot \left(w \cdot \left(D \cdot \left(h \cdot D\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(t_1 \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\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 (* w h)))
        (t_1 (* h (* M M)))
        (t_2 (* t_0 (pow (/ d D) 2.0)))
        (t_3 (/ c0 (* 2.0 w)))
        (t_4 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_5 (* t_3 (+ t_4 (sqrt (- (* t_4 t_4) (* M M)))))))
   (if (<= t_5 -2e-304)
     (*
      t_3
      (fma t_0 (* (/ d D) (/ d D)) (* (sqrt (+ M t_2)) (sqrt (- t_2 M)))))
     (if (<= t_5 0.0)
       (* 0.25 (/ (* D t_1) (* d (/ d D))))
       (if (<= t_5 INFINITY)
         (/ (pow (* c0 d) 2.0) (* w (* w (* D (* h D)))))
         (* 0.25 (* t_1 (* (/ D d) (/ D d)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (w * h);
	double t_1 = h * (M * M);
	double t_2 = t_0 * pow((d / D), 2.0);
	double t_3 = c0 / (2.0 * w);
	double t_4 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_5 = t_3 * (t_4 + sqrt(((t_4 * t_4) - (M * M))));
	double tmp;
	if (t_5 <= -2e-304) {
		tmp = t_3 * fma(t_0, ((d / D) * (d / D)), (sqrt((M + t_2)) * sqrt((t_2 - M))));
	} else if (t_5 <= 0.0) {
		tmp = 0.25 * ((D * t_1) / (d * (d / D)));
	} else if (t_5 <= ((double) INFINITY)) {
		tmp = pow((c0 * d), 2.0) / (w * (w * (D * (h * D))));
	} else {
		tmp = 0.25 * (t_1 * ((D / d) * (D / d)));
	}
	return tmp;
}
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M)))))
end
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(w * h))
	t_1 = Float64(h * Float64(M * M))
	t_2 = Float64(t_0 * (Float64(d / D) ^ 2.0))
	t_3 = Float64(c0 / Float64(2.0 * w))
	t_4 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_5 = Float64(t_3 * Float64(t_4 + sqrt(Float64(Float64(t_4 * t_4) - Float64(M * M)))))
	tmp = 0.0
	if (t_5 <= -2e-304)
		tmp = Float64(t_3 * fma(t_0, Float64(Float64(d / D) * Float64(d / D)), Float64(sqrt(Float64(M + t_2)) * sqrt(Float64(t_2 - M)))));
	elseif (t_5 <= 0.0)
		tmp = Float64(0.25 * Float64(Float64(D * t_1) / Float64(d * Float64(d / D))));
	elseif (t_5 <= Inf)
		tmp = Float64((Float64(c0 * d) ^ 2.0) / Float64(w * Float64(w * Float64(D * Float64(h * D)))));
	else
		tmp = Float64(0.25 * Float64(t_1 * Float64(Float64(D / d) * Float64(D / d))));
	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[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * N[(t$95$4 + N[Sqrt[N[(N[(t$95$4 * t$95$4), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -2e-304], N[(t$95$3 * N[(t$95$0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(M + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t$95$2 - M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 0.0], N[(0.25 * N[(N[(D * t$95$1), $MachinePrecision] / N[(d * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(N[Power[N[(c0 * d), $MachinePrecision], 2.0], $MachinePrecision] / N[(w * N[(w * N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(t$95$1 * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h}\\
t_1 := h \cdot \left(M \cdot M\right)\\
t_2 := t_0 \cdot {\left(\frac{d}{D}\right)}^{2}\\
t_3 := \frac{c0}{2 \cdot w}\\
t_4 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_5 := t_3 \cdot \left(t_4 + \sqrt{t_4 \cdot t_4 - M \cdot M}\right)\\
\mathbf{if}\;t_5 \leq -2 \cdot 10^{-304}:\\
\;\;\;\;t_3 \cdot \mathsf{fma}\left(t_0, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{M + t_2} \cdot \sqrt{t_2 - M}\right)\\

\mathbf{elif}\;t_5 \leq 0:\\
\;\;\;\;0.25 \cdot \frac{D \cdot t_1}{d \cdot \frac{d}{D}}\\

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

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


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 12 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

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))))) < -1.99999999999999994e-304

    1. Initial program 84.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. Simplified82.7%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}\right)} \]
      Step-by-step derivation

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

      times-frac [=>]82.6%

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

      fma-def [=>]82.6%

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]

      times-frac [=>]82.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{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) \]

      difference-of-squares [=>]82.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Applied egg-rr77.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{\frac{c0}{h}}{w} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
      Step-by-step derivation

      [Start]82.7%

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

      associate-*r/ [=>]82.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\left(d \cdot d\right) \cdot c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}} - M\right)}\right) \]

      *-commutative [<=]82.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\color{blue}{c0 \cdot \left(d \cdot d\right)}}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}\right) \]

      times-frac [=>]82.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} - M\right)}\right) \]

      associate-/l/ [<=]85.0%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{\frac{d \cdot d}{D}}{D}} - M\right)}\right) \]

      associate-*r/ [=>]85.0%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]

      associate-/l/ [<=]77.5%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\color{blue}{\frac{\frac{c0}{h}}{w}} \cdot \frac{d \cdot d}{D}}{D} - M\right)}\right) \]

      associate-/l* [=>]77.5%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\frac{\frac{c0}{h}}{w} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]

      div-inv [=>]77.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\frac{\frac{c0}{h}}{w} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]

      clear-num [<=]77.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\frac{\frac{c0}{h}}{w} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
    4. Simplified84.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
      Step-by-step derivation

      [Start]77.4%

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

      associate-/l* [=>]77.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{\frac{c0}{h}}{w}}{\frac{D}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]

      associate-/l/ [=>]84.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\color{blue}{\frac{c0}{w \cdot h}}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right) \]
    5. Applied egg-rr90.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \color{blue}{\sqrt{\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + M} \cdot \sqrt{\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M}}\right) \]
      Step-by-step derivation

      [Start]84.9%

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

      sqrt-prod [=>]88.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \color{blue}{\sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right)} \cdot \sqrt{\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}} - M}}\right) \]

    if -1.99999999999999994e-304 < (*.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))))) < 0.0

    1. Initial program 62.7%

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

      \[\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)} \]
    3. Simplified61.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot 0\right)} \]
      Step-by-step derivation

      [Start]61.6%

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

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

      times-frac [=>]61.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      unpow2 [=>]61.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      unpow2 [=>]61.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      *-commutative [=>]61.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{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) \]

      unpow2 [=>]61.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}{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) \]

      associate-*r* [=>]61.4%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, \color{blue}{\left(-1 \cdot \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)\right) \cdot c0}\right) \]
    4. Taylor expanded in c0 around 0 66.9%

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

      \[\leadsto \color{blue}{0.25 \cdot \left(\frac{D}{d \cdot \frac{d}{D}} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)} \]
      Step-by-step derivation

      [Start]66.9%

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

      unpow2 [=>]66.9%

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

      associate-/l* [=>]61.9%

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

      unpow2 [=>]61.9%

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

      associate-/r/ [=>]66.7%

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

      unpow2 [=>]66.7%

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

      associate-/l* [=>]72.3%

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

      associate-*r/ [<=]78.2%

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

      \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot \frac{d}{D}}} \]
      Step-by-step derivation

      [Start]78.2%

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

      associate-*l/ [=>]78.8%

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

    if 0.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))))) < +inf.0

    1. Initial program 72.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. Simplified71.9%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}\right)} \]
      Step-by-step derivation

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

      times-frac [=>]71.9%

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

      fma-def [=>]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]

      times-frac [=>]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{d}{D} \cdot \frac{d}{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) \]

      difference-of-squares [=>]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Applied egg-rr68.7%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{\frac{c0}{h}}{w} \cdot \left(d \cdot \frac{d}{D}\right)}{D}} - M\right)}\right) \]
      Step-by-step derivation

      [Start]71.9%

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

      associate-*r/ [=>]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\left(d \cdot d\right) \cdot c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}} - M\right)}\right) \]

      *-commutative [<=]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\color{blue}{c0 \cdot \left(d \cdot d\right)}}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}\right) \]

      times-frac [=>]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} - M\right)}\right) \]

      associate-/l/ [<=]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\frac{\frac{d \cdot d}{D}}{D}} - M\right)}\right) \]

      associate-*r/ [=>]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D}}{D}} - M\right)}\right) \]

      associate-/l/ [<=]68.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\color{blue}{\frac{\frac{c0}{h}}{w}} \cdot \frac{d \cdot d}{D}}{D} - M\right)}\right) \]

      associate-/l* [=>]68.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\frac{\frac{c0}{h}}{w} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{D} - M\right)}\right) \]

      div-inv [=>]68.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\frac{\frac{c0}{h}}{w} \cdot \color{blue}{\left(d \cdot \frac{1}{\frac{D}{d}}\right)}}{D} - M\right)}\right) \]

      clear-num [<=]68.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\frac{\frac{c0}{h}}{w} \cdot \left(d \cdot \color{blue}{\frac{d}{D}}\right)}{D} - M\right)}\right) \]
    4. Simplified71.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{c0}{w \cdot h}}{\frac{D}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]
      Step-by-step derivation

      [Start]68.7%

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

      associate-/l* [=>]68.7%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\color{blue}{\frac{\frac{\frac{c0}{h}}{w}}{\frac{D}{d \cdot \frac{d}{D}}}} - M\right)}\right) \]

      associate-/l/ [=>]71.9%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{\left(w \cdot h\right) \cdot D}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{\color{blue}{\frac{c0}{w \cdot h}}}{\frac{D}{d \cdot \frac{d}{D}}} - M\right)}\right) \]
    5. Taylor expanded in c0 around inf 61.8%

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

      \[\leadsto \color{blue}{\frac{{\left(d \cdot c0\right)}^{2}}{D \cdot \left(D \cdot \left(\left(w \cdot h\right) \cdot w\right)\right)}} \]
      Step-by-step derivation

      [Start]61.8%

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

      unpow2 [=>]61.8%

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

      unpow2 [=>]61.8%

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

      swap-sqr [<=]77.7%

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

      unpow2 [<=]77.7%

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

      *-commutative [=>]77.7%

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

      unpow2 [=>]77.7%

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

      unpow2 [=>]77.7%

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

      associate-*l* [=>]77.7%

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

      associate-*r* [=>]80.9%

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

      *-commutative [<=]80.9%

      \[ \frac{{\left(d \cdot c0\right)}^{2}}{D \cdot \left(D \cdot \left(\color{blue}{\left(w \cdot h\right)} \cdot w\right)\right)} \]
    7. Taylor expanded in d around 0 61.8%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    8. Simplified80.9%

      \[\leadsto \color{blue}{\frac{{\left(d \cdot c0\right)}^{2}}{\left(w \cdot w\right) \cdot \left(\left(D \cdot D\right) \cdot h\right)}} \]
      Step-by-step derivation

      [Start]61.8%

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

      unpow2 [=>]61.8%

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

      unpow2 [=>]61.8%

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

      swap-sqr [<=]77.7%

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

      unpow2 [<=]77.7%

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

      unpow2 [=>]77.7%

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

      associate-*r* [<=]80.9%

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

      *-commutative [=>]80.9%

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

      associate-*r* [=>]77.7%

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

      unpow2 [<=]77.7%

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

      associate-*l* [=>]80.9%

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

      unpow2 [=>]80.9%

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

      *-commutative [<=]80.9%

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

      unpow2 [=>]80.9%

      \[ \frac{{\left(d \cdot c0\right)}^{2}}{\left(w \cdot w\right) \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot h\right)} \]
    9. Applied egg-rr84.1%

      \[\leadsto \color{blue}{1 \cdot \frac{{\left(d \cdot c0\right)}^{2}}{w \cdot \left(w \cdot \left(D \cdot \left(D \cdot h\right)\right)\right)}} \]
      Step-by-step derivation

      [Start]80.9%

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

      *-un-lft-identity [=>]80.9%

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

      associate-*l* [=>]84.1%

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

      associate-*l* [=>]84.1%

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

    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 0.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 1.3%

      \[\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)} \]
    3. Simplified29.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot 0\right)} \]
      Step-by-step derivation

      [Start]1.3%

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

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

      times-frac [=>]2.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      unpow2 [=>]2.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      unpow2 [=>]2.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      *-commutative [=>]2.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{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) \]

      unpow2 [=>]2.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}{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) \]

      associate-*r* [=>]2.6%

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, \color{blue}{\left(-1 \cdot \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)\right) \cdot c0}\right) \]
    4. Taylor expanded in c0 around 0 41.3%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    5. Simplified52.3%

      \[\leadsto \color{blue}{0.25 \cdot \left(\frac{D}{d \cdot \frac{d}{D}} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)} \]
      Step-by-step derivation

      [Start]41.3%

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

      unpow2 [=>]41.3%

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

      associate-/l* [=>]40.7%

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

      unpow2 [=>]40.7%

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

      associate-/r/ [=>]41.3%

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

      unpow2 [=>]41.3%

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

      associate-/l* [=>]47.8%

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

      associate-*r/ [<=]52.3%

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

      \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{{D}^{2}}{{d}^{2}}} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \]
    7. Simplified54.9%

      \[\leadsto 0.25 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \]
      Step-by-step derivation

      [Start]41.3%

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

      unpow2 [=>]41.3%

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

      unpow2 [=>]41.3%

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

      times-frac [=>]54.9%

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

    \[\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 -2 \cdot 10^{-304}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{M + \frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}} \cdot \sqrt{\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M}\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 0:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot \frac{d}{D}}\\ \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{{\left(c0 \cdot d\right)}^{2}}{w \cdot \left(w \cdot \left(D \cdot \left(h \cdot D\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy61.9%
Cost44484
\[\begin{array}{l} t_0 := \frac{c0}{w \cdot h}\\ t_1 := h \cdot \left(M \cdot M\right)\\ t_2 := t_0 \cdot {\left(\frac{d}{D}\right)}^{2}\\ t_3 := \frac{c0}{2 \cdot w}\\ t_4 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_5 := t_3 \cdot \left(t_4 + \sqrt{t_4 \cdot t_4 - M \cdot M}\right)\\ \mathbf{if}\;t_5 \leq -2 \cdot 10^{-304}:\\ \;\;\;\;t_3 \cdot \mathsf{fma}\left(t_0, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{M + t_2} \cdot \sqrt{t_2 - M}\right)\\ \mathbf{elif}\;t_5 \leq 0:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_1}{d \cdot \frac{d}{D}}\\ \mathbf{elif}\;t_5 \leq \infty:\\ \;\;\;\;\frac{{\left(c0 \cdot d\right)}^{2}}{w \cdot \left(w \cdot \left(D \cdot \left(h \cdot D\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(t_1 \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \end{array} \]
Alternative 2
Accuracy62.0%
Cost36492
\[\begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := h \cdot \left(M \cdot M\right)\\ t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_3 := t_0 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\ \mathbf{if}\;t_3 \leq -2 \cdot 10^{-304}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right)\right)\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_1}{d \cdot \frac{d}{D}}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{{\left(c0 \cdot d\right)}^{2}}{w \cdot \left(w \cdot \left(D \cdot \left(h \cdot D\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(t_1 \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \end{array} \]
Alternative 3
Accuracy41.8%
Cost7825
\[\begin{array}{l} t_0 := h \cdot \left(M \cdot M\right)\\ t_1 := d \cdot \frac{d}{D}\\ \mathbf{if}\;h \leq -2.3 \cdot 10^{+99}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(d \cdot \left(d \cdot \frac{c0}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right) + \frac{\frac{c0}{w \cdot h}}{D} \cdot \frac{d \cdot d}{D}\right)\\ \mathbf{elif}\;h \leq -5.1 \cdot 10^{+81}:\\ \;\;\;\;0.25 \cdot \left(t_0 \cdot \frac{D}{t_1}\right)\\ \mathbf{elif}\;h \leq 4.3 \cdot 10^{-225} \lor \neg \left(h \leq 4.6 \cdot 10^{+172}\right):\\ \;\;\;\;\frac{{\left(c0 \cdot d\right)}^{2}}{D \cdot \left(\left(w \cdot h\right) \cdot \left(w \cdot D\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_0}{t_1}\\ \end{array} \]
Alternative 4
Accuracy41.0%
Cost7824
\[\begin{array}{l} t_0 := \left(c0 \cdot d\right) \cdot \left(c0 \cdot d\right)\\ t_1 := D \cdot \left(w \cdot \left(w \cdot h\right)\right)\\ t_2 := h \cdot \left(M \cdot M\right)\\ t_3 := d \cdot \frac{d}{D}\\ t_4 := \frac{\frac{t_0}{D}}{t_1}\\ \mathbf{if}\;h \leq -1.6 \cdot 10^{+97}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(d \cdot \left(d \cdot \frac{c0}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right) + \frac{\frac{c0}{w \cdot h}}{D} \cdot \frac{d \cdot d}{D}\right)\\ \mathbf{elif}\;h \leq -8 \cdot 10^{+81}:\\ \;\;\;\;0.25 \cdot \left(t_2 \cdot \frac{D}{t_3}\right)\\ \mathbf{elif}\;h \leq -8 \cdot 10^{+57}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;h \leq -1.05 \cdot 10^{-184}:\\ \;\;\;\;\frac{{\left(\frac{d}{D}\right)}^{2}}{w} \cdot \frac{c0 \cdot c0}{w \cdot h}\\ \mathbf{elif}\;h \leq 7.8 \cdot 10^{-225}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;h \leq 2.7 \cdot 10^{+172}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_2}{t_3}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{D \cdot t_1}\\ \end{array} \]
Alternative 5
Accuracy44.2%
Cost2389
\[\begin{array}{l} t_0 := h \cdot \left(M \cdot M\right)\\ t_1 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)\\ \mathbf{if}\;M \cdot M \leq 2.1 \cdot 10^{-236}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \cdot M \leq 6.2 \cdot 10^{-184}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;M \cdot M \leq 1.5 \cdot 10^{+137}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_0}{d \cdot \frac{d}{D}}\\ \mathbf{elif}\;M \cdot M \leq 1.2 \cdot 10^{+189} \lor \neg \left(M \cdot M \leq 1.25 \cdot 10^{+269}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(t_0 \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \end{array} \]
Alternative 6
Accuracy41.5%
Cost2244
\[\begin{array}{l} t_0 := \left(c0 \cdot d\right) \cdot \left(c0 \cdot d\right)\\ t_1 := D \cdot \left(w \cdot \left(w \cdot h\right)\right)\\ t_2 := h \cdot \left(M \cdot M\right)\\ t_3 := d \cdot \frac{d}{D}\\ \mathbf{if}\;h \leq -1.55 \cdot 10^{+100}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(d \cdot \left(d \cdot \frac{c0}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right) + \frac{\frac{c0}{w \cdot h}}{D} \cdot \frac{d \cdot d}{D}\right)\\ \mathbf{elif}\;h \leq -6.5 \cdot 10^{+81}:\\ \;\;\;\;0.25 \cdot \left(t_2 \cdot \frac{D}{t_3}\right)\\ \mathbf{elif}\;h \leq 3.5 \cdot 10^{-224}:\\ \;\;\;\;\frac{\frac{t_0}{D}}{t_1}\\ \mathbf{elif}\;h \leq 3.8 \cdot 10^{+172}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_2}{t_3}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{D \cdot t_1}\\ \end{array} \]
Alternative 7
Accuracy41.2%
Cost1616
\[\begin{array}{l} t_0 := d \cdot \frac{d}{D}\\ t_1 := \left(c0 \cdot d\right) \cdot \left(c0 \cdot d\right)\\ t_2 := D \cdot \left(w \cdot \left(w \cdot h\right)\right)\\ t_3 := h \cdot \left(M \cdot M\right)\\ \mathbf{if}\;h \leq -2.1 \cdot 10^{+99}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right)\right)\\ \mathbf{elif}\;h \leq -1.25 \cdot 10^{+82}:\\ \;\;\;\;0.25 \cdot \left(t_3 \cdot \frac{D}{t_0}\right)\\ \mathbf{elif}\;h \leq 3.8 \cdot 10^{-225}:\\ \;\;\;\;\frac{\frac{t_1}{D}}{t_2}\\ \mathbf{elif}\;h \leq 3.6 \cdot 10^{+172}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_3}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{D \cdot t_2}\\ \end{array} \]
Alternative 8
Accuracy41.1%
Cost1616
\[\begin{array}{l} t_0 := d \cdot \frac{d}{D}\\ t_1 := \left(c0 \cdot d\right) \cdot \left(c0 \cdot d\right)\\ t_2 := D \cdot \left(w \cdot \left(w \cdot h\right)\right)\\ t_3 := h \cdot \left(M \cdot M\right)\\ \mathbf{if}\;h \leq -9 \cdot 10^{+96}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{elif}\;h \leq -5.1 \cdot 10^{+81}:\\ \;\;\;\;0.25 \cdot \left(t_3 \cdot \frac{D}{t_0}\right)\\ \mathbf{elif}\;h \leq 5.8 \cdot 10^{-227}:\\ \;\;\;\;\frac{\frac{t_1}{D}}{t_2}\\ \mathbf{elif}\;h \leq 2.8 \cdot 10^{+172}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_3}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{D \cdot t_2}\\ \end{array} \]
Alternative 9
Accuracy41.7%
Cost1353
\[\begin{array}{l} \mathbf{if}\;h \leq 1.05 \cdot 10^{-226} \lor \neg \left(h \leq 2.2 \cdot 10^{+172}\right):\\ \;\;\;\;\frac{\left(c0 \cdot d\right) \cdot \left(c0 \cdot d\right)}{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot \frac{d}{D}}\\ \end{array} \]
Alternative 10
Accuracy42.2%
Cost1352
\[\begin{array}{l} t_0 := D \cdot \left(w \cdot \left(w \cdot h\right)\right)\\ t_1 := \left(c0 \cdot d\right) \cdot \left(c0 \cdot d\right)\\ \mathbf{if}\;h \leq 1.95 \cdot 10^{-225}:\\ \;\;\;\;\frac{\frac{t_1}{D}}{t_0}\\ \mathbf{elif}\;h \leq 4.4 \cdot 10^{+172}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{D \cdot t_0}\\ \end{array} \]
Alternative 11
Accuracy41.4%
Cost960
\[0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right) \]
Alternative 12
Accuracy32.4%
Cost64
\[0 \]

Reproduce?

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