Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.4% → 44.2%
Time: 24.4s
Alternatives: 15
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 15 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.4% 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: 44.2% accurate, 3.1× speedup?

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

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

\mathbf{elif}\;D \cdot D \leq 10^{-204}:\\
\;\;\;\;0\\

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

\mathbf{elif}\;D \cdot D \leq 10^{-7}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 D D) < 1.0000000000000001e-293 or 9.9999999999999995e-8 < (*.f64 D D)

    1. Initial program 24.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6431.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified31.4%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr56.2%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6456.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr56.7%

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

    if 1.0000000000000001e-293 < (*.f64 D D) < 1e-204 or 5.0000000000000001e-60 < (*.f64 D D) < 9.9999999999999995e-8

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval62.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified62.0%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div062.0%

        \[\leadsto 0 \]
    8. Applied egg-rr62.0%

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

    if 1e-204 < (*.f64 D D) < 5.0000000000000001e-60

    1. Initial program 26.6%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6434.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified34.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{2}{D \cdot D} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{\frac{c0 \cdot \left(d \cdot d\right)}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{2}{D \cdot D}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{1}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\frac{D \cdot D}{2}\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(D \cdot D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{\frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{1}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \left(\frac{h}{\frac{d \cdot d}{w}}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d \cdot d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{1}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      18. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \left(\frac{w}{d}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      20. /-lowering-/.f6444.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(w, d\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr44.4%

      \[\leadsto \frac{\color{blue}{\frac{c0}{\frac{D \cdot D}{2}} \cdot \frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \color{blue}{\frac{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}{w}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \frac{1}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{c0}{\frac{D \cdot D}{2}}}{2}}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{\frac{c0}{D \cdot D} \cdot 2}{2}}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot \frac{2}{2}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot 1}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      7. *-rgt-identityN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{c0}{D \cdot D}\right), \color{blue}{\left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \left(D \cdot D\right)\right), \left(\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \color{blue}{\left(\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}\right)}\right)\right) \]
      12. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0}{h} \cdot \color{blue}{\frac{d}{\frac{w}{d}}}\right)\right)\right) \]
      13. frac-timesN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0 \cdot d}{\color{blue}{h \cdot \frac{w}{d}}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(h \cdot \frac{w}{d}\right)}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\color{blue}{h} \cdot \frac{w}{d}\right)\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(h \cdot \frac{1}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      17. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\frac{h}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \color{blue}{\left(\frac{d}{w}\right)}\right)\right)\right)\right) \]
      19. /-lowering-/.f6457.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \color{blue}{w}\right)\right)\right)\right)\right) \]
    10. Applied egg-rr57.9%

      \[\leadsto \color{blue}{\frac{\frac{c0}{D \cdot D}}{\frac{w}{\frac{c0 \cdot d}{\frac{h}{\frac{d}{w}}}}}} \]
    11. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \color{blue}{\frac{h}{\frac{d}{w}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \left(\frac{h}{d} \cdot \color{blue}{w}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right) \cdot \color{blue}{w}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right), \color{blue}{w}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d}\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(c0 \cdot d\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(d \cdot c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      9. /-lowering-/.f6458.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \mathsf{/.f64}\left(h, d\right)\right), w\right)\right) \]
    12. Applied egg-rr58.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-293}:\\ \;\;\;\;\frac{\frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(c0 \cdot 2\right)}{2 \cdot w}\\ \mathbf{elif}\;D \cdot D \leq 10^{-204}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \cdot D \leq 5 \cdot 10^{-60}:\\ \;\;\;\;\frac{\frac{c0}{D \cdot D}}{w \cdot \left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right)}\\ \mathbf{elif}\;D \cdot D \leq 10^{-7}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(c0 \cdot 2\right)}{2 \cdot w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 55.5% accurate, 0.8× 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(\frac{d}{\left(w \cdot h\right) \cdot D} \cdot \left(\frac{c0 \cdot d}{D} + d \cdot \frac{c0}{D}\right)\right)}{2 \cdot w}\\ \mathbf{else}:\\ \;\;\;\;0\\ \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 (* (/ d (* (* w h) D)) (+ (/ (* c0 d) D) (* d (/ c0 D)))))
      (* 2.0 w))
     0.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 * ((d / ((w * h) * D)) * (((c0 * d) / D) + (d * (c0 / D))))) / (2.0 * w);
	} else {
		tmp = 0.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 * ((d / ((w * h) * D)) * (((c0 * d) / D) + (d * (c0 / D))))) / (2.0 * w);
	} else {
		tmp = 0.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 * ((d / ((w * h) * D)) * (((c0 * d) / D) + (d * (c0 / D))))) / (2.0 * w)
	else:
		tmp = 0.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(Float64(d / Float64(Float64(w * h) * D)) * Float64(Float64(Float64(c0 * d) / D) + Float64(d * Float64(c0 / D))))) / Float64(2.0 * w));
	else
		tmp = 0.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 * ((d / ((w * h) * D)) * (((c0 * d) / D) + (d * (c0 / D))))) / (2.0 * w);
	else
		tmp = 0.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[(N[(d / N[(N[(w * h), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * d), $MachinePrecision] / D), $MachinePrecision] + N[(d * N[(c0 / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], 0.0]]
\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(\frac{d}{\left(w \cdot h\right) \cdot D} \cdot \left(\frac{c0 \cdot d}{D} + d \cdot \frac{c0}{D}\right)\right)}{2 \cdot w}\\

\mathbf{else}:\\
\;\;\;\;0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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 76.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. Simplified71.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6472.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified72.9%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr85.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), D\right), \left(\frac{d \cdot c0}{D}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), D\right), \left(d \cdot \frac{c0}{D}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), D\right), \mathsf{*.f64}\left(d, \left(\frac{c0}{D}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. /-lowering-/.f6485.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(c0, D\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr85.0%

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

    if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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. Simplified0.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval44.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified44.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div044.6%

        \[\leadsto 0 \]
    8. Applied egg-rr44.6%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification56.9%

    \[\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(\frac{d}{\left(w \cdot h\right) \cdot D} \cdot \left(\frac{c0 \cdot d}{D} + d \cdot \frac{c0}{D}\right)\right)}{2 \cdot w}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 44.3% accurate, 3.1× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\frac{2}{\frac{D}{c0 \cdot d}}}{\frac{w \cdot h}{\frac{d}{D}}}\\
\mathbf{if}\;D \cdot D \leq 10^{-293}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{2 \cdot w}\\

\mathbf{elif}\;D \cdot D \leq 10^{-204}:\\
\;\;\;\;0\\

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

\mathbf{elif}\;D \cdot D \leq 10^{-7}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot t\_0}{2 \cdot w}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 D D) < 1.0000000000000001e-293

    1. Initial program 23.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6431.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified31.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr50.3%

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

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

        \[\leadsto \frac{\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)}{2 \cdot w} \cdot \color{blue}{c0} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)}{2 \cdot w}\right), \color{blue}{c0}\right) \]
    10. Applied egg-rr51.1%

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

    if 1.0000000000000001e-293 < (*.f64 D D) < 1e-204 or 5.0000000000000001e-60 < (*.f64 D D) < 9.9999999999999995e-8

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval62.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified62.0%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div062.0%

        \[\leadsto 0 \]
    8. Applied egg-rr62.0%

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

    if 1e-204 < (*.f64 D D) < 5.0000000000000001e-60

    1. Initial program 26.6%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6434.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified34.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{2}{D \cdot D} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{\frac{c0 \cdot \left(d \cdot d\right)}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{2}{D \cdot D}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{1}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\frac{D \cdot D}{2}\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(D \cdot D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{\frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{1}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \left(\frac{h}{\frac{d \cdot d}{w}}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d \cdot d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{1}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      18. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \left(\frac{w}{d}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      20. /-lowering-/.f6444.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(w, d\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr44.4%

      \[\leadsto \frac{\color{blue}{\frac{c0}{\frac{D \cdot D}{2}} \cdot \frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \color{blue}{\frac{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}{w}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \frac{1}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{c0}{\frac{D \cdot D}{2}}}{2}}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{\frac{c0}{D \cdot D} \cdot 2}{2}}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot \frac{2}{2}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot 1}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      7. *-rgt-identityN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{c0}{D \cdot D}\right), \color{blue}{\left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \left(D \cdot D\right)\right), \left(\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \color{blue}{\left(\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}\right)}\right)\right) \]
      12. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0}{h} \cdot \color{blue}{\frac{d}{\frac{w}{d}}}\right)\right)\right) \]
      13. frac-timesN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0 \cdot d}{\color{blue}{h \cdot \frac{w}{d}}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(h \cdot \frac{w}{d}\right)}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\color{blue}{h} \cdot \frac{w}{d}\right)\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(h \cdot \frac{1}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      17. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\frac{h}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \color{blue}{\left(\frac{d}{w}\right)}\right)\right)\right)\right) \]
      19. /-lowering-/.f6457.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \color{blue}{w}\right)\right)\right)\right)\right) \]
    10. Applied egg-rr57.9%

      \[\leadsto \color{blue}{\frac{\frac{c0}{D \cdot D}}{\frac{w}{\frac{c0 \cdot d}{\frac{h}{\frac{d}{w}}}}}} \]
    11. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \color{blue}{\frac{h}{\frac{d}{w}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \left(\frac{h}{d} \cdot \color{blue}{w}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right) \cdot \color{blue}{w}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right), \color{blue}{w}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d}\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(c0 \cdot d\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(d \cdot c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      9. /-lowering-/.f6458.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \mathsf{/.f64}\left(h, d\right)\right), w\right)\right) \]
    12. Applied egg-rr58.0%

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

    if 9.9999999999999995e-8 < (*.f64 D D)

    1. Initial program 24.9%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6432.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified32.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr64.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right), c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
    10. Applied egg-rr64.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-293}:\\ \;\;\;\;c0 \cdot \frac{\frac{\frac{2}{\frac{D}{c0 \cdot d}}}{\frac{w \cdot h}{\frac{d}{D}}}}{2 \cdot w}\\ \mathbf{elif}\;D \cdot D \leq 10^{-204}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \cdot D \leq 5 \cdot 10^{-60}:\\ \;\;\;\;\frac{\frac{c0}{D \cdot D}}{w \cdot \left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right)}\\ \mathbf{elif}\;D \cdot D \leq 10^{-7}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \frac{\frac{2}{\frac{D}{c0 \cdot d}}}{\frac{w \cdot h}{\frac{d}{D}}}}{2 \cdot w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 43.8% accurate, 3.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 10^{-293}:\\
\;\;\;\;c0 \cdot \frac{\frac{\frac{2}{\frac{D}{c0 \cdot d}}}{\frac{w \cdot h}{\frac{d}{D}}}}{2 \cdot w}\\

\mathbf{elif}\;D \cdot D \leq 10^{-204}:\\
\;\;\;\;0\\

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

\mathbf{elif}\;D \cdot D \leq 10^{-7}:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 D D) < 1.0000000000000001e-293

    1. Initial program 23.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6431.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified31.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr50.3%

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

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

        \[\leadsto \frac{\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)}{2 \cdot w} \cdot \color{blue}{c0} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)}{2 \cdot w}\right), \color{blue}{c0}\right) \]
    10. Applied egg-rr51.1%

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

    if 1.0000000000000001e-293 < (*.f64 D D) < 1e-204 or 5.0000000000000001e-60 < (*.f64 D D) < 9.9999999999999995e-8

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval62.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified62.0%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div062.0%

        \[\leadsto 0 \]
    8. Applied egg-rr62.0%

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

    if 1e-204 < (*.f64 D D) < 5.0000000000000001e-60

    1. Initial program 26.6%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6434.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified34.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{2}{D \cdot D} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{\frac{c0 \cdot \left(d \cdot d\right)}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{2}{D \cdot D}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{1}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\frac{D \cdot D}{2}\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(D \cdot D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{\frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{1}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \left(\frac{h}{\frac{d \cdot d}{w}}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d \cdot d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{1}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      18. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \left(\frac{w}{d}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      20. /-lowering-/.f6444.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(w, d\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr44.4%

      \[\leadsto \frac{\color{blue}{\frac{c0}{\frac{D \cdot D}{2}} \cdot \frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \color{blue}{\frac{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}{w}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \frac{1}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{c0}{\frac{D \cdot D}{2}}}{2}}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{\frac{c0}{D \cdot D} \cdot 2}{2}}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot \frac{2}{2}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot 1}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      7. *-rgt-identityN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{c0}{D \cdot D}\right), \color{blue}{\left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \left(D \cdot D\right)\right), \left(\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \color{blue}{\left(\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}\right)}\right)\right) \]
      12. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0}{h} \cdot \color{blue}{\frac{d}{\frac{w}{d}}}\right)\right)\right) \]
      13. frac-timesN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0 \cdot d}{\color{blue}{h \cdot \frac{w}{d}}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(h \cdot \frac{w}{d}\right)}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\color{blue}{h} \cdot \frac{w}{d}\right)\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(h \cdot \frac{1}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      17. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\frac{h}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \color{blue}{\left(\frac{d}{w}\right)}\right)\right)\right)\right) \]
      19. /-lowering-/.f6457.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \color{blue}{w}\right)\right)\right)\right)\right) \]
    10. Applied egg-rr57.9%

      \[\leadsto \color{blue}{\frac{\frac{c0}{D \cdot D}}{\frac{w}{\frac{c0 \cdot d}{\frac{h}{\frac{d}{w}}}}}} \]
    11. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \color{blue}{\frac{h}{\frac{d}{w}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \left(\frac{h}{d} \cdot \color{blue}{w}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right) \cdot \color{blue}{w}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right), \color{blue}{w}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d}\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(c0 \cdot d\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(d \cdot c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      9. /-lowering-/.f6458.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \mathsf{/.f64}\left(h, d\right)\right), w\right)\right) \]
    12. Applied egg-rr58.0%

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

    if 9.9999999999999995e-8 < (*.f64 D D)

    1. Initial program 24.9%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6432.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified32.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr64.5%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6464.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr64.7%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{D} \cdot \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{D}\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{D \cdot \left(w \cdot h\right)}\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D}\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(D \cdot \left(w \cdot h\right)\right)\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \left(w \cdot h\right)\right)\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(c0 \cdot d\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(d \cdot c0\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6464.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(d, c0\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    12. Applied egg-rr64.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-293}:\\ \;\;\;\;c0 \cdot \frac{\frac{\frac{2}{\frac{D}{c0 \cdot d}}}{\frac{w \cdot h}{\frac{d}{D}}}}{2 \cdot w}\\ \mathbf{elif}\;D \cdot D \leq 10^{-204}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \cdot D \leq 5 \cdot 10^{-60}:\\ \;\;\;\;\frac{\frac{c0}{D \cdot D}}{w \cdot \left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right)}\\ \mathbf{elif}\;D \cdot D \leq 10^{-7}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(c0 \cdot 2\right) \cdot \left(\left(c0 \cdot d\right) \cdot \frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D}\right)}{2 \cdot w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 44.3% accurate, 3.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 10^{-293}:\\
\;\;\;\;c0 \cdot \frac{\frac{\frac{2}{\frac{D}{c0 \cdot d}}}{\frac{w \cdot h}{\frac{d}{D}}}}{2 \cdot w}\\

\mathbf{elif}\;D \cdot D \leq 10^{-204}:\\
\;\;\;\;0\\

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

\mathbf{elif}\;D \cdot D \leq 1:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 D D) < 1.0000000000000001e-293

    1. Initial program 23.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6431.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified31.0%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr50.3%

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

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

        \[\leadsto \frac{\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)}{2 \cdot w} \cdot \color{blue}{c0} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)}{2 \cdot w}\right), \color{blue}{c0}\right) \]
    10. Applied egg-rr51.1%

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

    if 1.0000000000000001e-293 < (*.f64 D D) < 1e-204 or 5.0000000000000001e-60 < (*.f64 D D) < 1

    1. Initial program 14.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval60.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified60.2%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div060.2%

        \[\leadsto 0 \]
    8. Applied egg-rr60.2%

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

    if 1e-204 < (*.f64 D D) < 5.0000000000000001e-60

    1. Initial program 26.6%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6434.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified34.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{2}{D \cdot D} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{\frac{c0 \cdot \left(d \cdot d\right)}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{2}{D \cdot D}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{1}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\frac{D \cdot D}{2}\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(D \cdot D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{\frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{1}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \left(\frac{h}{\frac{d \cdot d}{w}}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d \cdot d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{1}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      18. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \left(\frac{w}{d}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      20. /-lowering-/.f6444.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(w, d\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr44.4%

      \[\leadsto \frac{\color{blue}{\frac{c0}{\frac{D \cdot D}{2}} \cdot \frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \color{blue}{\frac{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}{w}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \frac{1}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{c0}{\frac{D \cdot D}{2}}}{2}}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{\frac{c0}{D \cdot D} \cdot 2}{2}}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot \frac{2}{2}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot 1}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      7. *-rgt-identityN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{c0}{D \cdot D}\right), \color{blue}{\left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \left(D \cdot D\right)\right), \left(\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \color{blue}{\left(\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}\right)}\right)\right) \]
      12. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0}{h} \cdot \color{blue}{\frac{d}{\frac{w}{d}}}\right)\right)\right) \]
      13. frac-timesN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0 \cdot d}{\color{blue}{h \cdot \frac{w}{d}}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(h \cdot \frac{w}{d}\right)}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\color{blue}{h} \cdot \frac{w}{d}\right)\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(h \cdot \frac{1}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      17. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\frac{h}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \color{blue}{\left(\frac{d}{w}\right)}\right)\right)\right)\right) \]
      19. /-lowering-/.f6457.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \color{blue}{w}\right)\right)\right)\right)\right) \]
    10. Applied egg-rr57.9%

      \[\leadsto \color{blue}{\frac{\frac{c0}{D \cdot D}}{\frac{w}{\frac{c0 \cdot d}{\frac{h}{\frac{d}{w}}}}}} \]
    11. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \color{blue}{\frac{h}{\frac{d}{w}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \left(\frac{h}{d} \cdot \color{blue}{w}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right) \cdot \color{blue}{w}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right), \color{blue}{w}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d}\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(c0 \cdot d\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(d \cdot c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      9. /-lowering-/.f6458.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \mathsf{/.f64}\left(h, d\right)\right), w\right)\right) \]
    12. Applied egg-rr58.0%

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

    if 1 < (*.f64 D D)

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6432.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified32.8%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr64.9%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr65.1%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right) \]
      3. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right) \]
      4. *-lft-identityN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \frac{c0}{\color{blue}{w}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}}\right), \color{blue}{\left(\frac{c0}{w}\right)}\right) \]
    12. Applied egg-rr65.0%

      \[\leadsto \color{blue}{\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification57.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-293}:\\ \;\;\;\;c0 \cdot \frac{\frac{\frac{2}{\frac{D}{c0 \cdot d}}}{\frac{w \cdot h}{\frac{d}{D}}}}{2 \cdot w}\\ \mathbf{elif}\;D \cdot D \leq 10^{-204}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \cdot D \leq 5 \cdot 10^{-60}:\\ \;\;\;\;\frac{\frac{c0}{D \cdot D}}{w \cdot \left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right)}\\ \mathbf{elif}\;D \cdot D \leq 1:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 46.7% accurate, 4.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;D \leq 1.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{1}{D} \cdot \left(\frac{d}{w} \cdot \frac{\frac{\frac{c0 \cdot \left(c0 \cdot d\right)}{w}}{h}}{D}\right)\\

\mathbf{elif}\;D \leq 2 \cdot 10^{-102}:\\
\;\;\;\;0\\

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

\mathbf{elif}\;D \leq 0.78:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if D < 1.1999999999999999e-143

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6420.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified20.7%

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

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

        \[\leadsto \frac{\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}}{\color{blue}{D \cdot D}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\right), \color{blue}{\left(D \cdot D\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(\color{blue}{D} \cdot D\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(\left(w \cdot w\right) \cdot h\right)\right), \left(D \cdot D\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(w \cdot \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(D \cdot D\right)\right) \]
      13. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right) \]
    7. Applied egg-rr31.8%

      \[\leadsto \color{blue}{\frac{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}{D \cdot D}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{D \cdot D}{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}}} \]
      2. inv-powN/A

        \[\leadsto {\left(\frac{D \cdot D}{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}\right)}^{\color{blue}{-1}} \]
      3. associate-/l*N/A

        \[\leadsto {\left(D \cdot \frac{D}{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}\right)}^{-1} \]
      4. unpow-prod-downN/A

        \[\leadsto {D}^{-1} \cdot \color{blue}{{\left(\frac{D}{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}\right)}^{-1}} \]
      5. inv-powN/A

        \[\leadsto \frac{1}{D} \cdot {\color{blue}{\left(\frac{D}{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}\right)}}^{-1} \]
      6. inv-powN/A

        \[\leadsto \frac{1}{D} \cdot \frac{1}{\color{blue}{\frac{D}{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}}} \]
      7. clear-numN/A

        \[\leadsto \frac{1}{D} \cdot \frac{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}{\color{blue}{D}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{D}\right), \color{blue}{\left(\frac{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}{D}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, D\right), \left(\frac{\color{blue}{\frac{d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)}{w \cdot \left(w \cdot h\right)}}}{D}\right)\right) \]
      10. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, D\right), \left(\frac{\frac{d}{w} \cdot \frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, D\right), \left(\frac{d}{w} \cdot \color{blue}{\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, D\right), \mathsf{*.f64}\left(\left(\frac{d}{w}\right), \color{blue}{\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}\right)}\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, D\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, w\right), \left(\frac{\color{blue}{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}}{D}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, D\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, w\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}\right), \color{blue}{D}\right)\right)\right) \]
    9. Applied egg-rr46.6%

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

    if 1.1999999999999999e-143 < D < 1.99999999999999987e-102 or 1.6e-29 < D < 0.78000000000000003

    1. Initial program 24.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. Simplified16.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval55.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified55.4%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div055.4%

        \[\leadsto 0 \]
    8. Applied egg-rr55.4%

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

    if 1.99999999999999987e-102 < D < 1.6e-29

    1. Initial program 39.6%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6444.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified44.7%

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

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{2}{D \cdot D} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{\frac{c0 \cdot \left(d \cdot d\right)}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{2}{D \cdot D}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{1}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\frac{D \cdot D}{2}\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(D \cdot D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{\frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{1}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \left(\frac{h}{\frac{d \cdot d}{w}}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d \cdot d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{1}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      18. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \left(\frac{w}{d}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      20. /-lowering-/.f6449.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(w, d\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr49.0%

      \[\leadsto \frac{\color{blue}{\frac{c0}{\frac{D \cdot D}{2}} \cdot \frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \color{blue}{\frac{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}{w}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \frac{1}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{c0}{\frac{D \cdot D}{2}}}{2}}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{\frac{c0}{D \cdot D} \cdot 2}{2}}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot \frac{2}{2}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot 1}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      7. *-rgt-identityN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{c0}{D \cdot D}\right), \color{blue}{\left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \left(D \cdot D\right)\right), \left(\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \color{blue}{\left(\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}\right)}\right)\right) \]
      12. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0}{h} \cdot \color{blue}{\frac{d}{\frac{w}{d}}}\right)\right)\right) \]
      13. frac-timesN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0 \cdot d}{\color{blue}{h \cdot \frac{w}{d}}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(h \cdot \frac{w}{d}\right)}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\color{blue}{h} \cdot \frac{w}{d}\right)\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(h \cdot \frac{1}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      17. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\frac{h}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \color{blue}{\left(\frac{d}{w}\right)}\right)\right)\right)\right) \]
      19. /-lowering-/.f6457.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \color{blue}{w}\right)\right)\right)\right)\right) \]
    10. Applied egg-rr57.1%

      \[\leadsto \color{blue}{\frac{\frac{c0}{D \cdot D}}{\frac{w}{\frac{c0 \cdot d}{\frac{h}{\frac{d}{w}}}}}} \]
    11. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \color{blue}{\frac{h}{\frac{d}{w}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \left(\frac{h}{d} \cdot \color{blue}{w}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right) \cdot \color{blue}{w}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right), \color{blue}{w}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d}\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(c0 \cdot d\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(d \cdot c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      9. /-lowering-/.f6457.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \mathsf{/.f64}\left(h, d\right)\right), w\right)\right) \]
    12. Applied egg-rr57.3%

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

    if 0.78000000000000003 < D

    1. Initial program 25.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. Simplified22.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6437.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified37.1%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr62.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6462.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr62.6%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right) \]
      3. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right) \]
      4. *-lft-identityN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \frac{c0}{\color{blue}{w}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}}\right), \color{blue}{\left(\frac{c0}{w}\right)}\right) \]
    12. Applied egg-rr64.9%

      \[\leadsto \color{blue}{\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 1.2 \cdot 10^{-143}:\\ \;\;\;\;\frac{1}{D} \cdot \left(\frac{d}{w} \cdot \frac{\frac{\frac{c0 \cdot \left(c0 \cdot d\right)}{w}}{h}}{D}\right)\\ \mathbf{elif}\;D \leq 2 \cdot 10^{-102}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq 1.6 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{c0}{D \cdot D}}{w \cdot \left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right)}\\ \mathbf{elif}\;D \leq 0.78:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 45.4% accurate, 4.1× speedup?

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

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

\mathbf{elif}\;D \leq 8.2 \cdot 10^{-103}:\\
\;\;\;\;0\\

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

\mathbf{elif}\;D \leq 1.3:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if D < 1.4500000000000001e-144

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6420.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified20.7%

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

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

        \[\leadsto \frac{\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}}{\color{blue}{D \cdot D}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\right), \color{blue}{\left(D \cdot D\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(\color{blue}{D} \cdot D\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(\left(w \cdot w\right) \cdot h\right)\right), \left(D \cdot D\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(w \cdot \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(D \cdot D\right)\right) \]
      13. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right) \]
    7. Applied egg-rr31.8%

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

        \[\leadsto \frac{\frac{d}{w} \cdot \frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{\color{blue}{D} \cdot D} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{d}{w}}{D} \cdot \color{blue}{\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{w}}{D}\right), \color{blue}{\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{w}\right), D\right), \left(\frac{\color{blue}{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}}{D}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \left(\frac{\frac{\color{blue}{d \cdot \left(c0 \cdot c0\right)}}{w \cdot h}}{D}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}\right), \color{blue}{D}\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w}}{h}\right), D\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w}\right), h\right), D\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(c0 \cdot c0\right)\right), w\right), h\right), D\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(c0 \cdot c0\right) \cdot d\right), w\right), h\right), D\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c0 \cdot \left(c0 \cdot d\right)\right), w\right), h\right), D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot d\right)\right), w\right), h\right), D\right)\right) \]
      13. *-lowering-*.f6447.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), w\right), h\right), D\right)\right) \]
    9. Applied egg-rr47.0%

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

    if 1.4500000000000001e-144 < D < 8.19999999999999992e-103 or 1.7999999999999999e-28 < D < 1.30000000000000004

    1. Initial program 24.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. Simplified16.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval55.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified55.4%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div055.4%

        \[\leadsto 0 \]
    8. Applied egg-rr55.4%

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

    if 8.19999999999999992e-103 < D < 1.7999999999999999e-28

    1. Initial program 39.6%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6444.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified44.7%

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

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{2}{D \cdot D} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{\frac{c0 \cdot \left(d \cdot d\right)}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c0 \cdot \frac{2}{D \cdot D}\right) \cdot \frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{2}{D \cdot D}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c0 \cdot \frac{1}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0}{\frac{D \cdot D}{2}}\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\frac{D \cdot D}{2}\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(D \cdot D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0 \cdot \frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{\frac{d \cdot d}{w}}{h}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(c0 \cdot \frac{1}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \left(\frac{c0}{\frac{h}{\frac{d \cdot d}{w}}}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \left(\frac{h}{\frac{d \cdot d}{w}}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d \cdot d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{d}{w}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(d \cdot \frac{1}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      18. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \left(\frac{d}{\frac{w}{d}}\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      19. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \left(\frac{w}{d}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      20. /-lowering-/.f6449.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), 2\right)\right), \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(w, d\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr49.0%

      \[\leadsto \frac{\color{blue}{\frac{c0}{\frac{D \cdot D}{2}} \cdot \frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \color{blue}{\frac{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}{w}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{c0}{\frac{D \cdot D}{2}}}{2} \cdot \frac{1}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{\frac{\frac{c0}{\frac{D \cdot D}{2}}}{2}}{\color{blue}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}}} \]
      4. associate-/r/N/A

        \[\leadsto \frac{\frac{\frac{c0}{D \cdot D} \cdot 2}{2}}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      5. associate-/l*N/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot \frac{2}{2}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      6. metadata-evalN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D} \cdot 1}{\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      7. *-rgt-identityN/A

        \[\leadsto \frac{\frac{c0}{D \cdot D}}{\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{c0}{D \cdot D}\right), \color{blue}{\left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \left(D \cdot D\right)\right), \left(\frac{\color{blue}{w}}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}}\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \color{blue}{\left(\frac{c0}{\frac{h}{\frac{d}{\frac{w}{d}}}}\right)}\right)\right) \]
      12. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0}{h} \cdot \color{blue}{\frac{d}{\frac{w}{d}}}\right)\right)\right) \]
      13. frac-timesN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \left(\frac{c0 \cdot d}{\color{blue}{h \cdot \frac{w}{d}}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(h \cdot \frac{w}{d}\right)}\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\color{blue}{h} \cdot \frac{w}{d}\right)\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(h \cdot \frac{1}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      17. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \left(\frac{h}{\color{blue}{\frac{d}{w}}}\right)\right)\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \color{blue}{\left(\frac{d}{w}\right)}\right)\right)\right)\right) \]
      19. /-lowering-/.f6457.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{/.f64}\left(w, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, d\right), \mathsf{/.f64}\left(h, \mathsf{/.f64}\left(d, \color{blue}{w}\right)\right)\right)\right)\right) \]
    10. Applied egg-rr57.1%

      \[\leadsto \color{blue}{\frac{\frac{c0}{D \cdot D}}{\frac{w}{\frac{c0 \cdot d}{\frac{h}{\frac{d}{w}}}}}} \]
    11. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \color{blue}{\frac{h}{\frac{d}{w}}}\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\frac{w}{c0 \cdot d} \cdot \left(\frac{h}{d} \cdot \color{blue}{w}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right) \cdot \color{blue}{w}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right), \color{blue}{w}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{w}{c0 \cdot d}\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(c0 \cdot d\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \left(d \cdot c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \left(\frac{h}{d}\right)\right), w\right)\right) \]
      9. /-lowering-/.f6457.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w, \mathsf{*.f64}\left(d, c0\right)\right), \mathsf{/.f64}\left(h, d\right)\right), w\right)\right) \]
    12. Applied egg-rr57.3%

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

    if 1.30000000000000004 < D

    1. Initial program 25.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. Simplified22.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6437.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified37.1%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr62.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6462.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr62.6%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right) \]
      3. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right) \]
      4. *-lft-identityN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \frac{c0}{\color{blue}{w}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}}\right), \color{blue}{\left(\frac{c0}{w}\right)}\right) \]
    12. Applied egg-rr64.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 1.45 \cdot 10^{-144}:\\ \;\;\;\;\frac{\frac{\frac{c0 \cdot \left(c0 \cdot d\right)}{w}}{h}}{D} \cdot \frac{\frac{d}{w}}{D}\\ \mathbf{elif}\;D \leq 8.2 \cdot 10^{-103}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq 1.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{\frac{c0}{D \cdot D}}{w \cdot \left(\frac{w}{c0 \cdot d} \cdot \frac{h}{d}\right)}\\ \mathbf{elif}\;D \leq 1.3:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 42.5% accurate, 4.9× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{d}{D} \cdot \frac{\frac{\frac{\frac{c0 \cdot \left(c0 \cdot d\right)}{w}}{h}}{w}}{D}\\
\mathbf{if}\;D \cdot D \leq 10^{-293}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;D \cdot D \leq 10^{-7}:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 D D) < 1.0000000000000001e-293 or 9.9999999999999995e-8 < (*.f64 D D)

    1. Initial program 24.2%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6426.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified26.1%

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

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

        \[\leadsto \frac{\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}}{\color{blue}{D \cdot D}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\right), \color{blue}{\left(D \cdot D\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(\color{blue}{D} \cdot D\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(\left(w \cdot w\right) \cdot h\right)\right), \left(D \cdot D\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(w \cdot \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(D \cdot D\right)\right) \]
      13. *-lowering-*.f6437.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right) \]
    7. Applied egg-rr37.0%

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

        \[\leadsto \frac{d \cdot \frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}{\color{blue}{D} \cdot D} \]
      2. times-fracN/A

        \[\leadsto \frac{d}{D} \cdot \color{blue}{\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}{D}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{D}\right), \color{blue}{\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}{D}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(\frac{\color{blue}{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}}{D}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}\right), \color{blue}{D}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{\left(w \cdot h\right) \cdot w}\right), D\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{w}\right), D\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}\right), w\right), D\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w}}{h}\right), w\right), D\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w}\right), h\right), w\right), D\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(c0 \cdot c0\right)\right), w\right), h\right), w\right), D\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(c0 \cdot c0\right) \cdot d\right), w\right), h\right), w\right), D\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c0 \cdot \left(c0 \cdot d\right)\right), w\right), h\right), w\right), D\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot d\right)\right), w\right), h\right), w\right), D\right)\right) \]
      15. *-lowering-*.f6452.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), w\right), h\right), w\right), D\right)\right) \]
    9. Applied egg-rr52.5%

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

    if 1.0000000000000001e-293 < (*.f64 D D) < 9.9999999999999995e-8

    1. Initial program 21.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. Simplified19.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval47.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified47.1%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div047.1%

        \[\leadsto 0 \]
    8. Applied egg-rr47.1%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 44.4% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;D \leq 0.88:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if D < 2.5000000000000001e-143

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6420.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified20.7%

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

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

        \[\leadsto \frac{\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}}{\color{blue}{D \cdot D}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\right), \color{blue}{\left(D \cdot D\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(\color{blue}{D} \cdot D\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(\left(w \cdot w\right) \cdot h\right)\right), \left(D \cdot D\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(w \cdot \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(D \cdot D\right)\right) \]
      13. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right) \]
    7. Applied egg-rr31.8%

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

        \[\leadsto \frac{\frac{d}{w} \cdot \frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{\color{blue}{D} \cdot D} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{d}{w}}{D} \cdot \color{blue}{\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{w}}{D}\right), \color{blue}{\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{w}\right), D\right), \left(\frac{\color{blue}{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}}{D}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \left(\frac{\frac{\color{blue}{d \cdot \left(c0 \cdot c0\right)}}{w \cdot h}}{D}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}\right), \color{blue}{D}\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w}}{h}\right), D\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w}\right), h\right), D\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(c0 \cdot c0\right)\right), w\right), h\right), D\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(c0 \cdot c0\right) \cdot d\right), w\right), h\right), D\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c0 \cdot \left(c0 \cdot d\right)\right), w\right), h\right), D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot d\right)\right), w\right), h\right), D\right)\right) \]
      13. *-lowering-*.f6447.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), w\right), h\right), D\right)\right) \]
    9. Applied egg-rr47.0%

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

    if 2.5000000000000001e-143 < D < 0.880000000000000004

    1. Initial program 33.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. Simplified31.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval40.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified40.5%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div040.5%

        \[\leadsto 0 \]
    8. Applied egg-rr40.5%

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

    if 0.880000000000000004 < D

    1. Initial program 25.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. Simplified22.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6437.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified37.1%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr62.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6462.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr62.6%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right) \]
      3. metadata-evalN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right) \]
      4. *-lft-identityN/A

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \frac{c0}{\color{blue}{w}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}}\right), \color{blue}{\left(\frac{c0}{w}\right)}\right) \]
    12. Applied egg-rr64.9%

      \[\leadsto \color{blue}{\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 2.5 \cdot 10^{-143}:\\ \;\;\;\;\frac{\frac{\frac{c0 \cdot \left(c0 \cdot d\right)}{w}}{h}}{D} \cdot \frac{\frac{d}{w}}{D}\\ \mathbf{elif}\;D \leq 0.88:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\frac{D}{c0}}}{\frac{h}{\frac{d}{w \cdot D}}} \cdot \frac{c0}{w}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 44.0% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;D \leq 0.00042:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if D < 6.49999999999999968e-144

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6420.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified20.7%

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

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

        \[\leadsto \frac{\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}}{\color{blue}{D \cdot D}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\right), \color{blue}{\left(D \cdot D\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(\color{blue}{D} \cdot D\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(\left(w \cdot w\right) \cdot h\right)\right), \left(D \cdot D\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(w \cdot \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(D \cdot D\right)\right) \]
      13. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right) \]
    7. Applied egg-rr31.8%

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

        \[\leadsto \frac{\frac{d}{w} \cdot \frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{\color{blue}{D} \cdot D} \]
      2. times-fracN/A

        \[\leadsto \frac{\frac{d}{w}}{D} \cdot \color{blue}{\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{w}}{D}\right), \color{blue}{\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{D}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{w}\right), D\right), \left(\frac{\color{blue}{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}}{D}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \left(\frac{\frac{\color{blue}{d \cdot \left(c0 \cdot c0\right)}}{w \cdot h}}{D}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}\right), \color{blue}{D}\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w}}{h}\right), D\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w}\right), h\right), D\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(c0 \cdot c0\right)\right), w\right), h\right), D\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(c0 \cdot c0\right) \cdot d\right), w\right), h\right), D\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c0 \cdot \left(c0 \cdot d\right)\right), w\right), h\right), D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot d\right)\right), w\right), h\right), D\right)\right) \]
      13. *-lowering-*.f6447.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, w\right), D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), w\right), h\right), D\right)\right) \]
    9. Applied egg-rr47.0%

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

    if 6.49999999999999968e-144 < D < 4.2000000000000002e-4

    1. Initial program 34.6%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval41.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified41.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div041.6%

        \[\leadsto 0 \]
    8. Applied egg-rr41.6%

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

    if 4.2000000000000002e-4 < D

    1. Initial program 25.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. Simplified22.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6436.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified36.4%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr63.5%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6463.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr63.6%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. associate-/r/N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{D}\right), \color{blue}{\left(\left(c0 \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)}\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{D \cdot \left(w \cdot h\right)}\right), \left(\color{blue}{\left(c0 \cdot d\right)} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D}\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(\color{blue}{\left(c0 \cdot d\right)} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(\left(\color{blue}{c0} \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(D \cdot \left(w \cdot h\right)\right)\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \left(w \cdot h\right)\right)\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      12. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      14. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \frac{c0}{\color{blue}{w}}\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(\frac{c0}{w}\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\left(d \cdot c0\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, c0\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      18. /-lowering-/.f6463.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, c0\right), \mathsf{/.f64}\left(c0, \color{blue}{w}\right)\right)\right) \]
    12. Applied egg-rr63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 6.5 \cdot 10^{-144}:\\ \;\;\;\;\frac{\frac{\frac{c0 \cdot \left(c0 \cdot d\right)}{w}}{h}}{D} \cdot \frac{\frac{d}{w}}{D}\\ \mathbf{elif}\;D \leq 0.00042:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D} \cdot \left(\left(c0 \cdot d\right) \cdot \frac{c0}{w}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 43.9% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;D \leq 0.00024:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if D < 3.49999999999999997e-145

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6426.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified26.9%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr48.4%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6447.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr47.8%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. div-invN/A

        \[\leadsto \left(\frac{\frac{d}{D}}{w \cdot h} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right) \cdot \frac{\color{blue}{2 \cdot c0}}{2 \cdot w} \]
      3. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \color{blue}{\left(\frac{c0 \cdot d}{D} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\color{blue}{\frac{c0 \cdot d}{D}} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{\color{blue}{c0 \cdot d}}{D} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{c0 \cdot d}{\color{blue}{D}} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      9. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{c0 \cdot d}{D} \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{c0 \cdot d}{D} \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      11. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{c0 \cdot d}{D} \cdot \frac{c0}{\color{blue}{w}}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D}\right), \color{blue}{\left(\frac{c0}{w}\right)}\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\left(\frac{1}{\frac{D}{c0 \cdot d}}\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\left(\frac{1}{\frac{\frac{D}{c0}}{d}}\right), \left(\frac{c0}{w}\right)\right)\right) \]
      15. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\left(\frac{1}{\frac{1}{\frac{d}{\frac{D}{c0}}}}\right), \left(\frac{c0}{w}\right)\right)\right) \]
      16. remove-double-divN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\left(\frac{d}{\frac{D}{c0}}\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \left(\frac{D}{c0}\right)\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      18. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{/.f64}\left(D, c0\right)\right), \left(\frac{c0}{w}\right)\right)\right) \]
      19. /-lowering-/.f6444.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, \mathsf{/.f64}\left(D, c0\right)\right), \mathsf{/.f64}\left(c0, \color{blue}{w}\right)\right)\right) \]
    12. Applied egg-rr44.8%

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

    if 3.49999999999999997e-145 < D < 2.40000000000000006e-4

    1. Initial program 34.6%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval41.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified41.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div041.6%

        \[\leadsto 0 \]
    8. Applied egg-rr41.6%

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

    if 2.40000000000000006e-4 < D

    1. Initial program 25.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. Simplified22.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6436.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified36.4%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr63.5%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6463.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr63.6%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. associate-/r/N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{D}\right), \color{blue}{\left(\left(c0 \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)}\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{D \cdot \left(w \cdot h\right)}\right), \left(\color{blue}{\left(c0 \cdot d\right)} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D}\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(\color{blue}{\left(c0 \cdot d\right)} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(\left(\color{blue}{c0} \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(D \cdot \left(w \cdot h\right)\right)\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \left(w \cdot h\right)\right)\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      12. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      14. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \frac{c0}{\color{blue}{w}}\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(\frac{c0}{w}\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\left(d \cdot c0\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, c0\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      18. /-lowering-/.f6463.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, c0\right), \mathsf{/.f64}\left(c0, \color{blue}{w}\right)\right)\right) \]
    12. Applied egg-rr63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 3.5 \cdot 10^{-145}:\\ \;\;\;\;\frac{\frac{d}{D}}{w \cdot h} \cdot \left(\frac{d}{\frac{D}{c0}} \cdot \frac{c0}{w}\right)\\ \mathbf{elif}\;D \leq 0.00024:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D} \cdot \left(\left(c0 \cdot d\right) \cdot \frac{c0}{w}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 44.0% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;D \leq 0.00023:\\
\;\;\;\;0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if D < 8.00000000000000021e-146

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6420.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified20.7%

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

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

        \[\leadsto \frac{\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}}{\color{blue}{D \cdot D}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\right), \color{blue}{\left(D \cdot D\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(\color{blue}{D} \cdot D\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(\left(w \cdot w\right) \cdot h\right)\right), \left(D \cdot D\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(w \cdot \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(D \cdot D\right)\right) \]
      13. *-lowering-*.f6431.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right) \]
    7. Applied egg-rr31.8%

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

        \[\leadsto \frac{d \cdot \frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}{\color{blue}{D} \cdot D} \]
      2. times-fracN/A

        \[\leadsto \frac{d}{D} \cdot \color{blue}{\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}{D}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{d}{D}\right), \color{blue}{\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}{D}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(\frac{\color{blue}{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}}}{D}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}\right), \color{blue}{D}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{\left(w \cdot h\right) \cdot w}\right), D\right)\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}}{w}\right), D\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w \cdot h}\right), w\right), D\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d \cdot \left(c0 \cdot c0\right)}{w}}{h}\right), w\right), D\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d \cdot \left(c0 \cdot c0\right)}{w}\right), h\right), w\right), D\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(c0 \cdot c0\right)\right), w\right), h\right), w\right), D\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(c0 \cdot c0\right) \cdot d\right), w\right), h\right), w\right), D\right)\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c0 \cdot \left(c0 \cdot d\right)\right), w\right), h\right), w\right), D\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot d\right)\right), w\right), h\right), w\right), D\right)\right) \]
      15. *-lowering-*.f6445.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), w\right), h\right), w\right), D\right)\right) \]
    9. Applied egg-rr45.0%

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

    if 8.00000000000000021e-146 < D < 2.3000000000000001e-4

    1. Initial program 34.6%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval41.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified41.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div041.6%

        \[\leadsto 0 \]
    8. Applied egg-rr41.6%

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

    if 2.3000000000000001e-4 < D

    1. Initial program 25.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. Simplified22.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \color{blue}{\left(2 \cdot \frac{c0 \cdot {d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)}\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{2 \cdot \left(c0 \cdot {d}^{2}\right)}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(2 \cdot \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(c0 \cdot {d}^{2}\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left({d}^{2}\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \left(d \cdot d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \left({D}^{2} \cdot \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(h \cdot w\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(w \cdot h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. *-lowering-*.f6436.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(d, d\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified36.4%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot \left(d \cdot d\right)}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{\left(c0 \cdot d\right) \cdot d}{D \cdot \left(D \cdot \left(w \cdot h\right)\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. times-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. distribute-rgt-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. Applied egg-rr63.5%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \left(\frac{c0 \cdot d}{D} + \frac{c0 \cdot d}{D}\right)\right)}}{2 \cdot w} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)} + \frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0 + \left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot c0\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      3. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right) \cdot \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{c0 \cdot d}{D} \cdot \frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(\color{blue}{2}, w\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot d}{D}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)} \cdot \frac{1}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{d}{D \cdot \left(w \cdot h\right)}}{\frac{D}{c0 \cdot d}}\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D \cdot \left(w \cdot h\right)}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{d}{D}}{w \cdot h}\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(w \cdot h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \left(\frac{D}{c0 \cdot d}\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \left(c0 \cdot d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(c0 + c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      15. count-2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \left(2 \cdot c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      16. *-lowering-*.f6463.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(w, h\right)\right), \mathsf{/.f64}\left(D, \mathsf{*.f64}\left(c0, d\right)\right)\right), \mathsf{*.f64}\left(2, c0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. Applied egg-rr63.6%

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

        \[\leadsto \frac{\frac{\frac{d}{D}}{w \cdot h}}{\frac{D}{c0 \cdot d}} \cdot \color{blue}{\frac{2 \cdot c0}{2 \cdot w}} \]
      2. associate-/r/N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{d}{D}}{w \cdot h}}{D}\right), \color{blue}{\left(\left(c0 \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)}\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{D \cdot \left(w \cdot h\right)}\right), \left(\color{blue}{\left(c0 \cdot d\right)} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D}\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{d}{D}\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(\color{blue}{\left(c0 \cdot d\right)} \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(\left(w \cdot h\right) \cdot D\right)\right), \left(\left(\color{blue}{c0} \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \left(D \cdot \left(w \cdot h\right)\right)\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \left(w \cdot h\right)\right)\right), \left(\left(c0 \cdot \color{blue}{d}\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \frac{2 \cdot c0}{2 \cdot w}\right)\right) \]
      12. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \left(\frac{2}{2} \cdot \color{blue}{\frac{c0}{w}}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \left(1 \cdot \frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      14. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(\left(c0 \cdot d\right) \cdot \frac{c0}{\color{blue}{w}}\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\left(c0 \cdot d\right), \color{blue}{\left(\frac{c0}{w}\right)}\right)\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\left(d \cdot c0\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, c0\right), \left(\frac{\color{blue}{c0}}{w}\right)\right)\right) \]
      18. /-lowering-/.f6463.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(d, D\right), \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, c0\right), \mathsf{/.f64}\left(c0, \color{blue}{w}\right)\right)\right) \]
    12. Applied egg-rr63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 8 \cdot 10^{-146}:\\ \;\;\;\;\frac{d}{D} \cdot \frac{\frac{\frac{\frac{c0 \cdot \left(c0 \cdot d\right)}{w}}{h}}{w}}{D}\\ \mathbf{elif}\;D \leq 0.00023:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{D}}{\left(w \cdot h\right) \cdot D} \cdot \left(\left(c0 \cdot d\right) \cdot \frac{c0}{w}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 40.9% accurate, 5.6× speedup?

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

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

\mathbf{elif}\;M \leq 8 \cdot 10^{-105}:\\
\;\;\;\;0\\

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


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

    1. Initial program 23.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. Add Preprocessing
    3. Taylor expanded in c0 around inf

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6424.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified24.1%

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

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

        \[\leadsto d \cdot \color{blue}{\left(d \cdot \frac{c0 \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \frac{c0 \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}\right)}\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left(d \cdot \frac{1}{\color{blue}{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}{c0 \cdot c0}}}\right)\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left(\frac{d}{\color{blue}{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}{c0 \cdot c0}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}{c0 \cdot c0}\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)\right), \color{blue}{\left(c0 \cdot c0\right)}\right)\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\left(D \cdot \left(D \cdot \left(h \cdot \left(w \cdot w\right)\right)\right)\right), \left(\color{blue}{c0} \cdot c0\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(D \cdot \left(h \cdot \left(w \cdot w\right)\right)\right)\right), \left(\color{blue}{c0} \cdot c0\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(h \cdot \left(w \cdot w\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(\left(w \cdot w\right) \cdot h\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(w \cdot \left(w \cdot h\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      15. *-lowering-*.f6444.7%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(c0, \color{blue}{c0}\right)\right)\right)\right) \]
    7. Applied egg-rr44.7%

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

    if 1.49999999999999991e-224 < M < 7.99999999999999972e-105

    1. Initial program 27.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval47.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified47.4%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div047.4%

        \[\leadsto 0 \]
    8. Applied egg-rr47.4%

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

    if 7.99999999999999972e-105 < M

    1. Initial program 20.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6423.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified23.8%

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

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

        \[\leadsto \frac{\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}}{\color{blue}{D \cdot D}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{h \cdot \left(w \cdot w\right)}\right), \color{blue}{\left(D \cdot D\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(\color{blue}{D} \cdot D\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \left(d \cdot \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \left(c0 \cdot c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(h \cdot \left(w \cdot w\right)\right)\right), \left(D \cdot D\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(\left(w \cdot w\right) \cdot h\right)\right), \left(D \cdot D\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \left(w \cdot \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right), \left(D \cdot D\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \left(D \cdot D\right)\right) \]
      13. *-lowering-*.f6433.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(c0, c0\right)\right)\right), \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right) \]
    7. Applied egg-rr33.3%

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

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

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

        \[\leadsto \left(d \cdot \left(c0 \cdot c0\right)\right) \cdot \color{blue}{\frac{d}{\left(D \cdot D\right) \cdot \left(w \cdot \left(w \cdot h\right)\right)}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(d \cdot \left(c0 \cdot c0\right)\right), \color{blue}{\left(\frac{d}{\left(D \cdot D\right) \cdot \left(w \cdot \left(w \cdot h\right)\right)}\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(c0 \cdot c0\right) \cdot d\right), \left(\frac{\color{blue}{d}}{\left(D \cdot D\right) \cdot \left(w \cdot \left(w \cdot h\right)\right)}\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(c0 \cdot \left(c0 \cdot d\right)\right), \left(\frac{\color{blue}{d}}{\left(D \cdot D\right) \cdot \left(w \cdot \left(w \cdot h\right)\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot d\right)\right), \left(\frac{\color{blue}{d}}{\left(D \cdot D\right) \cdot \left(w \cdot \left(w \cdot h\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \left(\frac{d}{\left(D \cdot D\right) \cdot \left(w \cdot \left(w \cdot h\right)\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \color{blue}{\left(\left(D \cdot D\right) \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \left(\left(w \cdot \left(w \cdot h\right)\right) \cdot \color{blue}{\left(D \cdot D\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(\left(w \cdot \left(w \cdot h\right)\right), \color{blue}{\left(D \cdot D\right)}\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \left(w \cdot h\right)\right), \left(\color{blue}{D} \cdot D\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right), \left(D \cdot D\right)\right)\right)\right) \]
      14. *-lowering-*.f6436.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right), \mathsf{*.f64}\left(D, \color{blue}{D}\right)\right)\right)\right) \]
    9. Applied egg-rr36.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \color{blue}{\left(\frac{d}{{D}^{2} \cdot \left(h \cdot {w}^{2}\right)}\right)}\right) \]
    11. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \left({D}^{2} \cdot \left(h \cdot \left(w \cdot \color{blue}{w}\right)\right)\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \left({D}^{2} \cdot \left(\left(h \cdot w\right) \cdot \color{blue}{w}\right)\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \left(\left({D}^{2} \cdot \left(h \cdot w\right)\right) \cdot \color{blue}{w}\right)\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \left(w \cdot \color{blue}{\left({D}^{2} \cdot \left(h \cdot w\right)\right)}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \color{blue}{\left({D}^{2} \cdot \left(h \cdot w\right)\right)}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \left(\left(D \cdot D\right) \cdot \left(\color{blue}{h} \cdot w\right)\right)\right)\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \left(D \cdot \color{blue}{\left(D \cdot \left(h \cdot w\right)\right)}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(D, \color{blue}{\left(D \cdot \left(h \cdot w\right)\right)}\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(D, \left(\left(h \cdot w\right) \cdot \color{blue}{D}\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(D, \left(h \cdot \color{blue}{\left(w \cdot D\right)}\right)\right)\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(D, \left(h \cdot \left(D \cdot \color{blue}{w}\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(h, \color{blue}{\left(D \cdot w\right)}\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f6443.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, \color{blue}{w}\right)\right)\right)\right)\right)\right) \]
    12. Simplified43.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.5 \cdot 10^{-224}:\\ \;\;\;\;d \cdot \frac{d}{\frac{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}{c0 \cdot c0}}\\ \mathbf{elif}\;M \leq 8 \cdot 10^{-105}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\left(c0 \cdot \left(c0 \cdot d\right)\right) \cdot \frac{d}{w \cdot \left(D \cdot \left(h \cdot \left(w \cdot D\right)\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 38.8% accurate, 5.6× speedup?

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

\\
\begin{array}{l}
t_0 := d \cdot \frac{d}{\frac{D \cdot \left(D \cdot \left(w \cdot \left(w \cdot h\right)\right)\right)}{c0 \cdot c0}}\\
\mathbf{if}\;D \leq 3 \cdot 10^{-145}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;D \leq 0.00023:\\
\;\;\;\;0\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if D < 2.99999999999999992e-145 or 2.3000000000000001e-4 < D

    1. Initial program 21.5%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({c0}^{2} \cdot {d}^{2}\right), \color{blue}{\left({D}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left({d}^{2} \cdot {c0}^{2}\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({d}^{2}\right), \left({c0}^{2}\right)\right), \left(\color{blue}{{D}^{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(d \cdot d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left({c0}^{2}\right)\right), \left({\color{blue}{D}}^{2} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \left(c0 \cdot c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \left({D}^{\color{blue}{2}} \cdot \left(h \cdot {w}^{2}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(h \cdot {w}^{2}\right)}\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{h} \cdot {w}^{2}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
      13. *-lowering-*.f6422.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \mathsf{*.f64}\left(c0, c0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
    5. Simplified22.8%

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

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

        \[\leadsto d \cdot \color{blue}{\left(d \cdot \frac{c0 \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \color{blue}{\left(d \cdot \frac{c0 \cdot c0}{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}\right)}\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left(d \cdot \frac{1}{\color{blue}{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}{c0 \cdot c0}}}\right)\right) \]
      5. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(d, \left(\frac{d}{\color{blue}{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}{c0 \cdot c0}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)}{c0 \cdot c0}\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\left(\left(D \cdot D\right) \cdot \left(h \cdot \left(w \cdot w\right)\right)\right), \color{blue}{\left(c0 \cdot c0\right)}\right)\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\left(D \cdot \left(D \cdot \left(h \cdot \left(w \cdot w\right)\right)\right)\right), \left(\color{blue}{c0} \cdot c0\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \left(D \cdot \left(h \cdot \left(w \cdot w\right)\right)\right)\right), \left(\color{blue}{c0} \cdot c0\right)\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(h \cdot \left(w \cdot w\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(\left(w \cdot w\right) \cdot h\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \left(w \cdot \left(w \cdot h\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, \left(w \cdot h\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \left(c0 \cdot c0\right)\right)\right)\right) \]
      15. *-lowering-*.f6442.6%

        \[\leadsto \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, h\right)\right)\right)\right), \mathsf{*.f64}\left(c0, \color{blue}{c0}\right)\right)\right)\right) \]
    7. Applied egg-rr42.6%

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

    if 2.99999999999999992e-145 < D < 2.3000000000000001e-4

    1. Initial program 34.6%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      3. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      5. mul0-lftN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      7. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
      13. metadata-eval41.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. Simplified41.6%

      \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
    7. Step-by-step derivation
      1. mul0-rgtN/A

        \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
      2. mul0-rgtN/A

        \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
      3. div041.6%

        \[\leadsto 0 \]
    8. Applied egg-rr41.6%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 33.7% 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 23.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. Simplified22.3%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(-1 \cdot c0\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)} + \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    3. distribute-lft1-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    4. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(0 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(h \cdot w\right)}\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    5. mul0-lftN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    7. distribute-lft-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(\mathsf{neg}\left(c0 \cdot \left(-1 + 1\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    8. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(\left(-1 + 1\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(\mathsf{neg}\left(0\right)\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \left(c0 \cdot \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, \left(-1 + 1\right)\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
    13. metadata-eval34.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(c0, 0\right)\right), \mathsf{*.f64}\left(2, w\right)\right) \]
  6. Simplified34.0%

    \[\leadsto \frac{c0 \cdot \color{blue}{\left(c0 \cdot 0\right)}}{2 \cdot w} \]
  7. Step-by-step derivation
    1. mul0-rgtN/A

      \[\leadsto \frac{c0 \cdot 0}{2 \cdot w} \]
    2. mul0-rgtN/A

      \[\leadsto \frac{0}{\color{blue}{2} \cdot w} \]
    3. div034.0%

      \[\leadsto 0 \]
  8. Applied egg-rr34.0%

    \[\leadsto \color{blue}{0} \]
  9. Add Preprocessing

Reproduce

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