Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.7% → 66.6%
Time: 33.2s
Alternatives: 9
Speedup: 16.8×

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 9 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.7% 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: 66.6% accurate, 0.5× speedup?

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

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


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

    1. Initial program 84.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) \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 43.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := h \cdot \left(M \cdot M\right)\\ t_1 := \left(w \cdot h\right) \cdot \left(D \cdot D\right)\\ t_2 := \frac{c0}{2 \cdot w}\\ t_3 := t_2 \cdot \left(\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2} + \left(d \cdot \frac{d}{D \cdot D}\right) \cdot \frac{c0}{w \cdot h}\right)\\ t_4 := t_2 \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{t_1}\right)\right)\\ t_5 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot t_0}}\\ \mathbf{if}\;c0 \leq -6.2 \cdot 10^{+265}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;c0 \leq -1.4 \cdot 10^{+231}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;c0 \leq -0.0018:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq -5.5 \cdot 10^{-116}:\\ \;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot t_0}}}{2}\\ \mathbf{elif}\;c0 \leq -5.8 \cdot 10^{-199}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;c0 \leq 9.8 \cdot 10^{-119}:\\ \;\;\;\;t_2 \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 7.5 \cdot 10^{-97}:\\ \;\;\;\;t_2 \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot D}{d \cdot d} \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{w}{c0}\right)\right), \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{t_1}\right)\\ \mathbf{elif}\;c0 \leq 1.6 \cdot 10^{+216}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* h (* M M)))
        (t_1 (* (* w h) (* D D)))
        (t_2 (/ c0 (* 2.0 w)))
        (t_3
         (*
          t_2
          (+
           (* (/ (/ c0 h) w) (pow (/ d D) 2.0))
           (* (* d (/ d (* D D))) (/ c0 (* w h))))))
        (t_4 (* t_2 (* 2.0 (* d (/ (* c0 d) t_1)))))
        (t_5 (* (/ 0.25 d) (/ D (/ d (* D t_0))))))
   (if (<= c0 -6.2e+265)
     t_4
     (if (<= c0 -1.4e+231)
       t_5
       (if (<= c0 -0.0018)
         t_3
         (if (<= c0 -5.5e-116)
           (* (/ c0 w) (/ (* 0.5 (/ (pow (/ D d) 2.0) (/ c0 (* w t_0)))) 2.0))
           (if (<= c0 -5.8e-199)
             t_4
             (if (<= c0 9.8e-119)
               (* t_2 (* c0 0.0))
               (if (<= c0 7.5e-97)
                 (*
                  t_2
                  (fma
                   -0.5
                   (* (/ (* D D) (* d d)) (* h (* (* M M) (/ w c0))))
                   (/ (* 2.0 (* c0 (* d d))) t_1)))
                 (if (<= c0 1.6e+216) t_5 t_3))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = h * (M * M);
	double t_1 = (w * h) * (D * D);
	double t_2 = c0 / (2.0 * w);
	double t_3 = t_2 * ((((c0 / h) / w) * pow((d / D), 2.0)) + ((d * (d / (D * D))) * (c0 / (w * h))));
	double t_4 = t_2 * (2.0 * (d * ((c0 * d) / t_1)));
	double t_5 = (0.25 / d) * (D / (d / (D * t_0)));
	double tmp;
	if (c0 <= -6.2e+265) {
		tmp = t_4;
	} else if (c0 <= -1.4e+231) {
		tmp = t_5;
	} else if (c0 <= -0.0018) {
		tmp = t_3;
	} else if (c0 <= -5.5e-116) {
		tmp = (c0 / w) * ((0.5 * (pow((D / d), 2.0) / (c0 / (w * t_0)))) / 2.0);
	} else if (c0 <= -5.8e-199) {
		tmp = t_4;
	} else if (c0 <= 9.8e-119) {
		tmp = t_2 * (c0 * 0.0);
	} else if (c0 <= 7.5e-97) {
		tmp = t_2 * fma(-0.5, (((D * D) / (d * d)) * (h * ((M * M) * (w / c0)))), ((2.0 * (c0 * (d * d))) / t_1));
	} else if (c0 <= 1.6e+216) {
		tmp = t_5;
	} else {
		tmp = t_3;
	}
	return tmp;
}
function code(c0, w, h, D, d, M)
	t_0 = Float64(h * Float64(M * M))
	t_1 = Float64(Float64(w * h) * Float64(D * D))
	t_2 = Float64(c0 / Float64(2.0 * w))
	t_3 = Float64(t_2 * Float64(Float64(Float64(Float64(c0 / h) / w) * (Float64(d / D) ^ 2.0)) + Float64(Float64(d * Float64(d / Float64(D * D))) * Float64(c0 / Float64(w * h)))))
	t_4 = Float64(t_2 * Float64(2.0 * Float64(d * Float64(Float64(c0 * d) / t_1))))
	t_5 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * t_0))))
	tmp = 0.0
	if (c0 <= -6.2e+265)
		tmp = t_4;
	elseif (c0 <= -1.4e+231)
		tmp = t_5;
	elseif (c0 <= -0.0018)
		tmp = t_3;
	elseif (c0 <= -5.5e-116)
		tmp = Float64(Float64(c0 / w) * Float64(Float64(0.5 * Float64((Float64(D / d) ^ 2.0) / Float64(c0 / Float64(w * t_0)))) / 2.0));
	elseif (c0 <= -5.8e-199)
		tmp = t_4;
	elseif (c0 <= 9.8e-119)
		tmp = Float64(t_2 * Float64(c0 * 0.0));
	elseif (c0 <= 7.5e-97)
		tmp = Float64(t_2 * fma(-0.5, Float64(Float64(Float64(D * D) / Float64(d * d)) * Float64(h * Float64(Float64(M * M) * Float64(w / c0)))), Float64(Float64(2.0 * Float64(c0 * Float64(d * d))) / t_1)));
	elseif (c0 <= 1.6e+216)
		tmp = t_5;
	else
		tmp = t_3;
	end
	return tmp
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[(N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(d * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(2.0 * N[(d * N[(N[(c0 * d), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -6.2e+265], t$95$4, If[LessEqual[c0, -1.4e+231], t$95$5, If[LessEqual[c0, -0.0018], t$95$3, If[LessEqual[c0, -5.5e-116], N[(N[(c0 / w), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] / N[(c0 / N[(w * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -5.8e-199], t$95$4, If[LessEqual[c0, 9.8e-119], N[(t$95$2 * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 7.5e-97], N[(t$95$2 * N[(-0.5 * N[(N[(N[(D * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M * M), $MachinePrecision] * N[(w / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 1.6e+216], t$95$5, t$95$3]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c0 \leq -1.4 \cdot 10^{+231}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;c0 \leq -0.0018:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c0 \leq -5.5 \cdot 10^{-116}:\\
\;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot t_0}}}{2}\\

\mathbf{elif}\;c0 \leq -5.8 \cdot 10^{-199}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c0 \leq 9.8 \cdot 10^{-119}:\\
\;\;\;\;t_2 \cdot \left(c0 \cdot 0\right)\\

\mathbf{elif}\;c0 \leq 7.5 \cdot 10^{-97}:\\
\;\;\;\;t_2 \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot D}{d \cdot d} \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{w}{c0}\right)\right), \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{t_1}\right)\\

\mathbf{elif}\;c0 \leq 1.6 \cdot 10^{+216}:\\
\;\;\;\;t_5\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if c0 < -6.20000000000000016e265 or -5.4999999999999998e-116 < c0 < -5.8e-199

    1. Initial program 44.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. Step-by-step derivation
      1. associate-*l*43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.20000000000000016e265 < c0 < -1.4e231 or 7.5e-97 < c0 < 1.59999999999999985e216

    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. Taylor expanded in c0 around -inf 6.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e231 < c0 < -0.0018 or 1.59999999999999985e216 < c0

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0018 < c0 < -5.4999999999999998e-116

    1. Initial program 28.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. Taylor expanded in c0 around -inf 8.0%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot 0\right)} \]
    5. Step-by-step derivation
      1. associate-*r/56.8%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0}, c0 \cdot 0\right) \]
    6. Applied egg-rr60.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0}}, c0 \cdot 0\right) \]
    7. Step-by-step derivation
      1. associate-*l/60.9%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{w} \cdot \frac{\color{blue}{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2} \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0} + 0}}{2} \]
      3. +-rgt-identity60.9%

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

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

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

    if -5.8e-199 < c0 < 9.8e-119

    1. Initial program 19.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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. difference-of-squares19.3%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
      2. distribute-rgt1-in2.3%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval57.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft4.4%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval4.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified57.4%

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

    if 9.8e-119 < c0 < 7.5e-97

    1. Initial program 81.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}\right)} \]
    4. Applied egg-rr5.1%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \frac{0 + \color{blue}{M \cdot M}}{\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2} - \sqrt{{\left(\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2}\right)}^{2} - M \cdot M}} \]
      5. associate-/l/6.0%

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(-0.5, \frac{D \cdot D}{d \cdot d} \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{w}{c0}\right)\right), \frac{2 \cdot \left(\left(d \cdot d\right) \cdot c0\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification63.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -6.2 \cdot 10^{+265}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -1.4 \cdot 10^{+231}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;c0 \leq -0.0018:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2} + \left(d \cdot \frac{d}{D \cdot D}\right) \cdot \frac{c0}{w \cdot h}\right)\\ \mathbf{elif}\;c0 \leq -5.5 \cdot 10^{-116}:\\ \;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{2}\\ \mathbf{elif}\;c0 \leq -5.8 \cdot 10^{-199}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq 9.8 \cdot 10^{-119}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 7.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot D}{d \cdot d} \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{w}{c0}\right)\right), \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\\ \mathbf{elif}\;c0 \leq 1.6 \cdot 10^{+216}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2} + \left(d \cdot \frac{d}{D \cdot D}\right) \cdot \frac{c0}{w \cdot h}\right)\\ \end{array} \]

Alternative 3: 43.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := h \cdot \left(M \cdot M\right)\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := t_1 \cdot \left(\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2} + \left(d \cdot \frac{d}{D \cdot D}\right) \cdot \frac{c0}{w \cdot h}\right)\\ t_3 := t_1 \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ t_4 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot t_0}}\\ \mathbf{if}\;c0 \leq -6.5 \cdot 10^{+271}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq -2.05 \cdot 10^{+228}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;c0 \leq -0.000135:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c0 \leq -3.1 \cdot 10^{-116}:\\ \;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot t_0}}}{2}\\ \mathbf{elif}\;c0 \leq -4.6 \cdot 10^{-194}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq 1.3 \cdot 10^{-123}:\\ \;\;\;\;t_1 \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 8.5 \cdot 10^{-97} \lor \neg \left(c0 \leq 4.8 \cdot 10^{+216}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* h (* M M)))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2
         (*
          t_1
          (+
           (* (/ (/ c0 h) w) (pow (/ d D) 2.0))
           (* (* d (/ d (* D D))) (/ c0 (* w h))))))
        (t_3 (* t_1 (* 2.0 (* d (/ (* c0 d) (* (* w h) (* D D)))))))
        (t_4 (* (/ 0.25 d) (/ D (/ d (* D t_0))))))
   (if (<= c0 -6.5e+271)
     t_3
     (if (<= c0 -2.05e+228)
       t_4
       (if (<= c0 -0.000135)
         t_2
         (if (<= c0 -3.1e-116)
           (* (/ c0 w) (/ (* 0.5 (/ (pow (/ D d) 2.0) (/ c0 (* w t_0)))) 2.0))
           (if (<= c0 -4.6e-194)
             t_3
             (if (<= c0 1.3e-123)
               (* t_1 (* c0 0.0))
               (if (or (<= c0 8.5e-97) (not (<= c0 4.8e+216))) t_2 t_4)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = h * (M * M);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * ((((c0 / h) / w) * pow((d / D), 2.0)) + ((d * (d / (D * D))) * (c0 / (w * h))));
	double t_3 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))));
	double t_4 = (0.25 / d) * (D / (d / (D * t_0)));
	double tmp;
	if (c0 <= -6.5e+271) {
		tmp = t_3;
	} else if (c0 <= -2.05e+228) {
		tmp = t_4;
	} else if (c0 <= -0.000135) {
		tmp = t_2;
	} else if (c0 <= -3.1e-116) {
		tmp = (c0 / w) * ((0.5 * (pow((D / d), 2.0) / (c0 / (w * t_0)))) / 2.0);
	} else if (c0 <= -4.6e-194) {
		tmp = t_3;
	} else if (c0 <= 1.3e-123) {
		tmp = t_1 * (c0 * 0.0);
	} else if ((c0 <= 8.5e-97) || !(c0 <= 4.8e+216)) {
		tmp = t_2;
	} else {
		tmp = t_4;
	}
	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) :: t_4
    real(8) :: tmp
    t_0 = h * (m * m)
    t_1 = c0 / (2.0d0 * w)
    t_2 = t_1 * ((((c0 / h) / w) * ((d_1 / d) ** 2.0d0)) + ((d_1 * (d_1 / (d * d))) * (c0 / (w * h))))
    t_3 = t_1 * (2.0d0 * (d_1 * ((c0 * d_1) / ((w * h) * (d * d)))))
    t_4 = (0.25d0 / d_1) * (d / (d_1 / (d * t_0)))
    if (c0 <= (-6.5d+271)) then
        tmp = t_3
    else if (c0 <= (-2.05d+228)) then
        tmp = t_4
    else if (c0 <= (-0.000135d0)) then
        tmp = t_2
    else if (c0 <= (-3.1d-116)) then
        tmp = (c0 / w) * ((0.5d0 * (((d / d_1) ** 2.0d0) / (c0 / (w * t_0)))) / 2.0d0)
    else if (c0 <= (-4.6d-194)) then
        tmp = t_3
    else if (c0 <= 1.3d-123) then
        tmp = t_1 * (c0 * 0.0d0)
    else if ((c0 <= 8.5d-97) .or. (.not. (c0 <= 4.8d+216))) then
        tmp = t_2
    else
        tmp = t_4
    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 = h * (M * M);
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * ((((c0 / h) / w) * Math.pow((d / D), 2.0)) + ((d * (d / (D * D))) * (c0 / (w * h))));
	double t_3 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))));
	double t_4 = (0.25 / d) * (D / (d / (D * t_0)));
	double tmp;
	if (c0 <= -6.5e+271) {
		tmp = t_3;
	} else if (c0 <= -2.05e+228) {
		tmp = t_4;
	} else if (c0 <= -0.000135) {
		tmp = t_2;
	} else if (c0 <= -3.1e-116) {
		tmp = (c0 / w) * ((0.5 * (Math.pow((D / d), 2.0) / (c0 / (w * t_0)))) / 2.0);
	} else if (c0 <= -4.6e-194) {
		tmp = t_3;
	} else if (c0 <= 1.3e-123) {
		tmp = t_1 * (c0 * 0.0);
	} else if ((c0 <= 8.5e-97) || !(c0 <= 4.8e+216)) {
		tmp = t_2;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = h * (M * M)
	t_1 = c0 / (2.0 * w)
	t_2 = t_1 * ((((c0 / h) / w) * math.pow((d / D), 2.0)) + ((d * (d / (D * D))) * (c0 / (w * h))))
	t_3 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))))
	t_4 = (0.25 / d) * (D / (d / (D * t_0)))
	tmp = 0
	if c0 <= -6.5e+271:
		tmp = t_3
	elif c0 <= -2.05e+228:
		tmp = t_4
	elif c0 <= -0.000135:
		tmp = t_2
	elif c0 <= -3.1e-116:
		tmp = (c0 / w) * ((0.5 * (math.pow((D / d), 2.0) / (c0 / (w * t_0)))) / 2.0)
	elif c0 <= -4.6e-194:
		tmp = t_3
	elif c0 <= 1.3e-123:
		tmp = t_1 * (c0 * 0.0)
	elif (c0 <= 8.5e-97) or not (c0 <= 4.8e+216):
		tmp = t_2
	else:
		tmp = t_4
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(h * Float64(M * M))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(t_1 * Float64(Float64(Float64(Float64(c0 / h) / w) * (Float64(d / D) ^ 2.0)) + Float64(Float64(d * Float64(d / Float64(D * D))) * Float64(c0 / Float64(w * h)))))
	t_3 = Float64(t_1 * Float64(2.0 * Float64(d * Float64(Float64(c0 * d) / Float64(Float64(w * h) * Float64(D * D))))))
	t_4 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * t_0))))
	tmp = 0.0
	if (c0 <= -6.5e+271)
		tmp = t_3;
	elseif (c0 <= -2.05e+228)
		tmp = t_4;
	elseif (c0 <= -0.000135)
		tmp = t_2;
	elseif (c0 <= -3.1e-116)
		tmp = Float64(Float64(c0 / w) * Float64(Float64(0.5 * Float64((Float64(D / d) ^ 2.0) / Float64(c0 / Float64(w * t_0)))) / 2.0));
	elseif (c0 <= -4.6e-194)
		tmp = t_3;
	elseif (c0 <= 1.3e-123)
		tmp = Float64(t_1 * Float64(c0 * 0.0));
	elseif ((c0 <= 8.5e-97) || !(c0 <= 4.8e+216))
		tmp = t_2;
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = h * (M * M);
	t_1 = c0 / (2.0 * w);
	t_2 = t_1 * ((((c0 / h) / w) * ((d / D) ^ 2.0)) + ((d * (d / (D * D))) * (c0 / (w * h))));
	t_3 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))));
	t_4 = (0.25 / d) * (D / (d / (D * t_0)));
	tmp = 0.0;
	if (c0 <= -6.5e+271)
		tmp = t_3;
	elseif (c0 <= -2.05e+228)
		tmp = t_4;
	elseif (c0 <= -0.000135)
		tmp = t_2;
	elseif (c0 <= -3.1e-116)
		tmp = (c0 / w) * ((0.5 * (((D / d) ^ 2.0) / (c0 / (w * t_0)))) / 2.0);
	elseif (c0 <= -4.6e-194)
		tmp = t_3;
	elseif (c0 <= 1.3e-123)
		tmp = t_1 * (c0 * 0.0);
	elseif ((c0 <= 8.5e-97) || ~((c0 <= 4.8e+216)))
		tmp = t_2;
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[(N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(d * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(2.0 * N[(d * N[(N[(c0 * d), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -6.5e+271], t$95$3, If[LessEqual[c0, -2.05e+228], t$95$4, If[LessEqual[c0, -0.000135], t$95$2, If[LessEqual[c0, -3.1e-116], N[(N[(c0 / w), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] / N[(c0 / N[(w * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -4.6e-194], t$95$3, If[LessEqual[c0, 1.3e-123], N[(t$95$1 * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 8.5e-97], N[Not[LessEqual[c0, 4.8e+216]], $MachinePrecision]], t$95$2, t$95$4]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c0 \leq -2.05 \cdot 10^{+228}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c0 \leq -0.000135:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c0 \leq -3.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot t_0}}}{2}\\

\mathbf{elif}\;c0 \leq -4.6 \cdot 10^{-194}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c0 \leq 1.3 \cdot 10^{-123}:\\
\;\;\;\;t_1 \cdot \left(c0 \cdot 0\right)\\

\mathbf{elif}\;c0 \leq 8.5 \cdot 10^{-97} \lor \neg \left(c0 \leq 4.8 \cdot 10^{+216}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_4\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c0 < -6.49999999999999998e271 or -3.10000000000000018e-116 < c0 < -4.60000000000000005e-194

    1. Initial program 44.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. Step-by-step derivation
      1. associate-*l*43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.49999999999999998e271 < c0 < -2.05e228 or 8.5000000000000002e-97 < c0 < 4.7999999999999999e216

    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. Taylor expanded in c0 around -inf 6.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05e228 < c0 < -1.35000000000000002e-4 or 1.29999999999999998e-123 < c0 < 8.5000000000000002e-97 or 4.7999999999999999e216 < c0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000002e-4 < c0 < -3.10000000000000018e-116

    1. Initial program 28.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. Taylor expanded in c0 around -inf 8.0%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot 0\right)} \]
    5. Step-by-step derivation
      1. associate-*r/56.8%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0}, c0 \cdot 0\right) \]
    6. Applied egg-rr60.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0}}, c0 \cdot 0\right) \]
    7. Step-by-step derivation
      1. associate-*l/60.9%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{w} \cdot \frac{\color{blue}{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2} \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0} + 0}}{2} \]
      3. +-rgt-identity60.9%

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

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

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

    if -4.60000000000000005e-194 < c0 < 1.29999999999999998e-123

    1. Initial program 19.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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. difference-of-squares19.3%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
      2. distribute-rgt1-in2.3%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval57.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft4.4%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval4.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified57.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -6.5 \cdot 10^{+271}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -2.05 \cdot 10^{+228}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;c0 \leq -0.000135:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2} + \left(d \cdot \frac{d}{D \cdot D}\right) \cdot \frac{c0}{w \cdot h}\right)\\ \mathbf{elif}\;c0 \leq -3.1 \cdot 10^{-116}:\\ \;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{2}\\ \mathbf{elif}\;c0 \leq -4.6 \cdot 10^{-194}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq 1.3 \cdot 10^{-123}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 8.5 \cdot 10^{-97} \lor \neg \left(c0 \leq 4.8 \cdot 10^{+216}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{c0}{h}}{w} \cdot {\left(\frac{d}{D}\right)}^{2} + \left(d \cdot \frac{d}{D \cdot D}\right) \cdot \frac{c0}{w \cdot h}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \end{array} \]

Alternative 4: 43.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := h \cdot \left(M \cdot M\right)\\ t_1 := \left(w \cdot h\right) \cdot \left(D \cdot D\right)\\ t_2 := \frac{c0}{2 \cdot w}\\ t_3 := t_2 \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{t_1}\right)\right)\\ t_4 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot t_0}}\\ \mathbf{if}\;c0 \leq -4.4 \cdot 10^{+267}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq -1.28 \cdot 10^{+227}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;c0 \leq -0.0025:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq -8.5 \cdot 10^{-115}:\\ \;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot t_0}}}{2}\\ \mathbf{elif}\;c0 \leq -8 \cdot 10^{-204}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq 1.15 \cdot 10^{-120}:\\ \;\;\;\;t_2 \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 3.1 \cdot 10^{-95}:\\ \;\;\;\;t_2 \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{t_1}\\ \mathbf{elif}\;c0 \leq 7.4 \cdot 10^{+221}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* h (* M M)))
        (t_1 (* (* w h) (* D D)))
        (t_2 (/ c0 (* 2.0 w)))
        (t_3 (* t_2 (* 2.0 (* d (/ (* c0 d) t_1)))))
        (t_4 (* (/ 0.25 d) (/ D (/ d (* D t_0))))))
   (if (<= c0 -4.4e+267)
     t_3
     (if (<= c0 -1.28e+227)
       t_4
       (if (<= c0 -0.0025)
         t_3
         (if (<= c0 -8.5e-115)
           (* (/ c0 w) (/ (* 0.5 (/ (pow (/ D d) 2.0) (/ c0 (* w t_0)))) 2.0))
           (if (<= c0 -8e-204)
             t_3
             (if (<= c0 1.15e-120)
               (* t_2 (* c0 0.0))
               (if (<= c0 3.1e-95)
                 (* t_2 (/ (* 2.0 (* c0 (* d d))) t_1))
                 (if (<= c0 7.4e+221) t_4 t_3))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = h * (M * M);
	double t_1 = (w * h) * (D * D);
	double t_2 = c0 / (2.0 * w);
	double t_3 = t_2 * (2.0 * (d * ((c0 * d) / t_1)));
	double t_4 = (0.25 / d) * (D / (d / (D * t_0)));
	double tmp;
	if (c0 <= -4.4e+267) {
		tmp = t_3;
	} else if (c0 <= -1.28e+227) {
		tmp = t_4;
	} else if (c0 <= -0.0025) {
		tmp = t_3;
	} else if (c0 <= -8.5e-115) {
		tmp = (c0 / w) * ((0.5 * (pow((D / d), 2.0) / (c0 / (w * t_0)))) / 2.0);
	} else if (c0 <= -8e-204) {
		tmp = t_3;
	} else if (c0 <= 1.15e-120) {
		tmp = t_2 * (c0 * 0.0);
	} else if (c0 <= 3.1e-95) {
		tmp = t_2 * ((2.0 * (c0 * (d * d))) / t_1);
	} else if (c0 <= 7.4e+221) {
		tmp = t_4;
	} else {
		tmp = t_3;
	}
	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) :: t_4
    real(8) :: tmp
    t_0 = h * (m * m)
    t_1 = (w * h) * (d * d)
    t_2 = c0 / (2.0d0 * w)
    t_3 = t_2 * (2.0d0 * (d_1 * ((c0 * d_1) / t_1)))
    t_4 = (0.25d0 / d_1) * (d / (d_1 / (d * t_0)))
    if (c0 <= (-4.4d+267)) then
        tmp = t_3
    else if (c0 <= (-1.28d+227)) then
        tmp = t_4
    else if (c0 <= (-0.0025d0)) then
        tmp = t_3
    else if (c0 <= (-8.5d-115)) then
        tmp = (c0 / w) * ((0.5d0 * (((d / d_1) ** 2.0d0) / (c0 / (w * t_0)))) / 2.0d0)
    else if (c0 <= (-8d-204)) then
        tmp = t_3
    else if (c0 <= 1.15d-120) then
        tmp = t_2 * (c0 * 0.0d0)
    else if (c0 <= 3.1d-95) then
        tmp = t_2 * ((2.0d0 * (c0 * (d_1 * d_1))) / t_1)
    else if (c0 <= 7.4d+221) then
        tmp = t_4
    else
        tmp = t_3
    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 = h * (M * M);
	double t_1 = (w * h) * (D * D);
	double t_2 = c0 / (2.0 * w);
	double t_3 = t_2 * (2.0 * (d * ((c0 * d) / t_1)));
	double t_4 = (0.25 / d) * (D / (d / (D * t_0)));
	double tmp;
	if (c0 <= -4.4e+267) {
		tmp = t_3;
	} else if (c0 <= -1.28e+227) {
		tmp = t_4;
	} else if (c0 <= -0.0025) {
		tmp = t_3;
	} else if (c0 <= -8.5e-115) {
		tmp = (c0 / w) * ((0.5 * (Math.pow((D / d), 2.0) / (c0 / (w * t_0)))) / 2.0);
	} else if (c0 <= -8e-204) {
		tmp = t_3;
	} else if (c0 <= 1.15e-120) {
		tmp = t_2 * (c0 * 0.0);
	} else if (c0 <= 3.1e-95) {
		tmp = t_2 * ((2.0 * (c0 * (d * d))) / t_1);
	} else if (c0 <= 7.4e+221) {
		tmp = t_4;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = h * (M * M)
	t_1 = (w * h) * (D * D)
	t_2 = c0 / (2.0 * w)
	t_3 = t_2 * (2.0 * (d * ((c0 * d) / t_1)))
	t_4 = (0.25 / d) * (D / (d / (D * t_0)))
	tmp = 0
	if c0 <= -4.4e+267:
		tmp = t_3
	elif c0 <= -1.28e+227:
		tmp = t_4
	elif c0 <= -0.0025:
		tmp = t_3
	elif c0 <= -8.5e-115:
		tmp = (c0 / w) * ((0.5 * (math.pow((D / d), 2.0) / (c0 / (w * t_0)))) / 2.0)
	elif c0 <= -8e-204:
		tmp = t_3
	elif c0 <= 1.15e-120:
		tmp = t_2 * (c0 * 0.0)
	elif c0 <= 3.1e-95:
		tmp = t_2 * ((2.0 * (c0 * (d * d))) / t_1)
	elif c0 <= 7.4e+221:
		tmp = t_4
	else:
		tmp = t_3
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(h * Float64(M * M))
	t_1 = Float64(Float64(w * h) * Float64(D * D))
	t_2 = Float64(c0 / Float64(2.0 * w))
	t_3 = Float64(t_2 * Float64(2.0 * Float64(d * Float64(Float64(c0 * d) / t_1))))
	t_4 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * t_0))))
	tmp = 0.0
	if (c0 <= -4.4e+267)
		tmp = t_3;
	elseif (c0 <= -1.28e+227)
		tmp = t_4;
	elseif (c0 <= -0.0025)
		tmp = t_3;
	elseif (c0 <= -8.5e-115)
		tmp = Float64(Float64(c0 / w) * Float64(Float64(0.5 * Float64((Float64(D / d) ^ 2.0) / Float64(c0 / Float64(w * t_0)))) / 2.0));
	elseif (c0 <= -8e-204)
		tmp = t_3;
	elseif (c0 <= 1.15e-120)
		tmp = Float64(t_2 * Float64(c0 * 0.0));
	elseif (c0 <= 3.1e-95)
		tmp = Float64(t_2 * Float64(Float64(2.0 * Float64(c0 * Float64(d * d))) / t_1));
	elseif (c0 <= 7.4e+221)
		tmp = t_4;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = h * (M * M);
	t_1 = (w * h) * (D * D);
	t_2 = c0 / (2.0 * w);
	t_3 = t_2 * (2.0 * (d * ((c0 * d) / t_1)));
	t_4 = (0.25 / d) * (D / (d / (D * t_0)));
	tmp = 0.0;
	if (c0 <= -4.4e+267)
		tmp = t_3;
	elseif (c0 <= -1.28e+227)
		tmp = t_4;
	elseif (c0 <= -0.0025)
		tmp = t_3;
	elseif (c0 <= -8.5e-115)
		tmp = (c0 / w) * ((0.5 * (((D / d) ^ 2.0) / (c0 / (w * t_0)))) / 2.0);
	elseif (c0 <= -8e-204)
		tmp = t_3;
	elseif (c0 <= 1.15e-120)
		tmp = t_2 * (c0 * 0.0);
	elseif (c0 <= 3.1e-95)
		tmp = t_2 * ((2.0 * (c0 * (d * d))) / t_1);
	elseif (c0 <= 7.4e+221)
		tmp = t_4;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(2.0 * N[(d * N[(N[(c0 * d), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -4.4e+267], t$95$3, If[LessEqual[c0, -1.28e+227], t$95$4, If[LessEqual[c0, -0.0025], t$95$3, If[LessEqual[c0, -8.5e-115], N[(N[(c0 / w), $MachinePrecision] * N[(N[(0.5 * N[(N[Power[N[(D / d), $MachinePrecision], 2.0], $MachinePrecision] / N[(c0 / N[(w * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, -8e-204], t$95$3, If[LessEqual[c0, 1.15e-120], N[(t$95$2 * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 3.1e-95], N[(t$95$2 * N[(N[(2.0 * N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 7.4e+221], t$95$4, t$95$3]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c0 \leq -1.28 \cdot 10^{+227}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c0 \leq -0.0025:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;c0 \leq -8 \cdot 10^{-204}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c0 \leq 1.15 \cdot 10^{-120}:\\
\;\;\;\;t_2 \cdot \left(c0 \cdot 0\right)\\

\mathbf{elif}\;c0 \leq 3.1 \cdot 10^{-95}:\\
\;\;\;\;t_2 \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{t_1}\\

\mathbf{elif}\;c0 \leq 7.4 \cdot 10^{+221}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c0 < -4.4000000000000002e267 or -1.27999999999999991e227 < c0 < -0.00250000000000000005 or -8.49999999999999953e-115 < c0 < -8.00000000000000001e-204 or 7.40000000000000002e221 < c0

    1. Initial program 43.6%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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. difference-of-squares54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4000000000000002e267 < c0 < -1.27999999999999991e227 or 3.09999999999999992e-95 < c0 < 7.40000000000000002e221

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.00250000000000000005 < c0 < -8.49999999999999953e-115

    1. Initial program 28.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. Taylor expanded in c0 around -inf 8.0%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot 0\right)} \]
    5. Step-by-step derivation
      1. associate-*r/56.8%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0}, c0 \cdot 0\right) \]
    6. Applied egg-rr60.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0}}, c0 \cdot 0\right) \]
    7. Step-by-step derivation
      1. associate-*l/60.9%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{w} \cdot \frac{\color{blue}{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2} \cdot \left(w \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{c0} + 0}}{2} \]
      3. +-rgt-identity60.9%

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

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

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

    if -8.00000000000000001e-204 < c0 < 1.14999999999999993e-120

    1. Initial program 19.3%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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. difference-of-squares19.3%

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
      2. distribute-rgt1-in2.3%

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval57.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft4.4%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval4.4%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified57.4%

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

    if 1.14999999999999993e-120 < c0 < 3.09999999999999992e-95

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -4.4 \cdot 10^{+267}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -1.28 \cdot 10^{+227}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;c0 \leq -0.0025:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -8.5 \cdot 10^{-115}:\\ \;\;\;\;\frac{c0}{w} \cdot \frac{0.5 \cdot \frac{{\left(\frac{D}{d}\right)}^{2}}{\frac{c0}{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}}}{2}\\ \mathbf{elif}\;c0 \leq -8 \cdot 10^{-204}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq 1.15 \cdot 10^{-120}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 3.1 \cdot 10^{-95}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{elif}\;c0 \leq 7.4 \cdot 10^{+221}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \end{array} \]

Alternative 5: 43.5% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := t_1 \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ t_3 := t_1 \cdot \left(c0 \cdot 0\right)\\ \mathbf{if}\;c0 \leq -5.5 \cdot 10^{+265}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c0 \leq -5.5 \cdot 10^{+226}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c0 \leq -8 \cdot 10^{-5}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c0 \leq -8.5 \cdot 10^{-115}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq -2.8 \cdot 10^{-185}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c0 \leq 1.15 \cdot 10^{-120}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c0 \leq 10^{-96} \lor \neg \left(c0 \leq 6.9 \cdot 10^{+217}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (* t_1 (* 2.0 (* d (/ (* c0 d) (* (* w h) (* D D)))))))
        (t_3 (* t_1 (* c0 0.0))))
   (if (<= c0 -5.5e+265)
     t_2
     (if (<= c0 -5.5e+226)
       t_0
       (if (<= c0 -8e-5)
         t_2
         (if (<= c0 -8.5e-115)
           t_3
           (if (<= c0 -2.8e-185)
             t_2
             (if (<= c0 1.15e-120)
               t_3
               (if (or (<= c0 1e-96) (not (<= c0 6.9e+217))) t_2 t_0)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))));
	double t_3 = t_1 * (c0 * 0.0);
	double tmp;
	if (c0 <= -5.5e+265) {
		tmp = t_2;
	} else if (c0 <= -5.5e+226) {
		tmp = t_0;
	} else if (c0 <= -8e-5) {
		tmp = t_2;
	} else if (c0 <= -8.5e-115) {
		tmp = t_3;
	} else if (c0 <= -2.8e-185) {
		tmp = t_2;
	} else if (c0 <= 1.15e-120) {
		tmp = t_3;
	} else if ((c0 <= 1e-96) || !(c0 <= 6.9e+217)) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	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 = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
    t_1 = c0 / (2.0d0 * w)
    t_2 = t_1 * (2.0d0 * (d_1 * ((c0 * d_1) / ((w * h) * (d * d)))))
    t_3 = t_1 * (c0 * 0.0d0)
    if (c0 <= (-5.5d+265)) then
        tmp = t_2
    else if (c0 <= (-5.5d+226)) then
        tmp = t_0
    else if (c0 <= (-8d-5)) then
        tmp = t_2
    else if (c0 <= (-8.5d-115)) then
        tmp = t_3
    else if (c0 <= (-2.8d-185)) then
        tmp = t_2
    else if (c0 <= 1.15d-120) then
        tmp = t_3
    else if ((c0 <= 1d-96) .or. (.not. (c0 <= 6.9d+217))) then
        tmp = t_2
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_1 = c0 / (2.0 * w);
	double t_2 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))));
	double t_3 = t_1 * (c0 * 0.0);
	double tmp;
	if (c0 <= -5.5e+265) {
		tmp = t_2;
	} else if (c0 <= -5.5e+226) {
		tmp = t_0;
	} else if (c0 <= -8e-5) {
		tmp = t_2;
	} else if (c0 <= -8.5e-115) {
		tmp = t_3;
	} else if (c0 <= -2.8e-185) {
		tmp = t_2;
	} else if (c0 <= 1.15e-120) {
		tmp = t_3;
	} else if ((c0 <= 1e-96) || !(c0 <= 6.9e+217)) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))))
	t_1 = c0 / (2.0 * w)
	t_2 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))))
	t_3 = t_1 * (c0 * 0.0)
	tmp = 0
	if c0 <= -5.5e+265:
		tmp = t_2
	elif c0 <= -5.5e+226:
		tmp = t_0
	elif c0 <= -8e-5:
		tmp = t_2
	elif c0 <= -8.5e-115:
		tmp = t_3
	elif c0 <= -2.8e-185:
		tmp = t_2
	elif c0 <= 1.15e-120:
		tmp = t_3
	elif (c0 <= 1e-96) or not (c0 <= 6.9e+217):
		tmp = t_2
	else:
		tmp = t_0
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M))))))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(t_1 * Float64(2.0 * Float64(d * Float64(Float64(c0 * d) / Float64(Float64(w * h) * Float64(D * D))))))
	t_3 = Float64(t_1 * Float64(c0 * 0.0))
	tmp = 0.0
	if (c0 <= -5.5e+265)
		tmp = t_2;
	elseif (c0 <= -5.5e+226)
		tmp = t_0;
	elseif (c0 <= -8e-5)
		tmp = t_2;
	elseif (c0 <= -8.5e-115)
		tmp = t_3;
	elseif (c0 <= -2.8e-185)
		tmp = t_2;
	elseif (c0 <= 1.15e-120)
		tmp = t_3;
	elseif ((c0 <= 1e-96) || !(c0 <= 6.9e+217))
		tmp = t_2;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	t_1 = c0 / (2.0 * w);
	t_2 = t_1 * (2.0 * (d * ((c0 * d) / ((w * h) * (D * D)))));
	t_3 = t_1 * (c0 * 0.0);
	tmp = 0.0;
	if (c0 <= -5.5e+265)
		tmp = t_2;
	elseif (c0 <= -5.5e+226)
		tmp = t_0;
	elseif (c0 <= -8e-5)
		tmp = t_2;
	elseif (c0 <= -8.5e-115)
		tmp = t_3;
	elseif (c0 <= -2.8e-185)
		tmp = t_2;
	elseif (c0 <= 1.15e-120)
		tmp = t_3;
	elseif ((c0 <= 1e-96) || ~((c0 <= 6.9e+217)))
		tmp = t_2;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(d * N[(N[(c0 * d), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -5.5e+265], t$95$2, If[LessEqual[c0, -5.5e+226], t$95$0, If[LessEqual[c0, -8e-5], t$95$2, If[LessEqual[c0, -8.5e-115], t$95$3, If[LessEqual[c0, -2.8e-185], t$95$2, If[LessEqual[c0, 1.15e-120], t$95$3, If[Or[LessEqual[c0, 1e-96], N[Not[LessEqual[c0, 6.9e+217]], $MachinePrecision]], t$95$2, t$95$0]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c0 \leq -5.5 \cdot 10^{+226}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;c0 \leq -8 \cdot 10^{-5}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c0 \leq -8.5 \cdot 10^{-115}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c0 \leq -2.8 \cdot 10^{-185}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c0 \leq 1.15 \cdot 10^{-120}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c0 \leq 10^{-96} \lor \neg \left(c0 \leq 6.9 \cdot 10^{+217}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c0 < -5.4999999999999997e265 or -5.5000000000000005e226 < c0 < -8.00000000000000065e-5 or -8.49999999999999953e-115 < c0 < -2.79999999999999991e-185 or 1.14999999999999993e-120 < c0 < 9.9999999999999991e-97 or 6.89999999999999969e217 < c0

    1. Initial program 45.2%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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. difference-of-squares54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999997e265 < c0 < -5.5000000000000005e226 or 9.9999999999999991e-97 < c0 < 6.89999999999999969e217

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000065e-5 < c0 < -8.49999999999999953e-115 or -2.79999999999999991e-185 < c0 < 1.14999999999999993e-120

    1. Initial program 22.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval57.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft7.0%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval7.0%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified57.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -5.5 \cdot 10^{+265}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -5.5 \cdot 10^{+226}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;c0 \leq -8 \cdot 10^{-5}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -8.5 \cdot 10^{-115}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq -2.8 \cdot 10^{-185}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq 1.15 \cdot 10^{-120}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 10^{-96} \lor \neg \left(c0 \leq 6.9 \cdot 10^{+217}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \end{array} \]

Alternative 6: 43.2% accurate, 4.0× speedup?

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

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

\mathbf{elif}\;c0 \leq -3.2 \cdot 10^{+230}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c0 \leq -0.00185:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c0 \leq -3.15 \cdot 10^{-117}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c0 \leq -4.6 \cdot 10^{-185}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c0 \leq 1.2 \cdot 10^{-122}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c0 \leq 2.1 \cdot 10^{-95}:\\
\;\;\;\;t_2 \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{t_0}\\

\mathbf{elif}\;c0 \leq 9.2 \cdot 10^{+219}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c0 < -5.80000000000000035e266 or -3.2e230 < c0 < -0.0018500000000000001 or -3.1499999999999999e-117 < c0 < -4.6000000000000002e-185 or 9.2000000000000004e219 < c0

    1. Initial program 43.6%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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. difference-of-squares54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.80000000000000035e266 < c0 < -3.2e230 or 2.1e-95 < c0 < 9.2000000000000004e219

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0018500000000000001 < c0 < -3.1499999999999999e-117 or -4.6000000000000002e-185 < c0 < 1.19999999999999994e-122

    1. Initial program 22.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval57.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft7.0%

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval7.0%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified57.5%

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

    if 1.19999999999999994e-122 < c0 < 2.1e-95

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -5.8 \cdot 10^{+266}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -3.2 \cdot 10^{+230}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;c0 \leq -0.00185:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq -3.15 \cdot 10^{-117}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq -4.6 \cdot 10^{-185}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq 1.2 \cdot 10^{-122}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \mathbf{elif}\;c0 \leq 2.1 \cdot 10^{-95}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ \mathbf{elif}\;c0 \leq 9.2 \cdot 10^{+219}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(d \cdot \frac{c0 \cdot d}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right)\\ \end{array} \]

Alternative 7: 33.7% accurate, 7.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 2.9 \cdot 10^{-246}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\

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


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

    1. Initial program 39.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. Step-by-step derivation
      1. associate-*l*38.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\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. difference-of-squares38.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval43.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft12.0%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)} \]
      10. distribute-lft1-in12.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval12.0%

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified43.2%

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

    if 2.9e-246 < (*.f64 M M)

    1. Initial program 25.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 48.0% accurate, 10.1× speedup?

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

\\
\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}
\end{array}
Derivation
  1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 29.1% accurate, 16.8× speedup?

\[\begin{array}{l} \\ \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right) \end{array} \]
(FPCore (c0 w h D d M) :precision binary64 (* (/ c0 (* 2.0 w)) (* c0 0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (c0 * 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 = (c0 / (2.0d0 * w)) * (c0 * 0.0d0)
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (c0 * 0.0);
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (c0 * 0.0)
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(c0 * 0.0))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (c0 / (2.0 * w)) * (c0 * 0.0);
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)
\end{array}
Derivation
  1. Initial program 32.2%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}} - M\right)}\right) \]
  3. Simplified40.0%

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
    2. distribute-rgt1-in3.8%

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
    5. metadata-eval33.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
    6. mul0-lft5.7%

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

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

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
  6. Simplified33.4%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot 0\right)} \]
  7. Final simplification33.4%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right) \]

Reproduce

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