Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.5% → 61.1%
Time: 29.0s
Alternatives: 10
Speedup: 151.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 24.5% 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: 61.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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))))) < -0.20000000000000001 or 0.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 52.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. Simplified24.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 38.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := h \cdot \left(M \cdot M\right)\\ t_2 := 0.25 \cdot \frac{D \cdot t_1}{\frac{d}{\frac{D}{d}}}\\ t_3 := t_0 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + t_0 \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right)\\ t_4 := t_0 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.05 \cdot 10^{-71}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;M \leq 7.5 \cdot 10^{-42}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_1\right)\\ \mathbf{elif}\;M \leq 2.35 \cdot 10^{-6}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;M \leq 5.5 \cdot 10^{+36}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;M \leq 1.35 \cdot 10^{+61}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;M \leq 8.8 \cdot 10^{+145}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w)))
        (t_1 (* h (* M M)))
        (t_2 (* 0.25 (/ (* D t_1) (/ d (/ D d)))))
        (t_3
         (+
          (* t_0 (* (/ c0 (* w h)) (pow (/ d D) 2.0)))
          (* t_0 (* (/ c0 D) (* (/ d D) (/ d (* w h)))))))
        (t_4 (* t_0 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))))
   (if (<= M 2.7e-227)
     0.0
     (if (<= M 1.05e-71)
       t_3
       (if (<= M 7.5e-42)
         (* 0.25 (* (* (/ D d) (/ D d)) t_1))
         (if (<= M 2.35e-6)
           t_4
           (if (<= M 5.5e+36)
             t_2
             (if (<= M 1.35e+61) t_4 (if (<= M 8.8e+145) t_2 t_3)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = h * (M * M);
	double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
	double t_3 = (t_0 * ((c0 / (w * h)) * pow((d / D), 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h)))));
	double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	double tmp;
	if (M <= 2.7e-227) {
		tmp = 0.0;
	} else if (M <= 1.05e-71) {
		tmp = t_3;
	} else if (M <= 7.5e-42) {
		tmp = 0.25 * (((D / d) * (D / d)) * t_1);
	} else if (M <= 2.35e-6) {
		tmp = t_4;
	} else if (M <= 5.5e+36) {
		tmp = t_2;
	} else if (M <= 1.35e+61) {
		tmp = t_4;
	} else if (M <= 8.8e+145) {
		tmp = t_2;
	} 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 = c0 / (2.0d0 * w)
    t_1 = h * (m * m)
    t_2 = 0.25d0 * ((d * t_1) / (d_1 / (d / d_1)))
    t_3 = (t_0 * ((c0 / (w * h)) * ((d_1 / d) ** 2.0d0))) + (t_0 * ((c0 / d) * ((d_1 / d) * (d_1 / (w * h)))))
    t_4 = t_0 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
    if (m <= 2.7d-227) then
        tmp = 0.0d0
    else if (m <= 1.05d-71) then
        tmp = t_3
    else if (m <= 7.5d-42) then
        tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_1)
    else if (m <= 2.35d-6) then
        tmp = t_4
    else if (m <= 5.5d+36) then
        tmp = t_2
    else if (m <= 1.35d+61) then
        tmp = t_4
    else if (m <= 8.8d+145) then
        tmp = t_2
    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 = c0 / (2.0 * w);
	double t_1 = h * (M * M);
	double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
	double t_3 = (t_0 * ((c0 / (w * h)) * Math.pow((d / D), 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h)))));
	double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	double tmp;
	if (M <= 2.7e-227) {
		tmp = 0.0;
	} else if (M <= 1.05e-71) {
		tmp = t_3;
	} else if (M <= 7.5e-42) {
		tmp = 0.25 * (((D / d) * (D / d)) * t_1);
	} else if (M <= 2.35e-6) {
		tmp = t_4;
	} else if (M <= 5.5e+36) {
		tmp = t_2;
	} else if (M <= 1.35e+61) {
		tmp = t_4;
	} else if (M <= 8.8e+145) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = h * (M * M)
	t_2 = 0.25 * ((D * t_1) / (d / (D / d)))
	t_3 = (t_0 * ((c0 / (w * h)) * math.pow((d / D), 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h)))))
	t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))))
	tmp = 0
	if M <= 2.7e-227:
		tmp = 0.0
	elif M <= 1.05e-71:
		tmp = t_3
	elif M <= 7.5e-42:
		tmp = 0.25 * (((D / d) * (D / d)) * t_1)
	elif M <= 2.35e-6:
		tmp = t_4
	elif M <= 5.5e+36:
		tmp = t_2
	elif M <= 1.35e+61:
		tmp = t_4
	elif M <= 8.8e+145:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(h * Float64(M * M))
	t_2 = Float64(0.25 * Float64(Float64(D * t_1) / Float64(d / Float64(D / d))))
	t_3 = Float64(Float64(t_0 * Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0))) + Float64(t_0 * Float64(Float64(c0 / D) * Float64(Float64(d / D) * Float64(d / Float64(w * h))))))
	t_4 = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h)))))
	tmp = 0.0
	if (M <= 2.7e-227)
		tmp = 0.0;
	elseif (M <= 1.05e-71)
		tmp = t_3;
	elseif (M <= 7.5e-42)
		tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_1));
	elseif (M <= 2.35e-6)
		tmp = t_4;
	elseif (M <= 5.5e+36)
		tmp = t_2;
	elseif (M <= 1.35e+61)
		tmp = t_4;
	elseif (M <= 8.8e+145)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = h * (M * M);
	t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
	t_3 = (t_0 * ((c0 / (w * h)) * ((d / D) ^ 2.0))) + (t_0 * ((c0 / D) * ((d / D) * (d / (w * h)))));
	t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	tmp = 0.0;
	if (M <= 2.7e-227)
		tmp = 0.0;
	elseif (M <= 1.05e-71)
		tmp = t_3;
	elseif (M <= 7.5e-42)
		tmp = 0.25 * (((D / d) * (D / d)) * t_1);
	elseif (M <= 2.35e-6)
		tmp = t_4;
	elseif (M <= 5.5e+36)
		tmp = t_2;
	elseif (M <= 1.35e+61)
		tmp = t_4;
	elseif (M <= 8.8e+145)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(N[(D * t$95$1), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(N[(c0 / D), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2.7e-227], 0.0, If[LessEqual[M, 1.05e-71], t$95$3, If[LessEqual[M, 7.5e-42], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.35e-6], t$95$4, If[LessEqual[M, 5.5e+36], t$95$2, If[LessEqual[M, 1.35e+61], t$95$4, If[LessEqual[M, 8.8e+145], t$95$2, t$95$3]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;M \leq 1.05 \cdot 10^{-71}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;M \leq 2.35 \cdot 10^{-6}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;M \leq 5.5 \cdot 10^{+36}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;M \leq 1.35 \cdot 10^{+61}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;M \leq 8.8 \cdot 10^{+145}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if M < 2.7e-227

    1. Initial program 28.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. Simplified28.3%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    6. Taylor expanded in c0 around 0 39.6%

      \[\leadsto \color{blue}{0} \]

    if 2.7e-227 < M < 1.0500000000000001e-71 or 8.80000000000000035e145 < M

    1. Initial program 18.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. Simplified23.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0500000000000001e-71 < M < 7.49999999999999972e-42

    1. Initial program 17.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. Simplified17.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999972e-42 < M < 2.34999999999999995e-6 or 5.5000000000000002e36 < M < 1.3500000000000001e61

    1. Initial program 77.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. Simplified83.4%

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

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

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

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

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

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

    if 2.34999999999999995e-6 < M < 5.5000000000000002e36 or 1.3500000000000001e61 < M < 8.80000000000000035e145

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.05 \cdot 10^{-71}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right)\\ \mathbf{elif}\;M \leq 7.5 \cdot 10^{-42}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\ \mathbf{elif}\;M \leq 2.35 \cdot 10^{-6}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{elif}\;M \leq 5.5 \cdot 10^{+36}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;M \leq 1.35 \cdot 10^{+61}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{elif}\;M \leq 8.8 \cdot 10^{+145}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right)\\ \end{array} \]

Alternative 3: 38.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{d}{w \cdot h}\\ t_2 := h \cdot \left(M \cdot M\right)\\ t_3 := 0.25 \cdot \frac{D \cdot t_2}{\frac{d}{\frac{D}{d}}}\\ t_4 := t_0 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right)\\ t_5 := t_0 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.2 \cdot 10^{-71}:\\ \;\;\;\;t_4 + t_0 \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot t_1\right)\\ \mathbf{elif}\;M \leq 6 \cdot 10^{-42}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_2\right)\\ \mathbf{elif}\;M \leq 2.7 \cdot 10^{-6}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;M \leq 5.5 \cdot 10^{+41}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;M \leq 3.1 \cdot 10^{+63}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;M \leq 1.4 \cdot 10^{+145}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_4 + t_0 \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot t_1\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w)))
        (t_1 (/ d (* w h)))
        (t_2 (* h (* M M)))
        (t_3 (* 0.25 (/ (* D t_2) (/ d (/ D d)))))
        (t_4 (* t_0 (* (/ c0 (* w h)) (pow (/ d D) 2.0))))
        (t_5 (* t_0 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))))
   (if (<= M 2.7e-227)
     0.0
     (if (<= M 1.2e-71)
       (+ t_4 (* t_0 (* (/ (/ d D) (/ D c0)) t_1)))
       (if (<= M 6e-42)
         (* 0.25 (* (* (/ D d) (/ D d)) t_2))
         (if (<= M 2.7e-6)
           t_5
           (if (<= M 5.5e+41)
             t_3
             (if (<= M 3.1e+63)
               t_5
               (if (<= M 1.4e+145)
                 t_3
                 (+ t_4 (* t_0 (* (/ c0 D) (* (/ d D) t_1)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = d / (w * h);
	double t_2 = h * (M * M);
	double t_3 = 0.25 * ((D * t_2) / (d / (D / d)));
	double t_4 = t_0 * ((c0 / (w * h)) * pow((d / D), 2.0));
	double t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	double tmp;
	if (M <= 2.7e-227) {
		tmp = 0.0;
	} else if (M <= 1.2e-71) {
		tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1));
	} else if (M <= 6e-42) {
		tmp = 0.25 * (((D / d) * (D / d)) * t_2);
	} else if (M <= 2.7e-6) {
		tmp = t_5;
	} else if (M <= 5.5e+41) {
		tmp = t_3;
	} else if (M <= 3.1e+63) {
		tmp = t_5;
	} else if (M <= 1.4e+145) {
		tmp = t_3;
	} else {
		tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = d_1 / (w * h)
    t_2 = h * (m * m)
    t_3 = 0.25d0 * ((d * t_2) / (d_1 / (d / d_1)))
    t_4 = t_0 * ((c0 / (w * h)) * ((d_1 / d) ** 2.0d0))
    t_5 = t_0 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
    if (m <= 2.7d-227) then
        tmp = 0.0d0
    else if (m <= 1.2d-71) then
        tmp = t_4 + (t_0 * (((d_1 / d) / (d / c0)) * t_1))
    else if (m <= 6d-42) then
        tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_2)
    else if (m <= 2.7d-6) then
        tmp = t_5
    else if (m <= 5.5d+41) then
        tmp = t_3
    else if (m <= 3.1d+63) then
        tmp = t_5
    else if (m <= 1.4d+145) then
        tmp = t_3
    else
        tmp = t_4 + (t_0 * ((c0 / d) * ((d_1 / d) * t_1)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = d / (w * h);
	double t_2 = h * (M * M);
	double t_3 = 0.25 * ((D * t_2) / (d / (D / d)));
	double t_4 = t_0 * ((c0 / (w * h)) * Math.pow((d / D), 2.0));
	double t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	double tmp;
	if (M <= 2.7e-227) {
		tmp = 0.0;
	} else if (M <= 1.2e-71) {
		tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1));
	} else if (M <= 6e-42) {
		tmp = 0.25 * (((D / d) * (D / d)) * t_2);
	} else if (M <= 2.7e-6) {
		tmp = t_5;
	} else if (M <= 5.5e+41) {
		tmp = t_3;
	} else if (M <= 3.1e+63) {
		tmp = t_5;
	} else if (M <= 1.4e+145) {
		tmp = t_3;
	} else {
		tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = d / (w * h)
	t_2 = h * (M * M)
	t_3 = 0.25 * ((D * t_2) / (d / (D / d)))
	t_4 = t_0 * ((c0 / (w * h)) * math.pow((d / D), 2.0))
	t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))))
	tmp = 0
	if M <= 2.7e-227:
		tmp = 0.0
	elif M <= 1.2e-71:
		tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1))
	elif M <= 6e-42:
		tmp = 0.25 * (((D / d) * (D / d)) * t_2)
	elif M <= 2.7e-6:
		tmp = t_5
	elif M <= 5.5e+41:
		tmp = t_3
	elif M <= 3.1e+63:
		tmp = t_5
	elif M <= 1.4e+145:
		tmp = t_3
	else:
		tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1)))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(d / Float64(w * h))
	t_2 = Float64(h * Float64(M * M))
	t_3 = Float64(0.25 * Float64(Float64(D * t_2) / Float64(d / Float64(D / d))))
	t_4 = Float64(t_0 * Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0)))
	t_5 = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h)))))
	tmp = 0.0
	if (M <= 2.7e-227)
		tmp = 0.0;
	elseif (M <= 1.2e-71)
		tmp = Float64(t_4 + Float64(t_0 * Float64(Float64(Float64(d / D) / Float64(D / c0)) * t_1)));
	elseif (M <= 6e-42)
		tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_2));
	elseif (M <= 2.7e-6)
		tmp = t_5;
	elseif (M <= 5.5e+41)
		tmp = t_3;
	elseif (M <= 3.1e+63)
		tmp = t_5;
	elseif (M <= 1.4e+145)
		tmp = t_3;
	else
		tmp = Float64(t_4 + Float64(t_0 * Float64(Float64(c0 / D) * Float64(Float64(d / D) * t_1))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = d / (w * h);
	t_2 = h * (M * M);
	t_3 = 0.25 * ((D * t_2) / (d / (D / d)));
	t_4 = t_0 * ((c0 / (w * h)) * ((d / D) ^ 2.0));
	t_5 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	tmp = 0.0;
	if (M <= 2.7e-227)
		tmp = 0.0;
	elseif (M <= 1.2e-71)
		tmp = t_4 + (t_0 * (((d / D) / (D / c0)) * t_1));
	elseif (M <= 6e-42)
		tmp = 0.25 * (((D / d) * (D / d)) * t_2);
	elseif (M <= 2.7e-6)
		tmp = t_5;
	elseif (M <= 5.5e+41)
		tmp = t_3;
	elseif (M <= 3.1e+63)
		tmp = t_5;
	elseif (M <= 1.4e+145)
		tmp = t_3;
	else
		tmp = t_4 + (t_0 * ((c0 / D) * ((d / D) * t_1)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.25 * N[(N[(D * t$95$2), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2.7e-227], 0.0, If[LessEqual[M, 1.2e-71], N[(t$95$4 + N[(t$95$0 * N[(N[(N[(d / D), $MachinePrecision] / N[(D / c0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 6e-42], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.7e-6], t$95$5, If[LessEqual[M, 5.5e+41], t$95$3, If[LessEqual[M, 3.1e+63], t$95$5, If[LessEqual[M, 1.4e+145], t$95$3, N[(t$95$4 + N[(t$95$0 * N[(N[(c0 / D), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;M \leq 1.2 \cdot 10^{-71}:\\
\;\;\;\;t_4 + t_0 \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot t_1\right)\\

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

\mathbf{elif}\;M \leq 2.7 \cdot 10^{-6}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;M \leq 5.5 \cdot 10^{+41}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;M \leq 3.1 \cdot 10^{+63}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;M \leq 1.4 \cdot 10^{+145}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_4 + t_0 \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot t_1\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if M < 2.7e-227

    1. Initial program 28.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. Simplified28.3%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    6. Taylor expanded in c0 around 0 39.6%

      \[\leadsto \color{blue}{0} \]

    if 2.7e-227 < M < 1.2e-71

    1. Initial program 27.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. Simplified35.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-71 < M < 6.00000000000000054e-42

    1. Initial program 17.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. Simplified17.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.00000000000000054e-42 < M < 2.69999999999999998e-6 or 5.5000000000000003e41 < M < 3.1000000000000001e63

    1. Initial program 77.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. Simplified83.4%

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

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

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

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

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

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

    if 2.69999999999999998e-6 < M < 5.5000000000000003e41 or 3.1000000000000001e63 < M < 1.3999999999999999e145

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999e145 < M

    1. Initial program 4.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot \frac{d}{w \cdot h}\right)\\ \mathbf{elif}\;M \leq 6 \cdot 10^{-42}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\ \mathbf{elif}\;M \leq 2.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{elif}\;M \leq 5.5 \cdot 10^{+41}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;M \leq 3.1 \cdot 10^{+63}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{elif}\;M \leq 1.4 \cdot 10^{+145}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right)\\ \end{array} \]

Alternative 4: 38.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := h \cdot \left(M \cdot M\right)\\ t_2 := 0.25 \cdot \frac{D \cdot t_1}{\frac{d}{\frac{D}{d}}}\\ t_3 := t_0 \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right)\\ t_4 := t_0 \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.25 \cdot 10^{-71}:\\ \;\;\;\;t_3 + t_0 \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot \frac{d}{w \cdot h}\right)\\ \mathbf{elif}\;M \leq 7.5 \cdot 10^{-42}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_1\right)\\ \mathbf{elif}\;M \leq 2.2 \cdot 10^{-6}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;M \leq 2.9 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;M \leq 4 \cdot 10^{+60}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;M \leq 2.5 \cdot 10^{+140}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3 + t_0 \cdot \frac{c0 \cdot \left(d \cdot \frac{d}{D}\right)}{D \cdot \left(w \cdot h\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w)))
        (t_1 (* h (* M M)))
        (t_2 (* 0.25 (/ (* D t_1) (/ d (/ D d)))))
        (t_3 (* t_0 (* (/ c0 (* w h)) (pow (/ d D) 2.0))))
        (t_4 (* t_0 (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))))
   (if (<= M 2.7e-227)
     0.0
     (if (<= M 1.25e-71)
       (+ t_3 (* t_0 (* (/ (/ d D) (/ D c0)) (/ d (* w h)))))
       (if (<= M 7.5e-42)
         (* 0.25 (* (* (/ D d) (/ D d)) t_1))
         (if (<= M 2.2e-6)
           t_4
           (if (<= M 2.9e+40)
             t_2
             (if (<= M 4e+60)
               t_4
               (if (<= M 2.5e+140)
                 t_2
                 (+
                  t_3
                  (* t_0 (/ (* c0 (* d (/ d D))) (* D (* w h))))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = h * (M * M);
	double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
	double t_3 = t_0 * ((c0 / (w * h)) * pow((d / D), 2.0));
	double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	double tmp;
	if (M <= 2.7e-227) {
		tmp = 0.0;
	} else if (M <= 1.25e-71) {
		tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h))));
	} else if (M <= 7.5e-42) {
		tmp = 0.25 * (((D / d) * (D / d)) * t_1);
	} else if (M <= 2.2e-6) {
		tmp = t_4;
	} else if (M <= 2.9e+40) {
		tmp = t_2;
	} else if (M <= 4e+60) {
		tmp = t_4;
	} else if (M <= 2.5e+140) {
		tmp = t_2;
	} else {
		tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (w * h))));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = h * (m * m)
    t_2 = 0.25d0 * ((d * t_1) / (d_1 / (d / d_1)))
    t_3 = t_0 * ((c0 / (w * h)) * ((d_1 / d) ** 2.0d0))
    t_4 = t_0 * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
    if (m <= 2.7d-227) then
        tmp = 0.0d0
    else if (m <= 1.25d-71) then
        tmp = t_3 + (t_0 * (((d_1 / d) / (d / c0)) * (d_1 / (w * h))))
    else if (m <= 7.5d-42) then
        tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * t_1)
    else if (m <= 2.2d-6) then
        tmp = t_4
    else if (m <= 2.9d+40) then
        tmp = t_2
    else if (m <= 4d+60) then
        tmp = t_4
    else if (m <= 2.5d+140) then
        tmp = t_2
    else
        tmp = t_3 + (t_0 * ((c0 * (d_1 * (d_1 / d))) / (d * (w * h))))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = h * (M * M);
	double t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
	double t_3 = t_0 * ((c0 / (w * h)) * Math.pow((d / D), 2.0));
	double t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	double tmp;
	if (M <= 2.7e-227) {
		tmp = 0.0;
	} else if (M <= 1.25e-71) {
		tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h))));
	} else if (M <= 7.5e-42) {
		tmp = 0.25 * (((D / d) * (D / d)) * t_1);
	} else if (M <= 2.2e-6) {
		tmp = t_4;
	} else if (M <= 2.9e+40) {
		tmp = t_2;
	} else if (M <= 4e+60) {
		tmp = t_4;
	} else if (M <= 2.5e+140) {
		tmp = t_2;
	} else {
		tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (w * h))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = h * (M * M)
	t_2 = 0.25 * ((D * t_1) / (d / (D / d)))
	t_3 = t_0 * ((c0 / (w * h)) * math.pow((d / D), 2.0))
	t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))))
	tmp = 0
	if M <= 2.7e-227:
		tmp = 0.0
	elif M <= 1.25e-71:
		tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h))))
	elif M <= 7.5e-42:
		tmp = 0.25 * (((D / d) * (D / d)) * t_1)
	elif M <= 2.2e-6:
		tmp = t_4
	elif M <= 2.9e+40:
		tmp = t_2
	elif M <= 4e+60:
		tmp = t_4
	elif M <= 2.5e+140:
		tmp = t_2
	else:
		tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (w * h))))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(h * Float64(M * M))
	t_2 = Float64(0.25 * Float64(Float64(D * t_1) / Float64(d / Float64(D / d))))
	t_3 = Float64(t_0 * Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0)))
	t_4 = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h)))))
	tmp = 0.0
	if (M <= 2.7e-227)
		tmp = 0.0;
	elseif (M <= 1.25e-71)
		tmp = Float64(t_3 + Float64(t_0 * Float64(Float64(Float64(d / D) / Float64(D / c0)) * Float64(d / Float64(w * h)))));
	elseif (M <= 7.5e-42)
		tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_1));
	elseif (M <= 2.2e-6)
		tmp = t_4;
	elseif (M <= 2.9e+40)
		tmp = t_2;
	elseif (M <= 4e+60)
		tmp = t_4;
	elseif (M <= 2.5e+140)
		tmp = t_2;
	else
		tmp = Float64(t_3 + Float64(t_0 * Float64(Float64(c0 * Float64(d * Float64(d / D))) / Float64(D * Float64(w * h)))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = h * (M * M);
	t_2 = 0.25 * ((D * t_1) / (d / (D / d)));
	t_3 = t_0 * ((c0 / (w * h)) * ((d / D) ^ 2.0));
	t_4 = t_0 * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	tmp = 0.0;
	if (M <= 2.7e-227)
		tmp = 0.0;
	elseif (M <= 1.25e-71)
		tmp = t_3 + (t_0 * (((d / D) / (D / c0)) * (d / (w * h))));
	elseif (M <= 7.5e-42)
		tmp = 0.25 * (((D / d) * (D / d)) * t_1);
	elseif (M <= 2.2e-6)
		tmp = t_4;
	elseif (M <= 2.9e+40)
		tmp = t_2;
	elseif (M <= 4e+60)
		tmp = t_4;
	elseif (M <= 2.5e+140)
		tmp = t_2;
	else
		tmp = t_3 + (t_0 * ((c0 * (d * (d / D))) / (D * (w * h))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(N[(D * t$95$1), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2.7e-227], 0.0, If[LessEqual[M, 1.25e-71], N[(t$95$3 + N[(t$95$0 * N[(N[(N[(d / D), $MachinePrecision] / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 7.5e-42], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 2.2e-6], t$95$4, If[LessEqual[M, 2.9e+40], t$95$2, If[LessEqual[M, 4e+60], t$95$4, If[LessEqual[M, 2.5e+140], t$95$2, N[(t$95$3 + N[(t$95$0 * N[(N[(c0 * N[(d * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;M \leq 1.25 \cdot 10^{-71}:\\
\;\;\;\;t_3 + t_0 \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot \frac{d}{w \cdot h}\right)\\

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

\mathbf{elif}\;M \leq 2.2 \cdot 10^{-6}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;M \leq 2.9 \cdot 10^{+40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;M \leq 4 \cdot 10^{+60}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;M \leq 2.5 \cdot 10^{+140}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if M < 2.7e-227

    1. Initial program 28.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. Simplified28.3%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
    6. Taylor expanded in c0 around 0 39.6%

      \[\leadsto \color{blue}{0} \]

    if 2.7e-227 < M < 1.24999999999999999e-71

    1. Initial program 27.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. Simplified35.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.24999999999999999e-71 < M < 7.49999999999999972e-42

    1. Initial program 17.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. Simplified17.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999972e-42 < M < 2.2000000000000001e-6 or 2.90000000000000017e40 < M < 3.9999999999999998e60

    1. Initial program 77.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. Simplified83.4%

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

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

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

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

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

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

    if 2.2000000000000001e-6 < M < 2.90000000000000017e40 or 3.9999999999999998e60 < M < 2.50000000000000004e140

    1. Initial program 24.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.50000000000000004e140 < M

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2.7 \cdot 10^{-227}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.25 \cdot 10^{-71}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{d}{D}}{\frac{D}{c0}} \cdot \frac{d}{w \cdot h}\right)\\ \mathbf{elif}\;M \leq 7.5 \cdot 10^{-42}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\ \mathbf{elif}\;M \leq 2.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{elif}\;M \leq 2.9 \cdot 10^{+40}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;M \leq 4 \cdot 10^{+60}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{elif}\;M \leq 2.5 \cdot 10^{+140}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\right) + \frac{c0}{2 \cdot w} \cdot \frac{c0 \cdot \left(d \cdot \frac{d}{D}\right)}{D \cdot \left(w \cdot h\right)}\\ \end{array} \]

Alternative 5: 40.6% accurate, 3.5× speedup?

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

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

\mathbf{elif}\;c0 \leq -8.2 \cdot 10^{-15}:\\
\;\;\;\;t_0 \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right) + t_0 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\

\mathbf{elif}\;c0 \leq 3.4 \cdot 10^{+127} \lor \neg \left(c0 \leq 1.1 \cdot 10^{+243}\right):\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c0 < -4.4000000000000003e85

    1. Initial program 34.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. Simplified30.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4000000000000003e85 < c0 < -8.20000000000000072e-15

    1. Initial program 35.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. Simplified39.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.20000000000000072e-15 < c0 < 3.39999999999999977e127 or 1.10000000000000004e243 < c0

    1. Initial program 17.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999977e127 < c0 < 1.10000000000000004e243

    1. Initial program 50.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -4.4 \cdot 10^{+85}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;c0 \leq -8.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{D} \cdot \left(\frac{d}{D} \cdot \frac{d}{w \cdot h}\right)\right) + \frac{c0}{2 \cdot w} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\\ \mathbf{elif}\;c0 \leq 3.4 \cdot 10^{+127} \lor \neg \left(c0 \leq 1.1 \cdot 10^{+243}\right):\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \end{array} \]

Alternative 6: 40.2% accurate, 4.1× speedup?

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

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

\mathbf{elif}\;c0 \leq -4.8 \cdot 10^{-14}:\\
\;\;\;\;t_1 \cdot \left(\frac{c0}{w \cdot h} \cdot t_0 + c0 \cdot \frac{t_0}{w \cdot h}\right)\\

\mathbf{elif}\;c0 \leq 2.6 \cdot 10^{+127} \lor \neg \left(c0 \leq 1.05 \cdot 10^{+243}\right):\\
\;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c0 < -5.20000000000000021e85

    1. Initial program 34.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. Simplified30.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000021e85 < c0 < -4.8e-14

    1. Initial program 35.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. Simplified39.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e-14 < c0 < 2.6000000000000002e127 or 1.05e243 < c0

    1. Initial program 17.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6000000000000002e127 < c0 < 1.05e243

    1. Initial program 50.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -5.2 \cdot 10^{+85}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;c0 \leq -4.8 \cdot 10^{-14}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + c0 \cdot \frac{\frac{d \cdot d}{D \cdot D}}{w \cdot h}\right)\\ \mathbf{elif}\;c0 \leq 2.6 \cdot 10^{+127} \lor \neg \left(c0 \leq 1.05 \cdot 10^{+243}\right):\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \end{array} \]

Alternative 7: 40.3% accurate, 5.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := h \cdot \left(M \cdot M\right)\\ \mathbf{if}\;c0 \leq -3.8 \cdot 10^{+85}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_0}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;c0 \leq -6.8 \cdot 10^{-14} \lor \neg \left(c0 \leq 2.8 \cdot 10^{+127}\right) \land c0 \leq 5.5 \cdot 10^{+242}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_0\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* h (* M M))))
   (if (<= c0 -3.8e+85)
     (* 0.25 (/ (* D t_0) (/ d (/ D d))))
     (if (or (<= c0 -6.8e-14) (and (not (<= c0 2.8e+127)) (<= c0 5.5e+242)))
       (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ c0 (* D D)) (/ (* d d) (* w h)))))
       (* 0.25 (* (* (/ D d) (/ D d)) t_0))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = h * (M * M);
	double tmp;
	if (c0 <= -3.8e+85) {
		tmp = 0.25 * ((D * t_0) / (d / (D / d)));
	} else if ((c0 <= -6.8e-14) || (!(c0 <= 2.8e+127) && (c0 <= 5.5e+242))) {
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	} else {
		tmp = 0.25 * (((D / d) * (D / d)) * 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) :: tmp
    t_0 = h * (m * m)
    if (c0 <= (-3.8d+85)) then
        tmp = 0.25d0 * ((d * t_0) / (d_1 / (d / d_1)))
    else if ((c0 <= (-6.8d-14)) .or. (.not. (c0 <= 2.8d+127)) .and. (c0 <= 5.5d+242)) then
        tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((c0 / (d * d)) * ((d_1 * d_1) / (w * h))))
    else
        tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * 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 = h * (M * M);
	double tmp;
	if (c0 <= -3.8e+85) {
		tmp = 0.25 * ((D * t_0) / (d / (D / d)));
	} else if ((c0 <= -6.8e-14) || (!(c0 <= 2.8e+127) && (c0 <= 5.5e+242))) {
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	} else {
		tmp = 0.25 * (((D / d) * (D / d)) * t_0);
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = h * (M * M)
	tmp = 0
	if c0 <= -3.8e+85:
		tmp = 0.25 * ((D * t_0) / (d / (D / d)))
	elif (c0 <= -6.8e-14) or (not (c0 <= 2.8e+127) and (c0 <= 5.5e+242)):
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))))
	else:
		tmp = 0.25 * (((D / d) * (D / d)) * t_0)
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(h * Float64(M * M))
	tmp = 0.0
	if (c0 <= -3.8e+85)
		tmp = Float64(0.25 * Float64(Float64(D * t_0) / Float64(d / Float64(D / d))));
	elseif ((c0 <= -6.8e-14) || (!(c0 <= 2.8e+127) && (c0 <= 5.5e+242)))
		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(c0 / Float64(D * D)) * Float64(Float64(d * d) / Float64(w * h)))));
	else
		tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_0));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = h * (M * M);
	tmp = 0.0;
	if (c0 <= -3.8e+85)
		tmp = 0.25 * ((D * t_0) / (d / (D / d)));
	elseif ((c0 <= -6.8e-14) || (~((c0 <= 2.8e+127)) && (c0 <= 5.5e+242)))
		tmp = (c0 / (2.0 * w)) * (2.0 * ((c0 / (D * D)) * ((d * d) / (w * h))));
	else
		tmp = 0.25 * (((D / d) * (D / d)) * t_0);
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -3.8e+85], N[(0.25 * N[(N[(D * t$95$0), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, -6.8e-14], And[N[Not[LessEqual[c0, 2.8e+127]], $MachinePrecision], LessEqual[c0, 5.5e+242]]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;c0 \leq -6.8 \cdot 10^{-14} \lor \neg \left(c0 \leq 2.8 \cdot 10^{+127}\right) \land c0 \leq 5.5 \cdot 10^{+242}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c0 < -3.79999999999999992e85

    1. Initial program 34.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. Simplified30.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.79999999999999992e85 < c0 < -6.80000000000000006e-14 or 2.8000000000000002e127 < c0 < 5.50000000000000022e242

    1. Initial program 42.8%

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

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

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

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

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

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

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

    if -6.80000000000000006e-14 < c0 < 2.8000000000000002e127 or 5.50000000000000022e242 < c0

    1. Initial program 17.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -3.8 \cdot 10^{+85}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;c0 \leq -6.8 \cdot 10^{-14} \lor \neg \left(c0 \leq 2.8 \cdot 10^{+127}\right) \land c0 \leq 5.5 \cdot 10^{+242}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{D \cdot D} \cdot \frac{d \cdot d}{w \cdot h}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\ \end{array} \]

Alternative 8: 39.9% accurate, 6.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := h \cdot \left(M \cdot M\right)\\ \mathbf{if}\;c0 \leq -4.6 \cdot 10^{+27}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot t_0}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;c0 \leq -3.5 \cdot 10^{-14} \lor \neg \left(c0 \leq 3.8 \cdot 10^{+127}\right) \land c0 \leq 5.2 \cdot 10^{+234}:\\ \;\;\;\;\frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot t_0\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* h (* M M))))
   (if (<= c0 -4.6e+27)
     (* 0.25 (/ (* D t_0) (/ d (/ D d))))
     (if (or (<= c0 -3.5e-14) (and (not (<= c0 3.8e+127)) (<= c0 5.2e+234)))
       (* (/ (* c0 c0) (* D D)) (/ (* d d) (* h (* w w))))
       (* 0.25 (* (* (/ D d) (/ D d)) t_0))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = h * (M * M);
	double tmp;
	if (c0 <= -4.6e+27) {
		tmp = 0.25 * ((D * t_0) / (d / (D / d)));
	} else if ((c0 <= -3.5e-14) || (!(c0 <= 3.8e+127) && (c0 <= 5.2e+234))) {
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
	} else {
		tmp = 0.25 * (((D / d) * (D / d)) * 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) :: tmp
    t_0 = h * (m * m)
    if (c0 <= (-4.6d+27)) then
        tmp = 0.25d0 * ((d * t_0) / (d_1 / (d / d_1)))
    else if ((c0 <= (-3.5d-14)) .or. (.not. (c0 <= 3.8d+127)) .and. (c0 <= 5.2d+234)) then
        tmp = ((c0 * c0) / (d * d)) * ((d_1 * d_1) / (h * (w * w)))
    else
        tmp = 0.25d0 * (((d / d_1) * (d / d_1)) * 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 = h * (M * M);
	double tmp;
	if (c0 <= -4.6e+27) {
		tmp = 0.25 * ((D * t_0) / (d / (D / d)));
	} else if ((c0 <= -3.5e-14) || (!(c0 <= 3.8e+127) && (c0 <= 5.2e+234))) {
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
	} else {
		tmp = 0.25 * (((D / d) * (D / d)) * t_0);
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = h * (M * M)
	tmp = 0
	if c0 <= -4.6e+27:
		tmp = 0.25 * ((D * t_0) / (d / (D / d)))
	elif (c0 <= -3.5e-14) or (not (c0 <= 3.8e+127) and (c0 <= 5.2e+234)):
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)))
	else:
		tmp = 0.25 * (((D / d) * (D / d)) * t_0)
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(h * Float64(M * M))
	tmp = 0.0
	if (c0 <= -4.6e+27)
		tmp = Float64(0.25 * Float64(Float64(D * t_0) / Float64(d / Float64(D / d))));
	elseif ((c0 <= -3.5e-14) || (!(c0 <= 3.8e+127) && (c0 <= 5.2e+234)))
		tmp = Float64(Float64(Float64(c0 * c0) / Float64(D * D)) * Float64(Float64(d * d) / Float64(h * Float64(w * w))));
	else
		tmp = Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * t_0));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = h * (M * M);
	tmp = 0.0;
	if (c0 <= -4.6e+27)
		tmp = 0.25 * ((D * t_0) / (d / (D / d)));
	elseif ((c0 <= -3.5e-14) || (~((c0 <= 3.8e+127)) && (c0 <= 5.2e+234)))
		tmp = ((c0 * c0) / (D * D)) * ((d * d) / (h * (w * w)));
	else
		tmp = 0.25 * (((D / d) * (D / d)) * t_0);
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -4.6e+27], N[(0.25 * N[(N[(D * t$95$0), $MachinePrecision] / N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, -3.5e-14], And[N[Not[LessEqual[c0, 3.8e+127]], $MachinePrecision], LessEqual[c0, 5.2e+234]]], N[(N[(N[(c0 * c0), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;c0 \leq -3.5 \cdot 10^{-14} \lor \neg \left(c0 \leq 3.8 \cdot 10^{+127}\right) \land c0 \leq 5.2 \cdot 10^{+234}:\\
\;\;\;\;\frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c0 < -4.6000000000000001e27

    1. Initial program 31.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. Simplified29.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.6000000000000001e27 < c0 < -3.5000000000000002e-14 or 3.7999999999999998e127 < c0 < 5.2000000000000003e234

    1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

    if -3.5000000000000002e-14 < c0 < 3.7999999999999998e127 or 5.2000000000000003e234 < c0

    1. Initial program 18.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. Simplified23.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -4.6 \cdot 10^{+27}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{\frac{D}{d}}}\\ \mathbf{elif}\;c0 \leq -3.5 \cdot 10^{-14} \lor \neg \left(c0 \leq 3.8 \cdot 10^{+127}\right) \land c0 \leq 5.2 \cdot 10^{+234}:\\ \;\;\;\;\frac{c0 \cdot c0}{D \cdot D} \cdot \frac{d \cdot d}{h \cdot \left(w \cdot w\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\\ \end{array} \]

Alternative 9: 41.7% accurate, 10.1× speedup?

\[\begin{array}{l} \\ 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\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 / d_1) * (d / d_1)) * (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(0.25 * Float64(Float64(Float64(D / d) * Float64(D / 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[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 33.6% accurate, 151.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (c0 w h D d M) :precision binary64 0.0)
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.0;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return 0.0;
}
def code(c0, w, h, D, d, M):
	return 0.0
function code(c0, w, h, D, d, M)
	return 0.0
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.0;
end
code[c0_, w_, h_, D_, d_, M_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 27.5%

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

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

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

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

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

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
  6. Taylor expanded in c0 around 0 32.8%

    \[\leadsto \color{blue}{0} \]
  7. Final simplification32.8%

    \[\leadsto 0 \]

Reproduce

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