Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.1% → 54.1%
Time: 32.0s
Alternatives: 13
Speedup: 16.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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.1% 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: 54.1% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 37.3% accurate, 1.2× speedup?

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

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

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

\mathbf{elif}\;M \leq 6.8 \cdot 10^{-95} \lor \neg \left(M \leq 9.5 \cdot 10^{+59}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if M < 1.59999999999999999e-298

    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. Step-by-step derivation
      1. times-frac23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999999e-298 < M < 4.7000000000000003e-194

    1. Initial program 21.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.7000000000000003e-194 < M < 6.79999999999999986e-95 or 9.50000000000000023e59 < 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. Step-by-step derivation
      1. times-frac18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.79999999999999986e-95 < M < 9.50000000000000023e59

    1. Initial program 16.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.6 \cdot 10^{-298}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\ \mathbf{elif}\;M \leq 4.7 \cdot 10^{-194}:\\ \;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\ \mathbf{elif}\;M \leq 6.8 \cdot 10^{-95} \lor \neg \left(M \leq 9.5 \cdot 10^{+59}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \end{array} \]

Alternative 3: 36.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;M \leq 1.75 \cdot 10^{-133}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;M \leq 1.9 \cdot 10^{+60}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if M < 1.59999999999999999e-298

    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. Step-by-step derivation
      1. times-frac23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.59999999999999999e-298 < M < 1.75000000000000001e-133 or 1.49999999999999992e-123 < M < 1.90000000000000005e60

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.75000000000000001e-133 < M < 1.49999999999999992e-123

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.90000000000000005e60 < M

    1. Initial program 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.6 \cdot 10^{-298}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\ \mathbf{elif}\;M \leq 1.75 \cdot 10^{-133}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{elif}\;M \leq 1.5 \cdot 10^{-123}:\\ \;\;\;\;{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \mathbf{elif}\;M \leq 1.9 \cdot 10^{+60}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot \left(c0 \cdot d\right)\right) \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right)\right)\\ \end{array} \]

Alternative 4: 40.2% accurate, 4.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{if}\;M \cdot M \leq 3 \cdot 10^{-266}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;M \cdot M \leq 4.3 \cdot 10^{-246}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\\ \mathbf{elif}\;M \cdot M \leq 8.8 \cdot 10^{+120}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\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 D) 0.25) (/ (/ d (/ h d)) (* M M)))))
   (if (<= (* M M) 3e-266)
     t_1
     (if (<= (* M M) 4.3e-246)
       (* t_0 (* 2.0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
       (if (<= (* M M) 8.8e+120)
         t_1
         (* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* h (* D D)))))))))))
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 * D) * 0.25) / ((d / (h / d)) / (M * M));
	double tmp;
	if ((M * M) <= 3e-266) {
		tmp = t_1;
	} else if ((M * M) <= 4.3e-246) {
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
	} else if ((M * M) <= 8.8e+120) {
		tmp = t_1;
	} else {
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
    if ((m * m) <= 3d-266) then
        tmp = t_1
    else if ((m * m) <= 4.3d-246) then
        tmp = t_0 * (2.0d0 * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d))))
    else if ((m * m) <= 8.8d+120) then
        tmp = t_1
    else
        tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * d)))))
    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 * D) * 0.25) / ((d / (h / d)) / (M * M));
	double tmp;
	if ((M * M) <= 3e-266) {
		tmp = t_1;
	} else if ((M * M) <= 4.3e-246) {
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
	} else if ((M * M) <= 8.8e+120) {
		tmp = t_1;
	} else {
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M))
	tmp = 0
	if (M * M) <= 3e-266:
		tmp = t_1
	elif (M * M) <= 4.3e-246:
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))))
	elif (M * M) <= 8.8e+120:
		tmp = t_1
	else:
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M)))
	tmp = 0.0
	if (Float64(M * M) <= 3e-266)
		tmp = t_1;
	elseif (Float64(M * M) <= 4.3e-246)
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))));
	elseif (Float64(M * M) <= 8.8e+120)
		tmp = t_1;
	else
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * Float64(D * D))))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
	tmp = 0.0;
	if ((M * M) <= 3e-266)
		tmp = t_1;
	elseif ((M * M) <= 4.3e-246)
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
	elseif ((M * M) <= 8.8e+120)
		tmp = t_1;
	else
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M * M), $MachinePrecision], 3e-266], t$95$1, If[LessEqual[N[(M * M), $MachinePrecision], 4.3e-246], N[(t$95$0 * N[(2.0 * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M * M), $MachinePrecision], 8.8e+120], t$95$1, N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;M \cdot M \leq 8.8 \cdot 10^{+120}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 M M) < 3e-266 or 4.29999999999999992e-246 < (*.f64 M M) < 8.8000000000000005e120

    1. Initial program 21.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e-266 < (*.f64 M M) < 4.29999999999999992e-246

    1. Initial program 50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.8000000000000005e120 < (*.f64 M M)

    1. Initial program 16.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot M \leq 3 \cdot 10^{-266}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{elif}\;M \cdot M \leq 4.3 \cdot 10^{-246}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\\ \mathbf{elif}\;M \cdot M \leq 8.8 \cdot 10^{+120}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\ \end{array} \]

Alternative 5: 36.4% accurate, 4.8× speedup?

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

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

\mathbf{elif}\;M \leq 2.3 \cdot 10^{-134} \lor \neg \left(M \leq 1.7 \cdot 10^{-123}\right) \land M \leq 6.5 \cdot 10^{+60}:\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if M < 2.0499999999999999e-298

    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. Step-by-step derivation
      1. times-frac23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0499999999999999e-298 < M < 2.3e-134 or 1.7e-123 < M < 6.49999999999999931e60

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3e-134 < M < 1.7e-123 or 6.49999999999999931e60 < M

    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. Step-by-step derivation
      1. times-frac18.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2.05 \cdot 10^{-298}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\ \mathbf{elif}\;M \leq 2.3 \cdot 10^{-134} \lor \neg \left(M \leq 1.7 \cdot 10^{-123}\right) \land M \leq 6.5 \cdot 10^{+60}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot \left(c0 \cdot d\right)\right) \cdot \frac{1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\right)\right)\\ \end{array} \]

Alternative 6: 36.1% accurate, 5.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{if}\;M \leq 2 \cdot 10^{-298}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\ \mathbf{elif}\;M \leq 1.72 \cdot 10^{-133}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;M \leq 1.5 \cdot 10^{-123}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\\ \mathbf{elif}\;M \leq 4.6 \cdot 10^{+60}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\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 D) 0.25) (/ (/ d (/ h d)) (* M M)))))
   (if (<= M 2e-298)
     (/ (* c0 (* 2.0 (/ (* c0 (/ (* d d) h)) (* w (* D D))))) (* 2.0 w))
     (if (<= M 1.72e-133)
       t_1
       (if (<= M 1.5e-123)
         (* t_0 (* 2.0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
         (if (<= M 4.6e+60)
           t_1
           (* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* h (* D D))))))))))))
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 * D) * 0.25) / ((d / (h / d)) / (M * M));
	double tmp;
	if (M <= 2e-298) {
		tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
	} else if (M <= 1.72e-133) {
		tmp = t_1;
	} else if (M <= 1.5e-123) {
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
	} else if (M <= 4.6e+60) {
		tmp = t_1;
	} else {
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = ((d * d) * 0.25d0) / ((d_1 / (h / d_1)) / (m * m))
    if (m <= 2d-298) then
        tmp = (c0 * (2.0d0 * ((c0 * ((d_1 * d_1) / h)) / (w * (d * d))))) / (2.0d0 * w)
    else if (m <= 1.72d-133) then
        tmp = t_1
    else if (m <= 1.5d-123) then
        tmp = t_0 * (2.0d0 * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d))))
    else if (m <= 4.6d+60) then
        tmp = t_1
    else
        tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * d)))))
    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 * D) * 0.25) / ((d / (h / d)) / (M * M));
	double tmp;
	if (M <= 2e-298) {
		tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
	} else if (M <= 1.72e-133) {
		tmp = t_1;
	} else if (M <= 1.5e-123) {
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
	} else if (M <= 4.6e+60) {
		tmp = t_1;
	} else {
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M))
	tmp = 0
	if M <= 2e-298:
		tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w)
	elif M <= 1.72e-133:
		tmp = t_1
	elif M <= 1.5e-123:
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))))
	elif M <= 4.6e+60:
		tmp = t_1
	else:
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(Float64(D * D) * 0.25) / Float64(Float64(d / Float64(h / d)) / Float64(M * M)))
	tmp = 0.0
	if (M <= 2e-298)
		tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(c0 * Float64(Float64(d * d) / h)) / Float64(w * Float64(D * D))))) / Float64(2.0 * w));
	elseif (M <= 1.72e-133)
		tmp = t_1;
	elseif (M <= 1.5e-123)
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))));
	elseif (M <= 4.6e+60)
		tmp = t_1;
	else
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * Float64(D * D))))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = ((D * D) * 0.25) / ((d / (h / d)) / (M * M));
	tmp = 0.0;
	if (M <= 2e-298)
		tmp = (c0 * (2.0 * ((c0 * ((d * d) / h)) / (w * (D * D))))) / (2.0 * w);
	elseif (M <= 1.72e-133)
		tmp = t_1;
	elseif (M <= 1.5e-123)
		tmp = t_0 * (2.0 * ((c0 * (d * d)) / ((w * h) * (D * D))));
	elseif (M <= 4.6e+60)
		tmp = t_1;
	else
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(D * D), $MachinePrecision] * 0.25), $MachinePrecision] / N[(N[(d / N[(h / d), $MachinePrecision]), $MachinePrecision] / N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, 2e-298], N[(N[(c0 * N[(2.0 * N[(N[(c0 * N[(N[(d * d), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 1.72e-133], t$95$1, If[LessEqual[M, 1.5e-123], N[(t$95$0 * N[(2.0 * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 4.6e+60], t$95$1, N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;M \leq 1.72 \cdot 10^{-133}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;M \leq 4.6 \cdot 10^{+60}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if M < 1.99999999999999982e-298

    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. Step-by-step derivation
      1. times-frac23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999982e-298 < M < 1.71999999999999995e-133 or 1.49999999999999992e-123 < M < 4.60000000000000034e60

    1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.71999999999999995e-133 < M < 1.49999999999999992e-123

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.60000000000000034e60 < M

    1. Initial program 12.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2 \cdot 10^{-298}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d \cdot d}{h}}{w \cdot \left(D \cdot D\right)}\right)}{2 \cdot w}\\ \mathbf{elif}\;M \leq 1.72 \cdot 10^{-133}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{elif}\;M \leq 1.5 \cdot 10^{-123}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\\ \mathbf{elif}\;M \leq 4.6 \cdot 10^{+60}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\ \end{array} \]

Alternative 7: 41.0% accurate, 6.0× speedup?

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

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

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


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

    1. Initial program 23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.6000000000000003e120 < (*.f64 M M)

    1. Initial program 16.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 40.3% accurate, 6.0× speedup?

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

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

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


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

    1. Initial program 23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.95000000000000007e121 < (*.f64 M M)

    1. Initial program 16.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 40.4% accurate, 6.0× speedup?

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

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

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


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

    1. Initial program 23.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.00000000000000015e120 < (*.f64 M M)

    1. Initial program 16.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 37.4% accurate, 7.2× speedup?

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

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

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


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

    1. Initial program 23.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85000000000000012e133 < (*.f64 M M)

    1. Initial program 16.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 35.0% accurate, 7.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -4.8 \cdot 10^{+74} \lor \neg \left(c0 \leq 5.9 \cdot 10^{-80}\right):\\
\;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c0 < -4.80000000000000017e74 or 5.9000000000000001e-80 < c0

    1. Initial program 22.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.80000000000000017e74 < c0 < 5.9000000000000001e-80

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -4.8 \cdot 10^{+74} \lor \neg \left(c0 \leq 5.9 \cdot 10^{-80}\right):\\ \;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \end{array} \]

Alternative 12: 35.9% accurate, 7.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -6.8 \cdot 10^{+72} \lor \neg \left(c0 \leq 1.52 \cdot 10^{-223}\right):\\
\;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c0 < -6.7999999999999997e72 or 1.52000000000000001e-223 < c0

    1. Initial program 21.5%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{c0}}, -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right) \]
      3. unpow25.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{c0}, -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right) \]
      4. unpow25.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{c0}, -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right) \]
      5. *-commutative5.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{c0}, -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right) \]
      6. unpow25.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}{c0}, -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right) \]
      7. associate-*r*5.6%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, \color{blue}{\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0}\right) \]
    4. Simplified23.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{D \cdot D}{d \cdot d} \cdot \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot 0\right)} \]
    5. Taylor expanded in c0 around 0 38.3%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    6. Step-by-step derivation
      1. associate-/l*38.4%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}} \]
      2. associate-*r/38.4%

        \[\leadsto \color{blue}{\frac{0.25 \cdot {D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}} \]
      3. unpow238.4%

        \[\leadsto \frac{0.25 \cdot \color{blue}{\left(D \cdot D\right)}}{\frac{{d}^{2}}{h \cdot {M}^{2}}} \]
      4. associate-/r*36.8%

        \[\leadsto \frac{0.25 \cdot \left(D \cdot D\right)}{\color{blue}{\frac{\frac{{d}^{2}}{h}}{{M}^{2}}}} \]
      5. unpow236.8%

        \[\leadsto \frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{\color{blue}{d \cdot d}}{h}}{{M}^{2}}} \]
      6. associate-/l*40.2%

        \[\leadsto \frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\color{blue}{\frac{d}{\frac{h}{d}}}}{{M}^{2}}} \]
      7. unpow240.2%

        \[\leadsto \frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d}{\frac{h}{d}}}{\color{blue}{M \cdot M}}} \]
    7. Simplified40.2%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}} \]

    if -6.7999999999999997e72 < c0 < 1.52000000000000001e-223

    1. Initial program 22.0%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac20.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      2. fma-def20.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
      3. associate-/r*20.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      4. difference-of-squares24.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Simplified31.8%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Taylor expanded in c0 around -inf 5.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
      2. distribute-rgt1-in5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot c0\right) \]
      3. metadata-eval5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right) \]
      4. mul0-lft48.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval48.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(0 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
      7. metadata-eval5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right) \]
      8. distribute-lft1-in5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
      9. *-commutative5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)} \]
      10. distribute-lft1-in5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval5.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \]
      12. mul0-lft48.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified48.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot 0\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -6.8 \cdot 10^{+72} \lor \neg \left(c0 \leq 1.52 \cdot 10^{-223}\right):\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot 0.25}{\frac{\frac{d}{\frac{h}{d}}}{M \cdot M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)\\ \end{array} \]

Alternative 13: 29.0% accurate, 16.8× speedup?

\[\begin{array}{l} \\ \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right) \end{array} \]
(FPCore (c0 w h D d M) :precision binary64 (* (/ c0 (* 2.0 w)) (* c0 0.0)))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (c0 * 0.0);
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = (c0 / (2.0d0 * w)) * (c0 * 0.0d0)
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (c0 * 0.0);
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (c0 * 0.0)
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(c0 * 0.0))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (c0 / (2.0 * w)) * (c0 * 0.0);
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(c0 * 0.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right)
\end{array}
Derivation
  1. Initial program 21.6%

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Step-by-step derivation
    1. times-frac20.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. fma-def20.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
    3. associate-/r*20.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    4. difference-of-squares25.3%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
  3. Simplified30.0%

    \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
  4. Taylor expanded in c0 around -inf 4.1%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*4.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
    2. distribute-rgt1-in4.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot c0\right) \]
    3. metadata-eval4.1%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right) \]
    4. mul0-lft32.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
    5. metadata-eval32.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
    6. mul0-lft4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(0 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
    7. metadata-eval4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right) \]
    8. distribute-lft1-in4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
    9. *-commutative4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)} \]
    10. distribute-lft1-in4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    11. metadata-eval4.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \]
    12. mul0-lft32.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
  6. Simplified32.6%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot 0\right)} \]
  7. Final simplification32.6%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot 0\right) \]

Reproduce

?
herbie shell --seed 2023222 
(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))))))