Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.6% → 68.5%
Time: 22.2s
Alternatives: 5
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 5 alternatives:

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

Initial Program: 24.6% accurate, 1.0× speedup?

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

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

Alternative 1: 68.5% accurate, 0.9× 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:\\ \;\;\;\;2 \cdot \left(\frac{d}{D} \cdot \frac{\frac{c0 \cdot d}{\left(w \cdot h\right) \cdot D}}{\frac{w}{\frac{c0}{2}}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{d}\right)\right)\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
   (if (<=
        (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
        INFINITY)
     (* 2.0 (* (/ d D) (/ (/ (* c0 d) (* (* w h) D)) (/ w (/ c0 2.0)))))
     (* 0.25 (* D (* D (/ (/ (* h (* M M)) d) d)))))))
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 = 2.0 * ((d / D) * (((c0 * d) / ((w * h) * D)) / (w / (c0 / 2.0))));
	} else {
		tmp = 0.25 * (D * (D * (((h * (M * M)) / d) / d)));
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (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 = 2.0 * ((d / D) * (((c0 * d) / ((w * h) * D)) / (w / (c0 / 2.0))));
	} else {
		tmp = 0.25 * (D * (D * (((h * (M * M)) / d) / d)));
	}
	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 = 2.0 * ((d / D) * (((c0 * d) / ((w * h) * D)) / (w / (c0 / 2.0))))
	else:
		tmp = 0.25 * (D * (D * (((h * (M * M)) / d) / d)))
	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(2.0 * Float64(Float64(d / D) * Float64(Float64(Float64(c0 * d) / Float64(Float64(w * h) * D)) / Float64(w / Float64(c0 / 2.0)))));
	else
		tmp = Float64(0.25 * Float64(D * Float64(D * Float64(Float64(Float64(h * Float64(M * M)) / d) / d))));
	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 = 2.0 * ((d / D) * (((c0 * d) / ((w * h) * D)) / (w / (c0 / 2.0))));
	else
		tmp = 0.25 * (D * (D * (((h * (M * M)) / d) / d)));
	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[(2.0 * N[(N[(d / D), $MachinePrecision] * N[(N[(N[(c0 * d), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] / N[(w / N[(c0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(D * N[(D * N[(N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\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 83.2%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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), \color{blue}{\left(h \cdot w\right)}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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 \color{blue}{h}\right)\right)\right)\right) \]
      11. *-lowering-*.f6481.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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, \color{blue}{h}\right)\right)\right)\right) \]
    7. Simplified81.2%

      \[\leadsto \frac{c0}{2 \cdot w} \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)}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left({M}^{2}\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left(d \cdot \color{blue}{d}\right)\right)\right) \]
      11. *-lowering-*.f6445.9%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
    10. Simplified45.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right), d\right)\right)\right)\right) \]
      9. *-lowering-*.f6467.7%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right)\right)\right) \]
    12. Applied egg-rr67.7%

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

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

Alternative 2: 47.7% accurate, 4.2× speedup?

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

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

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

\mathbf{elif}\;d \leq 5.4 \cdot 10^{+244}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \left(D \cdot t\_0\right)}{d}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < 1.10000000000000001e-72

    1. Initial program 30.6%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left({M}^{2}\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left(d \cdot \color{blue}{d}\right)\right)\right) \]
      11. *-lowering-*.f6429.5%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
    10. Simplified29.5%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right), d\right)\right)\right)\right) \]
      9. *-lowering-*.f6449.5%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right)\right)\right) \]
    12. Applied egg-rr49.5%

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

    if 1.10000000000000001e-72 < d < 2.2e12

    1. Initial program 37.8%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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), \color{blue}{\left(h \cdot w\right)}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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 \color{blue}{h}\right)\right)\right)\right) \]
      11. *-lowering-*.f6451.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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, \color{blue}{h}\right)\right)\right)\right) \]
    7. Simplified51.0%

      \[\leadsto \frac{c0}{2 \cdot w} \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)}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \frac{\color{blue}{\frac{d}{D \cdot w} \cdot \frac{d \cdot c0}{h}}}{\frac{2 \cdot w}{c0} \cdot D} \]
    12. Taylor expanded in d around 0

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2}}}{{w}^{2}}\right), \color{blue}{h}\right) \]
    14. Simplified63.5%

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

    if 2.2e12 < d < 5.39999999999999995e244

    1. Initial program 29.7%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left({M}^{2}\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left(d \cdot \color{blue}{d}\right)\right)\right) \]
      11. *-lowering-*.f6445.0%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
    10. Simplified45.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\left(\frac{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}{d}\right), d\right)\right) \]
      7. associate-/l*N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), d\right)\right)\right), d\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right)\right)\right), d\right)\right) \]
      15. *-lowering-*.f6464.3%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right)\right)\right), d\right)\right) \]
    13. Simplified64.3%

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

    if 5.39999999999999995e244 < d

    1. Initial program 19.4%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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), \color{blue}{\left(h \cdot w\right)}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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 \color{blue}{h}\right)\right)\right)\right) \]
      11. *-lowering-*.f6425.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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, \color{blue}{h}\right)\right)\right)\right) \]
    7. Simplified25.0%

      \[\leadsto \frac{c0}{2 \cdot w} \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)}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 1.1 \cdot 10^{-72}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{d}\right)\right)\\ \mathbf{elif}\;d \leq 2200000000000:\\ \;\;\;\;\frac{\frac{\frac{c0 \cdot \left(c0 \cdot \left(d \cdot \frac{d}{D \cdot D}\right)\right)}{w}}{w}}{h}\\ \mathbf{elif}\;d \leq 5.4 \cdot 10^{+244}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(D \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(c0 \cdot d\right) \cdot \frac{d}{\frac{\left(w \cdot h\right) \cdot D}{\frac{c0}{\left(2 \cdot w\right) \cdot D}}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 48.4% accurate, 5.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < 6.80000000000000042e-73

    1. Initial program 30.6%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left({M}^{2}\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left(d \cdot \color{blue}{d}\right)\right)\right) \]
      11. *-lowering-*.f6429.5%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
    10. Simplified29.5%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right), d\right)\right)\right)\right) \]
      9. *-lowering-*.f6449.5%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right)\right)\right) \]
    12. Applied egg-rr49.5%

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

    if 6.80000000000000042e-73 < d < 1.05e10

    1. Initial program 37.8%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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), \color{blue}{\left(h \cdot w\right)}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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(\color{blue}{h} \cdot w\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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 \color{blue}{h}\right)\right)\right)\right) \]
      11. *-lowering-*.f6451.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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, \color{blue}{h}\right)\right)\right)\right) \]
    7. Simplified51.0%

      \[\leadsto \frac{c0}{2 \cdot w} \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)}} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \frac{\color{blue}{\frac{d}{D \cdot w} \cdot \frac{d \cdot c0}{h}}}{\frac{2 \cdot w}{c0} \cdot D} \]
    12. Taylor expanded in d around 0

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{{c0}^{2} \cdot {d}^{2}}{{D}^{2}}}{{w}^{2}}\right), \color{blue}{h}\right) \]
    14. Simplified63.5%

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

    if 1.05e10 < d

    1. Initial program 27.4%

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
      4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left({M}^{2}\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. unpow2N/A

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left(d \cdot \color{blue}{d}\right)\right)\right) \]
      11. *-lowering-*.f6442.5%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
    10. Simplified42.5%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\left(\frac{D \cdot \left(D \cdot \left({M}^{2} \cdot h\right)\right)}{d}\right), d\right)\right) \]
      7. associate-/l*N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left({M}^{2}\right)\right), d\right)\right)\right), d\right)\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right)\right)\right), d\right)\right) \]
      15. *-lowering-*.f6459.7%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right)\right)\right), d\right)\right) \]
    13. Simplified59.7%

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

Alternative 4: 48.5% accurate, 10.1× speedup?

\[\begin{array}{l} \\ 0.25 \cdot \left(D \cdot \left(D \cdot \frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{d}\right)\right) \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (* 0.25 (* D (* D (/ (/ (* h (* M M)) d) d)))))
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * (D * (D * (((h * (M * M)) / d) / d)));
}
real(8) function code(c0, w, h, d, d_1, m)
    real(8), intent (in) :: c0
    real(8), intent (in) :: w
    real(8), intent (in) :: h
    real(8), intent (in) :: d
    real(8), intent (in) :: d_1
    real(8), intent (in) :: m
    code = 0.25d0 * (d * (d * (((h * (m * m)) / d_1) / d_1)))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * (D * (D * (((h * (M * M)) / d) / d)));
}
def code(c0, w, h, D, d, M):
	return 0.25 * (D * (D * (((h * (M * M)) / d) / d)))
function code(c0, w, h, D, d, M)
	return Float64(0.25 * Float64(D * Float64(D * Float64(Float64(Float64(h * Float64(M * M)) / d) / d))))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.25 * (D * (D * (((h * (M * M)) / d) / d)));
end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(D * N[(D * N[(N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
    4. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \left({M}^{2}\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
    8. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left({d}^{2}\right)\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \left(d \cdot \color{blue}{d}\right)\right)\right) \]
    11. *-lowering-*.f6434.8%

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right) \]
  10. Simplified34.8%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \left(M \cdot M\right)\right), d\right), d\right)\right)\right)\right) \]
    9. *-lowering-*.f6452.5%

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right), d\right)\right)\right)\right) \]
  12. Applied egg-rr52.5%

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

Alternative 5: 34.1% 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 29.9%

    \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
  2. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{2 \cdot w}\right), \color{blue}{\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)}\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(2 \cdot w\right)\right), \left(\color{blue}{\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)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{\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)\right) \]
    4. +-lowering-+.f64N/A

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

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

    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \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) \]
  6. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\left(-1 \cdot c0\right) \cdot \color{blue}{\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) \]
    2. mul-1-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(\left(\mathsf{neg}\left(c0\right)\right) \cdot \left(\color{blue}{-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) \]
    3. distribute-lft1-inN/A

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \left(c0 \cdot 0\right)\right) \]
    9. *-lowering-*.f6429.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(2, w\right)\right), \mathsf{*.f64}\left(c0, \color{blue}{0}\right)\right) \]
  7. Simplified29.9%

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

      \[\leadsto \left(\frac{c0}{2 \cdot w} \cdot c0\right) \cdot \color{blue}{0} \]
    2. mul0-rgt34.1%

      \[\leadsto 0 \]
  9. Applied egg-rr34.1%

    \[\leadsto \color{blue}{0} \]
  10. Add Preprocessing

Reproduce

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