Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.8% → 72.8%
Time: 25.8s
Alternatives: 11
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 11 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: 24.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: 72.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\

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

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


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

    1. Initial program 81.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. Simplified81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{h \cdot w} \cdot \left(\frac{d}{D} \cdot \color{blue}{\frac{1}{\frac{D}{d}}}\right)\right)\right) \]
      4. div-inv83.9%

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

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

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

    if -1e-242 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 0.0

    1. Initial program 65.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. Simplified63.7%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow263.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow263.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow263.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow263.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified63.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 87.3%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow287.3%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow287.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative87.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow287.3%

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

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

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

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

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

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

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

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

        \[\leadsto 0.25 \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(h \cdot M\right) \cdot M}{\color{blue}{d \cdot d}}\right) \]
      5. times-frac99.8%

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

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

    if 0.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

    1. Initial program 74.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. Simplified76.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{h \cdot w} \cdot \color{blue}{\frac{\frac{d}{D} \cdot d}{D}}\right)\right) \]
    8. Step-by-step derivation
      1. *-un-lft-identity82.8%

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

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

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

    if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 0.0%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in2.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}, 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      3. metadata-eval2.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow22.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow22.8%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow22.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow22.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative2.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow22.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified2.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 42.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow243.1%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow243.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative43.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow243.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)\right)} \]
      2. expm1-udef45.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)} - 1} \]
      3. *-commutative45.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right) \cdot 0.25}\right)} - 1 \]
      4. associate-*l*46.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(h \cdot \left(\left(M \cdot M\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)} \cdot 0.25\right)} - 1 \]
      5. pow246.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(h \cdot \left({M}^{2} \cdot \color{blue}{{\left(\frac{D}{d}\right)}^{2}}\right)\right) \cdot 0.25\right)} - 1 \]
      7. pow-prod-down53.3%

        \[\leadsto e^{\mathsf{log1p}\left(\left(h \cdot \color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}}\right) \cdot 0.25\right)} - 1 \]
    13. Applied egg-rr53.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(h \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right) \cdot 0.25\right)} - 1} \]
    14. Step-by-step derivation
      1. expm1-def64.5%

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

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

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

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

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

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

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

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

Alternative 2: 49.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{d}{D} \cdot \frac{d}{D}\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := \left(h \cdot 0.25\right) \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\\ \mathbf{if}\;d \leq 5.2 \cdot 10^{-109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq 8200000000000:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot t_0\right)\right)\\ \mathbf{elif}\;d \leq 8.8 \cdot 10^{+131}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq 1.35 \cdot 10^{+151}:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+273}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d}{D}}{\frac{D}{d}}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ d D) (/ d D)))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (* (* h 0.25) (pow (* M (/ D d)) 2.0))))
   (if (<= d 5.2e-109)
     t_2
     (if (<= d 8200000000000.0)
       (* t_1 (* 2.0 (* (* (/ c0 h) (/ 1.0 w)) t_0)))
       (if (<= d 8.8e+131)
         t_2
         (if (<= d 1.35e+151)
           (* t_1 (* 2.0 (* t_0 (/ (/ c0 h) w))))
           (if (<= d 1.4e+273)
             t_2
             (* t_1 (* 2.0 (* (/ c0 (* w h)) (/ (/ d D) (/ D d))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (d / D) * (d / D);
	double t_1 = c0 / (2.0 * w);
	double t_2 = (h * 0.25) * pow((M * (D / d)), 2.0);
	double tmp;
	if (d <= 5.2e-109) {
		tmp = t_2;
	} else if (d <= 8200000000000.0) {
		tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
	} else if (d <= 8.8e+131) {
		tmp = t_2;
	} else if (d <= 1.35e+151) {
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
	} else if (d <= 1.4e+273) {
		tmp = t_2;
	} else {
		tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (d_1 / d) * (d_1 / d)
    t_1 = c0 / (2.0d0 * w)
    t_2 = (h * 0.25d0) * ((m * (d / d_1)) ** 2.0d0)
    if (d_1 <= 5.2d-109) then
        tmp = t_2
    else if (d_1 <= 8200000000000.0d0) then
        tmp = t_1 * (2.0d0 * (((c0 / h) * (1.0d0 / w)) * t_0))
    else if (d_1 <= 8.8d+131) then
        tmp = t_2
    else if (d_1 <= 1.35d+151) then
        tmp = t_1 * (2.0d0 * (t_0 * ((c0 / h) / w)))
    else if (d_1 <= 1.4d+273) then
        tmp = t_2
    else
        tmp = t_1 * (2.0d0 * ((c0 / (w * h)) * ((d_1 / d) / (d / 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 t_0 = (d / D) * (d / D);
	double t_1 = c0 / (2.0 * w);
	double t_2 = (h * 0.25) * Math.pow((M * (D / d)), 2.0);
	double tmp;
	if (d <= 5.2e-109) {
		tmp = t_2;
	} else if (d <= 8200000000000.0) {
		tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
	} else if (d <= 8.8e+131) {
		tmp = t_2;
	} else if (d <= 1.35e+151) {
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
	} else if (d <= 1.4e+273) {
		tmp = t_2;
	} else {
		tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (d / D) * (d / D)
	t_1 = c0 / (2.0 * w)
	t_2 = (h * 0.25) * math.pow((M * (D / d)), 2.0)
	tmp = 0
	if d <= 5.2e-109:
		tmp = t_2
	elif d <= 8200000000000.0:
		tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0))
	elif d <= 8.8e+131:
		tmp = t_2
	elif d <= 1.35e+151:
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)))
	elif d <= 1.4e+273:
		tmp = t_2
	else:
		tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d))))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(d / D) * Float64(d / D))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(Float64(h * 0.25) * (Float64(M * Float64(D / d)) ^ 2.0))
	tmp = 0.0
	if (d <= 5.2e-109)
		tmp = t_2;
	elseif (d <= 8200000000000.0)
		tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(Float64(c0 / h) * Float64(1.0 / w)) * t_0)));
	elseif (d <= 8.8e+131)
		tmp = t_2;
	elseif (d <= 1.35e+151)
		tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(Float64(c0 / h) / w))));
	elseif (d <= 1.4e+273)
		tmp = t_2;
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d / D) / Float64(D / d)))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (d / D) * (d / D);
	t_1 = c0 / (2.0 * w);
	t_2 = (h * 0.25) * ((M * (D / d)) ^ 2.0);
	tmp = 0.0;
	if (d <= 5.2e-109)
		tmp = t_2;
	elseif (d <= 8200000000000.0)
		tmp = t_1 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
	elseif (d <= 8.8e+131)
		tmp = t_2;
	elseif (d <= 1.35e+151)
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
	elseif (d <= 1.4e+273)
		tmp = t_2;
	else
		tmp = t_1 * (2.0 * ((c0 / (w * h)) * ((d / D) / (D / d))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(h * 0.25), $MachinePrecision] * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, 5.2e-109], t$95$2, If[LessEqual[d, 8200000000000.0], N[(t$95$1 * N[(2.0 * N[(N[(N[(c0 / h), $MachinePrecision] * N[(1.0 / w), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.8e+131], t$95$2, If[LessEqual[d, 1.35e+151], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.4e+273], t$95$2, N[(t$95$1 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;d \leq 8200000000000:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot t_0\right)\right)\\

\mathbf{elif}\;d \leq 8.8 \cdot 10^{+131}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;d \leq 1.35 \cdot 10^{+151}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\

\mathbf{elif}\;d \leq 1.4 \cdot 10^{+273}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < 5.1999999999999997e-109 or 8.2e12 < d < 8.7999999999999995e131 or 1.3500000000000001e151 < d < 1.40000000000000009e273

    1. Initial program 21.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. Simplified22.6%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow25.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow25.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow25.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow25.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified5.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 36.3%

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

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

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

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative35.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)\right)} \]
      2. expm1-udef36.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)} - 1} \]
      3. *-commutative36.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right) \cdot 0.25}\right)} - 1 \]
      4. associate-*l*37.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(h \cdot \left(\left(M \cdot M\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)} \cdot 0.25\right)} - 1 \]
      5. pow237.6%

        \[\leadsto e^{\mathsf{log1p}\left(\left(h \cdot \left(\color{blue}{{M}^{2}} \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right) \cdot 0.25\right)} - 1 \]
      6. pow237.6%

        \[\leadsto e^{\mathsf{log1p}\left(\left(h \cdot \left({M}^{2} \cdot \color{blue}{{\left(\frac{D}{d}\right)}^{2}}\right)\right) \cdot 0.25\right)} - 1 \]
      7. pow-prod-down42.4%

        \[\leadsto e^{\mathsf{log1p}\left(\left(h \cdot \color{blue}{{\left(M \cdot \frac{D}{d}\right)}^{2}}\right) \cdot 0.25\right)} - 1 \]
    13. Applied egg-rr42.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(h \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right) \cdot 0.25\right)} - 1} \]
    14. Step-by-step derivation
      1. expm1-def52.3%

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

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

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

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

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

    if 5.1999999999999997e-109 < d < 8.2e12

    1. Initial program 45.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. Simplified55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.7999999999999995e131 < d < 1.3500000000000001e151

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000009e273 < d

    1. Initial program 18.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. Simplified18.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{h \cdot w} \cdot \color{blue}{\frac{\frac{d}{D} \cdot d}{D}}\right)\right) \]
    8. Step-by-step derivation
      1. *-un-lft-identity64.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 5.2 \cdot 10^{-109}:\\ \;\;\;\;\left(h \cdot 0.25\right) \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\\ \mathbf{elif}\;d \leq 8200000000000:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\ \mathbf{elif}\;d \leq 8.8 \cdot 10^{+131}:\\ \;\;\;\;\left(h \cdot 0.25\right) \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\\ \mathbf{elif}\;d \leq 1.35 \cdot 10^{+151}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{+273}:\\ \;\;\;\;\left(h \cdot 0.25\right) \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d}{D}}{\frac{D}{d}}\right)\right)\\ \end{array} \]

Alternative 3: 45.7% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{d}{D} \cdot \frac{d}{D}\\ t_1 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0\right)\right)\\ t_2 := h \cdot \left(M \cdot M\right)\\ \mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\ \;\;\;\;0.25 \cdot \frac{t_2}{t_0}\\ \mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;M \cdot M \leq 10^{-48}:\\ \;\;\;\;0.25 \cdot \left(t_2 \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\ \mathbf{elif}\;M \cdot M \leq 500 \lor \neg \left(M \cdot M \leq 2 \cdot 10^{+144}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ d D) (/ d D)))
        (t_1 (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 (* w h)) t_0))))
        (t_2 (* h (* M M))))
   (if (<= (* M M) 4e-221)
     (* 0.25 (/ t_2 t_0))
     (if (<= (* M M) 5e-165)
       t_1
       (if (<= (* M M) 1e-48)
         (* 0.25 (* t_2 (/ (* D (/ D d)) d)))
         (if (or (<= (* M M) 500.0) (not (<= (* M M) 2e+144)))
           t_1
           (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (d / D) * (d / D);
	double t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0));
	double t_2 = h * (M * M);
	double tmp;
	if ((M * M) <= 4e-221) {
		tmp = 0.25 * (t_2 / t_0);
	} else if ((M * M) <= 5e-165) {
		tmp = t_1;
	} else if ((M * M) <= 1e-48) {
		tmp = 0.25 * (t_2 * ((D * (D / d)) / d));
	} else if (((M * M) <= 500.0) || !((M * M) <= 2e+144)) {
		tmp = t_1;
	} else {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / 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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (d_1 / d) * (d_1 / d)
    t_1 = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / (w * h)) * t_0))
    t_2 = h * (m * m)
    if ((m * m) <= 4d-221) then
        tmp = 0.25d0 * (t_2 / t_0)
    else if ((m * m) <= 5d-165) then
        tmp = t_1
    else if ((m * m) <= 1d-48) then
        tmp = 0.25d0 * (t_2 * ((d * (d / d_1)) / d_1))
    else if (((m * m) <= 500.0d0) .or. (.not. ((m * m) <= 2d+144))) then
        tmp = t_1
    else
        tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / 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 t_0 = (d / D) * (d / D);
	double t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0));
	double t_2 = h * (M * M);
	double tmp;
	if ((M * M) <= 4e-221) {
		tmp = 0.25 * (t_2 / t_0);
	} else if ((M * M) <= 5e-165) {
		tmp = t_1;
	} else if ((M * M) <= 1e-48) {
		tmp = 0.25 * (t_2 * ((D * (D / d)) / d));
	} else if (((M * M) <= 500.0) || !((M * M) <= 2e+144)) {
		tmp = t_1;
	} else {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (d / D) * (d / D)
	t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0))
	t_2 = h * (M * M)
	tmp = 0
	if (M * M) <= 4e-221:
		tmp = 0.25 * (t_2 / t_0)
	elif (M * M) <= 5e-165:
		tmp = t_1
	elif (M * M) <= 1e-48:
		tmp = 0.25 * (t_2 * ((D * (D / d)) / d))
	elif ((M * M) <= 500.0) or not ((M * M) <= 2e+144):
		tmp = t_1
	else:
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(d / D) * Float64(d / D))
	t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * t_0)))
	t_2 = Float64(h * Float64(M * M))
	tmp = 0.0
	if (Float64(M * M) <= 4e-221)
		tmp = Float64(0.25 * Float64(t_2 / t_0));
	elseif (Float64(M * M) <= 5e-165)
		tmp = t_1;
	elseif (Float64(M * M) <= 1e-48)
		tmp = Float64(0.25 * Float64(t_2 * Float64(Float64(D * Float64(D / d)) / d)));
	elseif ((Float64(M * M) <= 500.0) || !(Float64(M * M) <= 2e+144))
		tmp = t_1;
	else
		tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (d / D) * (d / D);
	t_1 = (c0 / (2.0 * w)) * (2.0 * ((c0 / (w * h)) * t_0));
	t_2 = h * (M * M);
	tmp = 0.0;
	if ((M * M) <= 4e-221)
		tmp = 0.25 * (t_2 / t_0);
	elseif ((M * M) <= 5e-165)
		tmp = t_1;
	elseif ((M * M) <= 1e-48)
		tmp = 0.25 * (t_2 * ((D * (D / d)) / d));
	elseif (((M * M) <= 500.0) || ~(((M * M) <= 2e+144)))
		tmp = t_1;
	else
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 4e-221], N[(0.25 * N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 5e-165], t$95$1, If[LessEqual[N[(M * M), $MachinePrecision], 1e-48], N[(0.25 * N[(t$95$2 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(M * M), $MachinePrecision], 500.0], N[Not[LessEqual[N[(M * M), $MachinePrecision], 2e+144]], $MachinePrecision]], t$95$1, N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;M \cdot M \leq 500 \lor \neg \left(M \cdot M \leq 2 \cdot 10^{+144}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 M M) < 4.00000000000000007e-221

    1. Initial program 27.7%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}, 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      3. metadata-eval7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow27.5%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified7.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 42.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow242.6%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow242.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative42.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow242.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000007e-221 < (*.f64 M M) < 4.99999999999999981e-165 or 9.9999999999999997e-49 < (*.f64 M M) < 500 or 2.00000000000000005e144 < (*.f64 M M)

    1. Initial program 22.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. Simplified24.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999981e-165 < (*.f64 M M) < 9.9999999999999997e-49

    1. Initial program 20.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. Simplified20.7%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in0.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow20.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative0.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified0.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 48.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow248.3%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow248.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative48.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow248.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 500 < (*.f64 M M) < 2.00000000000000005e144

    1. Initial program 14.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. Simplified17.5%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in8.9%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative8.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified8.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 47.5%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow250.0%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow250.0%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative50.0%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow250.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\ \;\;\;\;\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}\;M \cdot M \leq 10^{-48}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\ \mathbf{elif}\;M \cdot M \leq 500 \lor \neg \left(M \cdot M \leq 2 \cdot 10^{+144}\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 D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \end{array} \]

Alternative 4: 45.7% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{d}{D} \cdot \frac{d}{D}\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := t_1 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0\right)\right)\\ t_3 := h \cdot \left(M \cdot M\right)\\ \mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\ \;\;\;\;0.25 \cdot \frac{t_3}{t_0}\\ \mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;M \cdot M \leq 10^{-48}:\\ \;\;\;\;0.25 \cdot \left(t_3 \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\ \mathbf{elif}\;M \cdot M \leq 500:\\ \;\;\;\;t_2\\ \mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{+144}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \left(t_0 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ d D) (/ d D)))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (* t_1 (* 2.0 (* (/ c0 (* w h)) t_0))))
        (t_3 (* h (* M M))))
   (if (<= (* M M) 4e-221)
     (* 0.25 (/ t_3 t_0))
     (if (<= (* M M) 5e-165)
       t_2
       (if (<= (* M M) 1e-48)
         (* 0.25 (* t_3 (/ (* D (/ D d)) d)))
         (if (<= (* M M) 500.0)
           t_2
           (if (<= (* M M) 2e+144)
             (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))
             (* t_1 (* 2.0 (* t_0 (/ (/ c0 h) w)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (d / D) * (d / D);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
	double t_3 = h * (M * M);
	double tmp;
	if ((M * M) <= 4e-221) {
		tmp = 0.25 * (t_3 / t_0);
	} else if ((M * M) <= 5e-165) {
		tmp = t_2;
	} else if ((M * M) <= 1e-48) {
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
	} else if ((M * M) <= 500.0) {
		tmp = t_2;
	} else if ((M * M) <= 2e+144) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / 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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (d_1 / d) * (d_1 / d)
    t_1 = c0 / (2.0d0 * w)
    t_2 = t_1 * (2.0d0 * ((c0 / (w * h)) * t_0))
    t_3 = h * (m * m)
    if ((m * m) <= 4d-221) then
        tmp = 0.25d0 * (t_3 / t_0)
    else if ((m * m) <= 5d-165) then
        tmp = t_2
    else if ((m * m) <= 1d-48) then
        tmp = 0.25d0 * (t_3 * ((d * (d / d_1)) / d_1))
    else if ((m * m) <= 500.0d0) then
        tmp = t_2
    else if ((m * m) <= 2d+144) then
        tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
    else
        tmp = t_1 * (2.0d0 * (t_0 * ((c0 / h) / w)))
    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 = (d / D) * (d / D);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
	double t_3 = h * (M * M);
	double tmp;
	if ((M * M) <= 4e-221) {
		tmp = 0.25 * (t_3 / t_0);
	} else if ((M * M) <= 5e-165) {
		tmp = t_2;
	} else if ((M * M) <= 1e-48) {
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
	} else if ((M * M) <= 500.0) {
		tmp = t_2;
	} else if ((M * M) <= 2e+144) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (d / D) * (d / D)
	t_1 = c0 / (2.0 * w)
	t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0))
	t_3 = h * (M * M)
	tmp = 0
	if (M * M) <= 4e-221:
		tmp = 0.25 * (t_3 / t_0)
	elif (M * M) <= 5e-165:
		tmp = t_2
	elif (M * M) <= 1e-48:
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d))
	elif (M * M) <= 500.0:
		tmp = t_2
	elif (M * M) <= 2e+144:
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)))
	else:
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(d / D) * Float64(d / D))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * t_0)))
	t_3 = Float64(h * Float64(M * M))
	tmp = 0.0
	if (Float64(M * M) <= 4e-221)
		tmp = Float64(0.25 * Float64(t_3 / t_0));
	elseif (Float64(M * M) <= 5e-165)
		tmp = t_2;
	elseif (Float64(M * M) <= 1e-48)
		tmp = Float64(0.25 * Float64(t_3 * Float64(Float64(D * Float64(D / d)) / d)));
	elseif (Float64(M * M) <= 500.0)
		tmp = t_2;
	elseif (Float64(M * M) <= 2e+144)
		tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d))));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(Float64(c0 / h) / w))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (d / D) * (d / D);
	t_1 = c0 / (2.0 * w);
	t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
	t_3 = h * (M * M);
	tmp = 0.0;
	if ((M * M) <= 4e-221)
		tmp = 0.25 * (t_3 / t_0);
	elseif ((M * M) <= 5e-165)
		tmp = t_2;
	elseif ((M * M) <= 1e-48)
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
	elseif ((M * M) <= 500.0)
		tmp = t_2;
	elseif ((M * M) <= 2e+144)
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	else
		tmp = t_1 * (2.0 * (t_0 * ((c0 / h) / w)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 4e-221], N[(0.25 * N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 5e-165], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 1e-48], N[(0.25 * N[(t$95$3 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 500.0], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 2e+144], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;M \cdot M \leq 500:\\
\;\;\;\;t_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 M M) < 4.00000000000000007e-221

    1. Initial program 27.7%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}, 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      3. metadata-eval7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow27.5%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified7.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 42.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow242.6%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow242.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative42.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow242.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000007e-221 < (*.f64 M M) < 4.99999999999999981e-165 or 9.9999999999999997e-49 < (*.f64 M M) < 500

    1. Initial program 44.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. Simplified51.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999981e-165 < (*.f64 M M) < 9.9999999999999997e-49

    1. Initial program 20.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. Simplified20.7%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in0.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow20.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative0.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified0.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 48.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow248.3%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow248.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative48.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow248.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 500 < (*.f64 M M) < 2.00000000000000005e144

    1. Initial program 14.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. Simplified17.5%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in8.9%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative8.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified8.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 47.5%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow250.0%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow250.0%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative50.0%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow250.0%

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000005e144 < (*.f64 M M)

    1. Initial program 14.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. Simplified15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\ \;\;\;\;\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}\;M \cdot M \leq 10^{-48}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\ \mathbf{elif}\;M \cdot M \leq 500:\\ \;\;\;\;\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}\;M \cdot M \leq 2 \cdot 10^{+144}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \end{array} \]

Alternative 5: 46.3% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{d}{D} \cdot \frac{d}{D}\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := t_1 \cdot \left(2 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0\right)\right)\\ t_3 := h \cdot \left(M \cdot M\right)\\ \mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\ \;\;\;\;0.25 \cdot \frac{t_3}{t_0}\\ \mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;M \cdot M \leq 10^{-48}:\\ \;\;\;\;0.25 \cdot \left(t_3 \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\ \mathbf{elif}\;M \cdot M \leq 500:\\ \;\;\;\;t_2\\ \mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{+144}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d}{D}}{\left(w \cdot h\right) \cdot \frac{D}{d}}\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ d D) (/ d D)))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (* t_1 (* 2.0 (* (/ c0 (* w h)) t_0))))
        (t_3 (* h (* M M))))
   (if (<= (* M M) 4e-221)
     (* 0.25 (/ t_3 t_0))
     (if (<= (* M M) 5e-165)
       t_2
       (if (<= (* M M) 1e-48)
         (* 0.25 (* t_3 (/ (* D (/ D d)) d)))
         (if (<= (* M M) 500.0)
           t_2
           (if (<= (* M M) 2e+144)
             (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))
             (* t_1 (* 2.0 (/ (* c0 (/ d D)) (* (* w h) (/ D d))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (d / D) * (d / D);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
	double t_3 = h * (M * M);
	double tmp;
	if ((M * M) <= 4e-221) {
		tmp = 0.25 * (t_3 / t_0);
	} else if ((M * M) <= 5e-165) {
		tmp = t_2;
	} else if ((M * M) <= 1e-48) {
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
	} else if ((M * M) <= 500.0) {
		tmp = t_2;
	} else if ((M * M) <= 2e+144) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (d_1 / d) * (d_1 / d)
    t_1 = c0 / (2.0d0 * w)
    t_2 = t_1 * (2.0d0 * ((c0 / (w * h)) * t_0))
    t_3 = h * (m * m)
    if ((m * m) <= 4d-221) then
        tmp = 0.25d0 * (t_3 / t_0)
    else if ((m * m) <= 5d-165) then
        tmp = t_2
    else if ((m * m) <= 1d-48) then
        tmp = 0.25d0 * (t_3 * ((d * (d / d_1)) / d_1))
    else if ((m * m) <= 500.0d0) then
        tmp = t_2
    else if ((m * m) <= 2d+144) then
        tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
    else
        tmp = t_1 * (2.0d0 * ((c0 * (d_1 / d)) / ((w * h) * (d / 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 t_0 = (d / D) * (d / D);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
	double t_3 = h * (M * M);
	double tmp;
	if ((M * M) <= 4e-221) {
		tmp = 0.25 * (t_3 / t_0);
	} else if ((M * M) <= 5e-165) {
		tmp = t_2;
	} else if ((M * M) <= 1e-48) {
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
	} else if ((M * M) <= 500.0) {
		tmp = t_2;
	} else if ((M * M) <= 2e+144) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (d / D) * (d / D)
	t_1 = c0 / (2.0 * w)
	t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0))
	t_3 = h * (M * M)
	tmp = 0
	if (M * M) <= 4e-221:
		tmp = 0.25 * (t_3 / t_0)
	elif (M * M) <= 5e-165:
		tmp = t_2
	elif (M * M) <= 1e-48:
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d))
	elif (M * M) <= 500.0:
		tmp = t_2
	elif (M * M) <= 2e+144:
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)))
	else:
		tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d))))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(d / D) * Float64(d / D))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / Float64(w * h)) * t_0)))
	t_3 = Float64(h * Float64(M * M))
	tmp = 0.0
	if (Float64(M * M) <= 4e-221)
		tmp = Float64(0.25 * Float64(t_3 / t_0));
	elseif (Float64(M * M) <= 5e-165)
		tmp = t_2;
	elseif (Float64(M * M) <= 1e-48)
		tmp = Float64(0.25 * Float64(t_3 * Float64(Float64(D * Float64(D / d)) / d)));
	elseif (Float64(M * M) <= 500.0)
		tmp = t_2;
	elseif (Float64(M * M) <= 2e+144)
		tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d))));
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 * Float64(d / D)) / Float64(Float64(w * h) * Float64(D / d)))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (d / D) * (d / D);
	t_1 = c0 / (2.0 * w);
	t_2 = t_1 * (2.0 * ((c0 / (w * h)) * t_0));
	t_3 = h * (M * M);
	tmp = 0.0;
	if ((M * M) <= 4e-221)
		tmp = 0.25 * (t_3 / t_0);
	elseif ((M * M) <= 5e-165)
		tmp = t_2;
	elseif ((M * M) <= 1e-48)
		tmp = 0.25 * (t_3 * ((D * (D / d)) / d));
	elseif ((M * M) <= 500.0)
		tmp = t_2;
	elseif ((M * M) <= 2e+144)
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	else
		tmp = t_1 * (2.0 * ((c0 * (d / D)) / ((w * h) * (D / d))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(2.0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 4e-221], N[(0.25 * N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 5e-165], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 1e-48], N[(0.25 * N[(t$95$3 * N[(N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 500.0], t$95$2, If[LessEqual[N[(M * M), $MachinePrecision], 2e+144], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[(c0 * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;M \cdot M \leq 500:\\
\;\;\;\;t_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 M M) < 4.00000000000000007e-221

    1. Initial program 27.7%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}, 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      3. metadata-eval7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow27.5%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative7.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow27.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified7.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 42.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow242.6%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow242.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative42.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow242.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000007e-221 < (*.f64 M M) < 4.99999999999999981e-165 or 9.9999999999999997e-49 < (*.f64 M M) < 500

    1. Initial program 44.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. Simplified51.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999981e-165 < (*.f64 M M) < 9.9999999999999997e-49

    1. Initial program 20.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. Simplified20.7%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in0.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow20.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative0.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow20.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified0.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 48.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow248.3%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow248.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative48.3%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow248.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 500 < (*.f64 M M) < 2.00000000000000005e144

    1. Initial program 14.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. Simplified17.5%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in8.9%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative8.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow28.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified8.8%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 47.5%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow250.0%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow250.0%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative50.0%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow250.0%

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000005e144 < (*.f64 M M)

    1. Initial program 14.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. Simplified15.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{h \cdot w} \cdot \left(\frac{d}{D} \cdot \color{blue}{\frac{1}{\frac{D}{d}}}\right)\right)\right) \]
      4. div-inv58.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot M \leq 4 \cdot 10^{-221}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{-165}:\\ \;\;\;\;\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}\;M \cdot M \leq 10^{-48}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{D \cdot \frac{D}{d}}{d}\right)\\ \mathbf{elif}\;M \cdot M \leq 500:\\ \;\;\;\;\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}\;M \cdot M \leq 2 \cdot 10^{+144}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{c0 \cdot \frac{d}{D}}{\left(w \cdot h\right) \cdot \frac{D}{d}}\right)\\ \end{array} \]

Alternative 6: 43.4% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \cdot M \leq 10^{+190}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* M M) 1e+190)
   (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D))))
   (* (/ (* c0 c0) (* D D)) (/ (* d d) (* h (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((M * M) <= 1e+190) {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	} else {
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (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 ((m * m) <= 1d+190) then
        tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
    else
        tmp = ((c0 * c0) / (d * d)) * ((d_1 * d_1) / (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 ((M * M) <= 1e+190) {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	} else {
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (M * M) <= 1e+190:
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)))
	else:
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(M * M) <= 1e+190)
		tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D))));
	else
		tmp = Float64(Float64(Float64(c0 * c0) / Float64(D * D)) * Float64(Float64(d * d) / Float64(h * Float64(w * w))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((M * M) <= 1e+190)
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	else
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1e+190], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(c0 * c0), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 M M) < 1.0000000000000001e190

    1. Initial program 25.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. Simplified28.4%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow25.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow25.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow25.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow25.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified5.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 40.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow241.1%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow241.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative41.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow241.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e190 < (*.f64 M M)

    1. Initial program 15.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. Simplified15.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
    10. Simplified46.1%

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

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

Alternative 7: 43.4% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \cdot M \leq 10^{+190}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* M M) 1e+190)
   (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D))))
   (/ (* (* d d) (* c0 c0)) (* (* D D) (* h (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((M * M) <= 1e+190) {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	} else {
		tmp = ((d * d) * (c0 * c0)) / ((D * D) * (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 ((m * m) <= 1d+190) then
        tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
    else
        tmp = ((d_1 * d_1) * (c0 * c0)) / ((d * d) * (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 ((M * M) <= 1e+190) {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	} else {
		tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (M * M) <= 1e+190:
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)))
	else:
		tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(M * M) <= 1e+190)
		tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D))));
	else
		tmp = Float64(Float64(Float64(d * d) * Float64(c0 * c0)) / Float64(Float64(D * D) * Float64(h * Float64(w * w))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((M * M) <= 1e+190)
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	else
		tmp = ((d * d) * (c0 * c0)) / ((D * D) * (h * (w * w)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1e+190], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d * d), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 M M) < 1.0000000000000001e190

    1. Initial program 25.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. Simplified28.4%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow25.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow25.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow25.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow25.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified5.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 40.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow241.1%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow241.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative41.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow241.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e190 < (*.f64 M M)

    1. Initial program 15.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. Simplified15.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 45.4% accurate, 7.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;D \cdot D \leq 2 \cdot 10^{+127}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* D D) 2e+127)
   (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))
   (* 0.25 (* (* h (* M M)) (* (/ D d) (/ D d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((D * D) <= 2e+127) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (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 * d) <= 2d+127) then
        tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
    else
        tmp = 0.25d0 * ((h * (m * m)) * ((d / d_1) * (d / 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+127) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (D * D) <= 2e+127:
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)))
	else:
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(D * D) <= 2e+127)
		tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d))));
	else
		tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) * Float64(Float64(D / d) * Float64(D / d))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((D * D) <= 2e+127)
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	else
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 2e+127], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 23.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. Simplified26.1%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in4.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}, 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      3. metadata-eval4.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow24.5%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative4.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 36.2%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow237.1%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow237.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative37.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow237.1%

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

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

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

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

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

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

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

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

        \[\leadsto 0.25 \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(h \cdot M\right) \cdot M}{\color{blue}{d \cdot d}}\right) \]
      5. times-frac48.8%

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

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

    if 1.99999999999999991e127 < (*.f64 D D)

    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. Simplified21.2%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in8.6%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow28.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow28.6%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow28.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow28.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative8.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow28.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified8.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 31.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow227.6%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow227.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative27.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow227.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 45.3% accurate, 7.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;D \cdot D \leq 2 \cdot 10^{+127}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* D D) 2e+127)
   (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))
   (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((D * D) <= 2e+127) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (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 * d) <= 2d+127) then
        tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / d_1)))
    else
        tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
    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+127) {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	} else {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (D * D) <= 2e+127:
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)))
	else:
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(D * D) <= 2e+127)
		tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d))));
	else
		tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((D * D) <= 2e+127)
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	else
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 2e+127], N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 23.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. Simplified26.1%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in4.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}, 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      3. metadata-eval4.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow24.5%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative4.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow24.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 36.2%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow237.1%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow237.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative37.1%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow237.1%

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

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

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

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

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

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

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

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

        \[\leadsto 0.25 \cdot \left(\left(D \cdot D\right) \cdot \frac{\left(h \cdot M\right) \cdot M}{\color{blue}{d \cdot d}}\right) \]
      5. times-frac48.8%

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

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

    if 1.99999999999999991e127 < (*.f64 D D)

    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. Simplified21.2%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right)} \]
      2. distribute-lft1-in8.6%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      4. unpow28.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow28.6%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow28.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow28.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \color{blue}{\left(d \cdot d\right)}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      9. *-commutative8.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow28.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified8.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 31.6%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow227.6%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow227.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative27.6%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow227.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.5% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq 7.8 \cdot 10^{-118}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= M 7.8e-118) 0.0 (* 0.25 (* (* D D) (* (/ (* h M) d) (/ M d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= 7.8e-118) {
		tmp = 0.0;
	} else {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / 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 (m <= 7.8d-118) then
        tmp = 0.0d0
    else
        tmp = 0.25d0 * ((d * d) * (((h * m) / d_1) * (m / 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 (M <= 7.8e-118) {
		tmp = 0.0;
	} else {
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if M <= 7.8e-118:
		tmp = 0.0
	else:
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (M <= 7.8e-118)
		tmp = 0.0;
	else
		tmp = Float64(0.25 * Float64(Float64(D * D) * Float64(Float64(Float64(h * M) / d) * Float64(M / d))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if (M <= 7.8e-118)
		tmp = 0.0;
	else
		tmp = 0.25 * ((D * D) * (((h * M) / d) * (M / d)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, 7.8e-118], 0.0, N[(0.25 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq 7.8 \cdot 10^{-118}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < 7.80000000000000002e-118

    1. Initial program 23.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. Simplified25.9%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    6. Taylor expanded in c0 around 0 39.9%

      \[\leadsto \color{blue}{0} \]

    if 7.80000000000000002e-118 < M

    1. Initial program 21.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. Simplified23.6%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{\color{blue}{d \cdot d}}{{D}^{2} \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w\right)\right)}{c0 \cdot {d}^{2}}\right) \]
      5. unpow25.2%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \color{blue}{\frac{{D}^{2}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}}\right) \]
      7. unpow25.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{\color{blue}{D \cdot D}}{\frac{c0 \cdot {d}^{2}}{{M}^{2} \cdot \left(h \cdot w\right)}}\right) \]
      8. unpow25.1%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\left(h \cdot w\right) \cdot {M}^{2}}}}\right) \]
      10. unpow25.1%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \color{blue}{\left(M \cdot M\right)}}}\right) \]
    5. Simplified5.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-1, c0 \cdot \left(0 \cdot \frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(h \cdot w\right)}\right), 0.5 \cdot \frac{D \cdot D}{\frac{c0 \cdot \left(d \cdot d\right)}{\left(h \cdot w\right) \cdot \left(M \cdot M\right)}}\right)} \]
    6. Taylor expanded in c0 around 0 31.1%

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

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]
      2. unpow229.9%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]
      3. unpow229.9%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]
      4. *-commutative29.9%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{h \cdot {M}^{2}}}} \]
      5. unpow229.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 7.8 \cdot 10^{-118}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h \cdot M}{d} \cdot \frac{M}{d}\right)\right)\\ \end{array} \]

Alternative 11: 34.0% 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 23.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. Simplified25.2%

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-c0 \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)} \]
    2. distribute-rgt-in2.9%

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

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
  6. Taylor expanded in c0 around 0 35.8%

    \[\leadsto \color{blue}{0} \]
  7. Final simplification35.8%

    \[\leadsto 0 \]

Reproduce

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