Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.6% → 68.3%
Time: 37.7s
Alternatives: 13
Speedup: 151.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

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

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

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

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


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

    1. Initial program 72.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. times-frac68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 72.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. times-frac68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 45.5% accurate, 4.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ t_2 := \frac{d}{D} \cdot \frac{d}{D}\\ \mathbf{if}\;d \leq -6.2 \cdot 10^{+43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1.45 \cdot 10^{-130}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{D \cdot \left(h \cdot D\right)}\right)\right)\\ \mathbf{elif}\;d \leq 1.25 \cdot 10^{-226}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-48}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(t_2 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{+99}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;d \leq 5.8 \cdot 10^{+128}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\ \mathbf{elif}\;d \leq 1.25 \cdot 10^{+205}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{t_2}{h}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ c0 (* 2.0 w)))
        (t_1 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
        (t_2 (* (/ d D) (/ d D))))
   (if (<= d -6.2e+43)
     t_1
     (if (<= d -1.45e-130)
       (* t_0 (* 2.0 (* (/ c0 w) (/ (* d d) (* D (* h D))))))
       (if (<= d 1.25e-226)
         t_1
         (if (<= d 1.6e-48)
           (* t_0 (* 2.0 (* t_2 (/ (/ c0 h) w))))
           (if (<= d 1.5e+99)
             (* (/ 0.25 d) (/ D (/ (/ d h) (* D (* M M)))))
             (if (<= d 5.8e+128)
               (* (/ c0 w) (* (/ d D) (/ c0 (/ D (/ d (* w h))))))
               (if (<= d 1.25e+205)
                 t_1
                 (* t_0 (* 2.0 (* (/ c0 w) (/ t_2 h)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_2 = (d / D) * (d / D);
	double tmp;
	if (d <= -6.2e+43) {
		tmp = t_1;
	} else if (d <= -1.45e-130) {
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D)))));
	} else if (d <= 1.25e-226) {
		tmp = t_1;
	} else if (d <= 1.6e-48) {
		tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w)));
	} else if (d <= 1.5e+99) {
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	} else if (d <= 5.8e+128) {
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	} else if (d <= 1.25e+205) {
		tmp = t_1;
	} else {
		tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = c0 / (2.0d0 * w)
    t_1 = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
    t_2 = (d_1 / d) * (d_1 / d)
    if (d_1 <= (-6.2d+43)) then
        tmp = t_1
    else if (d_1 <= (-1.45d-130)) then
        tmp = t_0 * (2.0d0 * ((c0 / w) * ((d_1 * d_1) / (d * (h * d)))))
    else if (d_1 <= 1.25d-226) then
        tmp = t_1
    else if (d_1 <= 1.6d-48) then
        tmp = t_0 * (2.0d0 * (t_2 * ((c0 / h) / w)))
    else if (d_1 <= 1.5d+99) then
        tmp = (0.25d0 / d_1) * (d / ((d_1 / h) / (d * (m * m))))
    else if (d_1 <= 5.8d+128) then
        tmp = (c0 / w) * ((d_1 / d) * (c0 / (d / (d_1 / (w * h)))))
    else if (d_1 <= 1.25d+205) then
        tmp = t_1
    else
        tmp = t_0 * (2.0d0 * ((c0 / w) * (t_2 / h)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_2 = (d / D) * (d / D);
	double tmp;
	if (d <= -6.2e+43) {
		tmp = t_1;
	} else if (d <= -1.45e-130) {
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D)))));
	} else if (d <= 1.25e-226) {
		tmp = t_1;
	} else if (d <= 1.6e-48) {
		tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w)));
	} else if (d <= 1.5e+99) {
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	} else if (d <= 5.8e+128) {
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	} else if (d <= 1.25e+205) {
		tmp = t_1;
	} else {
		tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))))
	t_2 = (d / D) * (d / D)
	tmp = 0
	if d <= -6.2e+43:
		tmp = t_1
	elif d <= -1.45e-130:
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D)))))
	elif d <= 1.25e-226:
		tmp = t_1
	elif d <= 1.6e-48:
		tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w)))
	elif d <= 1.5e+99:
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))))
	elif d <= 5.8e+128:
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))))
	elif d <= 1.25e+205:
		tmp = t_1
	else:
		tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h)))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M))))))
	t_2 = Float64(Float64(d / D) * Float64(d / D))
	tmp = 0.0
	if (d <= -6.2e+43)
		tmp = t_1;
	elseif (d <= -1.45e-130)
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d * d) / Float64(D * Float64(h * D))))));
	elseif (d <= 1.25e-226)
		tmp = t_1;
	elseif (d <= 1.6e-48)
		tmp = Float64(t_0 * Float64(2.0 * Float64(t_2 * Float64(Float64(c0 / h) / w))));
	elseif (d <= 1.5e+99)
		tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(Float64(d / h) / Float64(D * Float64(M * M)))));
	elseif (d <= 5.8e+128)
		tmp = Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(c0 / Float64(D / Float64(d / Float64(w * h))))));
	elseif (d <= 1.25e+205)
		tmp = t_1;
	else
		tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(t_2 / h))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	t_2 = (d / D) * (d / D);
	tmp = 0.0;
	if (d <= -6.2e+43)
		tmp = t_1;
	elseif (d <= -1.45e-130)
		tmp = t_0 * (2.0 * ((c0 / w) * ((d * d) / (D * (h * D)))));
	elseif (d <= 1.25e-226)
		tmp = t_1;
	elseif (d <= 1.6e-48)
		tmp = t_0 * (2.0 * (t_2 * ((c0 / h) / w)));
	elseif (d <= 1.5e+99)
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	elseif (d <= 5.8e+128)
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	elseif (d <= 1.25e+205)
		tmp = t_1;
	else
		tmp = t_0 * (2.0 * ((c0 / w) * (t_2 / h)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.2e+43], t$95$1, If[LessEqual[d, -1.45e-130], N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.25e-226], t$95$1, If[LessEqual[d, 1.6e-48], N[(t$95$0 * N[(2.0 * N[(t$95$2 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e+99], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(N[(d / h), $MachinePrecision] / N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.8e+128], N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(D / N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.25e+205], t$95$1, N[(t$95$0 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(t$95$2 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;d \leq 1.25 \cdot 10^{-226}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;d \leq 1.6 \cdot 10^{-48}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(t_2 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\

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

\mathbf{elif}\;d \leq 5.8 \cdot 10^{+128}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\

\mathbf{elif}\;d \leq 1.25 \cdot 10^{+205}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -6.2000000000000003e43 or -1.45e-130 < d < 1.2499999999999999e-226 or 5.8000000000000001e128 < d < 1.25e205

    1. Initial program 15.5%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 36.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2000000000000003e43 < d < -1.45e-130

    1. Initial program 49.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2499999999999999e-226 < d < 1.5999999999999999e-48

    1. Initial program 28.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5999999999999999e-48 < d < 1.50000000000000007e99

    1. Initial program 10.0%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{\frac{d}{h}}{M \cdot M}} \cdot \frac{1}{D}} \]
    11. Applied egg-rr51.7%

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{\frac{\frac{d}{h}}{M \cdot M} \cdot 1}{D}}} \]
      2. *-rgt-identity51.7%

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{\frac{\frac{d}{h}}{\color{blue}{{M}^{2}}}}{D}} \]
      4. associate-/l/57.7%

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

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

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

    if 1.50000000000000007e99 < d < 5.8000000000000001e128

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\color{blue}{\frac{D}{\frac{d}{w \cdot h}}}}}{\frac{2}{2}} \]
      9. metadata-eval100.0%

        \[\leadsto \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{\color{blue}{1}} \]
    14. Simplified100.0%

      \[\leadsto \color{blue}{\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{1}} \]

    if 1.25e205 < d

    1. Initial program 29.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -6.2 \cdot 10^{+43}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;d \leq -1.45 \cdot 10^{-130}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{d \cdot d}{D \cdot \left(h \cdot D\right)}\right)\right)\\ \mathbf{elif}\;d \leq 1.25 \cdot 10^{-226}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{-48}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{+99}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;d \leq 5.8 \cdot 10^{+128}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\ \mathbf{elif}\;d \leq 1.25 \cdot 10^{+205}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h}\right)\right)\\ \end{array} \]

Alternative 4: 46.3% accurate, 4.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ t_1 := \frac{c0}{2 \cdot w}\\ t_2 := \frac{d}{D} \cdot \frac{d}{D}\\ \mathbf{if}\;d \leq -5.6 \cdot 10^{+58}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -6.8 \cdot 10^{-130}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}\right)\right)}{2 \cdot w}\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{-223}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-42}:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \left(t_2 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;d \leq 9 \cdot 10^{+131}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\ \mathbf{elif}\;d \leq 1.02 \cdot 10^{+210}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{t_2}{h}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
        (t_1 (/ c0 (* 2.0 w)))
        (t_2 (* (/ d D) (/ d D))))
   (if (<= d -5.6e+58)
     t_0
     (if (<= d -6.8e-130)
       (/ (* c0 (* 2.0 (* (/ d D) (/ (* c0 d) (* h (* w D)))))) (* 2.0 w))
       (if (<= d 2.6e-223)
         t_0
         (if (<= d 6.5e-42)
           (* t_1 (* 2.0 (* t_2 (/ (/ c0 h) w))))
           (if (<= d 1.5e+86)
             (* (/ 0.25 d) (/ D (/ (/ d h) (* D (* M M)))))
             (if (<= d 9e+131)
               (* (/ c0 w) (* (/ d D) (/ c0 (/ D (/ d (* w h))))))
               (if (<= d 1.02e+210)
                 t_0
                 (* t_1 (* 2.0 (* (/ c0 w) (/ t_2 h)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_1 = c0 / (2.0 * w);
	double t_2 = (d / D) * (d / D);
	double tmp;
	if (d <= -5.6e+58) {
		tmp = t_0;
	} else if (d <= -6.8e-130) {
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
	} else if (d <= 2.6e-223) {
		tmp = t_0;
	} else if (d <= 6.5e-42) {
		tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w)));
	} else if (d <= 1.5e+86) {
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	} else if (d <= 9e+131) {
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	} else if (d <= 1.02e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
    t_1 = c0 / (2.0d0 * w)
    t_2 = (d_1 / d) * (d_1 / d)
    if (d_1 <= (-5.6d+58)) then
        tmp = t_0
    else if (d_1 <= (-6.8d-130)) then
        tmp = (c0 * (2.0d0 * ((d_1 / d) * ((c0 * d_1) / (h * (w * d)))))) / (2.0d0 * w)
    else if (d_1 <= 2.6d-223) then
        tmp = t_0
    else if (d_1 <= 6.5d-42) then
        tmp = t_1 * (2.0d0 * (t_2 * ((c0 / h) / w)))
    else if (d_1 <= 1.5d+86) then
        tmp = (0.25d0 / d_1) * (d / ((d_1 / h) / (d * (m * m))))
    else if (d_1 <= 9d+131) then
        tmp = (c0 / w) * ((d_1 / d) * (c0 / (d / (d_1 / (w * h)))))
    else if (d_1 <= 1.02d+210) then
        tmp = t_0
    else
        tmp = t_1 * (2.0d0 * ((c0 / w) * (t_2 / h)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_1 = c0 / (2.0 * w);
	double t_2 = (d / D) * (d / D);
	double tmp;
	if (d <= -5.6e+58) {
		tmp = t_0;
	} else if (d <= -6.8e-130) {
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
	} else if (d <= 2.6e-223) {
		tmp = t_0;
	} else if (d <= 6.5e-42) {
		tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w)));
	} else if (d <= 1.5e+86) {
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	} else if (d <= 9e+131) {
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	} else if (d <= 1.02e+210) {
		tmp = t_0;
	} else {
		tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))))
	t_1 = c0 / (2.0 * w)
	t_2 = (d / D) * (d / D)
	tmp = 0
	if d <= -5.6e+58:
		tmp = t_0
	elif d <= -6.8e-130:
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w)
	elif d <= 2.6e-223:
		tmp = t_0
	elif d <= 6.5e-42:
		tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w)))
	elif d <= 1.5e+86:
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))))
	elif d <= 9e+131:
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))))
	elif d <= 1.02e+210:
		tmp = t_0
	else:
		tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h)))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M))))))
	t_1 = Float64(c0 / Float64(2.0 * w))
	t_2 = Float64(Float64(d / D) * Float64(d / D))
	tmp = 0.0
	if (d <= -5.6e+58)
		tmp = t_0;
	elseif (d <= -6.8e-130)
		tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(d / D) * Float64(Float64(c0 * d) / Float64(h * Float64(w * D)))))) / Float64(2.0 * w));
	elseif (d <= 2.6e-223)
		tmp = t_0;
	elseif (d <= 6.5e-42)
		tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * Float64(Float64(c0 / h) / w))));
	elseif (d <= 1.5e+86)
		tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(Float64(d / h) / Float64(D * Float64(M * M)))));
	elseif (d <= 9e+131)
		tmp = Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(c0 / Float64(D / Float64(d / Float64(w * h))))));
	elseif (d <= 1.02e+210)
		tmp = t_0;
	else
		tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(t_2 / h))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	t_1 = c0 / (2.0 * w);
	t_2 = (d / D) * (d / D);
	tmp = 0.0;
	if (d <= -5.6e+58)
		tmp = t_0;
	elseif (d <= -6.8e-130)
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
	elseif (d <= 2.6e-223)
		tmp = t_0;
	elseif (d <= 6.5e-42)
		tmp = t_1 * (2.0 * (t_2 * ((c0 / h) / w)));
	elseif (d <= 1.5e+86)
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	elseif (d <= 9e+131)
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	elseif (d <= 1.02e+210)
		tmp = t_0;
	else
		tmp = t_1 * (2.0 * ((c0 / w) * (t_2 / h)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5.6e+58], t$95$0, If[LessEqual[d, -6.8e-130], N[(N[(c0 * N[(2.0 * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.6e-223], t$95$0, If[LessEqual[d, 6.5e-42], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.5e+86], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(N[(d / h), $MachinePrecision] / N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9e+131], N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(D / N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.02e+210], t$95$0, N[(t$95$1 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(t$95$2 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;d \leq 2.6 \cdot 10^{-223}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;d \leq 6.5 \cdot 10^{-42}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(t_2 \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\

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

\mathbf{elif}\;d \leq 9 \cdot 10^{+131}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\

\mathbf{elif}\;d \leq 1.02 \cdot 10^{+210}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -5.5999999999999996e58 or -6.8000000000000001e-130 < d < 2.6e-223 or 9.00000000000000039e131 < d < 1.02000000000000005e210

    1. Initial program 14.3%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 36.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5999999999999996e58 < d < -6.8000000000000001e-130

    1. Initial program 49.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6e-223 < d < 6.4999999999999998e-42

    1. Initial program 28.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.4999999999999998e-42 < d < 1.49999999999999988e86

    1. Initial program 10.0%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{\frac{d}{h}}{M \cdot M}} \cdot \frac{1}{D}} \]
    11. Applied egg-rr51.7%

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{\frac{\frac{d}{h}}{M \cdot M} \cdot 1}{D}}} \]
      2. *-rgt-identity51.7%

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{\frac{\frac{d}{h}}{\color{blue}{{M}^{2}}}}{D}} \]
      4. associate-/l/57.7%

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

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

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

    if 1.49999999999999988e86 < d < 9.00000000000000039e131

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\color{blue}{\frac{D}{\frac{d}{w \cdot h}}}}}{\frac{2}{2}} \]
      9. metadata-eval100.0%

        \[\leadsto \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{\color{blue}{1}} \]
    14. Simplified100.0%

      \[\leadsto \color{blue}{\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{1}} \]

    if 1.02000000000000005e210 < d

    1. Initial program 29.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5.6 \cdot 10^{+58}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;d \leq -6.8 \cdot 10^{-130}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}\right)\right)}{2 \cdot w}\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{-223}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-42}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{\frac{c0}{h}}{w}\right)\right)\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;d \leq 9 \cdot 10^{+131}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\ \mathbf{elif}\;d \leq 1.02 \cdot 10^{+210}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h}\right)\right)\\ \end{array} \]

Alternative 5: 46.1% accurate, 4.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{d}{D} \cdot \frac{d}{D}\\ t_1 := \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ t_2 := \frac{c0}{2 \cdot w}\\ \mathbf{if}\;d \leq -3.1 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-130}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}\right)\right)}{2 \cdot w}\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-234}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-43}:\\ \;\;\;\;t_2 \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot t_0\right)\right)\\ \mathbf{elif}\;d \leq 9.4 \cdot 10^{+98}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;d \leq 6.3 \cdot 10^{+131}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\ \mathbf{elif}\;d \leq 1.45 \cdot 10^{+198}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{t_0}{h}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* (/ d D) (/ d D)))
        (t_1 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
        (t_2 (/ c0 (* 2.0 w))))
   (if (<= d -3.1e+59)
     t_1
     (if (<= d -1.75e-130)
       (/ (* c0 (* 2.0 (* (/ d D) (/ (* c0 d) (* h (* w D)))))) (* 2.0 w))
       (if (<= d 5e-234)
         t_1
         (if (<= d 5e-43)
           (* t_2 (* 2.0 (* (* (/ c0 h) (/ 1.0 w)) t_0)))
           (if (<= d 9.4e+98)
             (* (/ 0.25 d) (/ D (/ (/ d h) (* D (* M M)))))
             (if (<= d 6.3e+131)
               (* (/ c0 w) (* (/ d D) (/ c0 (/ D (/ d (* w h))))))
               (if (<= d 1.45e+198)
                 t_1
                 (* t_2 (* 2.0 (* (/ c0 w) (/ t_0 h)))))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (d / D) * (d / D);
	double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_2 = c0 / (2.0 * w);
	double tmp;
	if (d <= -3.1e+59) {
		tmp = t_1;
	} else if (d <= -1.75e-130) {
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
	} else if (d <= 5e-234) {
		tmp = t_1;
	} else if (d <= 5e-43) {
		tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
	} else if (d <= 9.4e+98) {
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	} else if (d <= 6.3e+131) {
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	} else if (d <= 1.45e+198) {
		tmp = t_1;
	} else {
		tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (d_1 / d) * (d_1 / d)
    t_1 = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
    t_2 = c0 / (2.0d0 * w)
    if (d_1 <= (-3.1d+59)) then
        tmp = t_1
    else if (d_1 <= (-1.75d-130)) then
        tmp = (c0 * (2.0d0 * ((d_1 / d) * ((c0 * d_1) / (h * (w * d)))))) / (2.0d0 * w)
    else if (d_1 <= 5d-234) then
        tmp = t_1
    else if (d_1 <= 5d-43) then
        tmp = t_2 * (2.0d0 * (((c0 / h) * (1.0d0 / w)) * t_0))
    else if (d_1 <= 9.4d+98) then
        tmp = (0.25d0 / d_1) * (d / ((d_1 / h) / (d * (m * m))))
    else if (d_1 <= 6.3d+131) then
        tmp = (c0 / w) * ((d_1 / d) * (c0 / (d / (d_1 / (w * h)))))
    else if (d_1 <= 1.45d+198) then
        tmp = t_1
    else
        tmp = t_2 * (2.0d0 * ((c0 / w) * (t_0 / h)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (d / D) * (d / D);
	double t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	double t_2 = c0 / (2.0 * w);
	double tmp;
	if (d <= -3.1e+59) {
		tmp = t_1;
	} else if (d <= -1.75e-130) {
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
	} else if (d <= 5e-234) {
		tmp = t_1;
	} else if (d <= 5e-43) {
		tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
	} else if (d <= 9.4e+98) {
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	} else if (d <= 6.3e+131) {
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	} else if (d <= 1.45e+198) {
		tmp = t_1;
	} else {
		tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (d / D) * (d / D)
	t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))))
	t_2 = c0 / (2.0 * w)
	tmp = 0
	if d <= -3.1e+59:
		tmp = t_1
	elif d <= -1.75e-130:
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w)
	elif d <= 5e-234:
		tmp = t_1
	elif d <= 5e-43:
		tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0))
	elif d <= 9.4e+98:
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))))
	elif d <= 6.3e+131:
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))))
	elif d <= 1.45e+198:
		tmp = t_1
	else:
		tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h)))
	return tmp
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(d / D) * Float64(d / D))
	t_1 = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M))))))
	t_2 = Float64(c0 / Float64(2.0 * w))
	tmp = 0.0
	if (d <= -3.1e+59)
		tmp = t_1;
	elseif (d <= -1.75e-130)
		tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(d / D) * Float64(Float64(c0 * d) / Float64(h * Float64(w * D)))))) / Float64(2.0 * w));
	elseif (d <= 5e-234)
		tmp = t_1;
	elseif (d <= 5e-43)
		tmp = Float64(t_2 * Float64(2.0 * Float64(Float64(Float64(c0 / h) * Float64(1.0 / w)) * t_0)));
	elseif (d <= 9.4e+98)
		tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(Float64(d / h) / Float64(D * Float64(M * M)))));
	elseif (d <= 6.3e+131)
		tmp = Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(c0 / Float64(D / Float64(d / Float64(w * h))))));
	elseif (d <= 1.45e+198)
		tmp = t_1;
	else
		tmp = Float64(t_2 * Float64(2.0 * Float64(Float64(c0 / w) * Float64(t_0 / h))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (d / D) * (d / D);
	t_1 = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	t_2 = c0 / (2.0 * w);
	tmp = 0.0;
	if (d <= -3.1e+59)
		tmp = t_1;
	elseif (d <= -1.75e-130)
		tmp = (c0 * (2.0 * ((d / D) * ((c0 * d) / (h * (w * D)))))) / (2.0 * w);
	elseif (d <= 5e-234)
		tmp = t_1;
	elseif (d <= 5e-43)
		tmp = t_2 * (2.0 * (((c0 / h) * (1.0 / w)) * t_0));
	elseif (d <= 9.4e+98)
		tmp = (0.25 / d) * (D / ((d / h) / (D * (M * M))));
	elseif (d <= 6.3e+131)
		tmp = (c0 / w) * ((d / D) * (c0 / (D / (d / (w * h)))));
	elseif (d <= 1.45e+198)
		tmp = t_1;
	else
		tmp = t_2 * (2.0 * ((c0 / w) * (t_0 / h)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.1e+59], t$95$1, If[LessEqual[d, -1.75e-130], N[(N[(c0 * N[(2.0 * N[(N[(d / D), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(h * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5e-234], t$95$1, If[LessEqual[d, 5e-43], N[(t$95$2 * N[(2.0 * N[(N[(N[(c0 / h), $MachinePrecision] * N[(1.0 / w), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9.4e+98], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(N[(d / h), $MachinePrecision] / N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.3e+131], N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(D / N[(d / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.45e+198], t$95$1, N[(t$95$2 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(t$95$0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;d \leq 5 \cdot 10^{-234}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;d \leq 5 \cdot 10^{-43}:\\
\;\;\;\;t_2 \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot t_0\right)\right)\\

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

\mathbf{elif}\;d \leq 6.3 \cdot 10^{+131}:\\
\;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\

\mathbf{elif}\;d \leq 1.45 \cdot 10^{+198}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if d < -3.10000000000000015e59 or -1.75e-130 < d < 4.99999999999999979e-234 or 6.29999999999999996e131 < d < 1.45e198

    1. Initial program 14.3%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 36.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000015e59 < d < -1.75e-130

    1. Initial program 49.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99999999999999979e-234 < d < 5.00000000000000019e-43

    1. Initial program 28.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000019e-43 < d < 9.3999999999999994e98

    1. Initial program 10.0%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{\frac{d}{h}}{M \cdot M}} \cdot \frac{1}{D}} \]
    11. Applied egg-rr51.7%

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{\frac{\frac{d}{h}}{M \cdot M} \cdot 1}{D}}} \]
      2. *-rgt-identity51.7%

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

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{\frac{\frac{d}{h}}{\color{blue}{{M}^{2}}}}{D}} \]
      4. associate-/l/57.7%

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

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

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

    if 9.3999999999999994e98 < d < 6.29999999999999996e131

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\color{blue}{\frac{D}{\frac{d}{w \cdot h}}}}}{\frac{2}{2}} \]
      9. metadata-eval100.0%

        \[\leadsto \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{\color{blue}{1}} \]
    14. Simplified100.0%

      \[\leadsto \color{blue}{\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{1}} \]

    if 1.45e198 < d

    1. Initial program 29.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.1 \cdot 10^{+59}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;d \leq -1.75 \cdot 10^{-130}:\\ \;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{c0 \cdot d}{h \cdot \left(w \cdot D\right)}\right)\right)}{2 \cdot w}\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-234}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-43}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{c0}{h} \cdot \frac{1}{w}\right) \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\ \mathbf{elif}\;d \leq 9.4 \cdot 10^{+98}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h}}{D \cdot \left(M \cdot M\right)}}\\ \mathbf{elif}\;d \leq 6.3 \cdot 10^{+131}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\ \mathbf{elif}\;d \leq 1.45 \cdot 10^{+198}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{d}{D}}{h}\right)\right)\\ \end{array} \]

Alternative 6: 48.2% accurate, 4.5× speedup?

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

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

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

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

\mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{+86}:\\
\;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot t_0}}\\


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

    1. Initial program 7.0%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 15.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-257 < (*.f64 d d) < 9.99999999999999955e-7

    1. Initial program 37.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{\color{blue}{1}} \]
    14. Simplified53.5%

      \[\leadsto \color{blue}{\frac{c0}{w} \cdot \frac{\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}}{1}} \]

    if 9.99999999999999955e-7 < (*.f64 d d) < 1.00000000000000004e62

    1. Initial program 27.3%

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

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 47.7%

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

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

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

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

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

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

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified47.9%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity47.9%

        \[\leadsto \color{blue}{1 \cdot \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
      2. times-frac47.9%

        \[\leadsto 1 \cdot \color{blue}{\left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)}{d}\right)} \]
      3. associate-*l*47.7%

        \[\leadsto 1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot \left(M \cdot M\right)\right)}}{d}\right) \]
    7. Applied egg-rr47.7%

      \[\leadsto \color{blue}{1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}\right)} \]
    8. Step-by-step derivation
      1. *-lft-identity47.7%

        \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}} \]
      2. unpow247.7%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{{D}^{2}} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d} \]
      3. associate-/l*47.7%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{h \cdot \left(M \cdot M\right)}}} \]
      4. unpow247.7%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{h \cdot \left(M \cdot M\right)}} \]
      5. associate-/l*49.1%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    9. Simplified49.1%

      \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    10. Taylor expanded in D around 0 47.7%

      \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d}} \]
    11. Step-by-step derivation
      1. associate-/l*47.7%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{{M}^{2} \cdot h}}} \]
      2. associate-/l/47.7%

        \[\leadsto \frac{0.25}{d} \cdot \frac{{D}^{2}}{\color{blue}{\frac{\frac{d}{h}}{{M}^{2}}}} \]
      3. unpow247.7%

        \[\leadsto \frac{0.25}{d} \cdot \frac{{D}^{2}}{\frac{\frac{d}{h}}{\color{blue}{M \cdot M}}} \]
      4. unpow247.7%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{\frac{d}{h}}{M \cdot M}} \]
      5. associate-*r/49.2%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\left(D \cdot \frac{D}{\frac{\frac{d}{h}}{M \cdot M}}\right)} \]
      6. unpow249.2%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \frac{D}{\frac{\frac{d}{h}}{\color{blue}{{M}^{2}}}}\right) \]
      7. associate-/r/55.2%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \color{blue}{\left(\frac{D}{\frac{d}{h}} \cdot {M}^{2}\right)}\right) \]
      8. associate-*l/55.5%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \color{blue}{\frac{D \cdot {M}^{2}}{\frac{d}{h}}}\right) \]
      9. unpow255.5%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \color{blue}{\left(M \cdot M\right)}}{\frac{d}{h}}\right) \]
    12. Simplified55.5%

      \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)} \]

    if 1.00000000000000004e62 < (*.f64 d d) < 4.9999999999999998e86

    1. Initial program 55.9%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac55.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      2. fma-def55.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
      3. associate-/r*55.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      4. difference-of-squares67.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Simplified67.0%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Taylor expanded in c0 around inf 56.1%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. associate-/l*56.1%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{\frac{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}{{c0}^{2}}}} \]
      2. unpow256.1%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{\frac{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}{{c0}^{2}}} \]
      3. associate-*r*67.2%

        \[\leadsto \frac{d \cdot d}{\frac{\color{blue}{\left({D}^{2} \cdot {w}^{2}\right) \cdot h}}{{c0}^{2}}} \]
      4. unpow267.2%

        \[\leadsto \frac{d \cdot d}{\frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot {w}^{2}\right) \cdot h}{{c0}^{2}}} \]
      5. unpow267.2%

        \[\leadsto \frac{d \cdot d}{\frac{\left(\left(D \cdot D\right) \cdot \color{blue}{\left(w \cdot w\right)}\right) \cdot h}{{c0}^{2}}} \]
      6. unswap-sqr78.3%

        \[\leadsto \frac{d \cdot d}{\frac{\color{blue}{\left(\left(D \cdot w\right) \cdot \left(D \cdot w\right)\right)} \cdot h}{{c0}^{2}}} \]
      7. unpow278.3%

        \[\leadsto \frac{d \cdot d}{\frac{\left(\left(D \cdot w\right) \cdot \left(D \cdot w\right)\right) \cdot h}{\color{blue}{c0 \cdot c0}}} \]
    6. Simplified78.3%

      \[\leadsto \color{blue}{\frac{d \cdot d}{\frac{\left(\left(D \cdot w\right) \cdot \left(D \cdot w\right)\right) \cdot h}{c0 \cdot c0}}} \]

    if 4.9999999999999998e86 < (*.f64 d d)

    1. Initial program 21.0%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 2.1%

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 35.7%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Step-by-step derivation
      1. associate-*r/35.7%

        \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
      2. unpow235.7%

        \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
      3. *-commutative35.7%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
      4. unpow235.7%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
      5. associate-*r*39.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
      6. unpow239.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified39.8%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity39.8%

        \[\leadsto \color{blue}{1 \cdot \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
      2. times-frac45.5%

        \[\leadsto 1 \cdot \color{blue}{\left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)}{d}\right)} \]
      3. associate-*l*40.7%

        \[\leadsto 1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot \left(M \cdot M\right)\right)}}{d}\right) \]
    7. Applied egg-rr40.7%

      \[\leadsto \color{blue}{1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}\right)} \]
    8. Step-by-step derivation
      1. *-lft-identity40.7%

        \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}} \]
      2. unpow240.7%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{{D}^{2}} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d} \]
      3. associate-/l*40.2%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{h \cdot \left(M \cdot M\right)}}} \]
      4. unpow240.2%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{h \cdot \left(M \cdot M\right)}} \]
      5. associate-/l*49.2%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    9. Simplified49.2%

      \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    10. Taylor expanded in d around 0 52.3%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left({M}^{2} \cdot h\right)}}} \]
    11. Step-by-step derivation
      1. *-commutative52.3%

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}} \]
      2. unpow252.3%

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}} \]
    12. Simplified52.3%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \cdot d \leq 2 \cdot 10^{-257}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}\\ \mathbf{elif}\;d \cdot d \leq 10^{-6}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{c0}{\frac{D}{\frac{d}{w \cdot h}}}\right)\\ \mathbf{elif}\;d \cdot d \leq 10^{+62}:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)\\ \mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{+86}:\\ \;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \end{array} \]

Alternative 7: 46.4% accurate, 7.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -3.45 \cdot 10^{+44} \lor \neg \left(d \leq -1.28 \cdot 10^{-85}\right):\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (or (<= d -3.45e+44) (not (<= d -1.28e-85)))
   (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M))))))
   (* (/ (* d d) (* D D)) (/ (* c0 c0) (* h (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((d <= -3.45e+44) || !(d <= -1.28e-85)) {
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	} else {
		tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if ((d_1 <= (-3.45d+44)) .or. (.not. (d_1 <= (-1.28d-85)))) then
        tmp = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
    else
        tmp = ((d_1 * d_1) / (d * d)) * ((c0 * c0) / (h * (w * w)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((d <= -3.45e+44) || !(d <= -1.28e-85)) {
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	} else {
		tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (d <= -3.45e+44) or not (d <= -1.28e-85):
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))))
	else:
		tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if ((d <= -3.45e+44) || !(d <= -1.28e-85))
		tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M))))));
	else
		tmp = Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((d <= -3.45e+44) || ~((d <= -1.28e-85)))
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	else
		tmp = ((d * d) / (D * D)) * ((c0 * c0) / (h * (w * w)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[d, -3.45e+44], N[Not[LessEqual[d, -1.28e-85]], $MachinePrecision]], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.45 \cdot 10^{+44} \lor \neg \left(d \leq -1.28 \cdot 10^{-85}\right):\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < -3.4499999999999999e44 or -1.28000000000000002e-85 < d

    1. Initial program 19.8%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 3.4%

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 31.8%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Step-by-step derivation
      1. associate-*r/31.8%

        \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
      2. unpow231.8%

        \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
      3. *-commutative31.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
      4. unpow231.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
      5. associate-*r*34.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
      6. unpow234.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified34.6%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity34.6%

        \[\leadsto \color{blue}{1 \cdot \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
      2. times-frac42.0%

        \[\leadsto 1 \cdot \color{blue}{\left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)}{d}\right)} \]
      3. associate-*l*38.7%

        \[\leadsto 1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot \left(M \cdot M\right)\right)}}{d}\right) \]
    7. Applied egg-rr38.7%

      \[\leadsto \color{blue}{1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}\right)} \]
    8. Step-by-step derivation
      1. *-lft-identity38.7%

        \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}} \]
      2. unpow238.7%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{{D}^{2}} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d} \]
      3. associate-/l*38.8%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{h \cdot \left(M \cdot M\right)}}} \]
      4. unpow238.8%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{h \cdot \left(M \cdot M\right)}} \]
      5. associate-/l*48.9%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    9. Simplified48.9%

      \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    10. Taylor expanded in d around 0 50.5%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left({M}^{2} \cdot h\right)}}} \]
    11. Step-by-step derivation
      1. *-commutative50.5%

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}} \]
      2. unpow250.5%

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}} \]
    12. Simplified50.5%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}} \]

    if -3.4499999999999999e44 < d < -1.28000000000000002e-85

    1. Initial program 53.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. times-frac53.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      2. fma-def50.8%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
      3. associate-/r*50.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      4. difference-of-squares54.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Simplified57.0%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Taylor expanded in c0 around inf 45.4%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. times-frac45.4%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}} \]
      2. unpow245.4%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      3. unpow245.4%

        \[\leadsto \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h} \]
      4. unpow245.4%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h} \]
      5. *-commutative45.4%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{h \cdot {w}^{2}}} \]
      6. unpow245.4%

        \[\leadsto \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \color{blue}{\left(w \cdot w\right)}} \]
    6. Simplified45.4%

      \[\leadsto \color{blue}{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.45 \cdot 10^{+44} \lor \neg \left(d \leq -1.28 \cdot 10^{-85}\right):\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\ \end{array} \]

Alternative 8: 47.1% accurate, 7.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -4.4 \cdot 10^{+58} \lor \neg \left(d \leq -2.6 \cdot 10^{-135}\right):\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (or (<= d -4.4e+58) (not (<= d -2.6e-135)))
   (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M))))))
   (/ (* d d) (/ (* h (* (* w D) (* w D))) (* c0 c0)))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((d <= -4.4e+58) || !(d <= -2.6e-135)) {
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	} else {
		tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
	}
	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 <= (-4.4d+58)) .or. (.not. (d_1 <= (-2.6d-135)))) then
        tmp = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
    else
        tmp = (d_1 * d_1) / ((h * ((w * d) * (w * d))) / (c0 * c0))
    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 <= -4.4e+58) || !(d <= -2.6e-135)) {
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	} else {
		tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (d <= -4.4e+58) or not (d <= -2.6e-135):
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))))
	else:
		tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if ((d <= -4.4e+58) || !(d <= -2.6e-135))
		tmp = Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M))))));
	else
		tmp = Float64(Float64(d * d) / Float64(Float64(h * Float64(Float64(w * D) * Float64(w * D))) / Float64(c0 * c0)));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((d <= -4.4e+58) || ~((d <= -2.6e-135)))
		tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
	else
		tmp = (d * d) / ((h * ((w * D) * (w * D))) / (c0 * c0));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[d, -4.4e+58], N[Not[LessEqual[d, -2.6e-135]], $MachinePrecision]], N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(d * d), $MachinePrecision] / N[(N[(h * N[(N[(w * D), $MachinePrecision] * N[(w * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c0 * c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.4 \cdot 10^{+58} \lor \neg \left(d \leq -2.6 \cdot 10^{-135}\right):\\
\;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < -4.4000000000000001e58 or -2.60000000000000004e-135 < d

    1. Initial program 18.7%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 3.1%

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 31.8%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Step-by-step derivation
      1. associate-*r/31.8%

        \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
      2. unpow231.8%

        \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
      3. *-commutative31.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
      4. unpow231.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
      5. associate-*r*34.7%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
      6. unpow234.7%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified34.7%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity34.7%

        \[\leadsto \color{blue}{1 \cdot \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
      2. times-frac42.5%

        \[\leadsto 1 \cdot \color{blue}{\left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)}{d}\right)} \]
      3. associate-*l*39.1%

        \[\leadsto 1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot \left(M \cdot M\right)\right)}}{d}\right) \]
    7. Applied egg-rr39.1%

      \[\leadsto \color{blue}{1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}\right)} \]
    8. Step-by-step derivation
      1. *-lft-identity39.1%

        \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}} \]
      2. unpow239.1%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{{D}^{2}} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d} \]
      3. associate-/l*39.1%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{h \cdot \left(M \cdot M\right)}}} \]
      4. unpow239.1%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{h \cdot \left(M \cdot M\right)}} \]
      5. associate-/l*49.5%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    9. Simplified49.5%

      \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    10. Taylor expanded in d around 0 51.2%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left({M}^{2} \cdot h\right)}}} \]
    11. Step-by-step derivation
      1. *-commutative51.2%

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}} \]
      2. unpow251.2%

        \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}} \]
    12. Simplified51.2%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}} \]

    if -4.4000000000000001e58 < d < -2.60000000000000004e-135

    1. Initial program 49.5%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. times-frac49.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      2. fma-def47.3%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
      3. associate-/r*47.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      4. difference-of-squares49.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Simplified52.0%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Taylor expanded in c0 around inf 43.7%

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    5. Step-by-step derivation
      1. associate-/l*43.8%

        \[\leadsto \color{blue}{\frac{{d}^{2}}{\frac{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}{{c0}^{2}}}} \]
      2. unpow243.8%

        \[\leadsto \frac{\color{blue}{d \cdot d}}{\frac{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}{{c0}^{2}}} \]
      3. associate-*r*48.1%

        \[\leadsto \frac{d \cdot d}{\frac{\color{blue}{\left({D}^{2} \cdot {w}^{2}\right) \cdot h}}{{c0}^{2}}} \]
      4. unpow248.1%

        \[\leadsto \frac{d \cdot d}{\frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot {w}^{2}\right) \cdot h}{{c0}^{2}}} \]
      5. unpow248.1%

        \[\leadsto \frac{d \cdot d}{\frac{\left(\left(D \cdot D\right) \cdot \color{blue}{\left(w \cdot w\right)}\right) \cdot h}{{c0}^{2}}} \]
      6. unswap-sqr59.0%

        \[\leadsto \frac{d \cdot d}{\frac{\color{blue}{\left(\left(D \cdot w\right) \cdot \left(D \cdot w\right)\right)} \cdot h}{{c0}^{2}}} \]
      7. unpow259.0%

        \[\leadsto \frac{d \cdot d}{\frac{\left(\left(D \cdot w\right) \cdot \left(D \cdot w\right)\right) \cdot h}{\color{blue}{c0 \cdot c0}}} \]
    6. Simplified59.0%

      \[\leadsto \color{blue}{\frac{d \cdot d}{\frac{\left(\left(D \cdot w\right) \cdot \left(D \cdot w\right)\right) \cdot h}{c0 \cdot c0}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -4.4 \cdot 10^{+58} \lor \neg \left(d \leq -2.6 \cdot 10^{-135}\right):\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d \cdot d}{\frac{h \cdot \left(\left(w \cdot D\right) \cdot \left(w \cdot D\right)\right)}{c0 \cdot c0}}\\ \end{array} \]

Alternative 9: 45.5% accurate, 7.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \cdot M \leq 10^{+185}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* M M) 1e+185)
   (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D))))
   (* (/ 0.25 d) (* D (/ (* D (* M M)) (/ d h))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((M * M) <= 1e+185) {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	} else {
		tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if ((m * m) <= 1d+185) then
        tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
    else
        tmp = (0.25d0 / d_1) * (d * ((d * (m * m)) / (d_1 / h)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((M * M) <= 1e+185) {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	} else {
		tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (M * M) <= 1e+185:
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)))
	else:
		tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(M * M) <= 1e+185)
		tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D))));
	else
		tmp = Float64(Float64(0.25 / d) * Float64(D * Float64(Float64(D * Float64(M * M)) / Float64(d / h))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((M * M) <= 1e+185)
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	else
		tmp = (0.25 / d) * (D * ((D * (M * M)) / (d / h)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(M * M), $MachinePrecision], 1e+185], N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 / d), $MachinePrecision] * N[(D * N[(N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(d / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \cdot M \leq 10^{+185}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 M M) < 9.9999999999999998e184

    1. Initial program 29.4%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 3.5%

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 36.3%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Step-by-step derivation
      1. associate-*r/36.3%

        \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
      2. unpow236.3%

        \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
      3. *-commutative36.3%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
      4. unpow236.3%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
      5. associate-*r*36.3%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
      6. unpow236.3%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified36.3%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Taylor expanded in D around 0 36.3%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative36.3%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{\left(h \cdot {M}^{2}\right) \cdot {D}^{2}}}{{d}^{2}} \]
      2. unpow236.3%

        \[\leadsto 0.25 \cdot \frac{\left(h \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot {D}^{2}}{{d}^{2}} \]
      3. associate-/l*35.8%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{h \cdot \left(M \cdot M\right)}{\frac{{d}^{2}}{{D}^{2}}}} \]
      4. unpow235.8%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{\color{blue}{d \cdot d}}{{D}^{2}}} \]
      5. unpow235.8%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d \cdot d}{\color{blue}{D \cdot D}}} \]
      6. times-frac47.9%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{\frac{d}{D} \cdot \frac{d}{D}}} \]
      7. unpow247.9%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{{\left(\frac{d}{D}\right)}^{2}}} \]
    8. Simplified47.9%

      \[\leadsto \color{blue}{0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{{\left(\frac{d}{D}\right)}^{2}}} \]
    9. Step-by-step derivation
      1. unpow247.9%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{\frac{d}{D} \cdot \frac{d}{D}}} \]
    10. Applied egg-rr47.9%

      \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{\frac{d}{D} \cdot \frac{d}{D}}} \]

    if 9.9999999999999998e184 < (*.f64 M M)

    1. Initial program 8.3%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 3.5%

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 10.8%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Step-by-step derivation
      1. associate-*r/10.8%

        \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
      2. unpow210.8%

        \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
      3. *-commutative10.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
      4. unpow210.8%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
      5. associate-*r*21.0%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
      6. unpow221.0%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified21.0%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity21.0%

        \[\leadsto \color{blue}{1 \cdot \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
      2. times-frac33.0%

        \[\leadsto 1 \cdot \color{blue}{\left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)}{d}\right)} \]
      3. associate-*l*21.3%

        \[\leadsto 1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot \left(M \cdot M\right)\right)}}{d}\right) \]
    7. Applied egg-rr21.3%

      \[\leadsto \color{blue}{1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}\right)} \]
    8. Step-by-step derivation
      1. *-lft-identity21.3%

        \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}} \]
      2. unpow221.3%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{{D}^{2}} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d} \]
      3. associate-/l*21.3%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{h \cdot \left(M \cdot M\right)}}} \]
      4. unpow221.3%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{h \cdot \left(M \cdot M\right)}} \]
      5. associate-/l*39.7%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    9. Simplified39.7%

      \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
    10. Taylor expanded in D around 0 21.3%

      \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{d}} \]
    11. Step-by-step derivation
      1. associate-/l*21.3%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{{M}^{2} \cdot h}}} \]
      2. associate-/l/19.4%

        \[\leadsto \frac{0.25}{d} \cdot \frac{{D}^{2}}{\color{blue}{\frac{\frac{d}{h}}{{M}^{2}}}} \]
      3. unpow219.4%

        \[\leadsto \frac{0.25}{d} \cdot \frac{{D}^{2}}{\frac{\frac{d}{h}}{\color{blue}{M \cdot M}}} \]
      4. unpow219.4%

        \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{\frac{d}{h}}{M \cdot M}} \]
      5. associate-*r/32.9%

        \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\left(D \cdot \frac{D}{\frac{\frac{d}{h}}{M \cdot M}}\right)} \]
      6. unpow232.9%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \frac{D}{\frac{\frac{d}{h}}{\color{blue}{{M}^{2}}}}\right) \]
      7. associate-/r/32.5%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \color{blue}{\left(\frac{D}{\frac{d}{h}} \cdot {M}^{2}\right)}\right) \]
      8. associate-*l/36.0%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \color{blue}{\frac{D \cdot {M}^{2}}{\frac{d}{h}}}\right) \]
      9. unpow236.0%

        \[\leadsto \frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \color{blue}{\left(M \cdot M\right)}}{\frac{d}{h}}\right) \]
    12. Simplified36.0%

      \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot M \leq 10^{+185}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(D \cdot \frac{D \cdot \left(M \cdot M\right)}{\frac{d}{h}}\right)\\ \end{array} \]

Alternative 10: 41.3% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq -3.4 \cdot 10^{+134}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= M -3.4e+134) 0.0 (* 0.25 (* (* h (* M M)) (* (/ D d) (/ D d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= -3.4e+134) {
		tmp = 0.0;
	} else {
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= (-3.4d+134)) then
        tmp = 0.0d0
    else
        tmp = 0.25d0 * ((h * (m * m)) * ((d / d_1) * (d / d_1)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= -3.4e+134) {
		tmp = 0.0;
	} else {
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if M <= -3.4e+134:
		tmp = 0.0
	else:
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (M <= -3.4e+134)
		tmp = 0.0;
	else
		tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) * Float64(Float64(D / d) * Float64(D / d))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if (M <= -3.4e+134)
		tmp = 0.0;
	else
		tmp = 0.25 * ((h * (M * M)) * ((D / d) * (D / d)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, -3.4e+134], 0.0, N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq -3.4 \cdot 10^{+134}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < -3.40000000000000018e134

    1. Initial program 3.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. times-frac3.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      2. fma-def3.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
      3. associate-/r*3.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      4. difference-of-squares24.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Simplified24.7%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Taylor expanded in c0 around -inf 0.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*0.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
      2. distribute-rgt1-in0.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot c0\right) \]
      3. metadata-eval0.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right) \]
      4. mul0-lft15.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval15.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(0 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
      7. metadata-eval0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right) \]
      8. distribute-lft1-in0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
      9. *-commutative0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)} \]
      10. distribute-lft1-in0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \]
      12. mul0-lft15.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified15.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot 0\right)} \]
    7. Taylor expanded in c0 around 0 22.9%

      \[\leadsto \color{blue}{0} \]

    if -3.40000000000000018e134 < M

    1. Initial program 27.0%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 3.4%

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 33.6%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Step-by-step derivation
      1. associate-*r/33.6%

        \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
      2. unpow233.6%

        \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
      3. *-commutative33.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
      4. unpow233.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
      5. associate-*r*33.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
      6. unpow233.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified33.6%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Taylor expanded in D around 0 33.6%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    7. Step-by-step derivation
      1. associate-/l*32.7%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}} \]
      2. unpow232.7%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{h \cdot {M}^{2}}} \]
      3. unpow232.7%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{h \cdot {M}^{2}}} \]
      4. unpow232.7%

        \[\leadsto 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \color{blue}{\left(M \cdot M\right)}}} \]
    8. Simplified32.7%

      \[\leadsto \color{blue}{0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}} \]
    9. Taylor expanded in D around 0 33.6%

      \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    10. Step-by-step derivation
      1. *-commutative33.6%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{\left(h \cdot {M}^{2}\right) \cdot {D}^{2}}}{{d}^{2}} \]
      2. unpow233.6%

        \[\leadsto 0.25 \cdot \frac{\left(h \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot {D}^{2}}{{d}^{2}} \]
      3. associate-*r/32.6%

        \[\leadsto 0.25 \cdot \color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{{D}^{2}}{{d}^{2}}\right)} \]
      4. unpow232.6%

        \[\leadsto 0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{\color{blue}{D \cdot D}}{{d}^{2}}\right) \]
      5. unpow232.6%

        \[\leadsto 0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{D \cdot D}{\color{blue}{d \cdot d}}\right) \]
      6. times-frac44.0%

        \[\leadsto 0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)}\right) \]
    11. Simplified44.0%

      \[\leadsto 0.25 \cdot \color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq -3.4 \cdot 10^{+134}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \end{array} \]

Alternative 11: 41.2% accurate, 8.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \leq -6.4 \cdot 10^{+134}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= M -6.4e+134) 0.0 (* 0.25 (/ (* h (* M M)) (* (/ d D) (/ d D))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= -6.4e+134) {
		tmp = 0.0;
	} else {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	}
	return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    real(8) :: tmp
    if (m <= (-6.4d+134)) then
        tmp = 0.0d0
    else
        tmp = 0.25d0 * ((h * (m * m)) / ((d_1 / d) * (d_1 / d)))
    end if
    code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if (M <= -6.4e+134) {
		tmp = 0.0;
	} else {
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if M <= -6.4e+134:
		tmp = 0.0
	else:
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)))
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (M <= -6.4e+134)
		tmp = 0.0;
	else
		tmp = Float64(0.25 * Float64(Float64(h * Float64(M * M)) / Float64(Float64(d / D) * Float64(d / D))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if (M <= -6.4e+134)
		tmp = 0.0;
	else
		tmp = 0.25 * ((h * (M * M)) / ((d / D) * (d / D)));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[M, -6.4e+134], 0.0, N[(0.25 * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;M \leq -6.4 \cdot 10^{+134}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if M < -6.4000000000000001e134

    1. Initial program 3.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. times-frac3.4%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      2. fma-def3.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
      3. associate-/r*3.5%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
      4. difference-of-squares24.7%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Simplified24.7%

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
    4. Taylor expanded in c0 around -inf 0.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*0.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
      2. distribute-rgt1-in0.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot c0\right) \]
      3. metadata-eval0.2%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right) \]
      4. mul0-lft15.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
      5. metadata-eval15.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
      6. mul0-lft0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(0 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
      7. metadata-eval0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right) \]
      8. distribute-lft1-in0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
      9. *-commutative0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)} \]
      10. distribute-lft1-in0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
      11. metadata-eval0.0%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \]
      12. mul0-lft15.9%

        \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
    6. Simplified15.9%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot 0\right)} \]
    7. Taylor expanded in c0 around 0 22.9%

      \[\leadsto \color{blue}{0} \]

    if -6.4000000000000001e134 < M

    1. Initial program 27.0%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 3.4%

      \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    3. Taylor expanded in c0 around 0 33.6%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Step-by-step derivation
      1. associate-*r/33.6%

        \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
      2. unpow233.6%

        \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
      3. *-commutative33.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
      4. unpow233.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
      5. associate-*r*33.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
      6. unpow233.6%

        \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
    5. Simplified33.6%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    6. Taylor expanded in D around 0 33.6%

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative33.6%

        \[\leadsto 0.25 \cdot \frac{\color{blue}{\left(h \cdot {M}^{2}\right) \cdot {D}^{2}}}{{d}^{2}} \]
      2. unpow233.6%

        \[\leadsto 0.25 \cdot \frac{\left(h \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot {D}^{2}}{{d}^{2}} \]
      3. associate-/l*32.7%

        \[\leadsto 0.25 \cdot \color{blue}{\frac{h \cdot \left(M \cdot M\right)}{\frac{{d}^{2}}{{D}^{2}}}} \]
      4. unpow232.7%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{\color{blue}{d \cdot d}}{{D}^{2}}} \]
      5. unpow232.7%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d \cdot d}{\color{blue}{D \cdot D}}} \]
      6. times-frac44.0%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{\frac{d}{D} \cdot \frac{d}{D}}} \]
      7. unpow244.0%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{{\left(\frac{d}{D}\right)}^{2}}} \]
    8. Simplified44.0%

      \[\leadsto \color{blue}{0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{{\left(\frac{d}{D}\right)}^{2}}} \]
    9. Step-by-step derivation
      1. unpow244.0%

        \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{\frac{d}{D} \cdot \frac{d}{D}}} \]
    10. Applied egg-rr44.0%

      \[\leadsto 0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\color{blue}{\frac{d}{D} \cdot \frac{d}{D}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq -6.4 \cdot 10^{+134}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \end{array} \]

Alternative 12: 48.2% accurate, 10.1× speedup?

\[\begin{array}{l} \\ \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (* (/ 0.25 d) (/ D (/ d (* D (* h (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (0.25 / d) * (D / (d / (D * (h * (M * M)))));
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = (0.25d0 / d_1) * (d / (d_1 / (d * (h * (m * m)))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (0.25 / d) * (D / (d / (D * (h * (M * M)))));
}
def code(c0, w, h, D, d, M):
	return (0.25 / d) * (D / (d / (D * (h * (M * M)))))
function code(c0, w, h, D, d, M)
	return Float64(Float64(0.25 / d) * Float64(D / Float64(d / Float64(D * Float64(h * Float64(M * M))))))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (0.25 / d) * (D / (d / (D * (h * (M * M)))));
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(0.25 / d), $MachinePrecision] * N[(D / N[(d / N[(D * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}
\end{array}
Derivation
  1. Initial program 24.3%

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Taylor expanded in c0 around -inf 3.5%

    \[\leadsto \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)} + \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
  3. Taylor expanded in c0 around 0 30.2%

    \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
  4. Step-by-step derivation
    1. associate-*r/30.2%

      \[\leadsto \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}}} \]
    2. unpow230.2%

      \[\leadsto \frac{0.25 \cdot \left(\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2}} \]
    3. *-commutative30.2%

      \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right)}{{d}^{2}} \]
    4. unpow230.2%

      \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)\right)}{{d}^{2}} \]
    5. associate-*r*32.7%

      \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \color{blue}{\left(\left(h \cdot M\right) \cdot M\right)}\right)}{{d}^{2}} \]
    6. unpow232.7%

      \[\leadsto \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{\color{blue}{d \cdot d}} \]
  5. Simplified32.7%

    \[\leadsto \color{blue}{\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
  6. Step-by-step derivation
    1. *-un-lft-identity32.7%

      \[\leadsto \color{blue}{1 \cdot \frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)\right)}{d \cdot d}} \]
    2. times-frac39.1%

      \[\leadsto 1 \cdot \color{blue}{\left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(h \cdot M\right) \cdot M\right)}{d}\right)} \]
    3. associate-*l*36.2%

      \[\leadsto 1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot \left(M \cdot M\right)\right)}}{d}\right) \]
  7. Applied egg-rr36.2%

    \[\leadsto \color{blue}{1 \cdot \left(\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}\right)} \]
  8. Step-by-step derivation
    1. *-lft-identity36.2%

      \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d}} \]
    2. unpow236.2%

      \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{{D}^{2}} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d} \]
    3. associate-/l*36.3%

      \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{{D}^{2}}{\frac{d}{h \cdot \left(M \cdot M\right)}}} \]
    4. unpow236.3%

      \[\leadsto \frac{0.25}{d} \cdot \frac{\color{blue}{D \cdot D}}{\frac{d}{h \cdot \left(M \cdot M\right)}} \]
    5. associate-/l*45.2%

      \[\leadsto \frac{0.25}{d} \cdot \color{blue}{\frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
  9. Simplified45.2%

    \[\leadsto \color{blue}{\frac{0.25}{d} \cdot \frac{D}{\frac{\frac{d}{h \cdot \left(M \cdot M\right)}}{D}}} \]
  10. Taylor expanded in d around 0 46.6%

    \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left({M}^{2} \cdot h\right)}}} \]
  11. Step-by-step derivation
    1. *-commutative46.6%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}} \]
    2. unpow246.6%

      \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}} \]
  12. Simplified46.6%

    \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\color{blue}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}}} \]
  13. Final simplification46.6%

    \[\leadsto \frac{0.25}{d} \cdot \frac{D}{\frac{d}{D \cdot \left(h \cdot \left(M \cdot M\right)\right)}} \]

Alternative 13: 33.2% accurate, 151.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (c0 w h D d M) :precision binary64 0.0)
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.0;
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return 0.0;
}
def code(c0, w, h, D, d, M):
	return 0.0
function code(c0, w, h, D, d, M)
	return 0.0
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.0;
end
code[c0_, w_, h_, D_, d_, M_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 24.3%

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Step-by-step derivation
    1. times-frac23.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. fma-def22.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)} \]
    3. associate-/r*22.5%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \color{blue}{\frac{\frac{d \cdot d}{D}}{D}}, \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    4. difference-of-squares28.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
  3. Simplified31.2%

    \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{\frac{d \cdot d}{D}}{D}, M\right) \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{\frac{d \cdot d}{D}}{D} - M\right)}\right)} \]
  4. Taylor expanded in c0 around -inf 3.4%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(-1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
  5. Step-by-step derivation
    1. associate-*r*3.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(\left(-1 \cdot \left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right)} \]
    2. distribute-rgt1-in3.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot c0\right) \]
    3. metadata-eval3.4%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot c0\right) \]
    4. mul0-lft26.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(-1 \cdot \color{blue}{0}\right) \cdot c0\right) \]
    5. metadata-eval26.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{0} \cdot c0\right) \]
    6. mul0-lft4.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(0 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
    7. metadata-eval4.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\left(\color{blue}{\left(-1 + 1\right)} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right) \]
    8. distribute-lft1-in4.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)} \cdot c0\right) \]
    9. *-commutative4.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot \left(-1 \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)} + \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)} \]
    10. distribute-lft1-in4.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \]
    11. metadata-eval4.2%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2} \cdot M}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \]
    12. mul0-lft26.6%

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(c0 \cdot \color{blue}{0}\right) \]
  6. Simplified26.6%

    \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(c0 \cdot 0\right)} \]
  7. Taylor expanded in c0 around 0 30.9%

    \[\leadsto \color{blue}{0} \]
  8. Final simplification30.9%

    \[\leadsto 0 \]

Reproduce

?
herbie shell --seed 2023187 
(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))))))