Henrywood and Agarwal, Equation (13)

Percentage Accurate: 23.8% → 63.8%
Time: 32.5s
Alternatives: 10
Speedup: 151.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))))
end
function tmp = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

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.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
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.

Initial Program: 23.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
    code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))))
end
function tmp = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}

Alternative 1: 63.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_1 := \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \cdot \frac{c0}{2 \cdot w}\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_1 (* (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))) (/ c0 (* 2.0 w)))))
   (if (<= t_1 INFINITY) t_1 (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_1 = (t_0 + sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_1 = (t_0 + Math.sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_1 = (t_0 + math.sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_1 = Float64(Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))) * Float64(c0 / Float64(2.0 * w)))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d)));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_1 = (t_0 + sqrt(((t_0 * t_0) - (M * M)))) * (c0 / (2.0 * w));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_1 := \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \cdot \frac{c0}{2 \cdot w}\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

    1. Initial program 77.9%

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

    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.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    3. Step-by-step derivation
      1. fma-def1.9%

        \[\leadsto \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)} \]
      2. times-frac2.5%

        \[\leadsto \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) \]
      3. *-commutative2.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow22.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow22.5%

        \[\leadsto \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(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) \]
      6. unpow22.5%

        \[\leadsto \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) \]
      7. associate-*r*2.5%

        \[\leadsto \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. Simplified30.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)} \]
    5. Taylor expanded in c0 around 0 40.9%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow240.9%

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

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity40.9%

        \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
      2. times-frac52.1%

        \[\leadsto 0.25 \cdot \left(1 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}\right) \]
    9. Applied egg-rr52.1%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity52.1%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
      2. associate-/l*55.6%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
      3. unpow255.6%

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
      4. associate-/l*56.8%

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

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
    11. Simplified56.8%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
    12. Step-by-step derivation
      1. associate-*l/58.0%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
      2. associate-/r/57.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}} \]
    13. Applied egg-rr57.3%

      \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}} \]
    14. Step-by-step derivation
      1. associate-/r/61.6%

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

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \left(\frac{h}{d} \cdot \color{blue}{{M}^{2}}\right)}{d} \cdot D\right) \]
      3. associate-*l/61.9%

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

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{d}}{d} \cdot D\right) \]
      5. associate-/l*60.9%

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \color{blue}{\frac{{M}^{2}}{\frac{d}{h}}}}{d} \cdot D\right) \]
      6. associate-*r/61.3%

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

        \[\leadsto 0.25 \cdot \left(\frac{\frac{D \cdot \color{blue}{\left(M \cdot M\right)}}{\frac{d}{h}}}{d} \cdot D\right) \]
    15. Simplified61.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \cdot \frac{c0}{2 \cdot w} \leq \infty:\\ \;\;\;\;\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) \cdot \frac{c0}{2 \cdot w}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\ \end{array} \]

Alternative 2: 44.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\

\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\

\mathbf{elif}\;d \cdot d \leq 10^{+295}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 d d) < 2.00000000000000011e-249

    1. Initial program 12.5%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 2.7%

      \[\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. Step-by-step derivation
      1. fma-def2.7%

        \[\leadsto \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)} \]
      2. times-frac2.7%

        \[\leadsto \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) \]
      3. *-commutative2.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow22.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow22.7%

        \[\leadsto \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(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) \]
      6. unpow22.7%

        \[\leadsto \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) \]
      7. associate-*r*2.7%

        \[\leadsto \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. Simplified12.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 17.5%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow217.5%

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

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity17.5%

        \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
      2. times-frac41.1%

        \[\leadsto 0.25 \cdot \left(1 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}\right) \]
    9. Applied egg-rr41.1%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity41.1%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
      2. associate-/l*56.7%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
      3. unpow256.7%

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
      4. associate-/l*58.9%

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

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
    11. Simplified58.9%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
    12. Step-by-step derivation
      1. associate-*l/58.3%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
      2. associate-/r/60.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}} \]
    13. Applied egg-rr60.3%

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

    if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7

    1. Initial program 48.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac45.8%

        \[\leadsto \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) \]
      2. fma-def45.7%

        \[\leadsto \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)} \]
      3. times-frac45.7%

        \[\leadsto \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) \]
      4. difference-of-squares45.7%

        \[\leadsto \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. Simplified48.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)} \]
    4. Step-by-step derivation
      1. fma-udef49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow249.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num48.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr51.8%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative51.6%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h}} + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      4. *-commutative51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*51.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/51.7%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac52.0%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac58.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      5. unpow258.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
    12. Simplified58.0%

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

        \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    14. Applied egg-rr58.0%

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

    if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294

    1. Initial program 26.8%

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

      \[\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. Step-by-step derivation
      1. fma-def9.4%

        \[\leadsto \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)} \]
      2. times-frac10.8%

        \[\leadsto \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) \]
      3. *-commutative10.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow210.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow210.8%

        \[\leadsto \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(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) \]
      6. unpow210.8%

        \[\leadsto \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) \]
      7. associate-*r*10.8%

        \[\leadsto \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. Simplified35.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 53.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow253.1%

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

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

        \[\leadsto 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    7. Simplified53.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)} \]
      2. associate-*l*56.3%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)} \cdot \frac{1}{d \cdot d}\right) \]
    9. Applied egg-rr56.3%

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

    if 9.9999999999999998e294 < (*.f64 d d)

    1. Initial program 26.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac27.8%

        \[\leadsto \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) \]
      2. fma-def27.8%

        \[\leadsto \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)} \]
      3. times-frac27.8%

        \[\leadsto \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) \]
      4. difference-of-squares36.5%

        \[\leadsto \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. Simplified36.5%

      \[\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)} \]
    4. Step-by-step derivation
      1. fma-udef36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow236.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr43.3%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative43.3%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/42.4%

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/40.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*42.4%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/42.5%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/40.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac41.5%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac49.6%

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

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

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r/48.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot c0}{w \cdot h}}\right) \]
    14. Applied egg-rr48.8%

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot c0}{w \cdot h}}\right) \]
    15. Step-by-step derivation
      1. associate-*r/49.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)}\right) \]
      2. associate-/r*49.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{w}}{h}}\right)\right) \]
    16. Simplified49.7%

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\ \mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\ \mathbf{elif}\;d \cdot d \leq 10^{+295}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\ \end{array} \]

Alternative 3: 44.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\

\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(t_0 \cdot \frac{c0}{w \cdot h}\right)\right)}{2 \cdot w}\\

\mathbf{elif}\;d \cdot d \leq 10^{+295}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 d d) < 2.00000000000000011e-249

    1. Initial program 12.5%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 2.7%

      \[\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. Step-by-step derivation
      1. fma-def2.7%

        \[\leadsto \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)} \]
      2. times-frac2.7%

        \[\leadsto \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) \]
      3. *-commutative2.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow22.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow22.7%

        \[\leadsto \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(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) \]
      6. unpow22.7%

        \[\leadsto \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) \]
      7. associate-*r*2.7%

        \[\leadsto \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. Simplified12.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 17.5%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow217.5%

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

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity17.5%

        \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
      2. times-frac41.1%

        \[\leadsto 0.25 \cdot \left(1 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}\right) \]
    9. Applied egg-rr41.1%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity41.1%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
      2. associate-/l*56.7%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
      3. unpow256.7%

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
      4. associate-/l*58.9%

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

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
    11. Simplified58.9%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
    12. Step-by-step derivation
      1. associate-*l/58.3%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
      2. associate-/r/60.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}} \]
    13. Applied egg-rr60.3%

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

    if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7

    1. Initial program 48.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac45.8%

        \[\leadsto \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) \]
      2. fma-def45.7%

        \[\leadsto \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)} \]
      3. times-frac45.7%

        \[\leadsto \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) \]
      4. difference-of-squares45.7%

        \[\leadsto \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. Simplified48.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)} \]
    4. Step-by-step derivation
      1. fma-udef49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow249.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num48.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr51.8%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative51.6%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h}} + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      4. *-commutative51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*51.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/51.7%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac52.0%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac58.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      5. unpow258.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
    12. Simplified58.0%

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*l/58.1%

        \[\leadsto \color{blue}{\frac{c0 \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)}{w \cdot 2}} \]
      2. *-commutative58.1%

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

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

    if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294

    1. Initial program 26.8%

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

      \[\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. Step-by-step derivation
      1. fma-def9.4%

        \[\leadsto \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)} \]
      2. times-frac10.8%

        \[\leadsto \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) \]
      3. *-commutative10.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow210.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow210.8%

        \[\leadsto \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(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) \]
      6. unpow210.8%

        \[\leadsto \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) \]
      7. associate-*r*10.8%

        \[\leadsto \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. Simplified35.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 53.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow253.1%

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

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

        \[\leadsto 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    7. Simplified53.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)} \]
      2. associate-*l*56.3%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)} \cdot \frac{1}{d \cdot d}\right) \]
    9. Applied egg-rr56.3%

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

    if 9.9999999999999998e294 < (*.f64 d d)

    1. Initial program 26.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac27.8%

        \[\leadsto \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) \]
      2. fma-def27.8%

        \[\leadsto \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)} \]
      3. times-frac27.8%

        \[\leadsto \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) \]
      4. difference-of-squares36.5%

        \[\leadsto \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. Simplified36.5%

      \[\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)} \]
    4. Step-by-step derivation
      1. fma-udef36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow236.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr43.3%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative43.3%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/42.4%

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/40.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*42.4%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/42.5%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/40.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac41.5%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac49.6%

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

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

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r/48.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot c0}{w \cdot h}}\right) \]
    14. Applied egg-rr48.8%

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot c0}{w \cdot h}}\right) \]
    15. Step-by-step derivation
      1. associate-*r/49.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)}\right) \]
      2. associate-/r*49.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{w}}{h}}\right)\right) \]
    16. Simplified49.7%

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\ \mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)}{2 \cdot w}\\ \mathbf{elif}\;d \cdot d \leq 10^{+295}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\ \end{array} \]

Alternative 4: 44.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
t_1 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\

\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \left(c0 \cdot \frac{1}{w \cdot h}\right)\right)\right)\\

\mathbf{elif}\;d \cdot d \leq 10^{+295}:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 d d) < 2.00000000000000011e-249

    1. Initial program 12.5%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 2.7%

      \[\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. Step-by-step derivation
      1. fma-def2.7%

        \[\leadsto \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)} \]
      2. times-frac2.7%

        \[\leadsto \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) \]
      3. *-commutative2.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow22.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow22.7%

        \[\leadsto \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(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) \]
      6. unpow22.7%

        \[\leadsto \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) \]
      7. associate-*r*2.7%

        \[\leadsto \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. Simplified12.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 17.5%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow217.5%

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

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity17.5%

        \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
      2. times-frac41.1%

        \[\leadsto 0.25 \cdot \left(1 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}\right) \]
    9. Applied egg-rr41.1%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity41.1%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
      2. associate-/l*56.7%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
      3. unpow256.7%

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
      4. associate-/l*58.9%

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

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
    11. Simplified58.9%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
    12. Step-by-step derivation
      1. associate-*l/58.3%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
      2. associate-/r/60.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}} \]
    13. Applied egg-rr60.3%

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

    if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7

    1. Initial program 48.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac45.8%

        \[\leadsto \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) \]
      2. fma-def45.7%

        \[\leadsto \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)} \]
      3. times-frac45.7%

        \[\leadsto \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) \]
      4. difference-of-squares45.7%

        \[\leadsto \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. Simplified48.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)} \]
    4. Step-by-step derivation
      1. fma-udef49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow249.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv49.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num48.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative45.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr51.8%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative51.6%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h}} + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      4. *-commutative51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/51.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*51.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/51.7%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/51.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac52.0%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac58.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      5. unpow258.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
    12. Simplified58.0%

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

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

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

    if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294

    1. Initial program 26.8%

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

      \[\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. Step-by-step derivation
      1. fma-def9.4%

        \[\leadsto \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)} \]
      2. times-frac10.8%

        \[\leadsto \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) \]
      3. *-commutative10.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow210.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow210.8%

        \[\leadsto \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(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) \]
      6. unpow210.8%

        \[\leadsto \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) \]
      7. associate-*r*10.8%

        \[\leadsto \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. Simplified35.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 53.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow253.1%

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

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

        \[\leadsto 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    7. Simplified53.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)} \]
      2. associate-*l*56.3%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)} \cdot \frac{1}{d \cdot d}\right) \]
    9. Applied egg-rr56.3%

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

    if 9.9999999999999998e294 < (*.f64 d d)

    1. Initial program 26.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac27.8%

        \[\leadsto \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) \]
      2. fma-def27.8%

        \[\leadsto \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)} \]
      3. times-frac27.8%

        \[\leadsto \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) \]
      4. difference-of-squares36.5%

        \[\leadsto \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. Simplified36.5%

      \[\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)} \]
    4. Step-by-step derivation
      1. fma-udef36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow236.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative36.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr43.3%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative43.3%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/42.4%

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/40.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*42.4%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/42.5%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/40.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/41.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac41.5%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac49.6%

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

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

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r/48.8%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot c0}{w \cdot h}}\right) \]
    14. Applied egg-rr48.8%

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\frac{{\left(\frac{d}{D}\right)}^{2} \cdot c0}{w \cdot h}}\right) \]
    15. Step-by-step derivation
      1. associate-*r/49.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}\right)}\right) \]
      2. associate-/r*49.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \color{blue}{\frac{\frac{c0}{w}}{h}}\right)\right) \]
    16. Simplified49.7%

      \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\ \mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \left(c0 \cdot \frac{1}{w \cdot h}\right)\right)\right)\\ \mathbf{elif}\;d \cdot d \leq 10^{+295}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\ \end{array} \]

Alternative 5: 43.7% accurate, 4.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\ \mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7} \lor \neg \left(d \cdot d \leq 10^{+295}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* d d) 2e-249)
   (* 0.25 (/ (* D (* (* M M) (/ h d))) (/ d D)))
   (if (or (<= (* d d) 8.5e-7) (not (<= (* d d) 1e+295)))
     (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 (* w h)) (* (/ d D) (/ d D)))))
     (* 0.25 (* (* D (* D (* h (* M M)))) (/ 1.0 (* d d)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((d * d) <= 2e-249) {
		tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
	} else if (((d * d) <= 8.5e-7) || !((d * d) <= 1e+295)) {
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))));
	} else {
		tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if ((d_1 * d_1) <= 2d-249) then
        tmp = 0.25d0 * ((d * ((m * m) * (h / d_1))) / (d_1 / d))
    else if (((d_1 * d_1) <= 8.5d-7) .or. (.not. ((d_1 * d_1) <= 1d+295))) then
        tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / (w * h)) * ((d_1 / d) * (d_1 / d))))
    else
        tmp = 0.25d0 * ((d * (d * (h * (m * m)))) * (1.0d0 / (d_1 * d_1)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((d * d) <= 2e-249) {
		tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
	} else if (((d * d) <= 8.5e-7) || !((d * d) <= 1e+295)) {
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))));
	} else {
		tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (d * d) <= 2e-249:
		tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D))
	elif ((d * d) <= 8.5e-7) or not ((d * d) <= 1e+295):
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))))
	else:
		tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(d * d) <= 2e-249)
		tmp = Float64(0.25 * Float64(Float64(D * Float64(Float64(M * M) * Float64(h / d))) / Float64(d / D)));
	elseif ((Float64(d * d) <= 8.5e-7) || !(Float64(d * d) <= 1e+295))
		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d / D) * Float64(d / D)))));
	else
		tmp = Float64(0.25 * Float64(Float64(D * Float64(D * Float64(h * Float64(M * M)))) * Float64(1.0 / Float64(d * d))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((d * d) <= 2e-249)
		tmp = 0.25 * ((D * ((M * M) * (h / d))) / (d / D));
	elseif (((d * d) <= 8.5e-7) || ~(((d * d) <= 1e+295)))
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * ((d / D) * (d / D))));
	else
		tmp = 0.25 * ((D * (D * (h * (M * M)))) * (1.0 / (d * d)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(d * d), $MachinePrecision], 2e-249], N[(0.25 * N[(N[(D * N[(N[(M * M), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(d * d), $MachinePrecision], 8.5e-7], N[Not[LessEqual[N[(d * d), $MachinePrecision], 1e+295]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\

\mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7} \lor \neg \left(d \cdot d \leq 10^{+295}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 d d) < 2.00000000000000011e-249

    1. Initial program 12.5%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 2.7%

      \[\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. Step-by-step derivation
      1. fma-def2.7%

        \[\leadsto \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)} \]
      2. times-frac2.7%

        \[\leadsto \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) \]
      3. *-commutative2.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow22.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow22.7%

        \[\leadsto \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(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) \]
      6. unpow22.7%

        \[\leadsto \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) \]
      7. associate-*r*2.7%

        \[\leadsto \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. Simplified12.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 17.5%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow217.5%

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

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity17.5%

        \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
      2. times-frac41.1%

        \[\leadsto 0.25 \cdot \left(1 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}\right) \]
    9. Applied egg-rr41.1%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity41.1%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
      2. associate-/l*56.7%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
      3. unpow256.7%

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
      4. associate-/l*58.9%

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

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
    11. Simplified58.9%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
    12. Step-by-step derivation
      1. associate-*l/58.3%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
      2. associate-/r/60.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}} \]
    13. Applied egg-rr60.3%

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

    if 2.00000000000000011e-249 < (*.f64 d d) < 8.50000000000000014e-7 or 9.9999999999999998e294 < (*.f64 d d)

    1. Initial program 32.2%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac32.1%

        \[\leadsto \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) \]
      2. fma-def32.1%

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

        \[\leadsto \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) \]
      4. difference-of-squares38.7%

        \[\leadsto \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. Simplified39.5%

      \[\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)} \]
    4. Step-by-step derivation
      1. fma-udef39.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow239.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*39.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv39.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num39.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/38.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative38.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr45.3%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative45.3%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/44.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h}} + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      4. *-commutative44.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/43.2%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*44.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/44.7%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac44.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/44.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/43.2%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/44.0%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac44.0%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac51.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      5. unpow251.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
    12. Simplified51.7%

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

        \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    14. Applied egg-rr51.7%

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

    if 8.50000000000000014e-7 < (*.f64 d d) < 9.9999999999999998e294

    1. Initial program 26.8%

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

      \[\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. Step-by-step derivation
      1. fma-def9.4%

        \[\leadsto \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)} \]
      2. times-frac10.8%

        \[\leadsto \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) \]
      3. *-commutative10.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow210.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow210.8%

        \[\leadsto \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(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) \]
      6. unpow210.8%

        \[\leadsto \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) \]
      7. associate-*r*10.8%

        \[\leadsto \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. Simplified35.9%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 53.1%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow253.1%

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

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

        \[\leadsto 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    7. Simplified53.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\left(\left(\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)} \]
      2. associate-*l*56.3%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)} \cdot \frac{1}{d \cdot d}\right) \]
    9. Applied egg-rr56.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-249}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d}\right)}{\frac{d}{D}}\\ \mathbf{elif}\;d \cdot d \leq 8.5 \cdot 10^{-7} \lor \neg \left(d \cdot d \leq 10^{+295}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \left(D \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right) \cdot \frac{1}{d \cdot d}\right)\\ \end{array} \]

Alternative 6: 44.0% accurate, 5.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\ t_1 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \mathbf{if}\;D \leq -1.4 \cdot 10^{+133}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;D \leq -2.6 \cdot 10^{-89}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d \cdot \left(c0 \cdot d\right)}{D \cdot D}}{w \cdot h}\right)\\ \mathbf{elif}\;D \leq -2.1 \cdot 10^{-273}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 1.28 \cdot 10^{-287}:\\ \;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \left(\frac{c0}{h} \cdot \frac{\frac{c0}{w}}{w}\right)\\ \mathbf{elif}\;D \leq 2.2 \cdot 10^{+73}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d))))
        (t_1 (* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w))))))
   (if (<= D -1.4e+133)
     t_1
     (if (<= D -2.6e-89)
       (* (/ c0 (* 2.0 w)) (* 2.0 (/ (/ (* d (* c0 d)) (* D D)) (* w h))))
       (if (<= D -2.1e-273)
         t_0
         (if (<= D 1.28e-287)
           (* (/ (* d d) (* D D)) (* (/ c0 h) (/ (/ c0 w) w)))
           (if (<= D 2.2e+73) t_0 t_1)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	double t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
	double tmp;
	if (D <= -1.4e+133) {
		tmp = t_1;
	} else if (D <= -2.6e-89) {
		tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h)));
	} else if (D <= -2.1e-273) {
		tmp = t_0;
	} else if (D <= 1.28e-287) {
		tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w));
	} else if (D <= 2.2e+73) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.25d0 * (d * (((d * (m * m)) / (d_1 / h)) / d_1))
    t_1 = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (h * (w * w)))
    if (d <= (-1.4d+133)) then
        tmp = t_1
    else if (d <= (-2.6d-89)) then
        tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 * (c0 * d_1)) / (d * d)) / (w * h)))
    else if (d <= (-2.1d-273)) then
        tmp = t_0
    else if (d <= 1.28d-287) then
        tmp = ((d_1 * d_1) / (d * d)) * ((c0 / h) * ((c0 / w) / w))
    else if (d <= 2.2d+73) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	double t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
	double tmp;
	if (D <= -1.4e+133) {
		tmp = t_1;
	} else if (D <= -2.6e-89) {
		tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h)));
	} else if (D <= -2.1e-273) {
		tmp = t_0;
	} else if (D <= 1.28e-287) {
		tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w));
	} else if (D <= 2.2e+73) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d))
	t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)))
	tmp = 0
	if D <= -1.4e+133:
		tmp = t_1
	elif D <= -2.6e-89:
		tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h)))
	elif D <= -2.1e-273:
		tmp = t_0
	elif D <= 1.28e-287:
		tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w))
	elif D <= 2.2e+73:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d)))
	t_1 = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w))))
	tmp = 0.0
	if (D <= -1.4e+133)
		tmp = t_1;
	elseif (D <= -2.6e-89)
		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d * Float64(c0 * d)) / Float64(D * D)) / Float64(w * h))));
	elseif (D <= -2.1e-273)
		tmp = t_0;
	elseif (D <= 1.28e-287)
		tmp = Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(Float64(c0 / h) * Float64(Float64(c0 / w) / w)));
	elseif (D <= 2.2e+73)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
	tmp = 0.0;
	if (D <= -1.4e+133)
		tmp = t_1;
	elseif (D <= -2.6e-89)
		tmp = (c0 / (2.0 * w)) * (2.0 * (((d * (c0 * d)) / (D * D)) / (w * h)));
	elseif (D <= -2.1e-273)
		tmp = t_0;
	elseif (D <= 1.28e-287)
		tmp = ((d * d) / (D * D)) * ((c0 / h) * ((c0 / w) / w));
	elseif (D <= 2.2e+73)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D, -1.4e+133], t$95$1, If[LessEqual[D, -2.6e-89], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, -2.1e-273], t$95$0, If[LessEqual[D, 1.28e-287], N[(N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 2.2e+73], t$95$0, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\
t_1 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;D \leq -1.4 \cdot 10^{+133}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;D \leq -2.6 \cdot 10^{-89}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d \cdot \left(c0 \cdot d\right)}{D \cdot D}}{w \cdot h}\right)\\

\mathbf{elif}\;D \leq -2.1 \cdot 10^{-273}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;D \leq 1.28 \cdot 10^{-287}:\\
\;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \left(\frac{c0}{h} \cdot \frac{\frac{c0}{w}}{w}\right)\\

\mathbf{elif}\;D \leq 2.2 \cdot 10^{+73}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if D < -1.40000000000000008e133 or 2.2e73 < D

    1. Initial program 22.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac25.3%

        \[\leadsto \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) \]
      2. fma-def22.9%

        \[\leadsto \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)} \]
      3. times-frac23.0%

        \[\leadsto \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) \]
      4. difference-of-squares25.5%

        \[\leadsto \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. Simplified25.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)} \]
    4. Step-by-step derivation
      1. fma-udef28.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow228.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*25.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv23.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num23.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/25.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative25.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr41.1%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative41.1%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/38.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h}} + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      4. *-commutative38.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/36.1%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*36.3%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/36.3%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac36.2%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/33.9%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/33.6%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/33.9%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac38.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow228.2%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. times-frac58.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    14. Applied egg-rr58.6%

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

    if -1.40000000000000008e133 < D < -2.5999999999999999e-89

    1. Initial program 41.3%

      \[\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. Step-by-step derivation
      1. times-frac39.2%

        \[\leadsto \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) \]
      2. fma-def39.2%

        \[\leadsto \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)} \]
      3. times-frac39.2%

        \[\leadsto \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) \]
      4. difference-of-squares46.0%

        \[\leadsto \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. Simplified43.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)} \]
    4. Step-by-step derivation
      1. fma-udef43.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow243.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*43.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv43.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num43.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/46.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative46.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr48.4%

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(2 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \]
    7. Step-by-step derivation
      1. associate-/r*55.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{\color{blue}{\left(d \cdot d\right)} \cdot c0}{{D}^{2}}}{w \cdot h}\right) \]
      3. associate-*l*57.7%

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

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

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

    if -2.5999999999999999e-89 < D < -2.1000000000000002e-273 or 1.28e-287 < D < 2.2e73

    1. Initial program 21.1%

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

      \[\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. Step-by-step derivation
      1. fma-def2.2%

        \[\leadsto \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)} \]
      2. times-frac2.2%

        \[\leadsto \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) \]
      3. *-commutative2.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow22.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow22.2%

        \[\leadsto \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(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) \]
      6. unpow22.2%

        \[\leadsto \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) \]
      7. associate-*r*2.2%

        \[\leadsto \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. Simplified25.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)} \]
    5. Taylor expanded in c0 around 0 35.5%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow235.5%

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

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity35.5%

        \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
      2. times-frac41.4%

        \[\leadsto 0.25 \cdot \left(1 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}\right) \]
    9. Applied egg-rr41.4%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity41.4%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
      2. associate-/l*45.8%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
      3. unpow245.8%

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
      4. associate-/l*47.2%

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

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

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
    12. Step-by-step derivation
      1. associate-*l/48.5%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
      2. associate-/r/49.7%

        \[\leadsto 0.25 \cdot \frac{D \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}} \]
    13. Applied egg-rr49.7%

      \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}} \]
    14. Step-by-step derivation
      1. associate-/r/54.3%

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

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \left(\frac{h}{d} \cdot \color{blue}{{M}^{2}}\right)}{d} \cdot D\right) \]
      3. associate-*l/53.3%

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

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{d}}{d} \cdot D\right) \]
      5. associate-/l*53.7%

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \color{blue}{\frac{{M}^{2}}{\frac{d}{h}}}}{d} \cdot D\right) \]
      6. associate-*r/52.8%

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

        \[\leadsto 0.25 \cdot \left(\frac{\frac{D \cdot \color{blue}{\left(M \cdot M\right)}}{\frac{d}{h}}}{d} \cdot D\right) \]
    15. Simplified52.8%

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

    if -2.1000000000000002e-273 < D < 1.28e-287

    1. Initial program 50.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. Step-by-step derivation
      1. times-frac50.0%

        \[\leadsto \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) \]
      2. fma-def50.0%

        \[\leadsto \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)} \]
      3. times-frac50.0%

        \[\leadsto \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) \]
      4. difference-of-squares50.0%

        \[\leadsto \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. Simplified54.5%

      \[\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)} \]
    4. Step-by-step derivation
      1. fma-udef54.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow254.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*54.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv54.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num54.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/50.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative50.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr59.1%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative59.1%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/59.1%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h}} + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      4. *-commutative59.1%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/54.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*59.1%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/59.1%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac59.1%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/59.1%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/54.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/59.1%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac59.3%

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

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

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

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

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

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{c0}{w \cdot h}\right)\right) \]
      4. times-frac59.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow245.5%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow245.5%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow245.5%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative45.5%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. times-frac45.8%

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

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \left(\frac{c0}{h} \cdot \frac{c0}{\color{blue}{w \cdot w}}\right) \]
      8. associate-/r*50.4%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \left(\frac{c0}{h} \cdot \color{blue}{\frac{\frac{c0}{w}}{w}}\right) \]
    15. Simplified50.4%

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \left(\frac{c0}{h} \cdot \frac{\frac{c0}{w}}{w}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq -1.4 \cdot 10^{+133}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \mathbf{elif}\;D \leq -2.6 \cdot 10^{-89}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d \cdot \left(c0 \cdot d\right)}{D \cdot D}}{w \cdot h}\right)\\ \mathbf{elif}\;D \leq -2.1 \cdot 10^{-273}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\ \mathbf{elif}\;D \leq 1.28 \cdot 10^{-287}:\\ \;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \left(\frac{c0}{h} \cdot \frac{\frac{c0}{w}}{w}\right)\\ \mathbf{elif}\;D \leq 2.2 \cdot 10^{+73}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \end{array} \]

Alternative 7: 45.5% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;D \cdot D \leq 5 \cdot 10^{+140}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* D D) 5e+140)
   (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d)))
   (* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((D * D) <= 5e+140) {
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	} else {
		tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if ((d * d) <= 5d+140) then
        tmp = 0.25d0 * (d * (((d * (m * m)) / (d_1 / h)) / d_1))
    else
        tmp = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (h * (w * w)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((D * D) <= 5e+140) {
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	} else {
		tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (D * D) <= 5e+140:
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d))
	else:
		tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(D * D) <= 5e+140)
		tmp = Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d)));
	else
		tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((D * D) <= 5e+140)
		tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
	else
		tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 5e+140], N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 5 \cdot 10^{+140}:\\
\;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 D D) < 5.00000000000000008e140

    1. Initial program 27.8%

      \[\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 2.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. Step-by-step derivation
      1. fma-def2.6%

        \[\leadsto \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)} \]
      2. times-frac3.1%

        \[\leadsto \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) \]
      3. *-commutative3.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
      4. unpow23.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
      5. unpow23.1%

        \[\leadsto \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(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) \]
      6. unpow23.1%

        \[\leadsto \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) \]
      7. associate-*r*3.1%

        \[\leadsto \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. Simplified25.7%

      \[\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)} \]
    5. Taylor expanded in c0 around 0 33.6%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. unpow233.6%

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

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

        \[\leadsto 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    7. Simplified33.6%

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity33.6%

        \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
      2. times-frac40.2%

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

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity40.2%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
      2. associate-/l*43.4%

        \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
      3. unpow243.4%

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
      4. associate-/l*43.9%

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

        \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
    11. Simplified43.9%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
    12. Step-by-step derivation
      1. associate-*l/45.4%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
      2. associate-/r/45.7%

        \[\leadsto 0.25 \cdot \frac{D \cdot \color{blue}{\left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}} \]
    13. Applied egg-rr45.7%

      \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}} \]
    14. Step-by-step derivation
      1. associate-/r/49.1%

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

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \left(\frac{h}{d} \cdot \color{blue}{{M}^{2}}\right)}{d} \cdot D\right) \]
      3. associate-*l/50.3%

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

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{d}}{d} \cdot D\right) \]
      5. associate-/l*48.6%

        \[\leadsto 0.25 \cdot \left(\frac{D \cdot \color{blue}{\frac{{M}^{2}}{\frac{d}{h}}}}{d} \cdot D\right) \]
      6. associate-*r/48.0%

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

        \[\leadsto 0.25 \cdot \left(\frac{\frac{D \cdot \color{blue}{\left(M \cdot M\right)}}{\frac{d}{h}}}{d} \cdot D\right) \]
    15. Simplified48.0%

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

    if 5.00000000000000008e140 < (*.f64 D D)

    1. Initial program 25.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. Step-by-step derivation
      1. times-frac25.5%

        \[\leadsto \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) \]
      2. fma-def23.5%

        \[\leadsto \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)} \]
      3. times-frac23.6%

        \[\leadsto \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) \]
      4. difference-of-squares25.7%

        \[\leadsto \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. Simplified25.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)} \]
    4. Step-by-step derivation
      1. fma-udef28.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right) + \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)} \]
      2. pow228.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{2}} + \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) \]
      3. associate-*l*25.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{\color{blue}{w \cdot \left(h \cdot D\right)}}, \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) \]
      4. div-inv23.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{1}{\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) \]
      5. clear-num23.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \color{blue}{\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) \]
      6. associate-*r/25.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
      7. *-commutative25.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \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) \]
    5. Applied egg-rr40.8%

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

        \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)}} \]
      2. *-commutative40.7%

        \[\leadsto \frac{c0}{\color{blue}{w \cdot 2}} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      3. associate-*l/38.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \color{blue}{\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h}} + \frac{c0}{2 \cdot w} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      4. *-commutative38.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{\color{blue}{w \cdot 2}} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, d \cdot \frac{d}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      5. associate-*r/34.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      6. associate-/l*36.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \frac{c0}{w \cdot 2} \cdot \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{\frac{D}{d}}}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2} - M\right)} \]
      7. associate-*l/36.7%

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

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

        \[\leadsto \color{blue}{\frac{c0}{w \cdot 2} \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right)} \]
      2. times-frac36.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\color{blue}{\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \frac{d}{\frac{D}{d}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      3. associate-/r/34.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d}{D} \cdot d}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      4. associate-*l/32.5%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{\frac{d \cdot d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      5. associate-*r/34.7%

        \[\leadsto \frac{c0}{w \cdot 2} \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot \left(h \cdot D\right)}, \color{blue}{d \cdot \frac{d}{D}}, M\right) \cdot \left(\frac{c0 \cdot {\left(\frac{d}{D}\right)}^{2}}{w \cdot h} - M\right)}\right) \]
      6. times-frac38.8%

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

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

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

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow226.0%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow226.0%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. times-frac51.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)} \]
    14. Applied egg-rr51.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \cdot D \leq 5 \cdot 10^{+140}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \end{array} \]

Alternative 8: 42.6% accurate, 10.1× speedup?

\[\begin{array}{l} \\ 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right) \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (* 0.25 (* (/ D (/ d D)) (/ h (/ d (* M M))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * ((D / (d / D)) * (h / (d / (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = 0.25d0 * ((d / (d_1 / d)) * (h / (d_1 / (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * ((D / (d / D)) * (h / (d / (M * M))));
}
def code(c0, w, h, D, d, M):
	return 0.25 * ((D / (d / D)) * (h / (d / (M * M))))
function code(c0, w, h, D, d, M)
	return Float64(0.25 * Float64(Float64(D / Float64(d / D)) * Float64(h / Float64(d / Float64(M * M)))))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.25 * ((D / (d / D)) * (h / (d / (M * M))));
end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(N[(D / N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(h / N[(d / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)
\end{array}
Derivation
  1. Initial program 27.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 4.5%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
  3. Step-by-step derivation
    1. fma-def4.5%

      \[\leadsto \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)} \]
    2. times-frac4.9%

      \[\leadsto \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) \]
    3. *-commutative4.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
    4. unpow24.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
    5. unpow24.9%

      \[\leadsto \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(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) \]
    6. unpow24.9%

      \[\leadsto \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) \]
    7. associate-*r*4.9%

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

    \[\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)} \]
  5. Taylor expanded in c0 around 0 31.7%

    \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
  6. Step-by-step derivation
    1. unpow231.7%

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

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

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

    \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
  8. Step-by-step derivation
    1. *-un-lft-identity31.7%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
    2. times-frac39.2%

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

    \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
  10. Step-by-step derivation
    1. *-lft-identity39.2%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
    2. associate-/l*41.4%

      \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
    3. unpow241.4%

      \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
    4. associate-/l*41.8%

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

      \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
  11. Simplified41.8%

    \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
  12. Final simplification41.8%

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

Alternative 9: 45.3% accurate, 10.1× speedup?

\[\begin{array}{l} \\ 0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right) \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (* 0.25 (* D (/ (/ (* D (* M M)) (/ d h)) d))))
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = 0.25d0 * (d * (((d * (m * m)) / (d_1 / h)) / d_1))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
}
def code(c0, w, h, D, d, M):
	return 0.25 * (D * (((D * (M * M)) / (d / h)) / d))
function code(c0, w, h, D, d, M)
	return Float64(0.25 * Float64(D * Float64(Float64(Float64(D * Float64(M * M)) / Float64(d / h)) / d)))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.25 * (D * (((D * (M * M)) / (d / h)) / d));
end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(D * N[(N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.25 \cdot \left(D \cdot \frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d}\right)
\end{array}
Derivation
  1. Initial program 27.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 4.5%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
  3. Step-by-step derivation
    1. fma-def4.5%

      \[\leadsto \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)} \]
    2. times-frac4.9%

      \[\leadsto \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) \]
    3. *-commutative4.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \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) \]
    4. unpow24.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \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) \]
    5. unpow24.9%

      \[\leadsto \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(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) \]
    6. unpow24.9%

      \[\leadsto \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) \]
    7. associate-*r*4.9%

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

    \[\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)} \]
  5. Taylor expanded in c0 around 0 31.7%

    \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
  6. Step-by-step derivation
    1. unpow231.7%

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

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

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

    \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}} \]
  8. Step-by-step derivation
    1. *-un-lft-identity31.7%

      \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\right)} \]
    2. times-frac39.2%

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

    \[\leadsto 0.25 \cdot \color{blue}{\left(1 \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
  10. Step-by-step derivation
    1. *-lft-identity39.2%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)} \]
    2. associate-/l*41.4%

      \[\leadsto 0.25 \cdot \left(\color{blue}{\frac{D}{\frac{d}{D}}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right) \]
    3. unpow241.4%

      \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h \cdot \color{blue}{{M}^{2}}}{d}\right) \]
    4. associate-/l*41.8%

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

      \[\leadsto 0.25 \cdot \left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{\color{blue}{M \cdot M}}}\right) \]
  11. Simplified41.8%

    \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D}{\frac{d}{D}} \cdot \frac{h}{\frac{d}{M \cdot M}}\right)} \]
  12. Step-by-step derivation
    1. associate-*l/43.1%

      \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \frac{h}{\frac{d}{M \cdot M}}}{\frac{d}{D}}} \]
    2. associate-/r/42.6%

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

    \[\leadsto 0.25 \cdot \color{blue}{\frac{D \cdot \left(\frac{h}{d} \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}} \]
  14. Step-by-step derivation
    1. associate-/r/45.4%

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

      \[\leadsto 0.25 \cdot \left(\frac{D \cdot \left(\frac{h}{d} \cdot \color{blue}{{M}^{2}}\right)}{d} \cdot D\right) \]
    3. associate-*l/47.1%

      \[\leadsto 0.25 \cdot \left(\frac{D \cdot \color{blue}{\frac{h \cdot {M}^{2}}{d}}}{d} \cdot D\right) \]
    4. *-commutative47.1%

      \[\leadsto 0.25 \cdot \left(\frac{D \cdot \frac{\color{blue}{{M}^{2} \cdot h}}{d}}{d} \cdot D\right) \]
    5. associate-/l*44.9%

      \[\leadsto 0.25 \cdot \left(\frac{D \cdot \color{blue}{\frac{{M}^{2}}{\frac{d}{h}}}}{d} \cdot D\right) \]
    6. associate-*r/44.8%

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

      \[\leadsto 0.25 \cdot \left(\frac{\frac{D \cdot \color{blue}{\left(M \cdot M\right)}}{\frac{d}{h}}}{d} \cdot D\right) \]
  15. Simplified44.8%

    \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{\frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}}{d} \cdot D\right)} \]
  16. Final simplification44.8%

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

Alternative 10: 33.3% accurate, 151.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (c0 w h D d M) :precision binary64 0.0)
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.0;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return 0.0;
}
def code(c0, w, h, D, d, M):
	return 0.0
function code(c0, w, h, D, d, M)
	return 0.0
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.0;
end
code[c0_, w_, h_, D_, d_, M_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 27.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. Step-by-step derivation
    1. times-frac26.9%

      \[\leadsto \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) \]
    2. fma-def26.1%

      \[\leadsto \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)} \]
    3. associate-/r*26.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{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) \]
    4. difference-of-squares31.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{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. Simplified37.5%

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

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\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)} \]
    2. distribute-rgt1-in3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot c0\right) \]
    3. metadata-eval3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right) \]
    4. mul0-lft27.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
    5. metadata-eval27.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
    6. mul0-lft3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(0 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
    7. metadata-eval3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right) \]
    8. distribute-lft1-in3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
    9. *-commutative3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)} \]
    10. distribute-lft1-in3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    11. metadata-eval3.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \]
    12. mul0-lft27.0%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
  6. Simplified27.0%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot 0\right)} \]
  7. Taylor expanded in c0 around 0 32.5%

    \[\leadsto \color{blue}{0} \]
  8. Final simplification32.5%

    \[\leadsto 0 \]

Reproduce

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