Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 80.8% → 86.9%
Time: 17.8s
Alternatives: 12
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 12 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: 80.8% 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: 86.9% 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} \mathbf{if}\;\frac{M\_m \cdot D\_m}{2 \cdot d\_m} \leq 5 \cdot 10^{+65}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{\frac{h}{\frac{-4}{M\_m}}}{\frac{d\_m}{M\_m \cdot D\_m}}}{\ell} \cdot \frac{D\_m}{d\_m}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{\frac{M\_m \cdot \left(M\_m \cdot D\_m\right)}{d\_m \cdot -4}}{\ell} \cdot \frac{D\_m}{\frac{1}{h}}}{d\_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 D_m) (* 2.0 d_m)) 5e+65)
   (*
    w0
    (sqrt
     (+ 1.0 (* (/ (/ (/ h (/ -4.0 M_m)) (/ d_m (* M_m D_m))) l) (/ D_m d_m)))))
   (*
    w0
    (sqrt
     (+
      1.0
      (/
       (* (/ (/ (* M_m (* M_m D_m)) (* d_m -4.0)) l) (/ D_m (/ 1.0 h)))
       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 * D_m) / (2.0 * d_m)) <= 5e+65) {
		tmp = w0 * sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (D_m / d_m))));
	} else {
		tmp = w0 * sqrt((1.0 + (((((M_m * (M_m * D_m)) / (d_m * -4.0)) / l) * (D_m / (1.0 / h))) / 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 * d_m) / (2.0d0 * d_m_1)) <= 5d+65) then
        tmp = w0 * sqrt((1.0d0 + ((((h / ((-4.0d0) / m_m)) / (d_m_1 / (m_m * d_m))) / l) * (d_m / d_m_1))))
    else
        tmp = w0 * sqrt((1.0d0 + (((((m_m * (m_m * d_m)) / (d_m_1 * (-4.0d0))) / l) * (d_m / (1.0d0 / h))) / 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 * D_m) / (2.0 * d_m)) <= 5e+65) {
		tmp = w0 * Math.sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (D_m / d_m))));
	} else {
		tmp = w0 * Math.sqrt((1.0 + (((((M_m * (M_m * D_m)) / (d_m * -4.0)) / l) * (D_m / (1.0 / h))) / 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 * D_m) / (2.0 * d_m)) <= 5e+65:
		tmp = w0 * math.sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (D_m / d_m))))
	else:
		tmp = w0 * math.sqrt((1.0 + (((((M_m * (M_m * D_m)) / (d_m * -4.0)) / l) * (D_m / (1.0 / h))) / 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 (Float64(Float64(M_m * D_m) / Float64(2.0 * d_m)) <= 5e+65)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(Float64(h / Float64(-4.0 / M_m)) / Float64(d_m / Float64(M_m * D_m))) / l) * Float64(D_m / d_m)))));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(Float64(Float64(M_m * Float64(M_m * D_m)) / Float64(d_m * -4.0)) / l) * Float64(D_m / Float64(1.0 / h))) / 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 * D_m) / (2.0 * d_m)) <= 5e+65)
		tmp = w0 * sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (D_m / d_m))));
	else
		tmp = w0 * sqrt((1.0 + (((((M_m * (M_m * D_m)) / (d_m * -4.0)) / l) * (D_m / (1.0 / h))) / 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[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d$95$m), $MachinePrecision]), $MachinePrecision], 5e+65], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(N[(h / N[(-4.0 / M$95$m), $MachinePrecision]), $MachinePrecision] / N[(d$95$m / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(N[(N[(M$95$m * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(d$95$m * -4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(D$95$m / N[(1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d$95$m), $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}\;\frac{M\_m \cdot D\_m}{2 \cdot d\_m} \leq 5 \cdot 10^{+65}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{\frac{h}{\frac{-4}{M\_m}}}{\frac{d\_m}{M\_m \cdot D\_m}}}{\ell} \cdot \frac{D\_m}{d\_m}}\\

\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{\frac{M\_m \cdot \left(M\_m \cdot D\_m\right)}{d\_m \cdot -4}}{\ell} \cdot \frac{D\_m}{\frac{1}{h}}}{d\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) < 4.99999999999999973e65

    1. Initial program 85.7%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified79.3%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{d}\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{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{d}\right)\right)\right)\right)\right) \]
    5. Applied egg-rr89.6%

      \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{\frac{h}{\frac{-4}{\frac{M}{\frac{d}{D \cdot M}}}}}{\ell} \cdot \frac{D}{d}}} \]
    6. 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(\mathsf{/.f64}\left(\left(\frac{h}{\frac{-4}{M} \cdot \frac{d}{D \cdot M}}\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      2. 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{h}{\frac{-4}{M}}}{\frac{d}{D \cdot M}}\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\mathsf{/.f64}\left(\left(\frac{h}{\frac{-4}{M}}\right), \left(\frac{d}{D \cdot M}\right)\right), \ell\right), \mathsf{/.f64}\left(D, 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(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \left(\frac{-4}{M}\right)\right), \left(\frac{d}{D \cdot M}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(h, \mathsf{/.f64}\left(-4, M\right)\right), \left(\frac{d}{D \cdot M}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(h, \mathsf{/.f64}\left(-4, M\right)\right), \mathsf{/.f64}\left(d, \left(D \cdot M\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      7. *-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(h, \mathsf{/.f64}\left(-4, M\right)\right), \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f6488.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, \mathsf{/.f64}\left(-4, M\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
    7. Applied egg-rr88.1%

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

    if 4.99999999999999973e65 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d))

    1. Initial program 66.2%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified57.0%

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right) \cdot \frac{h}{\ell}\right), d\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(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right) \cdot \frac{1}{\frac{\ell}{h}}\right), d\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{D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\frac{\ell}{h}}\right), d\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{\frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4} \cdot D}{\frac{\ell}{h}}\right), d\right)\right)\right)\right) \]
      5. div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{\frac{1}{h}}\right), d\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{\frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\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(\left(\frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\right)\right)\right)\right) \]
      9. 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(\frac{M \cdot \left(M \cdot D\right)}{-4 \cdot d}\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\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(\left(M \cdot \left(M \cdot D\right)\right), \left(-4 \cdot d\right)\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\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(\mathsf{*.f64}\left(M, \left(M \cdot D\right)\right), \left(-4 \cdot d\right)\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\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(\mathsf{*.f64}\left(M, \left(D \cdot M\right)\right), \left(-4 \cdot d\right)\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\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(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(D, M\right)\right), \left(-4 \cdot d\right)\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\right)\right)\right)\right) \]
      14. *-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(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(D, M\right)\right), \left(d \cdot -4\right)\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\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(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(D, M\right)\right), \mathsf{*.f64}\left(d, -4\right)\right), \ell\right), \left(\frac{D}{\frac{1}{h}}\right)\right), d\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(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(D, M\right)\right), \mathsf{*.f64}\left(d, -4\right)\right), \ell\right), \mathsf{/.f64}\left(D, \left(\frac{1}{h}\right)\right)\right), d\right)\right)\right)\right) \]
      17. /-lowering-/.f6464.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(\mathsf{*.f64}\left(M, \mathsf{*.f64}\left(D, M\right)\right), \mathsf{*.f64}\left(d, -4\right)\right), \ell\right), \mathsf{/.f64}\left(D, \mathsf{/.f64}\left(1, h\right)\right)\right), d\right)\right)\right)\right) \]
    5. Applied egg-rr64.0%

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

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

Alternative 2: 85.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} \mathbf{if}\;\frac{h}{\ell} \leq -4 \cdot 10^{-278}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{\frac{h}{\frac{-4}{M\_m}}}{\frac{d\_m}{M\_m \cdot D\_m}}}{\ell} \cdot \frac{D\_m}{d\_m}}\\ \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) -4e-278)
   (*
    w0
    (sqrt
     (+ 1.0 (* (/ (/ (/ h (/ -4.0 M_m)) (/ d_m (* M_m D_m))) l) (/ 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 ((h / l) <= -4e-278) {
		tmp = w0 * sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (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 ((h / l) <= (-4d-278)) then
        tmp = w0 * sqrt((1.0d0 + ((((h / ((-4.0d0) / m_m)) / (d_m_1 / (m_m * d_m))) / l) * (d_m / 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 ((h / l) <= -4e-278) {
		tmp = w0 * Math.sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (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 (h / l) <= -4e-278:
		tmp = w0 * math.sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (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 (Float64(h / l) <= -4e-278)
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(Float64(h / Float64(-4.0 / M_m)) / Float64(d_m / Float64(M_m * D_m))) / l) * 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 ((h / l) <= -4e-278)
		tmp = w0 * sqrt((1.0 + ((((h / (-4.0 / M_m)) / (d_m / (M_m * D_m))) / l) * (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[N[(h / l), $MachinePrecision], -4e-278], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(N[(h / N[(-4.0 / M$95$m), $MachinePrecision]), $MachinePrecision] / N[(d$95$m / N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $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}\;\frac{h}{\ell} \leq -4 \cdot 10^{-278}:\\
\;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{\frac{h}{\frac{-4}{M\_m}}}{\frac{d\_m}{M\_m \cdot D\_m}}}{\ell} \cdot \frac{D\_m}{d\_m}}\\

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


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

    1. Initial program 79.5%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified73.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{d}\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{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{d}\right)\right)\right)\right)\right) \]
    5. Applied egg-rr79.6%

      \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{\frac{h}{\frac{-4}{\frac{M}{\frac{d}{D \cdot M}}}}}{\ell} \cdot \frac{D}{d}}} \]
    6. 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(\mathsf{/.f64}\left(\left(\frac{h}{\frac{-4}{M} \cdot \frac{d}{D \cdot M}}\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      2. 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{h}{\frac{-4}{M}}}{\frac{d}{D \cdot M}}\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\mathsf{/.f64}\left(\left(\frac{h}{\frac{-4}{M}}\right), \left(\frac{d}{D \cdot M}\right)\right), \ell\right), \mathsf{/.f64}\left(D, 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(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \left(\frac{-4}{M}\right)\right), \left(\frac{d}{D \cdot M}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(h, \mathsf{/.f64}\left(-4, M\right)\right), \left(\frac{d}{D \cdot M}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(h, \mathsf{/.f64}\left(-4, M\right)\right), \mathsf{/.f64}\left(d, \left(D \cdot M\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      7. *-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(h, \mathsf{/.f64}\left(-4, M\right)\right), \mathsf{/.f64}\left(d, \left(M \cdot D\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f6477.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, \mathsf{/.f64}\left(-4, M\right)\right), \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(M, D\right)\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
    7. Applied egg-rr77.3%

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

    if -3.99999999999999975e-278 < (/.f64 h l)

    1. Initial program 85.6%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified77.6%

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

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

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

    Alternative 3: 87.1% 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}\;d\_m \leq 520000000:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\left(M\_m \cdot D\_m\right) \cdot \left(\frac{h}{-4} \cdot \frac{M\_m}{d\_m}\right)}{d\_m} \cdot \frac{D\_m}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{D\_m}{d\_m} \cdot \frac{\left(D\_m \cdot -0.25\right) \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{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
     (if (<= d_m 520000000.0)
       (*
        w0
        (sqrt
         (+ 1.0 (* (/ (* (* M_m D_m) (* (/ h -4.0) (/ M_m d_m))) d_m) (/ D_m l)))))
       (*
        w0
        (sqrt
         (+
          1.0
          (* (/ D_m d_m) (/ (* (* D_m -0.25) (/ (* h (* M_m M_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 (d_m <= 520000000.0) {
    		tmp = w0 * sqrt((1.0 + ((((M_m * D_m) * ((h / -4.0) * (M_m / d_m))) / d_m) * (D_m / l))));
    	} else {
    		tmp = w0 * sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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 (d_m_1 <= 520000000.0d0) then
            tmp = w0 * sqrt((1.0d0 + ((((m_m * d_m) * ((h / (-4.0d0)) * (m_m / d_m_1))) / d_m_1) * (d_m / l))))
        else
            tmp = w0 * sqrt((1.0d0 + ((d_m / d_m_1) * (((d_m * (-0.25d0)) * ((h * (m_m * m_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 (d_m <= 520000000.0) {
    		tmp = w0 * Math.sqrt((1.0 + ((((M_m * D_m) * ((h / -4.0) * (M_m / d_m))) / d_m) * (D_m / l))));
    	} else {
    		tmp = w0 * Math.sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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 d_m <= 520000000.0:
    		tmp = w0 * math.sqrt((1.0 + ((((M_m * D_m) * ((h / -4.0) * (M_m / d_m))) / d_m) * (D_m / l))))
    	else:
    		tmp = w0 * math.sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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 (d_m <= 520000000.0)
    		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(Float64(M_m * D_m) * Float64(Float64(h / -4.0) * Float64(M_m / d_m))) / d_m) * Float64(D_m / l)))));
    	else
    		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D_m / d_m) * Float64(Float64(Float64(D_m * -0.25) * Float64(Float64(h * Float64(M_m * M_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)
    	tmp = 0.0;
    	if (d_m <= 520000000.0)
    		tmp = w0 * sqrt((1.0 + ((((M_m * D_m) * ((h / -4.0) * (M_m / d_m))) / d_m) * (D_m / l))));
    	else
    		tmp = w0 * sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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[d$95$m, 520000000.0], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(N[(h / -4.0), $MachinePrecision] * N[(M$95$m / d$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(D$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D$95$m / d$95$m), $MachinePrecision] * N[(N[(N[(D$95$m * -0.25), $MachinePrecision] * N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision] / l), $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 520000000:\\
    \;\;\;\;w0 \cdot \sqrt{1 + \frac{\left(M\_m \cdot D\_m\right) \cdot \left(\frac{h}{-4} \cdot \frac{M\_m}{d\_m}\right)}{d\_m} \cdot \frac{D\_m}{\ell}}\\
    
    \mathbf{else}:\\
    \;\;\;\;w0 \cdot \sqrt{1 + \frac{D\_m}{d\_m} \cdot \frac{\left(D\_m \cdot -0.25\right) \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}}{\ell}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if d < 5.2e8

      1. Initial program 81.8%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified76.9%

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{d} \cdot \frac{D}{\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(\left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{d}\right), \left(\frac{D}{\ell}\right)\right)\right)\right)\right) \]
      5. Applied egg-rr78.4%

        \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{\frac{h}{\frac{-4}{\frac{M}{\frac{d}{D \cdot M}}}}}{d} \cdot \frac{D}{\ell}}} \]
      6. 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(\mathsf{/.f64}\left(\left(\frac{h}{-4} \cdot \frac{M}{\frac{d}{D \cdot M}}\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
        2. 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{h}{-4} \cdot \left(\frac{M}{d} \cdot \left(D \cdot M\right)\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\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(\mathsf{/.f64}\left(\left(\left(\frac{h}{-4} \cdot \frac{M}{d}\right) \cdot \left(D \cdot M\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\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(\mathsf{*.f64}\left(\left(\frac{h}{-4} \cdot \frac{M}{d}\right), \left(D \cdot M\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\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(\left(\frac{h}{-4}\right), \left(\frac{M}{d}\right)\right), \left(D \cdot M\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\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(\mathsf{/.f64}\left(h, -4\right), \left(\frac{M}{d}\right)\right), \left(D \cdot M\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\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(\mathsf{*.f64}\left(\mathsf{/.f64}\left(h, -4\right), \mathsf{/.f64}\left(M, d\right)\right), \left(D \cdot M\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
        8. *-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(\mathsf{/.f64}\left(h, -4\right), \mathsf{/.f64}\left(M, d\right)\right), \left(M \cdot D\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
        9. *-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(\mathsf{/.f64}\left(h, -4\right), \mathsf{/.f64}\left(M, d\right)\right), \mathsf{*.f64}\left(M, D\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
      7. Applied egg-rr79.0%

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

      if 5.2e8 < d

      1. Initial program 84.1%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified72.4%

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{d}\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{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{d}\right)\right)\right)\right)\right) \]
      5. Applied egg-rr89.6%

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot \frac{D \cdot \left({M}^{2} \cdot h\right)}{d}\right)}, \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      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(\mathsf{/.f64}\left(\left(\frac{-1}{4} \cdot \left(D \cdot \frac{{M}^{2} \cdot h}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        2. 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(\frac{-1}{4} \cdot D\right) \cdot \frac{{M}^{2} \cdot h}{d}\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\mathsf{*.f64}\left(\left(\frac{-1}{4} \cdot D\right), \left(\frac{{M}^{2} \cdot h}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, D\right), \left(\frac{{M}^{2} \cdot h}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\left({M}^{2} \cdot h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({M}^{2}\right), h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        7. unpow2N/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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot M\right), h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f6481.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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
      8. Simplified81.8%

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

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

    Alternative 4: 83.0% 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}\;M\_m \leq 4.5 \cdot 10^{-163}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{D\_m}{d\_m} \cdot \frac{\left(D\_m \cdot -0.25\right) \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{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
     (if (<= M_m 4.5e-163)
       w0
       (*
        w0
        (sqrt
         (+
          1.0
          (* (/ D_m d_m) (/ (* (* D_m -0.25) (/ (* h (* M_m M_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 <= 4.5e-163) {
    		tmp = w0;
    	} else {
    		tmp = w0 * sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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 <= 4.5d-163) then
            tmp = w0
        else
            tmp = w0 * sqrt((1.0d0 + ((d_m / d_m_1) * (((d_m * (-0.25d0)) * ((h * (m_m * m_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 <= 4.5e-163) {
    		tmp = w0;
    	} else {
    		tmp = w0 * Math.sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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 <= 4.5e-163:
    		tmp = w0
    	else:
    		tmp = w0 * math.sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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 <= 4.5e-163)
    		tmp = w0;
    	else
    		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(D_m / d_m) * Float64(Float64(Float64(D_m * -0.25) * Float64(Float64(h * Float64(M_m * M_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)
    	tmp = 0.0;
    	if (M_m <= 4.5e-163)
    		tmp = w0;
    	else
    		tmp = w0 * sqrt((1.0 + ((D_m / d_m) * (((D_m * -0.25) * ((h * (M_m * M_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, 4.5e-163], w0, N[(w0 * N[Sqrt[N[(1.0 + N[(N[(D$95$m / d$95$m), $MachinePrecision] * N[(N[(N[(D$95$m * -0.25), $MachinePrecision] * N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision]), $MachinePrecision] / l), $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 4.5 \cdot 10^{-163}:\\
    \;\;\;\;w0\\
    
    \mathbf{else}:\\
    \;\;\;\;w0 \cdot \sqrt{1 + \frac{D\_m}{d\_m} \cdot \frac{\left(D\_m \cdot -0.25\right) \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{d\_m}}{\ell}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if M < 4.4999999999999997e-163

      1. Initial program 83.6%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified77.9%

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

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

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

        if 4.4999999999999997e-163 < M

        1. Initial program 80.7%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Simplified71.9%

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell} \cdot \frac{D}{d}\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{h \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}}{\ell}\right), \left(\frac{D}{d}\right)\right)\right)\right)\right) \]
        5. Applied egg-rr81.8%

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

          \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot \frac{D \cdot \left({M}^{2} \cdot h\right)}{d}\right)}, \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        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(\mathsf{/.f64}\left(\left(\frac{-1}{4} \cdot \left(D \cdot \frac{{M}^{2} \cdot h}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
          2. 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(\frac{-1}{4} \cdot D\right) \cdot \frac{{M}^{2} \cdot h}{d}\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\mathsf{*.f64}\left(\left(\frac{-1}{4} \cdot D\right), \left(\frac{{M}^{2} \cdot h}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, D\right), \left(\frac{{M}^{2} \cdot h}{d}\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\left({M}^{2} \cdot h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({M}^{2}\right), h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
          7. unpow2N/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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot M\right), h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
          8. *-lowering-*.f6469.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(\frac{-1}{4}, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), d\right)\right), \ell\right), \mathsf{/.f64}\left(D, d\right)\right)\right)\right)\right) \]
        8. Simplified69.2%

          \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\left(-0.25 \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{d}}}{\ell} \cdot \frac{D}{d}} \]
      6. Recombined 2 regimes into one program.
      7. Final simplification74.1%

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

      Alternative 5: 76.7% accurate, 7.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 -1.8 \cdot 10^{-256}:\\ \;\;\;\;w0 + \frac{D\_m}{d\_m} \cdot \frac{D\_m \cdot \left(\left(M\_m \cdot \left(M\_m \cdot h\right)\right) \cdot \left(w0 \cdot -0.125\right)\right)}{d\_m \cdot \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) -1.8e-256)
         (+
          w0
          (* (/ D_m d_m) (/ (* D_m (* (* M_m (* M_m h)) (* w0 -0.125))) (* 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) <= -1.8e-256) {
      		tmp = w0 + ((D_m / d_m) * ((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / (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) <= (-1.8d-256)) then
              tmp = w0 + ((d_m / d_m_1) * ((d_m * ((m_m * (m_m * h)) * (w0 * (-0.125d0)))) / (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) <= -1.8e-256) {
      		tmp = w0 + ((D_m / d_m) * ((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / (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) <= -1.8e-256:
      		tmp = w0 + ((D_m / d_m) * ((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / (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) <= -1.8e-256)
      		tmp = Float64(w0 + Float64(Float64(D_m / d_m) * Float64(Float64(D_m * Float64(Float64(M_m * Float64(M_m * h)) * Float64(w0 * -0.125))) / Float64(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) <= -1.8e-256)
      		tmp = w0 + ((D_m / d_m) * ((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / (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], -1.8e-256], N[(w0 + N[(N[(D$95$m / d$95$m), $MachinePrecision] * N[(N[(D$95$m * N[(N[(M$95$m * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] * N[(w0 * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d$95$m * 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 -1.8 \cdot 10^{-256}:\\
      \;\;\;\;w0 + \frac{D\_m}{d\_m} \cdot \frac{D\_m \cdot \left(\left(M\_m \cdot \left(M\_m \cdot h\right)\right) \cdot \left(w0 \cdot -0.125\right)\right)}{d\_m \cdot \ell}\\
      
      \mathbf{else}:\\
      \;\;\;\;w0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 h l) < -1.8000000000000001e-256

        1. Initial program 79.4%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Simplified73.4%

          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
        3. Add Preprocessing
        4. 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}} \]
        5. 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. associate-*r/N/A

            \[\leadsto \mathsf{+.f64}\left(w0, \left(\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}}\right)\right) \]
          3. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
          5. associate-*r*N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \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)\right) \]
          8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.8000000000000001e-256 < (/.f64 h l)

        1. Initial program 85.4%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Simplified77.7%

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

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

            \[\leadsto \color{blue}{w0} \]
        6. Recombined 2 regimes into one program.
        7. Final simplification76.6%

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

        Alternative 6: 76.3% accurate, 7.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 -1.8 \cdot 10^{-256}:\\ \;\;\;\;w0 + \frac{D\_m \cdot \left(\left(M\_m \cdot \left(M\_m \cdot h\right)\right) \cdot \left(w0 \cdot -0.125\right)\right)}{d\_m} \cdot \frac{D\_m}{d\_m \cdot \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) -1.8e-256)
           (+
            w0
            (* (/ (* D_m (* (* M_m (* M_m h)) (* w0 -0.125))) 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) <= -1.8e-256) {
        		tmp = w0 + (((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / 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) <= (-1.8d-256)) then
                tmp = w0 + (((d_m * ((m_m * (m_m * h)) * (w0 * (-0.125d0)))) / 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) <= -1.8e-256) {
        		tmp = w0 + (((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / 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) <= -1.8e-256:
        		tmp = w0 + (((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / 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) <= -1.8e-256)
        		tmp = Float64(w0 + Float64(Float64(Float64(D_m * Float64(Float64(M_m * Float64(M_m * h)) * Float64(w0 * -0.125))) / d_m) * Float64(D_m / Float64(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) <= -1.8e-256)
        		tmp = w0 + (((D_m * ((M_m * (M_m * h)) * (w0 * -0.125))) / 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], -1.8e-256], N[(w0 + N[(N[(N[(D$95$m * N[(N[(M$95$m * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] * N[(w0 * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d$95$m), $MachinePrecision] * N[(D$95$m / N[(d$95$m * 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 -1.8 \cdot 10^{-256}:\\
        \;\;\;\;w0 + \frac{D\_m \cdot \left(\left(M\_m \cdot \left(M\_m \cdot h\right)\right) \cdot \left(w0 \cdot -0.125\right)\right)}{d\_m} \cdot \frac{D\_m}{d\_m \cdot \ell}\\
        
        \mathbf{else}:\\
        \;\;\;\;w0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 h l) < -1.8000000000000001e-256

          1. Initial program 79.4%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Simplified73.4%

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
          3. Add Preprocessing
          4. 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}} \]
          5. 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. associate-*r/N/A

              \[\leadsto \mathsf{+.f64}\left(w0, \left(\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}}\right)\right) \]
            3. /-lowering-/.f64N/A

              \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
            5. associate-*r*N/A

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

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

              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \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)\right) \]
            8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.8000000000000001e-256 < (/.f64 h l)

          1. Initial program 85.4%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Simplified77.7%

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

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

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

          Alternative 7: 74.9% accurate, 7.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^{-18}:\\ \;\;\;\;w0 + \frac{D\_m}{d\_m \cdot \ell} \cdot \left(\left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot h\right)\right) \cdot \frac{w0 \cdot -0.125}{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 (<= (/ h l) -5e-18)
             (+
              w0
              (* (/ D_m (* d_m l)) (* (* (* M_m D_m) (* M_m h)) (/ (* w0 -0.125) 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 ((h / l) <= -5e-18) {
          		tmp = w0 + ((D_m / (d_m * l)) * (((M_m * D_m) * (M_m * h)) * ((w0 * -0.125) / 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 ((h / l) <= (-5d-18)) then
                  tmp = w0 + ((d_m / (d_m_1 * l)) * (((m_m * d_m) * (m_m * h)) * ((w0 * (-0.125d0)) / 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 ((h / l) <= -5e-18) {
          		tmp = w0 + ((D_m / (d_m * l)) * (((M_m * D_m) * (M_m * h)) * ((w0 * -0.125) / 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 (h / l) <= -5e-18:
          		tmp = w0 + ((D_m / (d_m * l)) * (((M_m * D_m) * (M_m * h)) * ((w0 * -0.125) / 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 (Float64(h / l) <= -5e-18)
          		tmp = Float64(w0 + Float64(Float64(D_m / Float64(d_m * l)) * Float64(Float64(Float64(M_m * D_m) * Float64(M_m * h)) * Float64(Float64(w0 * -0.125) / 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 ((h / l) <= -5e-18)
          		tmp = w0 + ((D_m / (d_m * l)) * (((M_m * D_m) * (M_m * h)) * ((w0 * -0.125) / 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[N[(h / l), $MachinePrecision], -5e-18], N[(w0 + N[(N[(D$95$m / N[(d$95$m * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * -0.125), $MachinePrecision] / d$95$m), $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^{-18}:\\
          \;\;\;\;w0 + \frac{D\_m}{d\_m \cdot \ell} \cdot \left(\left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot h\right)\right) \cdot \frac{w0 \cdot -0.125}{d\_m}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;w0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 h l) < -5.00000000000000036e-18

            1. Initial program 77.1%

              \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
            2. Simplified69.6%

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
            3. Add Preprocessing
            4. 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}} \]
            5. 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. associate-*r/N/A

                \[\leadsto \mathsf{+.f64}\left(w0, \left(\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}}\right)\right) \]
              3. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
              5. associate-*r*N/A

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

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

                \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \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)\right) \]
              8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -5.00000000000000036e-18 < (/.f64 h l)

            1. Initial program 85.3%

              \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
            2. Simplified78.8%

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

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

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

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

            Alternative 8: 71.3% 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 5 \cdot 10^{+89}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(\frac{D\_m}{d\_m \cdot \ell} \cdot \frac{w0 \cdot \left(h \cdot \left(M\_m \cdot M\_m\right)\right)}{d\_m}\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 5e+89)
               w0
               (* (* D_m -0.125) (* (/ D_m (* d_m l)) (/ (* w0 (* 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 <= 5e+89) {
            		tmp = w0;
            	} else {
            		tmp = (D_m * -0.125) * ((D_m / (d_m * l)) * ((w0 * (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 <= 5d+89) then
                    tmp = w0
                else
                    tmp = (d_m * (-0.125d0)) * ((d_m / (d_m_1 * l)) * ((w0 * (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 <= 5e+89) {
            		tmp = w0;
            	} else {
            		tmp = (D_m * -0.125) * ((D_m / (d_m * l)) * ((w0 * (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 <= 5e+89:
            		tmp = w0
            	else:
            		tmp = (D_m * -0.125) * ((D_m / (d_m * l)) * ((w0 * (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 <= 5e+89)
            		tmp = w0;
            	else
            		tmp = Float64(Float64(D_m * -0.125) * Float64(Float64(D_m / Float64(d_m * l)) * Float64(Float64(w0 * 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 <= 5e+89)
            		tmp = w0;
            	else
            		tmp = (D_m * -0.125) * ((D_m / (d_m * l)) * ((w0 * (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, 5e+89], w0, N[(N[(D$95$m * -0.125), $MachinePrecision] * N[(N[(D$95$m / N[(d$95$m * l), $MachinePrecision]), $MachinePrecision] * N[(N[(w0 * N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d$95$m), $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 5 \cdot 10^{+89}:\\
            \;\;\;\;w0\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(\frac{D\_m}{d\_m \cdot \ell} \cdot \frac{w0 \cdot \left(h \cdot \left(M\_m \cdot M\_m\right)\right)}{d\_m}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if M < 4.99999999999999983e89

              1. Initial program 83.7%

                \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
              2. Simplified78.7%

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

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

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

                if 4.99999999999999983e89 < M

                1. Initial program 75.7%

                  \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                2. Simplified58.7%

                  \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                3. Add Preprocessing
                4. 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}} \]
                5. 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. associate-*r/N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \left(\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}}\right)\right) \]
                  3. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                  5. associate-*r*N/A

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

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

                    \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \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)\right) \]
                  8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{w0 + \frac{\left(-0.125 \cdot \left(w0 \cdot \left(\left(M \cdot M\right) \cdot h\right)\right)\right) \cdot \left(D \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}} \]
                7. Taylor expanded in M 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}} \]
                8. Step-by-step derivation
                  1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 70.7% 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 2.1 \cdot 10^{+93}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(h \cdot \left(D\_m \cdot \left(\frac{M\_m \cdot M\_m}{d\_m \cdot d\_m} \cdot \frac{w0}{\ell}\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 (<= M_m 2.1e+93)
                 w0
                 (* (* D_m -0.125) (* h (* D_m (* (/ (* M_m M_m) (* d_m d_m)) (/ w0 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 <= 2.1e+93) {
              		tmp = w0;
              	} else {
              		tmp = (D_m * -0.125) * (h * (D_m * (((M_m * M_m) / (d_m * d_m)) * (w0 / 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 <= 2.1d+93) then
                      tmp = w0
                  else
                      tmp = (d_m * (-0.125d0)) * (h * (d_m * (((m_m * m_m) / (d_m_1 * d_m_1)) * (w0 / 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 <= 2.1e+93) {
              		tmp = w0;
              	} else {
              		tmp = (D_m * -0.125) * (h * (D_m * (((M_m * M_m) / (d_m * d_m)) * (w0 / 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 <= 2.1e+93:
              		tmp = w0
              	else:
              		tmp = (D_m * -0.125) * (h * (D_m * (((M_m * M_m) / (d_m * d_m)) * (w0 / 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 <= 2.1e+93)
              		tmp = w0;
              	else
              		tmp = Float64(Float64(D_m * -0.125) * Float64(h * Float64(D_m * Float64(Float64(Float64(M_m * M_m) / Float64(d_m * d_m)) * Float64(w0 / 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 <= 2.1e+93)
              		tmp = w0;
              	else
              		tmp = (D_m * -0.125) * (h * (D_m * (((M_m * M_m) / (d_m * d_m)) * (w0 / 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, 2.1e+93], w0, N[(N[(D$95$m * -0.125), $MachinePrecision] * N[(h * N[(D$95$m * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / N[(d$95$m * d$95$m), $MachinePrecision]), $MachinePrecision] * N[(w0 / l), $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 2.1 \cdot 10^{+93}:\\
              \;\;\;\;w0\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(h \cdot \left(D\_m \cdot \left(\frac{M\_m \cdot M\_m}{d\_m \cdot d\_m} \cdot \frac{w0}{\ell}\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if M < 2.0999999999999998e93

                1. Initial program 83.0%

                  \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                2. Simplified78.1%

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

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

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

                  if 2.0999999999999998e93 < M

                  1. Initial program 79.1%

                    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                  2. Simplified60.6%

                    \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                  3. Add Preprocessing
                  4. 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}} \]
                  5. 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. associate-*r/N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \left(\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}}\right)\right) \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                    5. associate-*r*N/A

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

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

                      \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \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)\right) \]
                    8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{w0 + \frac{\left(-0.125 \cdot \left(w0 \cdot \left(\left(M \cdot M\right) \cdot h\right)\right)\right) \cdot \left(D \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}} \]
                  7. Taylor expanded in M 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}} \]
                  8. Step-by-step derivation
                    1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 10: 70.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.4 \cdot 10^{+95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(D\_m \cdot \frac{\frac{h}{\ell} \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)}{d\_m \cdot d\_m}\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.4e+95)
                   w0
                   (* (* D_m -0.125) (* D_m (/ (* (/ h l) (* w0 (* M_m M_m))) (* d_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.4e+95) {
                		tmp = w0;
                	} else {
                		tmp = (D_m * -0.125) * (D_m * (((h / l) * (w0 * (M_m * M_m))) / (d_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.4d+95) then
                        tmp = w0
                    else
                        tmp = (d_m * (-0.125d0)) * (d_m * (((h / l) * (w0 * (m_m * m_m))) / (d_m_1 * 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.4e+95) {
                		tmp = w0;
                	} else {
                		tmp = (D_m * -0.125) * (D_m * (((h / l) * (w0 * (M_m * M_m))) / (d_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.4e+95:
                		tmp = w0
                	else:
                		tmp = (D_m * -0.125) * (D_m * (((h / l) * (w0 * (M_m * M_m))) / (d_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.4e+95)
                		tmp = w0;
                	else
                		tmp = Float64(Float64(D_m * -0.125) * Float64(D_m * Float64(Float64(Float64(h / l) * Float64(w0 * Float64(M_m * M_m))) / Float64(d_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.4e+95)
                		tmp = w0;
                	else
                		tmp = (D_m * -0.125) * (D_m * (((h / l) * (w0 * (M_m * M_m))) / (d_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.4e+95], w0, N[(N[(D$95$m * -0.125), $MachinePrecision] * N[(D$95$m * N[(N[(N[(h / l), $MachinePrecision] * N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d$95$m * d$95$m), $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.4 \cdot 10^{+95}:\\
                \;\;\;\;w0\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(D\_m \cdot \frac{\frac{h}{\ell} \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)}{d\_m \cdot d\_m}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if M < 3.40000000000000022e95

                  1. Initial program 83.1%

                    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                  2. Simplified78.2%

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

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

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

                    if 3.40000000000000022e95 < M

                    1. Initial program 78.5%

                      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                    2. Simplified59.5%

                      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                    3. Add Preprocessing
                    4. 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}} \]
                    5. 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. associate-*r/N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \left(\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}}\right)\right) \]
                      3. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                      5. associate-*r*N/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \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)\right) \]
                      8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{w0 + \frac{\left(-0.125 \cdot \left(w0 \cdot \left(\left(M \cdot M\right) \cdot h\right)\right)\right) \cdot \left(D \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}} \]
                    7. Taylor expanded in M 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}} \]
                    8. Step-by-step derivation
                      1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(D \cdot -0.125\right) \cdot \left(D \cdot \frac{h \cdot \left(w0 \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}\right)} \]
                    12. Step-by-step derivation
                      1. times-fracN/A

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

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

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

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

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

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

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

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

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

                  Alternative 11: 70.6% 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 2.55 \cdot 10^{+95}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(D\_m \cdot \frac{h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)}{\ell \cdot \left(d\_m \cdot 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 2.55e+95)
                     w0
                     (* (* D_m -0.125) (* D_m (/ (* h (* w0 (* M_m M_m))) (* l (* d_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 <= 2.55e+95) {
                  		tmp = w0;
                  	} else {
                  		tmp = (D_m * -0.125) * (D_m * ((h * (w0 * (M_m * M_m))) / (l * (d_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 <= 2.55d+95) then
                          tmp = w0
                      else
                          tmp = (d_m * (-0.125d0)) * (d_m * ((h * (w0 * (m_m * m_m))) / (l * (d_m_1 * 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 <= 2.55e+95) {
                  		tmp = w0;
                  	} else {
                  		tmp = (D_m * -0.125) * (D_m * ((h * (w0 * (M_m * M_m))) / (l * (d_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 <= 2.55e+95:
                  		tmp = w0
                  	else:
                  		tmp = (D_m * -0.125) * (D_m * ((h * (w0 * (M_m * M_m))) / (l * (d_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 <= 2.55e+95)
                  		tmp = w0;
                  	else
                  		tmp = Float64(Float64(D_m * -0.125) * Float64(D_m * Float64(Float64(h * Float64(w0 * Float64(M_m * M_m))) / Float64(l * Float64(d_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 <= 2.55e+95)
                  		tmp = w0;
                  	else
                  		tmp = (D_m * -0.125) * (D_m * ((h * (w0 * (M_m * M_m))) / (l * (d_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, 2.55e+95], w0, N[(N[(D$95$m * -0.125), $MachinePrecision] * N[(D$95$m * N[(N[(h * N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d$95$m * 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 2.55 \cdot 10^{+95}:\\
                  \;\;\;\;w0\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(D\_m \cdot -0.125\right) \cdot \left(D\_m \cdot \frac{h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)}{\ell \cdot \left(d\_m \cdot d\_m\right)}\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if M < 2.55000000000000001e95

                    1. Initial program 83.0%

                      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                    2. Simplified78.1%

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

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

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

                      if 2.55000000000000001e95 < M

                      1. Initial program 79.1%

                        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                      2. Simplified60.6%

                        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h}{\ell} \cdot \left(D \cdot \frac{\frac{M \cdot \left(M \cdot D\right)}{d}}{-4}\right)}{d}}} \]
                      3. Add Preprocessing
                      4. 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}} \]
                      5. 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. associate-*r/N/A

                          \[\leadsto \mathsf{+.f64}\left(w0, \left(\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}}\right)\right) \]
                        3. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(w0, \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)\right) \]
                        5. associate-*r*N/A

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

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

                          \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \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)\right) \]
                        8. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{w0 + \frac{\left(-0.125 \cdot \left(w0 \cdot \left(\left(M \cdot M\right) \cdot h\right)\right)\right) \cdot \left(D \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}} \]
                      7. Taylor expanded in M 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}} \]
                      8. Step-by-step derivation
                        1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 12: 67.5% 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 82.5%

                      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                    2. Simplified75.6%

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

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

                        \[\leadsto \color{blue}{w0} \]
                      2. Add Preprocessing

                      Reproduce

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