Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.2% → 87.9%
Time: 19.3s
Alternatives: 17
Speedup: 1.7×

Specification

?
\[\begin{array}{l} \\ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\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 17 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: 81.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
real(8) function code(w0, m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\end{array}

Alternative 1: 87.9% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} t_0 := \frac{-4}{\frac{D\_m \cdot M\_m}{d\_m}}\\ \mathbf{if}\;d\_m \leq 2 \cdot 10^{-41}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D\_m \cdot M\_m\right)}{d\_m}}{\ell \cdot t\_0}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{M\_m \cdot h}{t\_0} \cdot \frac{D\_m}{d\_m}}{\ell}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d_m)
 :precision binary64
 (let* ((t_0 (/ -4.0 (/ (* D_m M_m) d_m))))
   (if (<= d_m 2e-41)
     (* w0 (sqrt (+ 1.0 (/ (/ (* h (* D_m M_m)) d_m) (* l t_0)))))
     (* w0 (sqrt (+ 1.0 (/ (* (/ (* M_m h) t_0) (/ D_m d_m)) l)))))))
M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
	double t_0 = -4.0 / ((D_m * M_m) / d_m);
	double tmp;
	if (d_m <= 2e-41) {
		tmp = w0 * sqrt((1.0 + (((h * (D_m * M_m)) / d_m) / (l * t_0))));
	} else {
		tmp = w0 * sqrt((1.0 + ((((M_m * h) / t_0) * (D_m / d_m)) / l)));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
d_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_m_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-4.0d0) / ((d_m * m_m) / d_m_1)
    if (d_m_1 <= 2d-41) then
        tmp = w0 * sqrt((1.0d0 + (((h * (d_m * m_m)) / d_m_1) / (l * t_0))))
    else
        tmp = w0 * sqrt((1.0d0 + ((((m_m * h) / t_0) * (d_m / d_m_1)) / l)))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
	double t_0 = -4.0 / ((D_m * M_m) / d_m);
	double tmp;
	if (d_m <= 2e-41) {
		tmp = w0 * Math.sqrt((1.0 + (((h * (D_m * M_m)) / d_m) / (l * t_0))));
	} else {
		tmp = w0 * Math.sqrt((1.0 + ((((M_m * h) / t_0) * (D_m / d_m)) / l)));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
d_m = math.fabs(d)
[w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
def code(w0, M_m, D_m, h, l, d_m):
	t_0 = -4.0 / ((D_m * M_m) / d_m)
	tmp = 0
	if d_m <= 2e-41:
		tmp = w0 * math.sqrt((1.0 + (((h * (D_m * M_m)) / d_m) / (l * t_0))))
	else:
		tmp = w0 * math.sqrt((1.0 + ((((M_m * h) / t_0) * (D_m / d_m)) / l)))
	return tmp
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
function code(w0, M_m, D_m, h, l, d_m)
	t_0 = Float64(-4.0 / Float64(Float64(D_m * M_m) / d_m))
	tmp = 0.0
	if (d_m <= 2e-41)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(h * Float64(D_m * M_m)) / d_m) / Float64(l * t_0)))));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(Float64(M_m * h) / t_0) * Float64(D_m / d_m)) / l))));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d_m = abs(d);
w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
	t_0 = -4.0 / ((D_m * M_m) / d_m);
	tmp = 0.0;
	if (d_m <= 2e-41)
		tmp = w0 * sqrt((1.0 + (((h * (D_m * M_m)) / d_m) / (l * t_0))));
	else
		tmp = w0 * sqrt((1.0 + ((((M_m * h) / t_0) * (D_m / d_m)) / l)));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
d_m = N[Abs[d], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := Block[{t$95$0 = N[(-4.0 / N[(N[(D$95$m * M$95$m), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d$95$m, 2e-41], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(h * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] / N[(l * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(N[(M$95$m * h), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(D$95$m / d$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
[w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
\\
\begin{array}{l}
t_0 := \frac{-4}{\frac{D\_m \cdot M\_m}{d\_m}}\\
\mathbf{if}\;d\_m \leq 2 \cdot 10^{-41}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D\_m \cdot M\_m\right)}{d\_m}}{\ell \cdot t\_0}}\\

\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{M\_m \cdot h}{t\_0} \cdot \frac{D\_m}{d\_m}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 2.00000000000000001e-41

    1. Initial program 76.9%

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      3. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
      6. distribute-neg-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
    3. Simplified74.9%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(h \cdot M\right) \cdot \frac{D \cdot \left(M \cdot D\right)}{d}}{d \cdot -4}\right), \ell\right)\right)\right)\right) \]
      5. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot D}{d}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot D}}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      12. un-div-invN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
    6. Applied egg-rr79.3%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{h \cdot M}{d} \cdot \frac{\frac{D}{\frac{d}{M \cdot D}}}{-4}}}{\ell}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot M}{d} \cdot \frac{D}{-4 \cdot \frac{d}{M \cdot D}}\right), \ell\right)\right)\right)\right) \]
      2. frac-timesN/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{d}{M \cdot D}\right)\right)\right), \ell\right)\right)\right)\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{1}{\frac{M \cdot D}{d}}\right)\right)\right), \ell\right)\right)\right)\right) \]
      9. un-div-invN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(M \cdot D\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
      13. *-lowering-*.f6478.9%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
    8. Applied egg-rr78.9%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{\left(M \cdot h\right) \cdot D}{d \cdot \frac{-4}{\frac{D \cdot M}{d}}}}}{\ell}} \]
    9. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), h\right), d\right), \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6484.2%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), h\right), d\right), \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right)\right)\right)\right) \]
    10. Applied egg-rr84.2%

      \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{\frac{\left(D \cdot M\right) \cdot h}{d}}{\ell \cdot \frac{-4}{\frac{D \cdot M}{d}}}}} \]

    if 2.00000000000000001e-41 < d

    1. Initial program 83.1%

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      3. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
      6. distribute-neg-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
    3. Simplified82.2%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(h \cdot M\right) \cdot \frac{D \cdot \left(M \cdot D\right)}{d}}{d \cdot -4}\right), \ell\right)\right)\right)\right) \]
      5. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot D}{d}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot D}}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      12. un-div-invN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      15. *-lowering-*.f6483.6%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
    6. Applied egg-rr83.6%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{h \cdot M}{d} \cdot \frac{\frac{D}{\frac{d}{M \cdot D}}}{-4}}}{\ell}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot M}{d} \cdot \frac{D}{-4 \cdot \frac{d}{M \cdot D}}\right), \ell\right)\right)\right)\right) \]
      2. frac-timesN/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{d}{M \cdot D}\right)\right)\right), \ell\right)\right)\right)\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{1}{\frac{M \cdot D}{d}}\right)\right)\right), \ell\right)\right)\right)\right) \]
      9. un-div-invN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(M \cdot D\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
      13. *-lowering-*.f6484.2%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
    8. Applied egg-rr84.2%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{\left(M \cdot h\right) \cdot D}{d \cdot \frac{-4}{\frac{D \cdot M}{d}}}}}{\ell}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(M \cdot h\right) \cdot D}{\frac{-4}{\frac{D \cdot M}{d}} \cdot d}\right), \ell\right)\right)\right)\right) \]
      2. times-fracN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right), \mathsf{/.f64}\left(D, d\right)\right), \ell\right)\right)\right)\right) \]
    10. Applied egg-rr86.7%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{M \cdot h}{\frac{-4}{\frac{D \cdot M}{d}}} \cdot \frac{D}{d}}}{\ell}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 2 \cdot 10^{-41}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D \cdot M\right)}{d}}{\ell \cdot \frac{-4}{\frac{D \cdot M}{d}}}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{M \cdot h}{\frac{-4}{\frac{D \cdot M}{d}}} \cdot \frac{D}{d}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.5% accurate, 1.6× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} t_0 := d\_m \cdot \left(d\_m \cdot \ell\right)\\ \mathbf{if}\;D\_m \leq 1.4 \cdot 10^{+70}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m \cdot D\_m}{d\_m} \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}\right)\right)\\ \mathbf{elif}\;D\_m \leq 1.8 \cdot 10^{+197}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M\_m \cdot \frac{h}{t\_0}}{\frac{-4}{D\_m \cdot \left(D\_m \cdot M\_m\right)}}}\\ \mathbf{else}:\\ \;\;\;\;w0 + D\_m \cdot \frac{D\_m}{\frac{t\_0}{-0.125 \cdot \left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d_m)
 :precision binary64
 (let* ((t_0 (* d_m (* d_m l))))
   (if (<= D_m 1.4e+70)
     (*
      w0
      (+
       1.0
       (* (/ -0.125 l) (* (/ (* D_m D_m) d_m) (/ (* h (* M_m M_m)) d_m)))))
     (if (<= D_m 1.8e+197)
       (* w0 (sqrt (+ 1.0 (/ (* M_m (/ h t_0)) (/ -4.0 (* D_m (* D_m M_m)))))))
       (+ w0 (* D_m (/ D_m (/ t_0 (* -0.125 (* h (* M_m (* w0 M_m))))))))))))
M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
	double t_0 = d_m * (d_m * l);
	double tmp;
	if (D_m <= 1.4e+70) {
		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
	} else if (D_m <= 1.8e+197) {
		tmp = w0 * sqrt((1.0 + ((M_m * (h / t_0)) / (-4.0 / (D_m * (D_m * M_m))))));
	} else {
		tmp = w0 + (D_m * (D_m / (t_0 / (-0.125 * (h * (M_m * (w0 * M_m)))))));
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
d_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_m_1
    real(8) :: t_0
    real(8) :: tmp
    t_0 = d_m_1 * (d_m_1 * l)
    if (d_m <= 1.4d+70) then
        tmp = w0 * (1.0d0 + (((-0.125d0) / l) * (((d_m * d_m) / d_m_1) * ((h * (m_m * m_m)) / d_m_1))))
    else if (d_m <= 1.8d+197) then
        tmp = w0 * sqrt((1.0d0 + ((m_m * (h / t_0)) / ((-4.0d0) / (d_m * (d_m * m_m))))))
    else
        tmp = w0 + (d_m * (d_m / (t_0 / ((-0.125d0) * (h * (m_m * (w0 * m_m)))))))
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
	double t_0 = d_m * (d_m * l);
	double tmp;
	if (D_m <= 1.4e+70) {
		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
	} else if (D_m <= 1.8e+197) {
		tmp = w0 * Math.sqrt((1.0 + ((M_m * (h / t_0)) / (-4.0 / (D_m * (D_m * M_m))))));
	} else {
		tmp = w0 + (D_m * (D_m / (t_0 / (-0.125 * (h * (M_m * (w0 * M_m)))))));
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
d_m = math.fabs(d)
[w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
def code(w0, M_m, D_m, h, l, d_m):
	t_0 = d_m * (d_m * l)
	tmp = 0
	if D_m <= 1.4e+70:
		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))))
	elif D_m <= 1.8e+197:
		tmp = w0 * math.sqrt((1.0 + ((M_m * (h / t_0)) / (-4.0 / (D_m * (D_m * M_m))))))
	else:
		tmp = w0 + (D_m * (D_m / (t_0 / (-0.125 * (h * (M_m * (w0 * M_m)))))))
	return tmp
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
function code(w0, M_m, D_m, h, l, d_m)
	t_0 = Float64(d_m * Float64(d_m * l))
	tmp = 0.0
	if (D_m <= 1.4e+70)
		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(-0.125 / l) * Float64(Float64(Float64(D_m * D_m) / d_m) * Float64(Float64(h * Float64(M_m * M_m)) / d_m)))));
	elseif (D_m <= 1.8e+197)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(M_m * Float64(h / t_0)) / Float64(-4.0 / Float64(D_m * Float64(D_m * M_m)))))));
	else
		tmp = Float64(w0 + Float64(D_m * Float64(D_m / Float64(t_0 / Float64(-0.125 * Float64(h * Float64(M_m * Float64(w0 * M_m))))))));
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d_m = abs(d);
w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
	t_0 = d_m * (d_m * l);
	tmp = 0.0;
	if (D_m <= 1.4e+70)
		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
	elseif (D_m <= 1.8e+197)
		tmp = w0 * sqrt((1.0 + ((M_m * (h / t_0)) / (-4.0 / (D_m * (D_m * M_m))))));
	else
		tmp = w0 + (D_m * (D_m / (t_0 / (-0.125 * (h * (M_m * (w0 * M_m)))))));
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
d_m = N[Abs[d], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := Block[{t$95$0 = N[(d$95$m * N[(d$95$m * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[D$95$m, 1.4e+70], N[(w0 * N[(1.0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D$95$m, 1.8e+197], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(M$95$m * N[(h / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(-4.0 / N[(D$95$m * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 + N[(D$95$m * N[(D$95$m / N[(t$95$0 / N[(-0.125 * N[(h * N[(M$95$m * N[(w0 * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
[w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
\\
\begin{array}{l}
t_0 := d\_m \cdot \left(d\_m \cdot \ell\right)\\
\mathbf{if}\;D\_m \leq 1.4 \cdot 10^{+70}:\\
\;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m \cdot D\_m}{d\_m} \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}\right)\right)\\

\mathbf{elif}\;D\_m \leq 1.8 \cdot 10^{+197}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{M\_m \cdot \frac{h}{t\_0}}{\frac{-4}{D\_m \cdot \left(D\_m \cdot M\_m\right)}}}\\

\mathbf{else}:\\
\;\;\;\;w0 + D\_m \cdot \frac{D\_m}{\frac{t\_0}{-0.125 \cdot \left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if D < 1.39999999999999995e70

    1. Initial program 79.5%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \frac{1}{h}}\right)\right)\right)\right) \]
      5. times-fracN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      12. clear-numN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \left(\frac{1}{h}\right)\right)\right)\right)\right)\right) \]
    4. Applied egg-rr89.1%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\ell} \cdot \frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\frac{1}{h}}}} \]
    5. Taylor expanded in D around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), d\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right)\right)\right)\right)\right) \]
    7. Simplified61.4%

      \[\leadsto w0 \cdot \color{blue}{\left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]

    if 1.39999999999999995e70 < D < 1.79999999999999991e197

    1. Initial program 85.9%

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      3. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
      6. distribute-neg-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
    3. Simplified82.8%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{M \cdot h}{\frac{-4}{D \cdot \left(M \cdot D\right)} \cdot \left(d \cdot d\right)}\right), \ell\right)\right)\right)\right) \]
      7. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(\mathsf{/.f64}\left(-4, D\right), \mathsf{*.f64}\left(M, D\right)\right)\right), \mathsf{/.f64}\left(h, \mathsf{*.f64}\left(d, d\right)\right)\right), \ell\right)\right)\right)\right) \]
    6. Applied egg-rr70.7%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{M}{\frac{\frac{-4}{D}}{M \cdot D}} \cdot \frac{h}{d \cdot d}}}{\ell}} \]
    7. Step-by-step derivation
      1. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right)\right), \mathsf{/.f64}\left(-4, \left(\left(M \cdot D\right) \cdot D\right)\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right)\right), \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(D, \left(M \cdot D\right)\right)\right)\right)\right)\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right)\right), \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(D, \left(D \cdot M\right)\right)\right)\right)\right)\right)\right) \]
      18. *-lowering-*.f6482.4%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{/.f64}\left(h, \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right)\right), \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(D, M\right)\right)\right)\right)\right)\right)\right) \]
    8. Applied egg-rr82.4%

      \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{M \cdot \frac{h}{d \cdot \left(d \cdot \ell\right)}}{\frac{-4}{D \cdot \left(D \cdot M\right)}}}} \]

    if 1.79999999999999991e197 < D

    1. Initial program 62.5%

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      3. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
      6. distribute-neg-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
    3. Simplified51.6%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
    4. Add Preprocessing
    5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
    7. Simplified28.1%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\left(D \cdot \frac{\frac{-1}{8} \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}\right), \color{blue}{D}\right)\right) \]
    9. Applied egg-rr62.9%

      \[\leadsto w0 + \color{blue}{\frac{D}{\frac{d \cdot \left(d \cdot \ell\right)}{-0.125 \cdot \left(h \cdot \left(M \cdot \left(M \cdot w0\right)\right)\right)}} \cdot D} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 1.4 \cdot 10^{+70}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)\\ \mathbf{elif}\;D \leq 1.8 \cdot 10^{+197}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{M \cdot \frac{h}{d \cdot \left(d \cdot \ell\right)}}{\frac{-4}{D \cdot \left(D \cdot M\right)}}}\\ \mathbf{else}:\\ \;\;\;\;w0 + D \cdot \frac{D}{\frac{d \cdot \left(d \cdot \ell\right)}{-0.125 \cdot \left(h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 85.3% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-323}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{M\_m \cdot h}{\frac{-4}{\frac{D\_m \cdot M\_m}{d\_m}}} \cdot \frac{D\_m}{d\_m}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
d_m = (fabs.f64 d)
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d_m)
 :precision binary64
 (if (<= (/ h l) -2e-323)
   (*
    w0
    (sqrt
     (+ 1.0 (/ (* (/ (* M_m h) (/ -4.0 (/ (* D_m M_m) d_m))) (/ D_m d_m)) l))))
   w0))
M_m = fabs(M);
D_m = fabs(D);
d_m = fabs(d);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
	double tmp;
	if ((h / l) <= -2e-323) {
		tmp = w0 * sqrt((1.0 + ((((M_m * h) / (-4.0 / ((D_m * M_m) / d_m))) * (D_m / d_m)) / l)));
	} else {
		tmp = w0;
	}
	return tmp;
}
M_m = abs(m)
D_m = abs(d)
d_m = abs(d)
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
real(8) function code(w0, m_m, d_m, h, l, d_m_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_m_1
    real(8) :: tmp
    if ((h / l) <= (-2d-323)) then
        tmp = w0 * sqrt((1.0d0 + ((((m_m * h) / ((-4.0d0) / ((d_m * m_m) / d_m_1))) * (d_m / d_m_1)) / l)))
    else
        tmp = w0
    end if
    code = tmp
end function
M_m = Math.abs(M);
D_m = Math.abs(D);
d_m = Math.abs(d);
assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
	double tmp;
	if ((h / l) <= -2e-323) {
		tmp = w0 * Math.sqrt((1.0 + ((((M_m * h) / (-4.0 / ((D_m * M_m) / d_m))) * (D_m / d_m)) / l)));
	} else {
		tmp = w0;
	}
	return tmp;
}
M_m = math.fabs(M)
D_m = math.fabs(D)
d_m = math.fabs(d)
[w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
def code(w0, M_m, D_m, h, l, d_m):
	tmp = 0
	if (h / l) <= -2e-323:
		tmp = w0 * math.sqrt((1.0 + ((((M_m * h) / (-4.0 / ((D_m * M_m) / d_m))) * (D_m / d_m)) / l)))
	else:
		tmp = w0
	return tmp
M_m = abs(M)
D_m = abs(D)
d_m = abs(d)
w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
function code(w0, M_m, D_m, h, l, d_m)
	tmp = 0.0
	if (Float64(h / l) <= -2e-323)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(Float64(M_m * h) / Float64(-4.0 / Float64(Float64(D_m * M_m) / d_m))) * Float64(D_m / d_m)) / l))));
	else
		tmp = w0;
	end
	return tmp
end
M_m = abs(M);
D_m = abs(D);
d_m = abs(d);
w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
	tmp = 0.0;
	if ((h / l) <= -2e-323)
		tmp = w0 * sqrt((1.0 + ((((M_m * h) / (-4.0 / ((D_m * M_m) / d_m))) * (D_m / d_m)) / l)));
	else
		tmp = w0;
	end
	tmp_2 = tmp;
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
d_m = N[Abs[d], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[N[(h / l), $MachinePrecision], -2e-323], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(N[(M$95$m * h), $MachinePrecision] / N[(-4.0 / N[(N[(D$95$m * M$95$m), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / d$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
d_m = \left|d\right|
\\
[w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-323}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{M\_m \cdot h}{\frac{-4}{\frac{D\_m \cdot M\_m}{d\_m}}} \cdot \frac{D\_m}{d\_m}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;w0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 h l) < -1.97626e-323

    1. Initial program 79.7%

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      3. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
      6. distribute-neg-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
    3. Simplified75.4%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(h \cdot M\right) \cdot \frac{D \cdot \left(M \cdot D\right)}{d}}{d \cdot -4}\right), \ell\right)\right)\right)\right) \]
      5. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot D}{d}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot D}}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      12. un-div-invN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
      15. *-lowering-*.f6478.5%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
    6. Applied egg-rr78.5%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{h \cdot M}{d} \cdot \frac{\frac{D}{\frac{d}{M \cdot D}}}{-4}}}{\ell}} \]
    7. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot M}{d} \cdot \frac{D}{-4 \cdot \frac{d}{M \cdot D}}\right), \ell\right)\right)\right)\right) \]
      2. frac-timesN/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{d}{M \cdot D}\right)\right)\right), \ell\right)\right)\right)\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{1}{\frac{M \cdot D}{d}}\right)\right)\right), \ell\right)\right)\right)\right) \]
      9. un-div-invN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(M \cdot D\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
      13. *-lowering-*.f6479.0%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
    8. Applied egg-rr79.0%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{\left(M \cdot h\right) \cdot D}{d \cdot \frac{-4}{\frac{D \cdot M}{d}}}}}{\ell}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(M \cdot h\right) \cdot D}{\frac{-4}{\frac{D \cdot M}{d}} \cdot d}\right), \ell\right)\right)\right)\right) \]
      2. times-fracN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right), \left(\frac{D}{d}\right)\right), \ell\right)\right)\right)\right) \]
      9. /-lowering-/.f6479.8%

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, h\right), \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right), \mathsf{/.f64}\left(D, d\right)\right), \ell\right)\right)\right)\right) \]
    10. Applied egg-rr79.8%

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{M \cdot h}{\frac{-4}{\frac{D \cdot M}{d}}} \cdot \frac{D}{d}}}{\ell}} \]

    if -1.97626e-323 < (/.f64 h l)

    1. Initial program 78.0%

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
      3. sub-negN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
      6. distribute-neg-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
    3. Simplified80.3%

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
    4. Add Preprocessing
    5. Taylor expanded in h around 0

      \[\leadsto \color{blue}{w0} \]
    6. Step-by-step derivation
      1. Simplified91.7%

        \[\leadsto \color{blue}{w0} \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 4: 84.5% accurate, 1.7× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-323}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{h}{-4 \cdot \frac{\frac{d\_m}{D\_m \cdot M\_m}}{D\_m}} \cdot \frac{M\_m}{d\_m}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    d_m = (fabs.f64 d)
    NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
    (FPCore (w0 M_m D_m h l d_m)
     :precision binary64
     (if (<= (/ h l) -2e-323)
       (*
        w0
        (sqrt
         (+ 1.0 (/ (* (/ h (* -4.0 (/ (/ d_m (* D_m M_m)) D_m))) (/ M_m d_m)) l))))
       w0))
    M_m = fabs(M);
    D_m = fabs(D);
    d_m = fabs(d);
    assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
    double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
    	double tmp;
    	if ((h / l) <= -2e-323) {
    		tmp = w0 * sqrt((1.0 + (((h / (-4.0 * ((d_m / (D_m * M_m)) / D_m))) * (M_m / d_m)) / l)));
    	} else {
    		tmp = w0;
    	}
    	return tmp;
    }
    
    M_m = abs(m)
    D_m = abs(d)
    d_m = abs(d)
    NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
    real(8) function code(w0, m_m, d_m, h, l, d_m_1)
        real(8), intent (in) :: w0
        real(8), intent (in) :: m_m
        real(8), intent (in) :: d_m
        real(8), intent (in) :: h
        real(8), intent (in) :: l
        real(8), intent (in) :: d_m_1
        real(8) :: tmp
        if ((h / l) <= (-2d-323)) then
            tmp = w0 * sqrt((1.0d0 + (((h / ((-4.0d0) * ((d_m_1 / (d_m * m_m)) / d_m))) * (m_m / d_m_1)) / l)))
        else
            tmp = w0
        end if
        code = tmp
    end function
    
    M_m = Math.abs(M);
    D_m = Math.abs(D);
    d_m = Math.abs(d);
    assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
    public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
    	double tmp;
    	if ((h / l) <= -2e-323) {
    		tmp = w0 * Math.sqrt((1.0 + (((h / (-4.0 * ((d_m / (D_m * M_m)) / D_m))) * (M_m / d_m)) / l)));
    	} else {
    		tmp = w0;
    	}
    	return tmp;
    }
    
    M_m = math.fabs(M)
    D_m = math.fabs(D)
    d_m = math.fabs(d)
    [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
    def code(w0, M_m, D_m, h, l, d_m):
    	tmp = 0
    	if (h / l) <= -2e-323:
    		tmp = w0 * math.sqrt((1.0 + (((h / (-4.0 * ((d_m / (D_m * M_m)) / D_m))) * (M_m / d_m)) / l)))
    	else:
    		tmp = w0
    	return tmp
    
    M_m = abs(M)
    D_m = abs(D)
    d_m = abs(d)
    w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
    function code(w0, M_m, D_m, h, l, d_m)
    	tmp = 0.0
    	if (Float64(h / l) <= -2e-323)
    		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(h / Float64(-4.0 * Float64(Float64(d_m / Float64(D_m * M_m)) / D_m))) * Float64(M_m / d_m)) / l))));
    	else
    		tmp = w0;
    	end
    	return tmp
    end
    
    M_m = abs(M);
    D_m = abs(D);
    d_m = abs(d);
    w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
    function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
    	tmp = 0.0;
    	if ((h / l) <= -2e-323)
    		tmp = w0 * sqrt((1.0 + (((h / (-4.0 * ((d_m / (D_m * M_m)) / D_m))) * (M_m / d_m)) / l)));
    	else
    		tmp = w0;
    	end
    	tmp_2 = tmp;
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    d_m = N[Abs[d], $MachinePrecision]
    NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
    code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[N[(h / l), $MachinePrecision], -2e-323], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(h / N[(-4.0 * N[(N[(d$95$m / N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M$95$m / d$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    d_m = \left|d\right|
    \\
    [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-323}:\\
    \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{h}{-4 \cdot \frac{\frac{d\_m}{D\_m \cdot M\_m}}{D\_m}} \cdot \frac{M\_m}{d\_m}}{\ell}}\\
    
    \mathbf{else}:\\
    \;\;\;\;w0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 h l) < -1.97626e-323

      1. Initial program 79.7%

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

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
        3. sub-negN/A

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
        5. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
        6. distribute-neg-fracN/A

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
      3. Simplified75.4%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)\right), \ell\right)\right)\right)\right) \]
      6. Applied egg-rr78.5%

        \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{\frac{h}{-4 \cdot \frac{\frac{d}{M \cdot D}}{D}} \cdot \frac{M}{d}}{\ell}}} \]

      if -1.97626e-323 < (/.f64 h l)

      1. Initial program 78.0%

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

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
        3. sub-negN/A

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
        5. associate-*r/N/A

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
        6. distribute-neg-fracN/A

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
      3. Simplified80.3%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
      4. Add Preprocessing
      5. Taylor expanded in h around 0

        \[\leadsto \color{blue}{w0} \]
      6. Step-by-step derivation
        1. Simplified91.7%

          \[\leadsto \color{blue}{w0} \]
      7. Recombined 2 regimes into one program.
      8. Final simplification83.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -2 \cdot 10^{-323}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{h}{-4 \cdot \frac{\frac{d}{D \cdot M}}{D}} \cdot \frac{M}{d}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
      9. Add Preprocessing

      Alternative 5: 81.4% accurate, 1.7× speedup?

      \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{-189}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \left(M\_m \cdot \frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot M\_m\right)}{d\_m}}{d\_m}}{-4}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
      M_m = (fabs.f64 M)
      D_m = (fabs.f64 D)
      d_m = (fabs.f64 d)
      NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
      (FPCore (w0 M_m D_m h l d_m)
       :precision binary64
       (if (<= (/ h l) -5e-189)
         (*
          w0
          (sqrt
           (+ 1.0 (/ (* h (* M_m (/ (/ (/ (* D_m (* D_m M_m)) d_m) d_m) -4.0))) l))))
         w0))
      M_m = fabs(M);
      D_m = fabs(D);
      d_m = fabs(d);
      assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
      double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
      	double tmp;
      	if ((h / l) <= -5e-189) {
      		tmp = w0 * sqrt((1.0 + ((h * (M_m * ((((D_m * (D_m * M_m)) / d_m) / d_m) / -4.0))) / l)));
      	} else {
      		tmp = w0;
      	}
      	return tmp;
      }
      
      M_m = abs(m)
      D_m = abs(d)
      d_m = abs(d)
      NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
      real(8) function code(w0, m_m, d_m, h, l, d_m_1)
          real(8), intent (in) :: w0
          real(8), intent (in) :: m_m
          real(8), intent (in) :: d_m
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: d_m_1
          real(8) :: tmp
          if ((h / l) <= (-5d-189)) then
              tmp = w0 * sqrt((1.0d0 + ((h * (m_m * ((((d_m * (d_m * m_m)) / d_m_1) / d_m_1) / (-4.0d0)))) / l)))
          else
              tmp = w0
          end if
          code = tmp
      end function
      
      M_m = Math.abs(M);
      D_m = Math.abs(D);
      d_m = Math.abs(d);
      assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
      public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
      	double tmp;
      	if ((h / l) <= -5e-189) {
      		tmp = w0 * Math.sqrt((1.0 + ((h * (M_m * ((((D_m * (D_m * M_m)) / d_m) / d_m) / -4.0))) / l)));
      	} else {
      		tmp = w0;
      	}
      	return tmp;
      }
      
      M_m = math.fabs(M)
      D_m = math.fabs(D)
      d_m = math.fabs(d)
      [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
      def code(w0, M_m, D_m, h, l, d_m):
      	tmp = 0
      	if (h / l) <= -5e-189:
      		tmp = w0 * math.sqrt((1.0 + ((h * (M_m * ((((D_m * (D_m * M_m)) / d_m) / d_m) / -4.0))) / l)))
      	else:
      		tmp = w0
      	return tmp
      
      M_m = abs(M)
      D_m = abs(D)
      d_m = abs(d)
      w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
      function code(w0, M_m, D_m, h, l, d_m)
      	tmp = 0.0
      	if (Float64(h / l) <= -5e-189)
      		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(h * Float64(M_m * Float64(Float64(Float64(Float64(D_m * Float64(D_m * M_m)) / d_m) / d_m) / -4.0))) / l))));
      	else
      		tmp = w0;
      	end
      	return tmp
      end
      
      M_m = abs(M);
      D_m = abs(D);
      d_m = abs(d);
      w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
      function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
      	tmp = 0.0;
      	if ((h / l) <= -5e-189)
      		tmp = w0 * sqrt((1.0 + ((h * (M_m * ((((D_m * (D_m * M_m)) / d_m) / d_m) / -4.0))) / l)));
      	else
      		tmp = w0;
      	end
      	tmp_2 = tmp;
      end
      
      M_m = N[Abs[M], $MachinePrecision]
      D_m = N[Abs[D], $MachinePrecision]
      d_m = N[Abs[d], $MachinePrecision]
      NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
      code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[N[(h / l), $MachinePrecision], -5e-189], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(h * N[(M$95$m * N[(N[(N[(N[(D$95$m * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] / d$95$m), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
      
      \begin{array}{l}
      M_m = \left|M\right|
      \\
      D_m = \left|D\right|
      \\
      d_m = \left|d\right|
      \\
      [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{-189}:\\
      \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \left(M\_m \cdot \frac{\frac{\frac{D\_m \cdot \left(D\_m \cdot M\_m\right)}{d\_m}}{d\_m}}{-4}\right)}{\ell}}\\
      
      \mathbf{else}:\\
      \;\;\;\;w0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 h l) < -4.9999999999999997e-189

        1. Initial program 80.9%

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

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
          3. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
          5. associate-*r/N/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
          6. distribute-neg-fracN/A

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
        3. Simplified77.5%

          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
        4. Add Preprocessing

        if -4.9999999999999997e-189 < (/.f64 h l)

        1. Initial program 77.0%

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

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
          3. sub-negN/A

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
          5. associate-*r/N/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
          6. distribute-neg-fracN/A

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
        3. Simplified77.3%

          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
        4. Add Preprocessing
        5. Taylor expanded in h around 0

          \[\leadsto \color{blue}{w0} \]
        6. Step-by-step derivation
          1. Simplified87.6%

            \[\leadsto \color{blue}{w0} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification82.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{-189}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(D \cdot M\right)}{d}}{d}}{-4}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
        9. Add Preprocessing

        Alternative 6: 88.7% accurate, 1.7× speedup?

        \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} t_0 := \frac{\frac{D\_m}{\frac{2}{M\_m}}}{d\_m}\\ w0 \cdot \sqrt{1 + \frac{t\_0}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}} \end{array} \end{array} \]
        M_m = (fabs.f64 M)
        D_m = (fabs.f64 D)
        d_m = (fabs.f64 d)
        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
        (FPCore (w0 M_m D_m h l d_m)
         :precision binary64
         (let* ((t_0 (/ (/ D_m (/ 2.0 M_m)) d_m)))
           (* w0 (sqrt (+ 1.0 (* (/ t_0 l) (/ t_0 (/ -1.0 h))))))))
        M_m = fabs(M);
        D_m = fabs(D);
        d_m = fabs(d);
        assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
        double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
        	double t_0 = (D_m / (2.0 / M_m)) / d_m;
        	return w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
        }
        
        M_m = abs(m)
        D_m = abs(d)
        d_m = abs(d)
        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
        real(8) function code(w0, m_m, d_m, h, l, d_m_1)
            real(8), intent (in) :: w0
            real(8), intent (in) :: m_m
            real(8), intent (in) :: d_m
            real(8), intent (in) :: h
            real(8), intent (in) :: l
            real(8), intent (in) :: d_m_1
            real(8) :: t_0
            t_0 = (d_m / (2.0d0 / m_m)) / d_m_1
            code = w0 * sqrt((1.0d0 + ((t_0 / l) * (t_0 / ((-1.0d0) / h)))))
        end function
        
        M_m = Math.abs(M);
        D_m = Math.abs(D);
        d_m = Math.abs(d);
        assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
        public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
        	double t_0 = (D_m / (2.0 / M_m)) / d_m;
        	return w0 * Math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
        }
        
        M_m = math.fabs(M)
        D_m = math.fabs(D)
        d_m = math.fabs(d)
        [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
        def code(w0, M_m, D_m, h, l, d_m):
        	t_0 = (D_m / (2.0 / M_m)) / d_m
        	return w0 * math.sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))))
        
        M_m = abs(M)
        D_m = abs(D)
        d_m = abs(d)
        w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
        function code(w0, M_m, D_m, h, l, d_m)
        	t_0 = Float64(Float64(D_m / Float64(2.0 / M_m)) / d_m)
        	return Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(t_0 / l) * Float64(t_0 / Float64(-1.0 / h))))))
        end
        
        M_m = abs(M);
        D_m = abs(D);
        d_m = abs(d);
        w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
        function tmp = code(w0, M_m, D_m, h, l, d_m)
        	t_0 = (D_m / (2.0 / M_m)) / d_m;
        	tmp = w0 * sqrt((1.0 + ((t_0 / l) * (t_0 / (-1.0 / h)))));
        end
        
        M_m = N[Abs[M], $MachinePrecision]
        D_m = N[Abs[D], $MachinePrecision]
        d_m = N[Abs[d], $MachinePrecision]
        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
        code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := Block[{t$95$0 = N[(N[(D$95$m / N[(2.0 / M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 + N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        M_m = \left|M\right|
        \\
        D_m = \left|D\right|
        \\
        d_m = \left|d\right|
        \\
        [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
        \\
        \begin{array}{l}
        t_0 := \frac{\frac{D\_m}{\frac{2}{M\_m}}}{d\_m}\\
        w0 \cdot \sqrt{1 + \frac{t\_0}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}}
        \end{array}
        \end{array}
        
        Derivation
        1. Initial program 79.0%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. clear-numN/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{\frac{\ell}{h}}\right)\right)\right)\right) \]
          2. un-div-invN/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
          3. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
          4. div-invN/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \frac{1}{h}}\right)\right)\right)\right) \]
          5. times-fracN/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

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

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

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
          10. *-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
          12. clear-numN/A

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

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

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
          16. /-lowering-/.f64N/A

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \left(\frac{1}{h}\right)\right)\right)\right)\right)\right) \]
        4. Applied egg-rr87.3%

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\ell} \cdot \frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\frac{1}{h}}}} \]
        5. Final simplification87.3%

          \[\leadsto w0 \cdot \sqrt{1 + \frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\ell} \cdot \frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\frac{-1}{h}}} \]
        6. Add Preprocessing

        Alternative 7: 74.1% accurate, 7.0× speedup?

        \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;d\_m \leq 2 \cdot 10^{-163}:\\ \;\;\;\;w0 + \left(D\_m \cdot D\_m\right) \cdot \frac{\frac{-0.125 \cdot \left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}{d\_m}}{d\_m \cdot \ell}\\ \mathbf{elif}\;d\_m \leq 1.26 \cdot 10^{-42}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \frac{h \cdot \left(M\_m \cdot \left(M\_m \cdot \left(D\_m \cdot D\_m\right)\right)\right)}{d\_m \cdot d\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
        M_m = (fabs.f64 M)
        D_m = (fabs.f64 D)
        d_m = (fabs.f64 d)
        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
        (FPCore (w0 M_m D_m h l d_m)
         :precision binary64
         (if (<= d_m 2e-163)
           (+
            w0
            (* (* D_m D_m) (/ (/ (* -0.125 (* h (* M_m (* w0 M_m)))) d_m) (* d_m l))))
           (if (<= d_m 1.26e-42)
             (*
              w0
              (+
               1.0
               (* (/ -0.125 l) (/ (* h (* M_m (* M_m (* D_m D_m)))) (* d_m d_m)))))
             w0)))
        M_m = fabs(M);
        D_m = fabs(D);
        d_m = fabs(d);
        assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
        double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
        	double tmp;
        	if (d_m <= 2e-163) {
        		tmp = w0 + ((D_m * D_m) * (((-0.125 * (h * (M_m * (w0 * M_m)))) / d_m) / (d_m * l)));
        	} else if (d_m <= 1.26e-42) {
        		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))));
        	} else {
        		tmp = w0;
        	}
        	return tmp;
        }
        
        M_m = abs(m)
        D_m = abs(d)
        d_m = abs(d)
        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
        real(8) function code(w0, m_m, d_m, h, l, d_m_1)
            real(8), intent (in) :: w0
            real(8), intent (in) :: m_m
            real(8), intent (in) :: d_m
            real(8), intent (in) :: h
            real(8), intent (in) :: l
            real(8), intent (in) :: d_m_1
            real(8) :: tmp
            if (d_m_1 <= 2d-163) then
                tmp = w0 + ((d_m * d_m) * ((((-0.125d0) * (h * (m_m * (w0 * m_m)))) / d_m_1) / (d_m_1 * l)))
            else if (d_m_1 <= 1.26d-42) then
                tmp = w0 * (1.0d0 + (((-0.125d0) / l) * ((h * (m_m * (m_m * (d_m * d_m)))) / (d_m_1 * d_m_1))))
            else
                tmp = w0
            end if
            code = tmp
        end function
        
        M_m = Math.abs(M);
        D_m = Math.abs(D);
        d_m = Math.abs(d);
        assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
        public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
        	double tmp;
        	if (d_m <= 2e-163) {
        		tmp = w0 + ((D_m * D_m) * (((-0.125 * (h * (M_m * (w0 * M_m)))) / d_m) / (d_m * l)));
        	} else if (d_m <= 1.26e-42) {
        		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))));
        	} else {
        		tmp = w0;
        	}
        	return tmp;
        }
        
        M_m = math.fabs(M)
        D_m = math.fabs(D)
        d_m = math.fabs(d)
        [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
        def code(w0, M_m, D_m, h, l, d_m):
        	tmp = 0
        	if d_m <= 2e-163:
        		tmp = w0 + ((D_m * D_m) * (((-0.125 * (h * (M_m * (w0 * M_m)))) / d_m) / (d_m * l)))
        	elif d_m <= 1.26e-42:
        		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))))
        	else:
        		tmp = w0
        	return tmp
        
        M_m = abs(M)
        D_m = abs(D)
        d_m = abs(d)
        w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
        function code(w0, M_m, D_m, h, l, d_m)
        	tmp = 0.0
        	if (d_m <= 2e-163)
        		tmp = Float64(w0 + Float64(Float64(D_m * D_m) * Float64(Float64(Float64(-0.125 * Float64(h * Float64(M_m * Float64(w0 * M_m)))) / d_m) / Float64(d_m * l))));
        	elseif (d_m <= 1.26e-42)
        		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(-0.125 / l) * Float64(Float64(h * Float64(M_m * Float64(M_m * Float64(D_m * D_m)))) / Float64(d_m * d_m)))));
        	else
        		tmp = w0;
        	end
        	return tmp
        end
        
        M_m = abs(M);
        D_m = abs(D);
        d_m = abs(d);
        w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
        function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
        	tmp = 0.0;
        	if (d_m <= 2e-163)
        		tmp = w0 + ((D_m * D_m) * (((-0.125 * (h * (M_m * (w0 * M_m)))) / d_m) / (d_m * l)));
        	elseif (d_m <= 1.26e-42)
        		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))));
        	else
        		tmp = w0;
        	end
        	tmp_2 = tmp;
        end
        
        M_m = N[Abs[M], $MachinePrecision]
        D_m = N[Abs[D], $MachinePrecision]
        d_m = N[Abs[d], $MachinePrecision]
        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
        code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[d$95$m, 2e-163], N[(w0 + N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(-0.125 * N[(h * N[(M$95$m * N[(w0 * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] / N[(d$95$m * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d$95$m, 1.26e-42], N[(w0 * N[(1.0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(h * N[(M$95$m * N[(M$95$m * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d$95$m * d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]]
        
        \begin{array}{l}
        M_m = \left|M\right|
        \\
        D_m = \left|D\right|
        \\
        d_m = \left|d\right|
        \\
        [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;d\_m \leq 2 \cdot 10^{-163}:\\
        \;\;\;\;w0 + \left(D\_m \cdot D\_m\right) \cdot \frac{\frac{-0.125 \cdot \left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}{d\_m}}{d\_m \cdot \ell}\\
        
        \mathbf{elif}\;d\_m \leq 1.26 \cdot 10^{-42}:\\
        \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \frac{h \cdot \left(M\_m \cdot \left(M\_m \cdot \left(D\_m \cdot D\_m\right)\right)\right)}{d\_m \cdot d\_m}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;w0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if d < 1.99999999999999985e-163

          1. Initial program 77.8%

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
            3. sub-negN/A

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
            5. associate-*r/N/A

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
            6. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
          3. Simplified76.2%

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
          4. Add Preprocessing
          5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
          7. Simplified47.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, w0\right)\right)\right)\right), d\right), \left(d \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
            14. *-lowering-*.f6461.5%

              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, w0\right)\right)\right)\right), d\right), \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right) \]
          9. Applied egg-rr61.5%

            \[\leadsto w0 + \left(D \cdot D\right) \cdot \color{blue}{\frac{\frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(M \cdot w0\right)\right)\right)}{d}}{d \cdot \ell}} \]

          if 1.99999999999999985e-163 < d < 1.26e-42

          1. Initial program 72.7%

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
            3. sub-negN/A

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
            5. associate-*r/N/A

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
            6. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
          3. Simplified67.3%

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
          4. Add Preprocessing
          5. Step-by-step derivation
            1. associate-*r*N/A

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

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(h \cdot M\right) \cdot \frac{D \cdot \left(M \cdot D\right)}{d}}{d \cdot -4}\right), \ell\right)\right)\right)\right) \]
            5. times-fracN/A

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot D}{d}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
            11. clear-numN/A

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot D}}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
            12. un-div-invN/A

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
            15. *-lowering-*.f6473.1%

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
          6. Applied egg-rr73.1%

            \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{h \cdot M}{d} \cdot \frac{\frac{D}{\frac{d}{M \cdot D}}}{-4}}}{\ell}} \]
          7. Step-by-step derivation
            1. associate-/l/N/A

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot M}{d} \cdot \frac{D}{-4 \cdot \frac{d}{M \cdot D}}\right), \ell\right)\right)\right)\right) \]
            2. frac-timesN/A

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{d}{M \cdot D}\right)\right)\right), \ell\right)\right)\right)\right) \]
            8. clear-numN/A

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{1}{\frac{M \cdot D}{d}}\right)\right)\right), \ell\right)\right)\right)\right) \]
            9. un-div-invN/A

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(M \cdot D\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
            13. *-lowering-*.f6484.0%

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
          8. Applied egg-rr84.0%

            \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{\left(M \cdot h\right) \cdot D}{d \cdot \frac{-4}{\frac{D \cdot M}{d}}}}}{\ell}} \]
          9. Step-by-step derivation
            1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), h\right), d\right), \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right)\right)\right)\right) \]
            12. *-lowering-*.f6489.1%

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), h\right), d\right), \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right)\right)\right)\right) \]
          10. Applied egg-rr89.1%

            \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{\frac{\left(D \cdot M\right) \cdot h}{d}}{\ell \cdot \frac{-4}{\frac{D \cdot M}{d}}}}} \]
          11. Taylor expanded in D around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), M\right), M\right), h\right), \left(d \cdot \color{blue}{d}\right)\right)\right)\right)\right) \]
            17. *-lowering-*.f6468.3%

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), M\right), M\right), h\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right)\right)\right) \]
          13. Simplified68.3%

            \[\leadsto w0 \cdot \color{blue}{\left(1 + \frac{-0.125}{\ell} \cdot \frac{\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h}{d \cdot d}\right)} \]

          if 1.26e-42 < d

          1. Initial program 82.3%

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

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
            3. sub-negN/A

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
            5. associate-*r/N/A

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
            6. distribute-neg-fracN/A

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

              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
          3. Simplified81.5%

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
          4. Add Preprocessing
          5. Taylor expanded in h around 0

            \[\leadsto \color{blue}{w0} \]
          6. Step-by-step derivation
            1. Simplified78.0%

              \[\leadsto \color{blue}{w0} \]
          7. Recombined 3 regimes into one program.
          8. Final simplification67.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 2 \cdot 10^{-163}:\\ \;\;\;\;w0 + \left(D \cdot D\right) \cdot \frac{\frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)\right)}{d}}{d \cdot \ell}\\ \mathbf{elif}\;d \leq 1.26 \cdot 10^{-42}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \frac{h \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{d \cdot d}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
          9. Add Preprocessing

          Alternative 8: 73.4% accurate, 7.0× speedup?

          \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;d\_m \leq 2.35 \cdot 10^{-163}:\\ \;\;\;\;w0 + \left(D\_m \cdot D\_m\right) \cdot \left(\frac{h \cdot -0.125}{d\_m} \cdot \frac{M\_m \cdot \left(w0 \cdot M\_m\right)}{d\_m \cdot \ell}\right)\\ \mathbf{elif}\;d\_m \leq 1.25 \cdot 10^{-42}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \frac{h \cdot \left(M\_m \cdot \left(M\_m \cdot \left(D\_m \cdot D\_m\right)\right)\right)}{d\_m \cdot d\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
          M_m = (fabs.f64 M)
          D_m = (fabs.f64 D)
          d_m = (fabs.f64 d)
          NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
          (FPCore (w0 M_m D_m h l d_m)
           :precision binary64
           (if (<= d_m 2.35e-163)
             (+
              w0
              (* (* D_m D_m) (* (/ (* h -0.125) d_m) (/ (* M_m (* w0 M_m)) (* d_m l)))))
             (if (<= d_m 1.25e-42)
               (*
                w0
                (+
                 1.0
                 (* (/ -0.125 l) (/ (* h (* M_m (* M_m (* D_m D_m)))) (* d_m d_m)))))
               w0)))
          M_m = fabs(M);
          D_m = fabs(D);
          d_m = fabs(d);
          assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
          double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
          	double tmp;
          	if (d_m <= 2.35e-163) {
          		tmp = w0 + ((D_m * D_m) * (((h * -0.125) / d_m) * ((M_m * (w0 * M_m)) / (d_m * l))));
          	} else if (d_m <= 1.25e-42) {
          		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))));
          	} else {
          		tmp = w0;
          	}
          	return tmp;
          }
          
          M_m = abs(m)
          D_m = abs(d)
          d_m = abs(d)
          NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
          real(8) function code(w0, m_m, d_m, h, l, d_m_1)
              real(8), intent (in) :: w0
              real(8), intent (in) :: m_m
              real(8), intent (in) :: d_m
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: d_m_1
              real(8) :: tmp
              if (d_m_1 <= 2.35d-163) then
                  tmp = w0 + ((d_m * d_m) * (((h * (-0.125d0)) / d_m_1) * ((m_m * (w0 * m_m)) / (d_m_1 * l))))
              else if (d_m_1 <= 1.25d-42) then
                  tmp = w0 * (1.0d0 + (((-0.125d0) / l) * ((h * (m_m * (m_m * (d_m * d_m)))) / (d_m_1 * d_m_1))))
              else
                  tmp = w0
              end if
              code = tmp
          end function
          
          M_m = Math.abs(M);
          D_m = Math.abs(D);
          d_m = Math.abs(d);
          assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
          public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
          	double tmp;
          	if (d_m <= 2.35e-163) {
          		tmp = w0 + ((D_m * D_m) * (((h * -0.125) / d_m) * ((M_m * (w0 * M_m)) / (d_m * l))));
          	} else if (d_m <= 1.25e-42) {
          		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))));
          	} else {
          		tmp = w0;
          	}
          	return tmp;
          }
          
          M_m = math.fabs(M)
          D_m = math.fabs(D)
          d_m = math.fabs(d)
          [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
          def code(w0, M_m, D_m, h, l, d_m):
          	tmp = 0
          	if d_m <= 2.35e-163:
          		tmp = w0 + ((D_m * D_m) * (((h * -0.125) / d_m) * ((M_m * (w0 * M_m)) / (d_m * l))))
          	elif d_m <= 1.25e-42:
          		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))))
          	else:
          		tmp = w0
          	return tmp
          
          M_m = abs(M)
          D_m = abs(D)
          d_m = abs(d)
          w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
          function code(w0, M_m, D_m, h, l, d_m)
          	tmp = 0.0
          	if (d_m <= 2.35e-163)
          		tmp = Float64(w0 + Float64(Float64(D_m * D_m) * Float64(Float64(Float64(h * -0.125) / d_m) * Float64(Float64(M_m * Float64(w0 * M_m)) / Float64(d_m * l)))));
          	elseif (d_m <= 1.25e-42)
          		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(-0.125 / l) * Float64(Float64(h * Float64(M_m * Float64(M_m * Float64(D_m * D_m)))) / Float64(d_m * d_m)))));
          	else
          		tmp = w0;
          	end
          	return tmp
          end
          
          M_m = abs(M);
          D_m = abs(D);
          d_m = abs(d);
          w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
          function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
          	tmp = 0.0;
          	if (d_m <= 2.35e-163)
          		tmp = w0 + ((D_m * D_m) * (((h * -0.125) / d_m) * ((M_m * (w0 * M_m)) / (d_m * l))));
          	elseif (d_m <= 1.25e-42)
          		tmp = w0 * (1.0 + ((-0.125 / l) * ((h * (M_m * (M_m * (D_m * D_m)))) / (d_m * d_m))));
          	else
          		tmp = w0;
          	end
          	tmp_2 = tmp;
          end
          
          M_m = N[Abs[M], $MachinePrecision]
          D_m = N[Abs[D], $MachinePrecision]
          d_m = N[Abs[d], $MachinePrecision]
          NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
          code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[d$95$m, 2.35e-163], N[(w0 + N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(h * -0.125), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(N[(M$95$m * N[(w0 * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(d$95$m * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d$95$m, 1.25e-42], N[(w0 * N[(1.0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(h * N[(M$95$m * N[(M$95$m * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d$95$m * d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]]
          
          \begin{array}{l}
          M_m = \left|M\right|
          \\
          D_m = \left|D\right|
          \\
          d_m = \left|d\right|
          \\
          [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;d\_m \leq 2.35 \cdot 10^{-163}:\\
          \;\;\;\;w0 + \left(D\_m \cdot D\_m\right) \cdot \left(\frac{h \cdot -0.125}{d\_m} \cdot \frac{M\_m \cdot \left(w0 \cdot M\_m\right)}{d\_m \cdot \ell}\right)\\
          
          \mathbf{elif}\;d\_m \leq 1.25 \cdot 10^{-42}:\\
          \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \frac{h \cdot \left(M\_m \cdot \left(M\_m \cdot \left(D\_m \cdot D\_m\right)\right)\right)}{d\_m \cdot d\_m}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;w0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if d < 2.35e-163

            1. Initial program 77.8%

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
              3. sub-negN/A

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
              5. associate-*r/N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
              6. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
            3. Simplified76.2%

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
            4. Add Preprocessing
            5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
            7. Simplified47.2%

              \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
            8. Step-by-step derivation
              1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \frac{-1}{8}\right), d\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(M, w0\right)\right), \mathsf{*.f64}\left(d, \color{blue}{\ell}\right)\right)\right)\right)\right) \]
            9. Applied egg-rr58.9%

              \[\leadsto w0 + \left(D \cdot D\right) \cdot \color{blue}{\left(\frac{h \cdot -0.125}{d} \cdot \frac{M \cdot \left(M \cdot w0\right)}{d \cdot \ell}\right)} \]

            if 2.35e-163 < d < 1.25000000000000001e-42

            1. Initial program 72.7%

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
              3. sub-negN/A

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
              5. associate-*r/N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
              6. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
            3. Simplified67.3%

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
            4. Add Preprocessing
            5. Step-by-step derivation
              1. associate-*r*N/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\left(h \cdot M\right) \cdot \frac{D \cdot \left(M \cdot D\right)}{d}}{d \cdot -4}\right), \ell\right)\right)\right)\right) \]
              5. times-fracN/A

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{M \cdot D}{d}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
              11. clear-numN/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\left(D \cdot \frac{1}{\frac{d}{M \cdot D}}\right), -4\right)\right), \ell\right)\right)\right)\right) \]
              12. un-div-invN/A

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
              15. *-lowering-*.f6473.1%

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(h, M\right), d\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), -4\right)\right), \ell\right)\right)\right)\right) \]
            6. Applied egg-rr73.1%

              \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{h \cdot M}{d} \cdot \frac{\frac{D}{\frac{d}{M \cdot D}}}{-4}}}{\ell}} \]
            7. Step-by-step derivation
              1. associate-/l/N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{h \cdot M}{d} \cdot \frac{D}{-4 \cdot \frac{d}{M \cdot D}}\right), \ell\right)\right)\right)\right) \]
              2. frac-timesN/A

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{d}{M \cdot D}\right)\right)\right), \ell\right)\right)\right)\right) \]
              8. clear-numN/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \left(-4 \cdot \frac{1}{\frac{M \cdot D}{d}}\right)\right)\right), \ell\right)\right)\right)\right) \]
              9. un-div-invN/A

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(M \cdot D\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
              12. *-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
              13. *-lowering-*.f6484.0%

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, h\right), D\right), \mathsf{*.f64}\left(d, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right), \ell\right)\right)\right)\right) \]
            8. Applied egg-rr84.0%

              \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{\left(M \cdot h\right) \cdot D}{d \cdot \frac{-4}{\frac{D \cdot M}{d}}}}}{\ell}} \]
            9. Step-by-step derivation
              1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), h\right), d\right), \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\left(D \cdot M\right), d\right)\right)\right)\right)\right)\right)\right) \]
              12. *-lowering-*.f6489.1%

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, M\right), h\right), d\right), \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(-4, \mathsf{/.f64}\left(\mathsf{*.f64}\left(D, M\right), d\right)\right)\right)\right)\right)\right)\right) \]
            10. Applied egg-rr89.1%

              \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{\frac{\left(D \cdot M\right) \cdot h}{d}}{\ell \cdot \frac{-4}{\frac{D \cdot M}{d}}}}} \]
            11. Taylor expanded in D around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), M\right), M\right), h\right), \left(d \cdot \color{blue}{d}\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f6468.3%

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), M\right), M\right), h\right), \mathsf{*.f64}\left(d, \color{blue}{d}\right)\right)\right)\right)\right) \]
            13. Simplified68.3%

              \[\leadsto w0 \cdot \color{blue}{\left(1 + \frac{-0.125}{\ell} \cdot \frac{\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h}{d \cdot d}\right)} \]

            if 1.25000000000000001e-42 < d

            1. Initial program 82.3%

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

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
              3. sub-negN/A

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
              5. associate-*r/N/A

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
              6. distribute-neg-fracN/A

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

                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
            3. Simplified81.5%

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
            4. Add Preprocessing
            5. Taylor expanded in h around 0

              \[\leadsto \color{blue}{w0} \]
            6. Step-by-step derivation
              1. Simplified78.0%

                \[\leadsto \color{blue}{w0} \]
            7. Recombined 3 regimes into one program.
            8. Final simplification66.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 2.35 \cdot 10^{-163}:\\ \;\;\;\;w0 + \left(D \cdot D\right) \cdot \left(\frac{h \cdot -0.125}{d} \cdot \frac{M \cdot \left(w0 \cdot M\right)}{d \cdot \ell}\right)\\ \mathbf{elif}\;d \leq 1.25 \cdot 10^{-42}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \frac{h \cdot \left(M \cdot \left(M \cdot \left(D \cdot D\right)\right)\right)}{d \cdot d}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
            9. Add Preprocessing

            Alternative 9: 77.3% accurate, 8.3× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;D\_m \leq 1.35 \cdot 10^{+70}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m \cdot D\_m}{d\_m} \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;w0 + D\_m \cdot \frac{D\_m}{\frac{d\_m \cdot \left(d\_m \cdot \ell\right)}{-0.125 \cdot \left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}}\\ \end{array} \end{array} \]
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            d_m = (fabs.f64 d)
            NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
            (FPCore (w0 M_m D_m h l d_m)
             :precision binary64
             (if (<= D_m 1.35e+70)
               (*
                w0
                (+ 1.0 (* (/ -0.125 l) (* (/ (* D_m D_m) d_m) (/ (* h (* M_m M_m)) d_m)))))
               (+
                w0
                (*
                 D_m
                 (/ D_m (/ (* d_m (* d_m l)) (* -0.125 (* h (* M_m (* w0 M_m))))))))))
            M_m = fabs(M);
            D_m = fabs(D);
            d_m = fabs(d);
            assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
            double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
            	double tmp;
            	if (D_m <= 1.35e+70) {
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
            	} else {
            		tmp = w0 + (D_m * (D_m / ((d_m * (d_m * l)) / (-0.125 * (h * (M_m * (w0 * M_m)))))));
            	}
            	return tmp;
            }
            
            M_m = abs(m)
            D_m = abs(d)
            d_m = abs(d)
            NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
            real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                real(8), intent (in) :: w0
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d_m
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: d_m_1
                real(8) :: tmp
                if (d_m <= 1.35d+70) then
                    tmp = w0 * (1.0d0 + (((-0.125d0) / l) * (((d_m * d_m) / d_m_1) * ((h * (m_m * m_m)) / d_m_1))))
                else
                    tmp = w0 + (d_m * (d_m / ((d_m_1 * (d_m_1 * l)) / ((-0.125d0) * (h * (m_m * (w0 * m_m)))))))
                end if
                code = tmp
            end function
            
            M_m = Math.abs(M);
            D_m = Math.abs(D);
            d_m = Math.abs(d);
            assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
            public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
            	double tmp;
            	if (D_m <= 1.35e+70) {
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
            	} else {
            		tmp = w0 + (D_m * (D_m / ((d_m * (d_m * l)) / (-0.125 * (h * (M_m * (w0 * M_m)))))));
            	}
            	return tmp;
            }
            
            M_m = math.fabs(M)
            D_m = math.fabs(D)
            d_m = math.fabs(d)
            [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
            def code(w0, M_m, D_m, h, l, d_m):
            	tmp = 0
            	if D_m <= 1.35e+70:
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))))
            	else:
            		tmp = w0 + (D_m * (D_m / ((d_m * (d_m * l)) / (-0.125 * (h * (M_m * (w0 * M_m)))))))
            	return tmp
            
            M_m = abs(M)
            D_m = abs(D)
            d_m = abs(d)
            w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
            function code(w0, M_m, D_m, h, l, d_m)
            	tmp = 0.0
            	if (D_m <= 1.35e+70)
            		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(-0.125 / l) * Float64(Float64(Float64(D_m * D_m) / d_m) * Float64(Float64(h * Float64(M_m * M_m)) / d_m)))));
            	else
            		tmp = Float64(w0 + Float64(D_m * Float64(D_m / Float64(Float64(d_m * Float64(d_m * l)) / Float64(-0.125 * Float64(h * Float64(M_m * Float64(w0 * M_m))))))));
            	end
            	return tmp
            end
            
            M_m = abs(M);
            D_m = abs(D);
            d_m = abs(d);
            w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
            function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
            	tmp = 0.0;
            	if (D_m <= 1.35e+70)
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
            	else
            		tmp = w0 + (D_m * (D_m / ((d_m * (d_m * l)) / (-0.125 * (h * (M_m * (w0 * M_m)))))));
            	end
            	tmp_2 = tmp;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            d_m = N[Abs[d], $MachinePrecision]
            NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
            code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[D$95$m, 1.35e+70], N[(w0 * N[(1.0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 + N[(D$95$m * N[(D$95$m / N[(N[(d$95$m * N[(d$95$m * l), $MachinePrecision]), $MachinePrecision] / N[(-0.125 * N[(h * N[(M$95$m * N[(w0 * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            d_m = \left|d\right|
            \\
            [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;D\_m \leq 1.35 \cdot 10^{+70}:\\
            \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m \cdot D\_m}{d\_m} \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;w0 + D\_m \cdot \frac{D\_m}{\frac{d\_m \cdot \left(d\_m \cdot \ell\right)}{-0.125 \cdot \left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if D < 1.35e70

              1. Initial program 79.5%

                \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. clear-numN/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{\frac{\ell}{h}}\right)\right)\right)\right) \]
                2. un-div-invN/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
                4. div-invN/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \frac{1}{h}}\right)\right)\right)\right) \]
                5. times-fracN/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right) \]
                6. *-lowering-*.f64N/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
                10. *-commutativeN/A

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
                12. clear-numN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
                16. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \left(\frac{1}{h}\right)\right)\right)\right)\right)\right) \]
              4. Applied egg-rr89.1%

                \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\ell} \cdot \frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\frac{1}{h}}}} \]
              5. Taylor expanded in D around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), d\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right)\right)\right)\right)\right) \]
              7. Simplified61.4%

                \[\leadsto w0 \cdot \color{blue}{\left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]

              if 1.35e70 < D

              1. Initial program 76.8%

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

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                3. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                5. associate-*r/N/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                6. distribute-neg-fracN/A

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
              3. Simplified70.6%

                \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
              4. Add Preprocessing
              5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
              7. Simplified49.6%

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\left(D \cdot \frac{\frac{-1}{8} \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}\right), \color{blue}{D}\right)\right) \]
              9. Applied egg-rr69.7%

                \[\leadsto w0 + \color{blue}{\frac{D}{\frac{d \cdot \left(d \cdot \ell\right)}{-0.125 \cdot \left(h \cdot \left(M \cdot \left(M \cdot w0\right)\right)\right)}} \cdot D} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification62.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 1.35 \cdot 10^{+70}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;w0 + D \cdot \frac{D}{\frac{d \cdot \left(d \cdot \ell\right)}{-0.125 \cdot \left(h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)\right)}}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 10: 74.6% accurate, 8.3× speedup?

            \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3.7 \cdot 10^{-48}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m \cdot D\_m}{d\_m} \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}\right)\right)\\ \end{array} \end{array} \]
            M_m = (fabs.f64 M)
            D_m = (fabs.f64 D)
            d_m = (fabs.f64 d)
            NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
            (FPCore (w0 M_m D_m h l d_m)
             :precision binary64
             (if (<= M_m 3.7e-48)
               w0
               (*
                w0
                (+
                 1.0
                 (* (/ -0.125 l) (* (/ (* D_m D_m) d_m) (/ (* h (* M_m M_m)) d_m)))))))
            M_m = fabs(M);
            D_m = fabs(D);
            d_m = fabs(d);
            assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
            double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
            	double tmp;
            	if (M_m <= 3.7e-48) {
            		tmp = w0;
            	} else {
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
            	}
            	return tmp;
            }
            
            M_m = abs(m)
            D_m = abs(d)
            d_m = abs(d)
            NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
            real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                real(8), intent (in) :: w0
                real(8), intent (in) :: m_m
                real(8), intent (in) :: d_m
                real(8), intent (in) :: h
                real(8), intent (in) :: l
                real(8), intent (in) :: d_m_1
                real(8) :: tmp
                if (m_m <= 3.7d-48) then
                    tmp = w0
                else
                    tmp = w0 * (1.0d0 + (((-0.125d0) / l) * (((d_m * d_m) / d_m_1) * ((h * (m_m * m_m)) / d_m_1))))
                end if
                code = tmp
            end function
            
            M_m = Math.abs(M);
            D_m = Math.abs(D);
            d_m = Math.abs(d);
            assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
            public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
            	double tmp;
            	if (M_m <= 3.7e-48) {
            		tmp = w0;
            	} else {
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
            	}
            	return tmp;
            }
            
            M_m = math.fabs(M)
            D_m = math.fabs(D)
            d_m = math.fabs(d)
            [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
            def code(w0, M_m, D_m, h, l, d_m):
            	tmp = 0
            	if M_m <= 3.7e-48:
            		tmp = w0
            	else:
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))))
            	return tmp
            
            M_m = abs(M)
            D_m = abs(D)
            d_m = abs(d)
            w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
            function code(w0, M_m, D_m, h, l, d_m)
            	tmp = 0.0
            	if (M_m <= 3.7e-48)
            		tmp = w0;
            	else
            		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(-0.125 / l) * Float64(Float64(Float64(D_m * D_m) / d_m) * Float64(Float64(h * Float64(M_m * M_m)) / d_m)))));
            	end
            	return tmp
            end
            
            M_m = abs(M);
            D_m = abs(D);
            d_m = abs(d);
            w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
            function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
            	tmp = 0.0;
            	if (M_m <= 3.7e-48)
            		tmp = w0;
            	else
            		tmp = w0 * (1.0 + ((-0.125 / l) * (((D_m * D_m) / d_m) * ((h * (M_m * M_m)) / d_m))));
            	end
            	tmp_2 = tmp;
            end
            
            M_m = N[Abs[M], $MachinePrecision]
            D_m = N[Abs[D], $MachinePrecision]
            d_m = N[Abs[d], $MachinePrecision]
            NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
            code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M$95$m, 3.7e-48], w0, N[(w0 * N[(1.0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            M_m = \left|M\right|
            \\
            D_m = \left|D\right|
            \\
            d_m = \left|d\right|
            \\
            [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;M\_m \leq 3.7 \cdot 10^{-48}:\\
            \;\;\;\;w0\\
            
            \mathbf{else}:\\
            \;\;\;\;w0 \cdot \left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m \cdot D\_m}{d\_m} \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if M < 3.6999999999999998e-48

              1. Initial program 80.5%

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

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                3. sub-negN/A

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                5. associate-*r/N/A

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                6. distribute-neg-fracN/A

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

                  \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
              3. Simplified78.6%

                \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
              4. Add Preprocessing
              5. Taylor expanded in h around 0

                \[\leadsto \color{blue}{w0} \]
              6. Step-by-step derivation
                1. Simplified72.7%

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

                if 3.6999999999999998e-48 < M

                1. Initial program 75.2%

                  \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. clear-numN/A

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{\frac{\ell}{h}}\right)\right)\right)\right) \]
                  2. un-div-invN/A

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\frac{\ell}{h}}\right)\right)\right)\right) \]
                  4. div-invN/A

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\ell \cdot \frac{1}{h}}\right)\right)\right)\right) \]
                  5. times-fracN/A

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{M \cdot D}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
                  10. *-commutativeN/A

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

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(D \cdot \frac{M}{2}\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
                  12. clear-numN/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)\right)\right)\right) \]
                  16. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(D, \mathsf{/.f64}\left(2, M\right)\right), d\right), \ell\right), \mathsf{/.f64}\left(\left(\frac{M \cdot D}{2 \cdot d}\right), \left(\frac{1}{h}\right)\right)\right)\right)\right)\right) \]
                4. Applied egg-rr81.1%

                  \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\ell} \cdot \frac{\frac{\frac{D}{\frac{2}{M}}}{d}}{\frac{1}{h}}}} \]
                5. Taylor expanded in D around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{8}, \ell\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(D, D\right), d\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right), d\right)\right)\right)\right)\right) \]
                7. Simplified57.6%

                  \[\leadsto w0 \cdot \color{blue}{\left(1 + \frac{-0.125}{\ell} \cdot \left(\frac{D \cdot D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)} \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 11: 72.4% accurate, 9.0× speedup?

              \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3.7 \cdot 10^{+20}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{D\_m \cdot D\_m}{d\_m} \cdot \left(\left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right) \cdot \frac{-0.125}{d\_m}\right)}{\ell}\\ \end{array} \end{array} \]
              M_m = (fabs.f64 M)
              D_m = (fabs.f64 D)
              d_m = (fabs.f64 d)
              NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
              (FPCore (w0 M_m D_m h l d_m)
               :precision binary64
               (if (<= M_m 3.7e+20)
                 w0
                 (/ (* (/ (* D_m D_m) d_m) (* (* h (* w0 (* M_m M_m))) (/ -0.125 d_m))) l)))
              M_m = fabs(M);
              D_m = fabs(D);
              d_m = fabs(d);
              assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
              double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
              	double tmp;
              	if (M_m <= 3.7e+20) {
              		tmp = w0;
              	} else {
              		tmp = (((D_m * D_m) / d_m) * ((h * (w0 * (M_m * M_m))) * (-0.125 / d_m))) / l;
              	}
              	return tmp;
              }
              
              M_m = abs(m)
              D_m = abs(d)
              d_m = abs(d)
              NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
              real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                  real(8), intent (in) :: w0
                  real(8), intent (in) :: m_m
                  real(8), intent (in) :: d_m
                  real(8), intent (in) :: h
                  real(8), intent (in) :: l
                  real(8), intent (in) :: d_m_1
                  real(8) :: tmp
                  if (m_m <= 3.7d+20) then
                      tmp = w0
                  else
                      tmp = (((d_m * d_m) / d_m_1) * ((h * (w0 * (m_m * m_m))) * ((-0.125d0) / d_m_1))) / l
                  end if
                  code = tmp
              end function
              
              M_m = Math.abs(M);
              D_m = Math.abs(D);
              d_m = Math.abs(d);
              assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
              public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
              	double tmp;
              	if (M_m <= 3.7e+20) {
              		tmp = w0;
              	} else {
              		tmp = (((D_m * D_m) / d_m) * ((h * (w0 * (M_m * M_m))) * (-0.125 / d_m))) / l;
              	}
              	return tmp;
              }
              
              M_m = math.fabs(M)
              D_m = math.fabs(D)
              d_m = math.fabs(d)
              [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
              def code(w0, M_m, D_m, h, l, d_m):
              	tmp = 0
              	if M_m <= 3.7e+20:
              		tmp = w0
              	else:
              		tmp = (((D_m * D_m) / d_m) * ((h * (w0 * (M_m * M_m))) * (-0.125 / d_m))) / l
              	return tmp
              
              M_m = abs(M)
              D_m = abs(D)
              d_m = abs(d)
              w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
              function code(w0, M_m, D_m, h, l, d_m)
              	tmp = 0.0
              	if (M_m <= 3.7e+20)
              		tmp = w0;
              	else
              		tmp = Float64(Float64(Float64(Float64(D_m * D_m) / d_m) * Float64(Float64(h * Float64(w0 * Float64(M_m * M_m))) * Float64(-0.125 / d_m))) / l);
              	end
              	return tmp
              end
              
              M_m = abs(M);
              D_m = abs(D);
              d_m = abs(d);
              w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
              function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
              	tmp = 0.0;
              	if (M_m <= 3.7e+20)
              		tmp = w0;
              	else
              		tmp = (((D_m * D_m) / d_m) * ((h * (w0 * (M_m * M_m))) * (-0.125 / d_m))) / l;
              	end
              	tmp_2 = tmp;
              end
              
              M_m = N[Abs[M], $MachinePrecision]
              D_m = N[Abs[D], $MachinePrecision]
              d_m = N[Abs[d], $MachinePrecision]
              NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
              code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M$95$m, 3.7e+20], w0, N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(N[(h * N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]]
              
              \begin{array}{l}
              M_m = \left|M\right|
              \\
              D_m = \left|D\right|
              \\
              d_m = \left|d\right|
              \\
              [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
              \\
              \begin{array}{l}
              \mathbf{if}\;M\_m \leq 3.7 \cdot 10^{+20}:\\
              \;\;\;\;w0\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\frac{D\_m \cdot D\_m}{d\_m} \cdot \left(\left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right) \cdot \frac{-0.125}{d\_m}\right)}{\ell}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if M < 3.7e20

                1. Initial program 80.6%

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

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

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                  3. sub-negN/A

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

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                  5. associate-*r/N/A

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                  6. distribute-neg-fracN/A

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

                    \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                3. Simplified78.8%

                  \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                4. Add Preprocessing
                5. Taylor expanded in h around 0

                  \[\leadsto \color{blue}{w0} \]
                6. Step-by-step derivation
                  1. Simplified72.5%

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

                  if 3.7e20 < M

                  1. Initial program 73.3%

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

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

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                    3. sub-negN/A

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

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                    5. associate-*r/N/A

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                    6. distribute-neg-fracN/A

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

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                  3. Simplified72.2%

                    \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                  4. Add Preprocessing
                  5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
                  7. Simplified37.2%

                    \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                  8. Taylor expanded in D around inf

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

                      \[\leadsto \frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{\color{blue}{{d}^{2} \cdot \ell}} \]
                    2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), w0\right), \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right) \]
                    18. *-lowering-*.f6423.2%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), w0\right), \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right) \]
                  10. Simplified23.2%

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

                      \[\leadsto \frac{\frac{\left(\left(\frac{-1}{8} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot w0\right) \cdot \left(D \cdot D\right)}{d \cdot d}}{\color{blue}{\ell}} \]
                    2. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\left(\frac{-1}{8} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot w0\right) \cdot \left(D \cdot D\right)}{d \cdot d}\right), \color{blue}{\ell}\right) \]
                  12. Applied egg-rr29.8%

                    \[\leadsto \color{blue}{\frac{\left(\left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right) \cdot \frac{D \cdot D}{d}}{\ell}} \]
                7. Recombined 2 regimes into one program.
                8. Final simplification63.3%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.7 \cdot 10^{+20}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{D \cdot D}{d} \cdot \left(\left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{-0.125}{d}\right)}{\ell}\\ \end{array} \]
                9. Add Preprocessing

                Alternative 12: 72.0% accurate, 9.0× speedup?

                \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 1.05 \cdot 10^{+95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.125 \cdot \left(D\_m \cdot \left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right)\right)}{d\_m} \cdot \frac{D\_m}{d\_m \cdot \ell}\\ \end{array} \end{array} \]
                M_m = (fabs.f64 M)
                D_m = (fabs.f64 D)
                d_m = (fabs.f64 d)
                NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                (FPCore (w0 M_m D_m h l d_m)
                 :precision binary64
                 (if (<= M_m 1.05e+95)
                   w0
                   (* (/ (* -0.125 (* D_m (* h (* w0 (* M_m M_m))))) d_m) (/ D_m (* d_m l)))))
                M_m = fabs(M);
                D_m = fabs(D);
                d_m = fabs(d);
                assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
                double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                	double tmp;
                	if (M_m <= 1.05e+95) {
                		tmp = w0;
                	} else {
                		tmp = ((-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) / d_m) * (D_m / (d_m * l));
                	}
                	return tmp;
                }
                
                M_m = abs(m)
                D_m = abs(d)
                d_m = abs(d)
                NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                    real(8), intent (in) :: w0
                    real(8), intent (in) :: m_m
                    real(8), intent (in) :: d_m
                    real(8), intent (in) :: h
                    real(8), intent (in) :: l
                    real(8), intent (in) :: d_m_1
                    real(8) :: tmp
                    if (m_m <= 1.05d+95) then
                        tmp = w0
                    else
                        tmp = (((-0.125d0) * (d_m * (h * (w0 * (m_m * m_m))))) / d_m_1) * (d_m / (d_m_1 * l))
                    end if
                    code = tmp
                end function
                
                M_m = Math.abs(M);
                D_m = Math.abs(D);
                d_m = Math.abs(d);
                assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
                public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                	double tmp;
                	if (M_m <= 1.05e+95) {
                		tmp = w0;
                	} else {
                		tmp = ((-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) / d_m) * (D_m / (d_m * l));
                	}
                	return tmp;
                }
                
                M_m = math.fabs(M)
                D_m = math.fabs(D)
                d_m = math.fabs(d)
                [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
                def code(w0, M_m, D_m, h, l, d_m):
                	tmp = 0
                	if M_m <= 1.05e+95:
                		tmp = w0
                	else:
                		tmp = ((-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) / d_m) * (D_m / (d_m * l))
                	return tmp
                
                M_m = abs(M)
                D_m = abs(D)
                d_m = abs(d)
                w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
                function code(w0, M_m, D_m, h, l, d_m)
                	tmp = 0.0
                	if (M_m <= 1.05e+95)
                		tmp = w0;
                	else
                		tmp = Float64(Float64(Float64(-0.125 * Float64(D_m * Float64(h * Float64(w0 * Float64(M_m * M_m))))) / d_m) * Float64(D_m / Float64(d_m * l)));
                	end
                	return tmp
                end
                
                M_m = abs(M);
                D_m = abs(D);
                d_m = abs(d);
                w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
                function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
                	tmp = 0.0;
                	if (M_m <= 1.05e+95)
                		tmp = w0;
                	else
                		tmp = ((-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) / d_m) * (D_m / (d_m * l));
                	end
                	tmp_2 = tmp;
                end
                
                M_m = N[Abs[M], $MachinePrecision]
                D_m = N[Abs[D], $MachinePrecision]
                d_m = N[Abs[d], $MachinePrecision]
                NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M$95$m, 1.05e+95], w0, N[(N[(N[(-0.125 * N[(D$95$m * N[(h * N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(D$95$m / N[(d$95$m * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                M_m = \left|M\right|
                \\
                D_m = \left|D\right|
                \\
                d_m = \left|d\right|
                \\
                [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;M\_m \leq 1.05 \cdot 10^{+95}:\\
                \;\;\;\;w0\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{-0.125 \cdot \left(D\_m \cdot \left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right)\right)}{d\_m} \cdot \frac{D\_m}{d\_m \cdot \ell}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if M < 1.05e95

                  1. Initial program 79.7%

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

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

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                    3. sub-negN/A

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

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                    5. associate-*r/N/A

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                    6. distribute-neg-fracN/A

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

                      \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                  3. Simplified78.5%

                    \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                  4. Add Preprocessing
                  5. Taylor expanded in h around 0

                    \[\leadsto \color{blue}{w0} \]
                  6. Step-by-step derivation
                    1. Simplified72.5%

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

                    if 1.05e95 < M

                    1. Initial program 75.6%

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

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

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                      3. sub-negN/A

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

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                      5. associate-*r/N/A

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                      6. distribute-neg-fracN/A

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

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                    3. Simplified71.9%

                      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                    4. Add Preprocessing
                    5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
                    7. Simplified32.7%

                      \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                    8. Taylor expanded in D around inf

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

                        \[\leadsto \frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{\color{blue}{{d}^{2} \cdot \ell}} \]
                      2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), w0\right), \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right) \]
                      18. *-lowering-*.f6426.1%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), w0\right), \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right) \]
                    10. Simplified26.1%

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

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

                        \[\leadsto \frac{\left(\left(\left(\frac{-1}{8} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot w0\right) \cdot D\right) \cdot D}{d \cdot \color{blue}{\left(d \cdot \ell\right)}} \]
                      3. times-fracN/A

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

                        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\left(\left(\frac{-1}{8} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right) \cdot w0\right) \cdot D}{d}\right), \color{blue}{\left(\frac{D}{d \cdot \ell}\right)}\right) \]
                    12. Applied egg-rr32.3%

                      \[\leadsto \color{blue}{\frac{-0.125 \cdot \left(\left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right) \cdot D\right)}{d} \cdot \frac{D}{d \cdot \ell}} \]
                  7. Recombined 2 regimes into one program.
                  8. Final simplification65.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.05 \cdot 10^{+95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.125 \cdot \left(D \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)\right)}{d} \cdot \frac{D}{d \cdot \ell}\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 13: 71.5% accurate, 9.0× speedup?

                  \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3.5 \cdot 10^{+95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\left(-0.125 \cdot \left(D\_m \cdot \left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right)\right)\right) \cdot \frac{D\_m}{d\_m \cdot \left(d\_m \cdot \ell\right)}\\ \end{array} \end{array} \]
                  M_m = (fabs.f64 M)
                  D_m = (fabs.f64 D)
                  d_m = (fabs.f64 d)
                  NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                  (FPCore (w0 M_m D_m h l d_m)
                   :precision binary64
                   (if (<= M_m 3.5e+95)
                     w0
                     (* (* -0.125 (* D_m (* h (* w0 (* M_m M_m))))) (/ D_m (* d_m (* d_m l))))))
                  M_m = fabs(M);
                  D_m = fabs(D);
                  d_m = fabs(d);
                  assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
                  double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                  	double tmp;
                  	if (M_m <= 3.5e+95) {
                  		tmp = w0;
                  	} else {
                  		tmp = (-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) * (D_m / (d_m * (d_m * l)));
                  	}
                  	return tmp;
                  }
                  
                  M_m = abs(m)
                  D_m = abs(d)
                  d_m = abs(d)
                  NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                  real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                      real(8), intent (in) :: w0
                      real(8), intent (in) :: m_m
                      real(8), intent (in) :: d_m
                      real(8), intent (in) :: h
                      real(8), intent (in) :: l
                      real(8), intent (in) :: d_m_1
                      real(8) :: tmp
                      if (m_m <= 3.5d+95) then
                          tmp = w0
                      else
                          tmp = ((-0.125d0) * (d_m * (h * (w0 * (m_m * m_m))))) * (d_m / (d_m_1 * (d_m_1 * l)))
                      end if
                      code = tmp
                  end function
                  
                  M_m = Math.abs(M);
                  D_m = Math.abs(D);
                  d_m = Math.abs(d);
                  assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
                  public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                  	double tmp;
                  	if (M_m <= 3.5e+95) {
                  		tmp = w0;
                  	} else {
                  		tmp = (-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) * (D_m / (d_m * (d_m * l)));
                  	}
                  	return tmp;
                  }
                  
                  M_m = math.fabs(M)
                  D_m = math.fabs(D)
                  d_m = math.fabs(d)
                  [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
                  def code(w0, M_m, D_m, h, l, d_m):
                  	tmp = 0
                  	if M_m <= 3.5e+95:
                  		tmp = w0
                  	else:
                  		tmp = (-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) * (D_m / (d_m * (d_m * l)))
                  	return tmp
                  
                  M_m = abs(M)
                  D_m = abs(D)
                  d_m = abs(d)
                  w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
                  function code(w0, M_m, D_m, h, l, d_m)
                  	tmp = 0.0
                  	if (M_m <= 3.5e+95)
                  		tmp = w0;
                  	else
                  		tmp = Float64(Float64(-0.125 * Float64(D_m * Float64(h * Float64(w0 * Float64(M_m * M_m))))) * Float64(D_m / Float64(d_m * Float64(d_m * l))));
                  	end
                  	return tmp
                  end
                  
                  M_m = abs(M);
                  D_m = abs(D);
                  d_m = abs(d);
                  w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
                  function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
                  	tmp = 0.0;
                  	if (M_m <= 3.5e+95)
                  		tmp = w0;
                  	else
                  		tmp = (-0.125 * (D_m * (h * (w0 * (M_m * M_m))))) * (D_m / (d_m * (d_m * l)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  M_m = N[Abs[M], $MachinePrecision]
                  D_m = N[Abs[D], $MachinePrecision]
                  d_m = N[Abs[d], $MachinePrecision]
                  NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                  code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M$95$m, 3.5e+95], w0, N[(N[(-0.125 * N[(D$95$m * N[(h * N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / N[(d$95$m * N[(d$95$m * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  M_m = \left|M\right|
                  \\
                  D_m = \left|D\right|
                  \\
                  d_m = \left|d\right|
                  \\
                  [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;M\_m \leq 3.5 \cdot 10^{+95}:\\
                  \;\;\;\;w0\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(-0.125 \cdot \left(D\_m \cdot \left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right)\right)\right) \cdot \frac{D\_m}{d\_m \cdot \left(d\_m \cdot \ell\right)}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if M < 3.5e95

                    1. Initial program 79.8%

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

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

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                      3. sub-negN/A

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

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                      5. associate-*r/N/A

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                      6. distribute-neg-fracN/A

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

                        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                    3. Simplified78.6%

                      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                    4. Add Preprocessing
                    5. Taylor expanded in h around 0

                      \[\leadsto \color{blue}{w0} \]
                    6. Step-by-step derivation
                      1. Simplified72.6%

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

                      if 3.5e95 < M

                      1. Initial program 75.0%

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

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

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                        3. sub-negN/A

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

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                        5. associate-*r/N/A

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                        6. distribute-neg-fracN/A

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

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                      3. Simplified71.3%

                        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                      4. Add Preprocessing
                      5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
                      7. Simplified31.2%

                        \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                      8. Taylor expanded in D around inf

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

                          \[\leadsto \frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{\color{blue}{{d}^{2} \cdot \ell}} \]
                        2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), w0\right), \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right) \]
                        18. *-lowering-*.f6426.7%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(h, \mathsf{*.f64}\left(M, M\right)\right)\right), w0\right), \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right) \]
                      10. Simplified26.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(-0.125 \cdot \left(\left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right) \cdot D\right)\right) \cdot \frac{D}{d \cdot \left(d \cdot \ell\right)}} \]
                    7. Recombined 2 regimes into one program.
                    8. Final simplification65.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.5 \cdot 10^{+95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\left(-0.125 \cdot \left(D \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)\right)\right) \cdot \frac{D}{d \cdot \left(d \cdot \ell\right)}\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 14: 71.2% accurate, 11.3× speedup?

                    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 1.42 \cdot 10^{+80}:\\ \;\;\;\;w0\\ \mathbf{elif}\;M\_m \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{w0 \cdot \left(M\_m \cdot M\_m\right)}{M\_m \cdot M\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{w0}{M\_m} \cdot \frac{M\_m \cdot M\_m}{M\_m}\\ \end{array} \end{array} \]
                    M_m = (fabs.f64 M)
                    D_m = (fabs.f64 D)
                    d_m = (fabs.f64 d)
                    NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                    (FPCore (w0 M_m D_m h l d_m)
                     :precision binary64
                     (if (<= M_m 1.42e+80)
                       w0
                       (if (<= M_m 1.32e+154)
                         (/ (* w0 (* M_m M_m)) (* M_m M_m))
                         (* (/ w0 M_m) (/ (* M_m M_m) M_m)))))
                    M_m = fabs(M);
                    D_m = fabs(D);
                    d_m = fabs(d);
                    assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
                    double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                    	double tmp;
                    	if (M_m <= 1.42e+80) {
                    		tmp = w0;
                    	} else if (M_m <= 1.32e+154) {
                    		tmp = (w0 * (M_m * M_m)) / (M_m * M_m);
                    	} else {
                    		tmp = (w0 / M_m) * ((M_m * M_m) / M_m);
                    	}
                    	return tmp;
                    }
                    
                    M_m = abs(m)
                    D_m = abs(d)
                    d_m = abs(d)
                    NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                    real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                        real(8), intent (in) :: w0
                        real(8), intent (in) :: m_m
                        real(8), intent (in) :: d_m
                        real(8), intent (in) :: h
                        real(8), intent (in) :: l
                        real(8), intent (in) :: d_m_1
                        real(8) :: tmp
                        if (m_m <= 1.42d+80) then
                            tmp = w0
                        else if (m_m <= 1.32d+154) then
                            tmp = (w0 * (m_m * m_m)) / (m_m * m_m)
                        else
                            tmp = (w0 / m_m) * ((m_m * m_m) / m_m)
                        end if
                        code = tmp
                    end function
                    
                    M_m = Math.abs(M);
                    D_m = Math.abs(D);
                    d_m = Math.abs(d);
                    assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
                    public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                    	double tmp;
                    	if (M_m <= 1.42e+80) {
                    		tmp = w0;
                    	} else if (M_m <= 1.32e+154) {
                    		tmp = (w0 * (M_m * M_m)) / (M_m * M_m);
                    	} else {
                    		tmp = (w0 / M_m) * ((M_m * M_m) / M_m);
                    	}
                    	return tmp;
                    }
                    
                    M_m = math.fabs(M)
                    D_m = math.fabs(D)
                    d_m = math.fabs(d)
                    [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
                    def code(w0, M_m, D_m, h, l, d_m):
                    	tmp = 0
                    	if M_m <= 1.42e+80:
                    		tmp = w0
                    	elif M_m <= 1.32e+154:
                    		tmp = (w0 * (M_m * M_m)) / (M_m * M_m)
                    	else:
                    		tmp = (w0 / M_m) * ((M_m * M_m) / M_m)
                    	return tmp
                    
                    M_m = abs(M)
                    D_m = abs(D)
                    d_m = abs(d)
                    w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
                    function code(w0, M_m, D_m, h, l, d_m)
                    	tmp = 0.0
                    	if (M_m <= 1.42e+80)
                    		tmp = w0;
                    	elseif (M_m <= 1.32e+154)
                    		tmp = Float64(Float64(w0 * Float64(M_m * M_m)) / Float64(M_m * M_m));
                    	else
                    		tmp = Float64(Float64(w0 / M_m) * Float64(Float64(M_m * M_m) / M_m));
                    	end
                    	return tmp
                    end
                    
                    M_m = abs(M);
                    D_m = abs(D);
                    d_m = abs(d);
                    w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
                    function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
                    	tmp = 0.0;
                    	if (M_m <= 1.42e+80)
                    		tmp = w0;
                    	elseif (M_m <= 1.32e+154)
                    		tmp = (w0 * (M_m * M_m)) / (M_m * M_m);
                    	else
                    		tmp = (w0 / M_m) * ((M_m * M_m) / M_m);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    M_m = N[Abs[M], $MachinePrecision]
                    D_m = N[Abs[D], $MachinePrecision]
                    d_m = N[Abs[d], $MachinePrecision]
                    NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                    code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M$95$m, 1.42e+80], w0, If[LessEqual[M$95$m, 1.32e+154], N[(N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(w0 / M$95$m), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / M$95$m), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    M_m = \left|M\right|
                    \\
                    D_m = \left|D\right|
                    \\
                    d_m = \left|d\right|
                    \\
                    [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;M\_m \leq 1.42 \cdot 10^{+80}:\\
                    \;\;\;\;w0\\
                    
                    \mathbf{elif}\;M\_m \leq 1.32 \cdot 10^{+154}:\\
                    \;\;\;\;\frac{w0 \cdot \left(M\_m \cdot M\_m\right)}{M\_m \cdot M\_m}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{w0}{M\_m} \cdot \frac{M\_m \cdot M\_m}{M\_m}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if M < 1.4200000000000001e80

                      1. Initial program 80.4%

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

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

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                        3. sub-negN/A

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

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                        5. associate-*r/N/A

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                        6. distribute-neg-fracN/A

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

                          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                      3. Simplified78.7%

                        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                      4. Add Preprocessing
                      5. Taylor expanded in h around 0

                        \[\leadsto \color{blue}{w0} \]
                      6. Step-by-step derivation
                        1. Simplified72.5%

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

                        if 1.4200000000000001e80 < M < 1.31999999999999998e154

                        1. Initial program 67.7%

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

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                          3. sub-negN/A

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                          5. associate-*r/N/A

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                          6. distribute-neg-fracN/A

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                        3. Simplified72.8%

                          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                        4. Add Preprocessing
                        5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
                        7. Simplified34.4%

                          \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                        8. Taylor expanded in M around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \left(\frac{w0}{{M}^{2}}\right)\right)\right) \]
                          17. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right)\right) \]
                          18. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \left(M \cdot \color{blue}{M}\right)\right)\right)\right) \]
                          19. *-lowering-*.f6440.0%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right)\right)\right) \]
                        10. Simplified40.0%

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \color{blue}{\left(\frac{w0}{{M}^{2}}\right)}\right) \]
                        12. Step-by-step derivation
                          1. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right) \]
                          2. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \left(M \cdot \color{blue}{M}\right)\right)\right) \]
                          3. *-lowering-*.f6426.7%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right)\right) \]
                        13. Simplified26.7%

                          \[\leadsto \left(M \cdot M\right) \cdot \color{blue}{\frac{w0}{M \cdot M}} \]
                        14. Step-by-step derivation
                          1. associate-*r/N/A

                            \[\leadsto \frac{\left(M \cdot M\right) \cdot w0}{\color{blue}{M \cdot M}} \]
                          2. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{/.f64}\left(\left(\left(M \cdot M\right) \cdot w0\right), \color{blue}{\left(M \cdot M\right)}\right) \]
                          3. *-commutativeN/A

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

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \left(M \cdot M\right)\right), \left(\color{blue}{M} \cdot M\right)\right) \]
                          5. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(M, M\right)\right), \left(M \cdot M\right)\right) \]
                          6. *-lowering-*.f6455.0%

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(M, M\right)\right), \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right) \]
                        15. Applied egg-rr55.0%

                          \[\leadsto \color{blue}{\frac{w0 \cdot \left(M \cdot M\right)}{M \cdot M}} \]

                        if 1.31999999999999998e154 < M

                        1. Initial program 77.1%

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

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                          3. sub-negN/A

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                          5. associate-*r/N/A

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                          6. distribute-neg-fracN/A

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                        3. Simplified70.7%

                          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                        4. Add Preprocessing
                        5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
                        7. Simplified31.5%

                          \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                        8. Taylor expanded in M around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \left(\frac{w0}{{M}^{2}}\right)\right)\right) \]
                          17. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right)\right) \]
                          18. unpow2N/A

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \color{blue}{\left(\frac{w0}{{M}^{2}}\right)}\right) \]
                        12. Step-by-step derivation
                          1. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right) \]
                          2. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \left(M \cdot \color{blue}{M}\right)\right)\right) \]
                          3. *-lowering-*.f640.0%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right)\right) \]
                        13. Simplified0.0%

                          \[\leadsto \left(M \cdot M\right) \cdot \color{blue}{\frac{w0}{M \cdot M}} \]
                        14. Step-by-step derivation
                          1. associate-*r/N/A

                            \[\leadsto \frac{\left(M \cdot M\right) \cdot w0}{\color{blue}{M \cdot M}} \]
                          2. times-fracN/A

                            \[\leadsto \frac{M \cdot M}{M} \cdot \color{blue}{\frac{w0}{M}} \]
                          3. *-lowering-*.f64N/A

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), M\right), \left(\frac{w0}{M}\right)\right) \]
                          6. /-lowering-/.f6436.7%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(M, M\right), M\right), \mathsf{/.f64}\left(w0, \color{blue}{M}\right)\right) \]
                        15. Applied egg-rr36.7%

                          \[\leadsto \color{blue}{\frac{M \cdot M}{M} \cdot \frac{w0}{M}} \]
                      7. Recombined 3 regimes into one program.
                      8. Final simplification67.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 1.42 \cdot 10^{+80}:\\ \;\;\;\;w0\\ \mathbf{elif}\;M \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{w0 \cdot \left(M \cdot M\right)}{M \cdot M}\\ \mathbf{else}:\\ \;\;\;\;\frac{w0}{M} \cdot \frac{M \cdot M}{M}\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 15: 71.8% accurate, 15.4× speedup?

                      \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 3 \cdot 10^{+78}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{w0 \cdot \left(M\_m \cdot M\_m\right)}{M\_m}}{M\_m}\\ \end{array} \end{array} \]
                      M_m = (fabs.f64 M)
                      D_m = (fabs.f64 D)
                      d_m = (fabs.f64 d)
                      NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                      (FPCore (w0 M_m D_m h l d_m)
                       :precision binary64
                       (if (<= M_m 3e+78) w0 (/ (/ (* w0 (* M_m M_m)) M_m) M_m)))
                      M_m = fabs(M);
                      D_m = fabs(D);
                      d_m = fabs(d);
                      assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
                      double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                      	double tmp;
                      	if (M_m <= 3e+78) {
                      		tmp = w0;
                      	} else {
                      		tmp = ((w0 * (M_m * M_m)) / M_m) / M_m;
                      	}
                      	return tmp;
                      }
                      
                      M_m = abs(m)
                      D_m = abs(d)
                      d_m = abs(d)
                      NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                      real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                          real(8), intent (in) :: w0
                          real(8), intent (in) :: m_m
                          real(8), intent (in) :: d_m
                          real(8), intent (in) :: h
                          real(8), intent (in) :: l
                          real(8), intent (in) :: d_m_1
                          real(8) :: tmp
                          if (m_m <= 3d+78) then
                              tmp = w0
                          else
                              tmp = ((w0 * (m_m * m_m)) / m_m) / m_m
                          end if
                          code = tmp
                      end function
                      
                      M_m = Math.abs(M);
                      D_m = Math.abs(D);
                      d_m = Math.abs(d);
                      assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
                      public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                      	double tmp;
                      	if (M_m <= 3e+78) {
                      		tmp = w0;
                      	} else {
                      		tmp = ((w0 * (M_m * M_m)) / M_m) / M_m;
                      	}
                      	return tmp;
                      }
                      
                      M_m = math.fabs(M)
                      D_m = math.fabs(D)
                      d_m = math.fabs(d)
                      [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
                      def code(w0, M_m, D_m, h, l, d_m):
                      	tmp = 0
                      	if M_m <= 3e+78:
                      		tmp = w0
                      	else:
                      		tmp = ((w0 * (M_m * M_m)) / M_m) / M_m
                      	return tmp
                      
                      M_m = abs(M)
                      D_m = abs(D)
                      d_m = abs(d)
                      w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
                      function code(w0, M_m, D_m, h, l, d_m)
                      	tmp = 0.0
                      	if (M_m <= 3e+78)
                      		tmp = w0;
                      	else
                      		tmp = Float64(Float64(Float64(w0 * Float64(M_m * M_m)) / M_m) / M_m);
                      	end
                      	return tmp
                      end
                      
                      M_m = abs(M);
                      D_m = abs(D);
                      d_m = abs(d);
                      w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
                      function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
                      	tmp = 0.0;
                      	if (M_m <= 3e+78)
                      		tmp = w0;
                      	else
                      		tmp = ((w0 * (M_m * M_m)) / M_m) / M_m;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      M_m = N[Abs[M], $MachinePrecision]
                      D_m = N[Abs[D], $MachinePrecision]
                      d_m = N[Abs[d], $MachinePrecision]
                      NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                      code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M$95$m, 3e+78], w0, N[(N[(N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / M$95$m), $MachinePrecision] / M$95$m), $MachinePrecision]]
                      
                      \begin{array}{l}
                      M_m = \left|M\right|
                      \\
                      D_m = \left|D\right|
                      \\
                      d_m = \left|d\right|
                      \\
                      [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;M\_m \leq 3 \cdot 10^{+78}:\\
                      \;\;\;\;w0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\frac{w0 \cdot \left(M\_m \cdot M\_m\right)}{M\_m}}{M\_m}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if M < 2.99999999999999982e78

                        1. Initial program 80.4%

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

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                          3. sub-negN/A

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                          5. associate-*r/N/A

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                          6. distribute-neg-fracN/A

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

                            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                        3. Simplified78.7%

                          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                        4. Add Preprocessing
                        5. Taylor expanded in h around 0

                          \[\leadsto \color{blue}{w0} \]
                        6. Step-by-step derivation
                          1. Simplified72.5%

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

                          if 2.99999999999999982e78 < M

                          1. Initial program 72.9%

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

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                            3. sub-negN/A

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                            5. associate-*r/N/A

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                            6. distribute-neg-fracN/A

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                          3. Simplified71.6%

                            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                          4. Add Preprocessing
                          5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
                          7. Simplified32.8%

                            \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                          8. Taylor expanded in M around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \left(\frac{w0}{{M}^{2}}\right)\right)\right) \]
                            17. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right)\right) \]
                            18. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \left(M \cdot \color{blue}{M}\right)\right)\right)\right) \]
                            19. *-lowering-*.f6435.2%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right)\right)\right) \]
                          10. Simplified35.2%

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \color{blue}{\left(\frac{w0}{{M}^{2}}\right)}\right) \]
                          12. Step-by-step derivation
                            1. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right) \]
                            2. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \left(M \cdot \color{blue}{M}\right)\right)\right) \]
                            3. *-lowering-*.f6411.9%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right)\right) \]
                          13. Simplified11.9%

                            \[\leadsto \left(M \cdot M\right) \cdot \color{blue}{\frac{w0}{M \cdot M}} \]
                          14. Step-by-step derivation
                            1. associate-*r/N/A

                              \[\leadsto \frac{\left(M \cdot M\right) \cdot w0}{\color{blue}{M \cdot M}} \]
                            2. associate-/r*N/A

                              \[\leadsto \frac{\frac{\left(M \cdot M\right) \cdot w0}{M}}{\color{blue}{M}} \]
                            3. /-lowering-/.f64N/A

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

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(M \cdot M\right) \cdot w0\right), M\right), M\right) \]
                            5. *-commutativeN/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(w0 \cdot \left(M \cdot M\right)\right), M\right), M\right) \]
                            6. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \left(M \cdot M\right)\right), M\right), M\right) \]
                            7. *-lowering-*.f6447.5%

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(M, M\right)\right), M\right), M\right) \]
                          15. Applied egg-rr47.5%

                            \[\leadsto \color{blue}{\frac{\frac{w0 \cdot \left(M \cdot M\right)}{M}}{M}} \]
                        7. Recombined 2 regimes into one program.
                        8. Add Preprocessing

                        Alternative 16: 70.3% accurate, 15.4× speedup?

                        \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 7.5 \cdot 10^{-69}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(M\_m \cdot M\_m\right) \cdot \frac{w0}{M\_m}}{M\_m}\\ \end{array} \end{array} \]
                        M_m = (fabs.f64 M)
                        D_m = (fabs.f64 D)
                        d_m = (fabs.f64 d)
                        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                        (FPCore (w0 M_m D_m h l d_m)
                         :precision binary64
                         (if (<= M_m 7.5e-69) w0 (/ (* (* M_m M_m) (/ w0 M_m)) M_m)))
                        M_m = fabs(M);
                        D_m = fabs(D);
                        d_m = fabs(d);
                        assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
                        double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                        	double tmp;
                        	if (M_m <= 7.5e-69) {
                        		tmp = w0;
                        	} else {
                        		tmp = ((M_m * M_m) * (w0 / M_m)) / M_m;
                        	}
                        	return tmp;
                        }
                        
                        M_m = abs(m)
                        D_m = abs(d)
                        d_m = abs(d)
                        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                        real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                            real(8), intent (in) :: w0
                            real(8), intent (in) :: m_m
                            real(8), intent (in) :: d_m
                            real(8), intent (in) :: h
                            real(8), intent (in) :: l
                            real(8), intent (in) :: d_m_1
                            real(8) :: tmp
                            if (m_m <= 7.5d-69) then
                                tmp = w0
                            else
                                tmp = ((m_m * m_m) * (w0 / m_m)) / m_m
                            end if
                            code = tmp
                        end function
                        
                        M_m = Math.abs(M);
                        D_m = Math.abs(D);
                        d_m = Math.abs(d);
                        assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
                        public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                        	double tmp;
                        	if (M_m <= 7.5e-69) {
                        		tmp = w0;
                        	} else {
                        		tmp = ((M_m * M_m) * (w0 / M_m)) / M_m;
                        	}
                        	return tmp;
                        }
                        
                        M_m = math.fabs(M)
                        D_m = math.fabs(D)
                        d_m = math.fabs(d)
                        [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
                        def code(w0, M_m, D_m, h, l, d_m):
                        	tmp = 0
                        	if M_m <= 7.5e-69:
                        		tmp = w0
                        	else:
                        		tmp = ((M_m * M_m) * (w0 / M_m)) / M_m
                        	return tmp
                        
                        M_m = abs(M)
                        D_m = abs(D)
                        d_m = abs(d)
                        w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
                        function code(w0, M_m, D_m, h, l, d_m)
                        	tmp = 0.0
                        	if (M_m <= 7.5e-69)
                        		tmp = w0;
                        	else
                        		tmp = Float64(Float64(Float64(M_m * M_m) * Float64(w0 / M_m)) / M_m);
                        	end
                        	return tmp
                        end
                        
                        M_m = abs(M);
                        D_m = abs(D);
                        d_m = abs(d);
                        w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
                        function tmp_2 = code(w0, M_m, D_m, h, l, d_m)
                        	tmp = 0.0;
                        	if (M_m <= 7.5e-69)
                        		tmp = w0;
                        	else
                        		tmp = ((M_m * M_m) * (w0 / M_m)) / M_m;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        M_m = N[Abs[M], $MachinePrecision]
                        D_m = N[Abs[D], $MachinePrecision]
                        d_m = N[Abs[d], $MachinePrecision]
                        NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                        code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M$95$m, 7.5e-69], w0, N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(w0 / M$95$m), $MachinePrecision]), $MachinePrecision] / M$95$m), $MachinePrecision]]
                        
                        \begin{array}{l}
                        M_m = \left|M\right|
                        \\
                        D_m = \left|D\right|
                        \\
                        d_m = \left|d\right|
                        \\
                        [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;M\_m \leq 7.5 \cdot 10^{-69}:\\
                        \;\;\;\;w0\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\left(M\_m \cdot M\_m\right) \cdot \frac{w0}{M\_m}}{M\_m}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if M < 7.5e-69

                          1. Initial program 80.6%

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

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                            3. sub-negN/A

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                            5. associate-*r/N/A

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                            6. distribute-neg-fracN/A

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                          3. Simplified78.6%

                            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                          4. Add Preprocessing
                          5. Taylor expanded in h around 0

                            \[\leadsto \color{blue}{w0} \]
                          6. Step-by-step derivation
                            1. Simplified72.1%

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

                            if 7.5e-69 < M

                            1. Initial program 75.2%

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

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

                                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                              3. sub-negN/A

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

                                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                              5. associate-*r/N/A

                                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                              6. distribute-neg-fracN/A

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

                                \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                            3. Simplified74.4%

                              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                            4. Add Preprocessing
                            5. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right)\right) \]
                            7. Simplified44.7%

                              \[\leadsto \color{blue}{w0 + \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                            8. Taylor expanded in M around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \left(\frac{w0}{{M}^{2}}\right)\right)\right) \]
                              17. /-lowering-/.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right)\right) \]
                              18. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \left(M \cdot \color{blue}{M}\right)\right)\right)\right) \]
                              19. *-lowering-*.f6441.0%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(h, \mathsf{*.f64}\left(D, D\right)\right), w0\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right), \mathsf{/.f64}\left(w0, \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right)\right)\right) \]
                            10. Simplified41.0%

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

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \color{blue}{\left(\frac{w0}{{M}^{2}}\right)}\right) \]
                            12. Step-by-step derivation
                              1. /-lowering-/.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \color{blue}{\left({M}^{2}\right)}\right)\right) \]
                              2. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \left(M \cdot \color{blue}{M}\right)\right)\right) \]
                              3. *-lowering-*.f6434.4%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), \mathsf{/.f64}\left(w0, \mathsf{*.f64}\left(M, \color{blue}{M}\right)\right)\right) \]
                            13. Simplified34.4%

                              \[\leadsto \left(M \cdot M\right) \cdot \color{blue}{\frac{w0}{M \cdot M}} \]
                            14. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \frac{w0}{M \cdot M} \cdot \color{blue}{\left(M \cdot M\right)} \]
                              2. associate-/r*N/A

                                \[\leadsto \frac{\frac{w0}{M}}{M} \cdot \left(\color{blue}{M} \cdot M\right) \]
                              3. associate-*l/N/A

                                \[\leadsto \frac{\frac{w0}{M} \cdot \left(M \cdot M\right)}{\color{blue}{M}} \]
                              4. /-lowering-/.f64N/A

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

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{w0}{M}\right), \left(M \cdot M\right)\right), M\right) \]
                              6. /-lowering-/.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w0, M\right), \left(M \cdot M\right)\right), M\right) \]
                              7. *-lowering-*.f6453.2%

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(w0, M\right), \mathsf{*.f64}\left(M, M\right)\right), M\right) \]
                            15. Applied egg-rr53.2%

                              \[\leadsto \color{blue}{\frac{\frac{w0}{M} \cdot \left(M \cdot M\right)}{M}} \]
                          7. Recombined 2 regimes into one program.
                          8. Final simplification66.5%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 7.5 \cdot 10^{-69}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(M \cdot M\right) \cdot \frac{w0}{M}}{M}\\ \end{array} \]
                          9. Add Preprocessing

                          Alternative 17: 68.0% accurate, 216.0× speedup?

                          \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\ \\ w0 \end{array} \]
                          M_m = (fabs.f64 M)
                          D_m = (fabs.f64 D)
                          d_m = (fabs.f64 d)
                          NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                          (FPCore (w0 M_m D_m h l d_m) :precision binary64 w0)
                          M_m = fabs(M);
                          D_m = fabs(D);
                          d_m = fabs(d);
                          assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m);
                          double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                          	return w0;
                          }
                          
                          M_m = abs(m)
                          D_m = abs(d)
                          d_m = abs(d)
                          NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                          real(8) function code(w0, m_m, d_m, h, l, d_m_1)
                              real(8), intent (in) :: w0
                              real(8), intent (in) :: m_m
                              real(8), intent (in) :: d_m
                              real(8), intent (in) :: h
                              real(8), intent (in) :: l
                              real(8), intent (in) :: d_m_1
                              code = w0
                          end function
                          
                          M_m = Math.abs(M);
                          D_m = Math.abs(D);
                          d_m = Math.abs(d);
                          assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d_m;
                          public static double code(double w0, double M_m, double D_m, double h, double l, double d_m) {
                          	return w0;
                          }
                          
                          M_m = math.fabs(M)
                          D_m = math.fabs(D)
                          d_m = math.fabs(d)
                          [w0, M_m, D_m, h, l, d_m] = sort([w0, M_m, D_m, h, l, d_m])
                          def code(w0, M_m, D_m, h, l, d_m):
                          	return w0
                          
                          M_m = abs(M)
                          D_m = abs(D)
                          d_m = abs(d)
                          w0, M_m, D_m, h, l, d_m = sort([w0, M_m, D_m, h, l, d_m])
                          function code(w0, M_m, D_m, h, l, d_m)
                          	return w0
                          end
                          
                          M_m = abs(M);
                          D_m = abs(D);
                          d_m = abs(d);
                          w0, M_m, D_m, h, l, d_m = num2cell(sort([w0, M_m, D_m, h, l, d_m])){:}
                          function tmp = code(w0, M_m, D_m, h, l, d_m)
                          	tmp = w0;
                          end
                          
                          M_m = N[Abs[M], $MachinePrecision]
                          D_m = N[Abs[D], $MachinePrecision]
                          d_m = N[Abs[d], $MachinePrecision]
                          NOTE: w0, M_m, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                          code[w0_, M$95$m_, D$95$m_, h_, l_, d$95$m_] := w0
                          
                          \begin{array}{l}
                          M_m = \left|M\right|
                          \\
                          D_m = \left|D\right|
                          \\
                          d_m = \left|d\right|
                          \\
                          [w0, M_m, D_m, h, l, d_m] = \mathsf{sort}([w0, M_m, D_m, h, l, d_m])\\
                          \\
                          w0
                          \end{array}
                          
                          Derivation
                          1. Initial program 79.0%

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

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\left(1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right) \]
                            3. sub-negN/A

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\right)\right) \]
                            5. associate-*r/N/A

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}\right)\right)\right)\right)\right) \]
                            6. distribute-neg-fracN/A

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

                              \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h\right)\right), \ell\right)\right)\right)\right) \]
                          3. Simplified77.4%

                            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{h \cdot \left(M \cdot \frac{\frac{\frac{D \cdot \left(M \cdot D\right)}{d}}{d}}{-4}\right)}{\ell}}} \]
                          4. Add Preprocessing
                          5. Taylor expanded in h around 0

                            \[\leadsto \color{blue}{w0} \]
                          6. Step-by-step derivation
                            1. Simplified66.5%

                              \[\leadsto \color{blue}{w0} \]
                            2. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024191 
                            (FPCore (w0 M D h l d)
                              :name "Henrywood and Agarwal, Equation (9a)"
                              :precision binary64
                              (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))