Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.8% → 54.9%
Time: 42.3s
Alternatives: 11
Speedup: 21.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 24.8% accurate, 1.0× speedup?

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

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

Alternative 1: 54.9% 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(D \cdot D\right) \cdot \left(w \cdot h\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}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* D D) (* w h)))))
   (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)))))
     (* 0.25 (/ (* h (* (* D D) (* M M))) (* 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 = (c0 * (d * d)) / ((D * D) * (w * h));
	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 = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (c0 * (d * d)) / ((D * D) * (w * h));
	double 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 = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = (c0 * (d * d)) / ((D * D) * (w * h))
	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 = 0.25 * ((h * ((D * D) * (M * M))) / (d * d))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(D * D) * Float64(w * h)))
	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(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / 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 = (c0 * (d * d)) / ((D * D) * (w * h));
	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 = 0.25 * ((h * ((D * D) * (M * M))) / (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[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * N[(w * h), $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[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $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(D \cdot D\right) \cdot \left(w \cdot h\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}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\


\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 75.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. Simplified73.8%

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

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

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

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

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

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

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

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

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

        \[\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. frac-times84.9%

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

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \color{blue}{\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}\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. Step-by-step derivation
      1. frac-times0.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. frac-times0.1%

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

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

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 1.8%

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 43.6% accurate, 1.2× speedup?

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

      1. Initial program 26.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. Simplified26.2%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{{\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\sqrt[3]{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}} \cdot \sqrt[3]{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}}\right) \cdot \sqrt[3]{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{h \cdot w}}\right)\right)\right)}^{1}} \]
        2. add-cube-cbrt47.9%

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

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

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

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

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

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

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

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

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

      if -1.6000000000000001e-141 < c0 < 3.6999999999999999e-179

      1. Initial program 17.8%

        \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      2. Step-by-step derivation
        1. frac-times16.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. frac-times16.1%

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

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

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

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 2.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -1.6 \cdot 10^{-141} \lor \neg \left(c0 \leq 3.7 \cdot 10^{-179}\right):\\ \;\;\;\;\left({\left(\frac{d}{D}\right)}^{2} \cdot \frac{\frac{c0}{h}}{w}\right) \cdot \frac{2 \cdot \frac{c0}{2}}{w}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\ \end{array} \]

      Alternative 3: 38.6% accurate, 4.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ \mathbf{if}\;D \cdot D \leq 5 \cdot 10^{-205}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\ \mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-59}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\ \mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{+304}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0}{\frac{D \cdot D}{d} \cdot \frac{w \cdot h}{d}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\ \end{array} \end{array} \]
      (FPCore (c0 w h D d M)
       :precision binary64
       (let* ((t_0 (/ c0 (* 2.0 w))))
         (if (<= (* D D) 5e-205)
           (* t_0 (* 2.0 (* (* d d) (/ c0 (* D (* D (* w h)))))))
           (if (<= (* D D) 4e-59)
             (* 0.25 (/ (* h (* (* D D) (* M M))) (* d d)))
             (if (<= (* D D) 4e+304)
               (* t_0 (* 2.0 (/ c0 (* (/ (* D D) d) (/ (* w h) d)))))
               (* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w)))))))))
      double code(double c0, double w, double h, double D, double d, double M) {
      	double t_0 = c0 / (2.0 * w);
      	double tmp;
      	if ((D * D) <= 5e-205) {
      		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
      	} else if ((D * D) <= 4e-59) {
      		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
      	} else if ((D * D) <= 4e+304) {
      		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
      	} else {
      		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
      	}
      	return tmp;
      }
      
      real(8) function code(c0, w, h, d, d_1, m)
          real(8), intent (in) :: c0
          real(8), intent (in) :: w
          real(8), intent (in) :: h
          real(8), intent (in) :: d
          real(8), intent (in) :: d_1
          real(8), intent (in) :: m
          real(8) :: t_0
          real(8) :: tmp
          t_0 = c0 / (2.0d0 * w)
          if ((d * d) <= 5d-205) then
              tmp = t_0 * (2.0d0 * ((d_1 * d_1) * (c0 / (d * (d * (w * h))))))
          else if ((d * d) <= 4d-59) then
              tmp = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
          else if ((d * d) <= 4d+304) then
              tmp = t_0 * (2.0d0 * (c0 / (((d * d) / d_1) * ((w * h) / d_1))))
          else
              tmp = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
          end if
          code = tmp
      end function
      
      public static double code(double c0, double w, double h, double D, double d, double M) {
      	double t_0 = c0 / (2.0 * w);
      	double tmp;
      	if ((D * D) <= 5e-205) {
      		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
      	} else if ((D * D) <= 4e-59) {
      		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
      	} else if ((D * D) <= 4e+304) {
      		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
      	} else {
      		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
      	}
      	return tmp;
      }
      
      def code(c0, w, h, D, d, M):
      	t_0 = c0 / (2.0 * w)
      	tmp = 0
      	if (D * D) <= 5e-205:
      		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))))
      	elif (D * D) <= 4e-59:
      		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d))
      	elif (D * D) <= 4e+304:
      		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))))
      	else:
      		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)))
      	return tmp
      
      function code(c0, w, h, D, d, M)
      	t_0 = Float64(c0 / Float64(2.0 * w))
      	tmp = 0.0
      	if (Float64(D * D) <= 5e-205)
      		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * d) * Float64(c0 / Float64(D * Float64(D * Float64(w * h)))))));
      	elseif (Float64(D * D) <= 4e-59)
      		tmp = Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d)));
      	elseif (Float64(D * D) <= 4e+304)
      		tmp = Float64(t_0 * Float64(2.0 * Float64(c0 / Float64(Float64(Float64(D * D) / d) * Float64(Float64(w * h) / d)))));
      	else
      		tmp = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(c0, w, h, D, d, M)
      	t_0 = c0 / (2.0 * w);
      	tmp = 0.0;
      	if ((D * D) <= 5e-205)
      		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
      	elseif ((D * D) <= 4e-59)
      		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
      	elseif ((D * D) <= 4e+304)
      		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
      	else
      		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
      	end
      	tmp_2 = tmp;
      end
      
      code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(D * D), $MachinePrecision], 5e-205], N[(t$95$0 * N[(2.0 * N[(N[(d * d), $MachinePrecision] * N[(c0 / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 4e-59], N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 4e+304], N[(t$95$0 * N[(2.0 * N[(c0 / N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(w * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{c0}{2 \cdot w}\\
      \mathbf{if}\;D \cdot D \leq 5 \cdot 10^{-205}:\\
      \;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\
      
      \mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-59}:\\
      \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
      
      \mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{+304}:\\
      \;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0}{\frac{D \cdot D}{d} \cdot \frac{w \cdot h}{d}}\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (*.f64 D D) < 5.00000000000000001e-205

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

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

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

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

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

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

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

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

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

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

        if 5.00000000000000001e-205 < (*.f64 D D) < 4.0000000000000001e-59

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

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

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

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

          \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 2.6%

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

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

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

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

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

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

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

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

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

          if 4.0000000000000001e-59 < (*.f64 D D) < 3.9999999999999998e304

          1. Initial program 32.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. Simplified30.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 3.9999999999999998e304 < (*.f64 D D)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 39.0% accurate, 5.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\ \mathbf{if}\;D \cdot D \leq 2 \cdot 10^{-209}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-59}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\ \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+286}:\\ \;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
        (FPCore (c0 w h D d M)
         :precision binary64
         (let* ((t_0 (* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w))))))
           (if (<= (* D D) 2e-209)
             t_0
             (if (<= (* D D) 4e-59)
               (* 0.25 (/ (* h (* (* D D) (* M M))) (* d d)))
               (if (<= (* D D) 2e+286)
                 (* c0 (* (* c0 (/ d (* D D))) (/ d (* h (* w w)))))
                 t_0)))))
        double code(double c0, double w, double h, double D, double d, double M) {
        	double t_0 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
        	double tmp;
        	if ((D * D) <= 2e-209) {
        		tmp = t_0;
        	} else if ((D * D) <= 4e-59) {
        		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
        	} else if ((D * D) <= 2e+286) {
        		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        real(8) function code(c0, w, h, d, d_1, m)
            real(8), intent (in) :: c0
            real(8), intent (in) :: w
            real(8), intent (in) :: h
            real(8), intent (in) :: d
            real(8), intent (in) :: d_1
            real(8), intent (in) :: m
            real(8) :: t_0
            real(8) :: tmp
            t_0 = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
            if ((d * d) <= 2d-209) then
                tmp = t_0
            else if ((d * d) <= 4d-59) then
                tmp = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
            else if ((d * d) <= 2d+286) then
                tmp = c0 * ((c0 * (d_1 / (d * d))) * (d_1 / (h * (w * w))))
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double c0, double w, double h, double D, double d, double M) {
        	double t_0 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
        	double tmp;
        	if ((D * D) <= 2e-209) {
        		tmp = t_0;
        	} else if ((D * D) <= 4e-59) {
        		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
        	} else if ((D * D) <= 2e+286) {
        		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(c0, w, h, D, d, M):
        	t_0 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)))
        	tmp = 0
        	if (D * D) <= 2e-209:
        		tmp = t_0
        	elif (D * D) <= 4e-59:
        		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d))
        	elif (D * D) <= 2e+286:
        		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))))
        	else:
        		tmp = t_0
        	return tmp
        
        function code(c0, w, h, D, d, M)
        	t_0 = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w))))
        	tmp = 0.0
        	if (Float64(D * D) <= 2e-209)
        		tmp = t_0;
        	elseif (Float64(D * D) <= 4e-59)
        		tmp = Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d)));
        	elseif (Float64(D * D) <= 2e+286)
        		tmp = Float64(c0 * Float64(Float64(c0 * Float64(d / Float64(D * D))) * Float64(d / Float64(h * Float64(w * w)))));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(c0, w, h, D, d, M)
        	t_0 = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
        	tmp = 0.0;
        	if ((D * D) <= 2e-209)
        		tmp = t_0;
        	elseif ((D * D) <= 4e-59)
        		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
        	elseif ((D * D) <= 2e+286)
        		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(D * D), $MachinePrecision], 2e-209], t$95$0, If[LessEqual[N[(D * D), $MachinePrecision], 4e-59], N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 2e+286], N[(c0 * N[(N[(c0 * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
        \mathbf{if}\;D \cdot D \leq 2 \cdot 10^{-209}:\\
        \;\;\;\;t_0\\
        
        \mathbf{elif}\;D \cdot D \leq 4 \cdot 10^{-59}:\\
        \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
        
        \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+286}:\\
        \;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 D D) < 2.0000000000000001e-209 or 2.00000000000000007e286 < (*.f64 D D)

          1. Initial program 24.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. Simplified24.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 2.0000000000000001e-209 < (*.f64 D D) < 4.0000000000000001e-59

          1. Initial program 25.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. frac-times23.6%

              \[\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. frac-times23.6%

              \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{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) \]
            3. *-commutative23.6%

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

              \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Applied egg-rr23.6%

            \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 2.4%

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

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

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

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

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

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

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

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

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

            if 4.0000000000000001e-59 < (*.f64 D D) < 2.00000000000000007e286

            1. Initial program 27.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 39.7% accurate, 5.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ \mathbf{if}\;d \cdot d \leq 5 \cdot 10^{-284}:\\ \;\;\;\;\frac{c0}{2} \cdot \frac{0.5 \cdot \frac{\left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{h}{d} \cdot \frac{w}{d}\right)}{c0}}{w}\\ \mathbf{elif}\;d \cdot d \leq 2 \cdot 10^{+304}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0}{\frac{D \cdot D}{d} \cdot \frac{w \cdot h}{d}}\right)\\ \end{array} \end{array} \]
          (FPCore (c0 w h D d M)
           :precision binary64
           (let* ((t_0 (/ c0 (* 2.0 w))))
             (if (<= (* d d) 5e-284)
               (*
                (/ c0 2.0)
                (/ (* 0.5 (/ (* (* (* D D) (* M M)) (* (/ h d) (/ w d))) c0)) w))
               (if (<= (* d d) 2e+304)
                 (* t_0 (* 2.0 (* (* d d) (/ c0 (* D (* D (* w h)))))))
                 (* t_0 (* 2.0 (/ c0 (* (/ (* D D) d) (/ (* w h) d)))))))))
          double code(double c0, double w, double h, double D, double d, double M) {
          	double t_0 = c0 / (2.0 * w);
          	double tmp;
          	if ((d * d) <= 5e-284) {
          		tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w);
          	} else if ((d * d) <= 2e+304) {
          		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
          	} else {
          		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / 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 = c0 / (2.0d0 * w)
              if ((d_1 * d_1) <= 5d-284) then
                  tmp = (c0 / 2.0d0) * ((0.5d0 * ((((d * d) * (m * m)) * ((h / d_1) * (w / d_1))) / c0)) / w)
              else if ((d_1 * d_1) <= 2d+304) then
                  tmp = t_0 * (2.0d0 * ((d_1 * d_1) * (c0 / (d * (d * (w * h))))))
              else
                  tmp = t_0 * (2.0d0 * (c0 / (((d * d) / d_1) * ((w * h) / d_1))))
              end if
              code = tmp
          end function
          
          public static double code(double c0, double w, double h, double D, double d, double M) {
          	double t_0 = c0 / (2.0 * w);
          	double tmp;
          	if ((d * d) <= 5e-284) {
          		tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w);
          	} else if ((d * d) <= 2e+304) {
          		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
          	} else {
          		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))));
          	}
          	return tmp;
          }
          
          def code(c0, w, h, D, d, M):
          	t_0 = c0 / (2.0 * w)
          	tmp = 0
          	if (d * d) <= 5e-284:
          		tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w)
          	elif (d * d) <= 2e+304:
          		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))))
          	else:
          		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / d))))
          	return tmp
          
          function code(c0, w, h, D, d, M)
          	t_0 = Float64(c0 / Float64(2.0 * w))
          	tmp = 0.0
          	if (Float64(d * d) <= 5e-284)
          		tmp = Float64(Float64(c0 / 2.0) * Float64(Float64(0.5 * Float64(Float64(Float64(Float64(D * D) * Float64(M * M)) * Float64(Float64(h / d) * Float64(w / d))) / c0)) / w));
          	elseif (Float64(d * d) <= 2e+304)
          		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * d) * Float64(c0 / Float64(D * Float64(D * Float64(w * h)))))));
          	else
          		tmp = Float64(t_0 * Float64(2.0 * Float64(c0 / Float64(Float64(Float64(D * D) / d) * Float64(Float64(w * h) / d)))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(c0, w, h, D, d, M)
          	t_0 = c0 / (2.0 * w);
          	tmp = 0.0;
          	if ((d * d) <= 5e-284)
          		tmp = (c0 / 2.0) * ((0.5 * ((((D * D) * (M * M)) * ((h / d) * (w / d))) / c0)) / w);
          	elseif ((d * d) <= 2e+304)
          		tmp = t_0 * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
          	else
          		tmp = t_0 * (2.0 * (c0 / (((D * D) / d) * ((w * h) / 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]}, If[LessEqual[N[(d * d), $MachinePrecision], 5e-284], N[(N[(c0 / 2.0), $MachinePrecision] * N[(N[(0.5 * N[(N[(N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(N[(h / d), $MachinePrecision] * N[(w / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 2e+304], N[(t$95$0 * N[(2.0 * N[(N[(d * d), $MachinePrecision] * N[(c0 / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(2.0 * N[(c0 / N[(N[(N[(D * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(w * h), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{c0}{2 \cdot w}\\
          \mathbf{if}\;d \cdot d \leq 5 \cdot 10^{-284}:\\
          \;\;\;\;\frac{c0}{2} \cdot \frac{0.5 \cdot \frac{\left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{h}{d} \cdot \frac{w}{d}\right)}{c0}}{w}\\
          
          \mathbf{elif}\;d \cdot d \leq 2 \cdot 10^{+304}:\\
          \;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t_0 \cdot \left(2 \cdot \frac{c0}{\frac{D \cdot D}{d} \cdot \frac{w \cdot h}{d}}\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 d d) < 4.99999999999999973e-284

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

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

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

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

              \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

              if 4.99999999999999973e-284 < (*.f64 d d) < 1.9999999999999999e304

              1. Initial program 29.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. Simplified30.0%

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

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

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

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

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

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

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

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

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

              if 1.9999999999999999e304 < (*.f64 d d)

              1. Initial program 24.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 6: 39.4% accurate, 6.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ \mathbf{if}\;w \leq -4.1 \cdot 10^{+93}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\ \mathbf{elif}\;w \leq 1.3 \cdot 10^{-126}:\\ \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\ \mathbf{elif}\;w \leq 2.2 \cdot 10^{-86} \lor \neg \left(w \leq 5.9 \cdot 10^{+153}\right):\\ \;\;\;\;t_0 \cdot 0\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\ \end{array} \end{array} \]
            (FPCore (c0 w h D d M)
             :precision binary64
             (let* ((t_0 (/ c0 (* 2.0 w))))
               (if (<= w -4.1e+93)
                 (* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* h (* D D))))))
                 (if (<= w 1.3e-126)
                   (* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w))))
                   (if (or (<= w 2.2e-86) (not (<= w 5.9e+153)))
                     (* t_0 0.0)
                     (* c0 (* (* c0 (/ d (* D D))) (/ d (* h (* w w))))))))))
            double code(double c0, double w, double h, double D, double d, double M) {
            	double t_0 = c0 / (2.0 * w);
            	double tmp;
            	if (w <= -4.1e+93) {
            		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
            	} else if (w <= 1.3e-126) {
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
            	} else if ((w <= 2.2e-86) || !(w <= 5.9e+153)) {
            		tmp = t_0 * 0.0;
            	} else {
            		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
            	}
            	return tmp;
            }
            
            real(8) function code(c0, w, h, d, d_1, m)
                real(8), intent (in) :: c0
                real(8), intent (in) :: w
                real(8), intent (in) :: h
                real(8), intent (in) :: d
                real(8), intent (in) :: d_1
                real(8), intent (in) :: m
                real(8) :: t_0
                real(8) :: tmp
                t_0 = c0 / (2.0d0 * w)
                if (w <= (-4.1d+93)) then
                    tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (h * (d * d)))))
                else if (w <= 1.3d-126) then
                    tmp = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
                else if ((w <= 2.2d-86) .or. (.not. (w <= 5.9d+153))) then
                    tmp = t_0 * 0.0d0
                else
                    tmp = c0 * ((c0 * (d_1 / (d * d))) * (d_1 / (h * (w * w))))
                end if
                code = tmp
            end function
            
            public static double code(double c0, double w, double h, double D, double d, double M) {
            	double t_0 = c0 / (2.0 * w);
            	double tmp;
            	if (w <= -4.1e+93) {
            		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
            	} else if (w <= 1.3e-126) {
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
            	} else if ((w <= 2.2e-86) || !(w <= 5.9e+153)) {
            		tmp = t_0 * 0.0;
            	} else {
            		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
            	}
            	return tmp;
            }
            
            def code(c0, w, h, D, d, M):
            	t_0 = c0 / (2.0 * w)
            	tmp = 0
            	if w <= -4.1e+93:
            		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))))
            	elif w <= 1.3e-126:
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)))
            	elif (w <= 2.2e-86) or not (w <= 5.9e+153):
            		tmp = t_0 * 0.0
            	else:
            		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))))
            	return tmp
            
            function code(c0, w, h, D, d, M)
            	t_0 = Float64(c0 / Float64(2.0 * w))
            	tmp = 0.0
            	if (w <= -4.1e+93)
            		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(h * Float64(D * D))))));
            	elseif (w <= 1.3e-126)
            		tmp = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w))));
            	elseif ((w <= 2.2e-86) || !(w <= 5.9e+153))
            		tmp = Float64(t_0 * 0.0);
            	else
            		tmp = Float64(c0 * Float64(Float64(c0 * Float64(d / Float64(D * D))) * Float64(d / Float64(h * Float64(w * w)))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(c0, w, h, D, d, M)
            	t_0 = c0 / (2.0 * w);
            	tmp = 0.0;
            	if (w <= -4.1e+93)
            		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (h * (D * D)))));
            	elseif (w <= 1.3e-126)
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
            	elseif ((w <= 2.2e-86) || ~((w <= 5.9e+153)))
            		tmp = t_0 * 0.0;
            	else
            		tmp = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
            	end
            	tmp_2 = tmp;
            end
            
            code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -4.1e+93], 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], If[LessEqual[w, 1.3e-126], N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, 2.2e-86], N[Not[LessEqual[w, 5.9e+153]], $MachinePrecision]], N[(t$95$0 * 0.0), $MachinePrecision], N[(c0 * N[(N[(c0 * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{c0}{2 \cdot w}\\
            \mathbf{if}\;w \leq -4.1 \cdot 10^{+93}:\\
            \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{h \cdot \left(D \cdot D\right)}\right)\right)\\
            
            \mathbf{elif}\;w \leq 1.3 \cdot 10^{-126}:\\
            \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
            
            \mathbf{elif}\;w \leq 2.2 \cdot 10^{-86} \lor \neg \left(w \leq 5.9 \cdot 10^{+153}\right):\\
            \;\;\;\;t_0 \cdot 0\\
            
            \mathbf{else}:\\
            \;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if w < -4.1000000000000001e93

              1. Initial program 24.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. Simplified24.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -4.1000000000000001e93 < w < 1.3e-126

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 1.3e-126 < w < 2.2000000000000002e-86 or 5.9000000000000002e153 < w

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

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

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

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

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

                \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]

              if 2.2000000000000002e-86 < w < 5.9000000000000002e153

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -4.1 \cdot 10^{+93}:\\ \;\;\;\;\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)\\ \mathbf{elif}\;w \leq 1.3 \cdot 10^{-126}:\\ \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\ \mathbf{elif}\;w \leq 2.2 \cdot 10^{-86} \lor \neg \left(w \leq 5.9 \cdot 10^{+153}\right):\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\ \end{array} \]

            Alternative 7: 39.0% accurate, 6.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c0 \leq -1.2 \cdot 10^{-141}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq 1.08 \cdot 10^{-163}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;c0 \leq 3 \cdot 10^{+50} \lor \neg \left(c0 \leq 6.5 \cdot 10^{+129}\right):\\ \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c0 \cdot c0}{\frac{w}{0}}\\ \end{array} \end{array} \]
            (FPCore (c0 w h D d M)
             :precision binary64
             (if (<= c0 -1.2e-141)
               (* (/ c0 (* 2.0 w)) (* 2.0 (* (* d d) (/ c0 (* D (* D (* w h)))))))
               (if (<= c0 1.08e-163)
                 (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
                 (if (or (<= c0 3e+50) (not (<= c0 6.5e+129)))
                   (* (/ c0 (/ D c0)) (* (/ d D) (/ (/ d h) (* w w))))
                   (* -0.5 (/ (* c0 c0) (/ w 0.0)))))))
            double code(double c0, double w, double h, double D, double d, double M) {
            	double tmp;
            	if (c0 <= -1.2e-141) {
            		tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
            	} else if (c0 <= 1.08e-163) {
            		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
            	} else if ((c0 <= 3e+50) || !(c0 <= 6.5e+129)) {
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
            	} else {
            		tmp = -0.5 * ((c0 * c0) / (w / 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 <= (-1.2d-141)) then
                    tmp = (c0 / (2.0d0 * w)) * (2.0d0 * ((d_1 * d_1) * (c0 / (d * (d * (w * h))))))
                else if (c0 <= 1.08d-163) then
                    tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
                else if ((c0 <= 3d+50) .or. (.not. (c0 <= 6.5d+129))) then
                    tmp = (c0 / (d / c0)) * ((d_1 / d) * ((d_1 / h) / (w * w)))
                else
                    tmp = (-0.5d0) * ((c0 * c0) / (w / 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 <= -1.2e-141) {
            		tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
            	} else if (c0 <= 1.08e-163) {
            		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
            	} else if ((c0 <= 3e+50) || !(c0 <= 6.5e+129)) {
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
            	} else {
            		tmp = -0.5 * ((c0 * c0) / (w / 0.0));
            	}
            	return tmp;
            }
            
            def code(c0, w, h, D, d, M):
            	tmp = 0
            	if c0 <= -1.2e-141:
            		tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))))
            	elif c0 <= 1.08e-163:
            		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))))
            	elif (c0 <= 3e+50) or not (c0 <= 6.5e+129):
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)))
            	else:
            		tmp = -0.5 * ((c0 * c0) / (w / 0.0))
            	return tmp
            
            function code(c0, w, h, D, d, M)
            	tmp = 0.0
            	if (c0 <= -1.2e-141)
            		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(d * d) * Float64(c0 / Float64(D * Float64(D * Float64(w * h)))))));
            	elseif (c0 <= 1.08e-163)
            		tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M)))));
            	elseif ((c0 <= 3e+50) || !(c0 <= 6.5e+129))
            		tmp = Float64(Float64(c0 / Float64(D / c0)) * Float64(Float64(d / D) * Float64(Float64(d / h) / Float64(w * w))));
            	else
            		tmp = Float64(-0.5 * Float64(Float64(c0 * c0) / Float64(w / 0.0)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(c0, w, h, D, d, M)
            	tmp = 0.0;
            	if (c0 <= -1.2e-141)
            		tmp = (c0 / (2.0 * w)) * (2.0 * ((d * d) * (c0 / (D * (D * (w * h))))));
            	elseif (c0 <= 1.08e-163)
            		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
            	elseif ((c0 <= 3e+50) || ~((c0 <= 6.5e+129)))
            		tmp = (c0 / (D / c0)) * ((d / D) * ((d / h) / (w * w)));
            	else
            		tmp = -0.5 * ((c0 * c0) / (w / 0.0));
            	end
            	tmp_2 = tmp;
            end
            
            code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[c0, -1.2e-141], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(d * d), $MachinePrecision] * N[(c0 / N[(D * N[(D * N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 1.08e-163], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 3e+50], N[Not[LessEqual[c0, 6.5e+129]], $MachinePrecision]], N[(N[(c0 / N[(D / c0), $MachinePrecision]), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / h), $MachinePrecision] / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(c0 * c0), $MachinePrecision] / N[(w / 0.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;c0 \leq -1.2 \cdot 10^{-141}:\\
            \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\
            
            \mathbf{elif}\;c0 \leq 1.08 \cdot 10^{-163}:\\
            \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
            
            \mathbf{elif}\;c0 \leq 3 \cdot 10^{+50} \lor \neg \left(c0 \leq 6.5 \cdot 10^{+129}\right):\\
            \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;-0.5 \cdot \frac{c0 \cdot c0}{\frac{w}{0}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if c0 < -1.2e-141

              1. Initial program 24.6%

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

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

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

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

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

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

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

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

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

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

              if -1.2e-141 < c0 < 1.0800000000000001e-163

              1. Initial program 19.4%

                \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
              2. Step-by-step derivation
                1. frac-times17.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. frac-times17.7%

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

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

                  \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Applied egg-rr17.7%

                \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 2.5%

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

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

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

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

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

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

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

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

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

                if 1.0800000000000001e-163 < c0 < 2.9999999999999998e50 or 6.4999999999999995e129 < c0

                1. Initial program 29.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. Simplified30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 2.9999999999999998e50 < c0 < 6.4999999999999995e129

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

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

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

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

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

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

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

                    \[\leadsto -0.5 \cdot \frac{c0 \cdot c0}{\frac{w}{\color{blue}{0}}} \]
                5. Simplified42.6%

                  \[\leadsto \color{blue}{-0.5 \cdot \frac{c0 \cdot c0}{\frac{w}{0}}} \]
              6. Recombined 4 regimes into one program.
              7. Final simplification48.2%

                \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -1.2 \cdot 10^{-141}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right)\\ \mathbf{elif}\;c0 \leq 1.08 \cdot 10^{-163}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;c0 \leq 3 \cdot 10^{+50} \lor \neg \left(c0 \leq 6.5 \cdot 10^{+129}\right):\\ \;\;\;\;\frac{c0}{\frac{D}{c0}} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{h}}{w \cdot w}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c0 \cdot c0}{\frac{w}{0}}\\ \end{array} \]

              Alternative 8: 38.5% accurate, 6.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\ \mathbf{if}\;w \leq -4.3 \cdot 10^{-99}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\ \mathbf{elif}\;w \leq 1.5 \cdot 10^{-217}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;w \leq 2.5 \cdot 10^{-86}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;w \leq 2.1 \cdot 10^{+139}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \end{array} \end{array} \]
              (FPCore (c0 w h D d M)
               :precision binary64
               (let* ((t_0 (* c0 (* (* c0 (/ d (* D D))) (/ d (* h (* w w)))))))
                 (if (<= w -4.3e-99)
                   (* 0.25 (/ (* h (* (* D D) (* M M))) (* d d)))
                   (if (<= w 1.5e-217)
                     t_0
                     (if (<= w 2.5e-86)
                       (* 0.25 (/ (* D D) (/ (* d d) (* h (* M M)))))
                       (if (<= w 2.1e+139) t_0 (* (/ c0 (* 2.0 w)) 0.0)))))))
              double code(double c0, double w, double h, double D, double d, double M) {
              	double t_0 = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
              	double tmp;
              	if (w <= -4.3e-99) {
              		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
              	} else if (w <= 1.5e-217) {
              		tmp = t_0;
              	} else if (w <= 2.5e-86) {
              		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
              	} else if (w <= 2.1e+139) {
              		tmp = t_0;
              	} else {
              		tmp = (c0 / (2.0 * w)) * 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) :: t_0
                  real(8) :: tmp
                  t_0 = c0 * ((c0 * (d_1 / (d * d))) * (d_1 / (h * (w * w))))
                  if (w <= (-4.3d-99)) then
                      tmp = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
                  else if (w <= 1.5d-217) then
                      tmp = t_0
                  else if (w <= 2.5d-86) then
                      tmp = 0.25d0 * ((d * d) / ((d_1 * d_1) / (h * (m * m))))
                  else if (w <= 2.1d+139) then
                      tmp = t_0
                  else
                      tmp = (c0 / (2.0d0 * w)) * 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 t_0 = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
              	double tmp;
              	if (w <= -4.3e-99) {
              		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
              	} else if (w <= 1.5e-217) {
              		tmp = t_0;
              	} else if (w <= 2.5e-86) {
              		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
              	} else if (w <= 2.1e+139) {
              		tmp = t_0;
              	} else {
              		tmp = (c0 / (2.0 * w)) * 0.0;
              	}
              	return tmp;
              }
              
              def code(c0, w, h, D, d, M):
              	t_0 = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))))
              	tmp = 0
              	if w <= -4.3e-99:
              		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d))
              	elif w <= 1.5e-217:
              		tmp = t_0
              	elif w <= 2.5e-86:
              		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))))
              	elif w <= 2.1e+139:
              		tmp = t_0
              	else:
              		tmp = (c0 / (2.0 * w)) * 0.0
              	return tmp
              
              function code(c0, w, h, D, d, M)
              	t_0 = Float64(c0 * Float64(Float64(c0 * Float64(d / Float64(D * D))) * Float64(d / Float64(h * Float64(w * w)))))
              	tmp = 0.0
              	if (w <= -4.3e-99)
              		tmp = Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d)));
              	elseif (w <= 1.5e-217)
              		tmp = t_0;
              	elseif (w <= 2.5e-86)
              		tmp = Float64(0.25 * Float64(Float64(D * D) / Float64(Float64(d * d) / Float64(h * Float64(M * M)))));
              	elseif (w <= 2.1e+139)
              		tmp = t_0;
              	else
              		tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0);
              	end
              	return tmp
              end
              
              function tmp_2 = code(c0, w, h, D, d, M)
              	t_0 = c0 * ((c0 * (d / (D * D))) * (d / (h * (w * w))));
              	tmp = 0.0;
              	if (w <= -4.3e-99)
              		tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
              	elseif (w <= 1.5e-217)
              		tmp = t_0;
              	elseif (w <= 2.5e-86)
              		tmp = 0.25 * ((D * D) / ((d * d) / (h * (M * M))));
              	elseif (w <= 2.1e+139)
              		tmp = t_0;
              	else
              		tmp = (c0 / (2.0 * w)) * 0.0;
              	end
              	tmp_2 = tmp;
              end
              
              code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 * N[(N[(c0 * N[(d / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -4.3e-99], N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 1.5e-217], t$95$0, If[LessEqual[w, 2.5e-86], N[(0.25 * N[(N[(D * D), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] / N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.1e+139], t$95$0, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\
              \mathbf{if}\;w \leq -4.3 \cdot 10^{-99}:\\
              \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\
              
              \mathbf{elif}\;w \leq 1.5 \cdot 10^{-217}:\\
              \;\;\;\;t_0\\
              
              \mathbf{elif}\;w \leq 2.5 \cdot 10^{-86}:\\
              \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\
              
              \mathbf{elif}\;w \leq 2.1 \cdot 10^{+139}:\\
              \;\;\;\;t_0\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if w < -4.2999999999999999e-99

                1. Initial program 18.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. frac-times18.5%

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

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

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

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

                  \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 6.1%

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

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

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

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

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

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

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

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

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

                  if -4.2999999999999999e-99 < w < 1.50000000000000002e-217 or 2.4999999999999999e-86 < w < 2.0999999999999999e139

                  1. Initial program 32.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 1.50000000000000002e-217 < w < 2.4999999999999999e-86

                  1. Initial program 15.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. frac-times15.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. frac-times15.7%

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

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

                      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Applied egg-rr15.7%

                    \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 0.1%

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

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

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

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

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

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

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

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

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

                    if 2.0999999999999999e139 < w

                    1. Initial program 15.8%

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

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

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

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

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

                      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
                  6. Recombined 4 regimes into one program.
                  7. Final simplification45.1%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -4.3 \cdot 10^{-99}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}\\ \mathbf{elif}\;w \leq 1.5 \cdot 10^{-217}:\\ \;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\ \mathbf{elif}\;w \leq 2.5 \cdot 10^{-86}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;w \leq 2.1 \cdot 10^{+139}:\\ \;\;\;\;c0 \cdot \left(\left(c0 \cdot \frac{d}{D \cdot D}\right) \cdot \frac{d}{h \cdot \left(w \cdot w\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\ \end{array} \]

                  Alternative 9: 35.9% accurate, 7.9× speedup?

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

                    1. Initial program 25.7%

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

                        \[\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. frac-times24.6%

                        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{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) \]
                      3. *-commutative24.6%

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

                        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Applied egg-rr24.6%

                      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 5.4%

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

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

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

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

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

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

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

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

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

                      if 7.8000000000000003e301 < (*.f64 d d)

                      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. Simplified23.8%

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

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

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

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

                        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
                    6. Recombined 2 regimes into one program.
                    7. Final simplification34.8%

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

                    Alternative 10: 34.8% accurate, 10.1× speedup?

                    \[\begin{array}{l} \\ 0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d} \end{array} \]
                    (FPCore (c0 w h D d M)
                     :precision binary64
                     (* 0.25 (/ (* h (* (* D D) (* M M))) (* d d))))
                    double code(double c0, double w, double h, double D, double d, double M) {
                    	return 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
                    }
                    
                    real(8) function code(c0, w, h, d, d_1, m)
                        real(8), intent (in) :: c0
                        real(8), intent (in) :: w
                        real(8), intent (in) :: h
                        real(8), intent (in) :: d
                        real(8), intent (in) :: d_1
                        real(8), intent (in) :: m
                        code = 0.25d0 * ((h * ((d * d) * (m * m))) / (d_1 * d_1))
                    end function
                    
                    public static double code(double c0, double w, double h, double D, double d, double M) {
                    	return 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
                    }
                    
                    def code(c0, w, h, D, d, M):
                    	return 0.25 * ((h * ((D * D) * (M * M))) / (d * d))
                    
                    function code(c0, w, h, D, d, M)
                    	return Float64(0.25 * Float64(Float64(h * Float64(Float64(D * D) * Float64(M * M))) / Float64(d * d)))
                    end
                    
                    function tmp = code(c0, w, h, D, d, M)
                    	tmp = 0.25 * ((h * ((D * D) * (M * M))) / (d * d));
                    end
                    
                    code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(N[(h * N[(N[(D * D), $MachinePrecision] * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    0.25 \cdot \frac{h \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right)}{d \cdot d}
                    \end{array}
                    
                    Derivation
                    1. Initial program 24.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. frac-times24.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. frac-times24.3%

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

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

                        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2}} \cdot \frac{c0}{w \cdot h} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Applied egg-rr24.3%

                      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{{\left(\frac{d}{D}\right)}^{2} \cdot \frac{c0}{w \cdot h}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \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. Taylor expanded in c0 around -inf 3.3%

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

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

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

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

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

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

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

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

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

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

                      Alternative 11: 30.0% accurate, 21.6× speedup?

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

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

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

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

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

                        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{0} \]
                      6. Final simplification25.0%

                        \[\leadsto \frac{c0}{2 \cdot w} \cdot 0 \]

                      Reproduce

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