Henrywood and Agarwal, Equation (13)

Percentage Accurate: 24.2% → 69.2%
Time: 22.2s
Alternatives: 9
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 9 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.2% 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: 69.2% accurate, 0.5× 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)}\\ t_1 := \frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \frac{M}{d}}{\frac{d}{D \cdot \left(h \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))))
        (t_1 (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
   (if (<= t_1 INFINITY) t_1 (* 0.25 (/ (* D (/ M d)) (/ d (* D (* h 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));
	double t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = 0.25 * ((D * (M / d)) / (d / (D * (h * M))));
	}
	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 t_1 = (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = 0.25 * ((D * (M / d)) / (d / (D * (h * M))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_1 = (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = 0.25 * ((D * (M / d)) / (d / (D * (h * M))))
	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)))
	t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(0.25 * Float64(Float64(D * Float64(M / d)) / Float64(d / Float64(D * Float64(h * M)))));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = 0.25 * ((D * (M / d)) / (d / (D * (h * M))));
	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]}, Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(0.25 * N[(N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision] / N[(d / N[(D * N[(h * 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)}\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{D \cdot \frac{M}{d}}{\frac{d}{D \cdot \left(h \cdot M\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 72.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. Add Preprocessing

    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. Simplified1.1%

      \[\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. Simplified21.0%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left(d \cdot \color{blue}{d}\right)\right)\right) \]
      10. *-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(\mathsf{*.f64}\left(M, M\right), h\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(\left(M \cdot M\right) \cdot h\right)}{d \cdot d}} \]
    11. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{/.f64}\left(M, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \color{blue}{h}\right)\right)\right)\right)\right) \]
    14. Applied egg-rr73.0%

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

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

Alternative 2: 50.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \cdot d \leq 5 \cdot 10^{-182}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \frac{h \cdot M}{d}}{d}\right)\right)\\ \mathbf{elif}\;d \cdot d \leq 5 \cdot 10^{-105}:\\ \;\;\;\;\frac{\frac{\frac{c0}{\frac{w}{\frac{-0.5}{d \cdot d} \cdot \left(\left(M \cdot \left(D \cdot \left(D \cdot M\right)\right)\right) \cdot \frac{w \cdot \left(w \cdot h\right)}{c0}\right) + \frac{2}{D \cdot D} \cdot \frac{c0 \cdot d}{\frac{h}{d}}}}}{w}}{2}\\ \mathbf{elif}\;d \cdot d \leq \infty:\\ \;\;\;\;0.25 \cdot \left(\frac{M \cdot \left(h \cdot D\right)}{d} \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{D \cdot \left(D \cdot \left(h \cdot M\right)\right)}{d}}{d}\\ \end{array} \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (if (<= (* d d) 5e-182)
   (* 0.25 (* D (* D (/ (* M (/ (* h M) d)) d))))
   (if (<= (* d d) 5e-105)
     (/
      (/
       (/
        c0
        (/
         w
         (+
          (* (/ -0.5 (* d d)) (* (* M (* D (* D M))) (/ (* w (* w h)) c0)))
          (* (/ 2.0 (* D D)) (/ (* c0 d) (/ h d))))))
       w)
      2.0)
     (if (<= (* d d) INFINITY)
       (* 0.25 (* (/ (* M (* h D)) d) (/ (* D M) d)))
       (* 0.25 (/ (* M (/ (* D (* D (* h M))) d)) d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((d * d) <= 5e-182) {
		tmp = 0.25 * (D * (D * ((M * ((h * M) / d)) / d)));
	} else if ((d * d) <= 5e-105) {
		tmp = ((c0 / (w / (((-0.5 / (d * d)) * ((M * (D * (D * M))) * ((w * (w * h)) / c0))) + ((2.0 / (D * D)) * ((c0 * d) / (h / d)))))) / w) / 2.0;
	} else if ((d * d) <= ((double) INFINITY)) {
		tmp = 0.25 * (((M * (h * D)) / d) * ((D * M) / d));
	} else {
		tmp = 0.25 * ((M * ((D * (D * (h * M))) / d)) / d);
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double tmp;
	if ((d * d) <= 5e-182) {
		tmp = 0.25 * (D * (D * ((M * ((h * M) / d)) / d)));
	} else if ((d * d) <= 5e-105) {
		tmp = ((c0 / (w / (((-0.5 / (d * d)) * ((M * (D * (D * M))) * ((w * (w * h)) / c0))) + ((2.0 / (D * D)) * ((c0 * d) / (h / d)))))) / w) / 2.0;
	} else if ((d * d) <= Double.POSITIVE_INFINITY) {
		tmp = 0.25 * (((M * (h * D)) / d) * ((D * M) / d));
	} else {
		tmp = 0.25 * ((M * ((D * (D * (h * M))) / d)) / d);
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	tmp = 0
	if (d * d) <= 5e-182:
		tmp = 0.25 * (D * (D * ((M * ((h * M) / d)) / d)))
	elif (d * d) <= 5e-105:
		tmp = ((c0 / (w / (((-0.5 / (d * d)) * ((M * (D * (D * M))) * ((w * (w * h)) / c0))) + ((2.0 / (D * D)) * ((c0 * d) / (h / d)))))) / w) / 2.0
	elif (d * d) <= math.inf:
		tmp = 0.25 * (((M * (h * D)) / d) * ((D * M) / d))
	else:
		tmp = 0.25 * ((M * ((D * (D * (h * M))) / d)) / d)
	return tmp
function code(c0, w, h, D, d, M)
	tmp = 0.0
	if (Float64(d * d) <= 5e-182)
		tmp = Float64(0.25 * Float64(D * Float64(D * Float64(Float64(M * Float64(Float64(h * M) / d)) / d))));
	elseif (Float64(d * d) <= 5e-105)
		tmp = Float64(Float64(Float64(c0 / Float64(w / Float64(Float64(Float64(-0.5 / Float64(d * d)) * Float64(Float64(M * Float64(D * Float64(D * M))) * Float64(Float64(w * Float64(w * h)) / c0))) + Float64(Float64(2.0 / Float64(D * D)) * Float64(Float64(c0 * d) / Float64(h / d)))))) / w) / 2.0);
	elseif (Float64(d * d) <= Inf)
		tmp = Float64(0.25 * Float64(Float64(Float64(M * Float64(h * D)) / d) * Float64(Float64(D * M) / d)));
	else
		tmp = Float64(0.25 * Float64(Float64(M * Float64(Float64(D * Float64(D * Float64(h * M))) / d)) / d));
	end
	return tmp
end
function tmp_2 = code(c0, w, h, D, d, M)
	tmp = 0.0;
	if ((d * d) <= 5e-182)
		tmp = 0.25 * (D * (D * ((M * ((h * M) / d)) / d)));
	elseif ((d * d) <= 5e-105)
		tmp = ((c0 / (w / (((-0.5 / (d * d)) * ((M * (D * (D * M))) * ((w * (w * h)) / c0))) + ((2.0 / (D * D)) * ((c0 * d) / (h / d)))))) / w) / 2.0;
	elseif ((d * d) <= Inf)
		tmp = 0.25 * (((M * (h * D)) / d) * ((D * M) / d));
	else
		tmp = 0.25 * ((M * ((D * (D * (h * M))) / d)) / d);
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(d * d), $MachinePrecision], 5e-182], N[(0.25 * N[(D * N[(D * N[(N[(M * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], 5e-105], N[(N[(N[(c0 / N[(w / N[(N[(N[(-0.5 / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * N[(D * N[(D * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(w * N[(w * h), $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[N[(d * d), $MachinePrecision], Infinity], N[(0.25 * N[(N[(N[(M * N[(h * D), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(M * N[(N[(D * N[(D * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

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


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

    1. Initial program 12.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. Simplified14.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. Simplified12.8%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{d \cdot d}\right)}\right)\right) \]
      4. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{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(\left(\frac{h \cdot \left(M \cdot M\right)}{d}\right), \color{blue}{d}\right)\right)\right)\right) \]
      8. associate-*r*N/A

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

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

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

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

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

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

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

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

    if 5.00000000000000024e-182 < (*.f64 d d) < 4.99999999999999963e-105

    1. Initial program 46.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. Simplified46.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 w around 0

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

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

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

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

    if 4.99999999999999963e-105 < (*.f64 d d) < +inf.0

    1. Initial program 22.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. Simplified21.7%

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

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (*.f64 d d)

    1. Initial program 21.6%

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

      \[\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. Simplified17.1%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 50.5% accurate, 6.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 d d) < 4.99999999999999973e182

    1. Initial program 24.2%

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

      \[\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. Simplified14.7%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{d \cdot d}\right)}\right)\right) \]
      4. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{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(\left(\frac{h \cdot \left(M \cdot M\right)}{d}\right), \color{blue}{d}\right)\right)\right)\right) \]
      8. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot h}{d}}{d}\right), \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(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot h}{d}\right), d\right), D\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

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

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

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

    if 4.99999999999999973e182 < (*.f64 d d)

    1. Initial program 19.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. Simplified19.9%

      \[\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. Simplified19.3%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \cdot d \leq 5 \cdot 10^{+182}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(M \cdot \left(D \cdot \frac{\frac{h \cdot M}{d}}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{D \cdot \left(D \cdot \left(h \cdot M\right)\right)}{d}}{d}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.4% accurate, 7.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if D < 5.0000000000000002e-203

    1. Initial program 19.3%

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

      \[\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. Simplified19.0%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{d \cdot d}\right)}\right)\right) \]
      4. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{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(\left(\frac{h \cdot \left(M \cdot M\right)}{d}\right), \color{blue}{d}\right)\right)\right)\right) \]
      8. associate-*r*N/A

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

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

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

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

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

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

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

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

    if 5.0000000000000002e-203 < D

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

      \[\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. Simplified13.4%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 5 \cdot 10^{-203}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \frac{h \cdot M}{d}}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{D \cdot M}{d} \cdot \frac{D \cdot \left(h \cdot M\right)}{d}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.4% accurate, 7.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if h < -3.0000000000000002e65

    1. Initial program 18.1%

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

      \[\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.5%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{d \cdot d}\right)}\right)\right) \]
      4. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{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(\left(\frac{h \cdot \left(M \cdot M\right)}{d}\right), \color{blue}{d}\right)\right)\right)\right) \]
      8. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot h}{d}}{d}\right), \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(M, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot h}{d}\right), d\right), D\right)\right)\right)\right) \]
      7. /-lowering-/.f64N/A

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

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

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

    if -3.0000000000000002e65 < h

    1. Initial program 22.1%

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

      \[\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. Simplified16.8%

      \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
      9. unpow2N/A

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

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

      \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{d \cdot d}\right)}\right)\right) \]
      4. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{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(\left(\frac{h \cdot \left(M \cdot M\right)}{d}\right), \color{blue}{d}\right)\right)\right)\right) \]
      8. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -3 \cdot 10^{+65}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(M \cdot \left(D \cdot \frac{\frac{h \cdot M}{d}}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \left(h \cdot \frac{M}{d}\right)}{d}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 51.0% accurate, 10.1× speedup?

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

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

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

    \[\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. Simplified17.1%

    \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    7. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    9. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, \mathsf{/.f64}\left(M, d\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(M, \color{blue}{h}\right)\right)\right)\right)\right) \]
  14. Applied egg-rr58.6%

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

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

Alternative 7: 49.4% accurate, 10.1× speedup?

\[\begin{array}{l} \\ 0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \left(h \cdot \frac{M}{d}\right)}{d}\right)\right) \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (* 0.25 (* D (* D (/ (* M (* h (/ M d))) d)))))
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * (D * (D * ((M * (h * (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 * ((m * (h * (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 * ((M * (h * (M / d))) / d)));
}
def code(c0, w, h, D, d, M):
	return 0.25 * (D * (D * ((M * (h * (M / d))) / d)))
function code(c0, w, h, D, d, M)
	return Float64(0.25 * Float64(D * Float64(D * Float64(Float64(M * Float64(h * Float64(M / d))) / d))))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.25 * (D * (D * ((M * (h * (M / d))) / d)));
end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(D * N[(D * N[(N[(M * N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

    \[\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. Simplified17.1%

    \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    7. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    9. unpow2N/A

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

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

    \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{d \cdot d}\right)}\right)\right) \]
    4. *-commutativeN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{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(\left(\frac{h \cdot \left(M \cdot M\right)}{d}\right), \color{blue}{d}\right)\right)\right)\right) \]
    8. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 47.7% accurate, 10.1× speedup?

\[\begin{array}{l} \\ 0.25 \cdot \left(D \cdot \left(D \cdot \left(M \cdot \frac{\frac{h \cdot M}{d}}{d}\right)\right)\right) \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (* 0.25 (* D (* D (* M (/ (/ (* h M) d) d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return 0.25 * (D * (D * (M * (((h * 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 * (m * (((h * 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 * (M * (((h * M) / d) / d))));
}
def code(c0, w, h, D, d, M):
	return 0.25 * (D * (D * (M * (((h * M) / d) / d))))
function code(c0, w, h, D, d, M)
	return Float64(0.25 * Float64(D * Float64(D * Float64(M * Float64(Float64(Float64(h * M) / d) / d)))))
end
function tmp = code(c0, w, h, D, d, M)
	tmp = 0.25 * (D * (D * (M * (((h * M) / d) / d))));
end
code[c0_, w_, h_, D_, d_, M_] := N[(0.25 * N[(D * N[(D * N[(M * N[(N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

    \[\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. Simplified17.1%

    \[\leadsto \color{blue}{\left(c0 \cdot c0\right) \cdot \left(\frac{0}{w} + 0.25 \cdot \frac{\frac{\left(D \cdot D\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot d}}{c0 \cdot c0}\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. *-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(\left({M}^{2}\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    7. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    8. *-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(\mathsf{*.f64}\left(M, M\right), h\right)\right), \left({d}^{2}\right)\right)\right) \]
    9. unpow2N/A

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

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

    \[\leadsto \color{blue}{0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\left(M \cdot M\right) \cdot h\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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{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{\left(M \cdot M\right) \cdot h}{d \cdot d}\right)}\right)\right) \]
    4. *-commutativeN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{\frac{h \cdot \left(M \cdot M\right)}{d}}{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(\left(\frac{h \cdot \left(M \cdot M\right)}{d}\right), \color{blue}{d}\right)\right)\right)\right) \]
    8. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(\frac{\frac{M \cdot h}{d}}{d}\right), \color{blue}{M}\right)\right)\right)\right) \]
    4. /-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(\frac{M \cdot h}{d}\right), d\right), M\right)\right)\right)\right) \]
    5. /-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(\left(M \cdot h\right), d\right), d\right), M\right)\right)\right)\right) \]
    6. *-lowering-*.f6453.9%

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

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

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

Alternative 9: 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 21.6%

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

    \[\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-*.f6430.8%

      \[\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. Simplified30.8%

    \[\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-rgt35.4%

      \[\leadsto 0 \]
  9. Applied egg-rr35.4%

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

Reproduce

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