Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.0% → 89.0%
Time: 18.0s
Alternatives: 14
Speedup: 1.6×

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 14 alternatives:

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

Initial Program: 81.0% 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: 89.0% accurate, 0.9× speedup?

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

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


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

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), M\right), D\right)\right), \left(\frac{\frac{2 \cdot d}{M}}{D}\right)\right)\right)\right)\right) \]
      17. /-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(h, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), M\right), D\right)\right), \mathsf{/.f64}\left(\left(\frac{2 \cdot d}{M}\right), D\right)\right)\right)\right)\right) \]
      18. /-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(h, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), M\right), D\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot d\right), M\right), D\right)\right)\right)\right)\right) \]
      19. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(h, \ell\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(d, 2\right), M\right), D\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(d \cdot 2\right), M\right), D\right)\right)\right)\right)\right) \]
      20. *-lowering-*.f6491.3%

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

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

    if 0.0100000000000000002 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))

    1. Initial program 0.0%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified0.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. *-commutativeN/A

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

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

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

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{\frac{h}{\ell}}{\frac{-4}{\frac{M}{\frac{d}{D \cdot M}}}} \cdot 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 \cdot \ell}\right)}, D\right), d\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-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(\frac{-1}{4}, \left(\frac{D \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}\right)\right), D\right), d\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(\mathsf{*.f64}\left(\frac{-1}{4}, \left(\frac{\frac{D \cdot \left({M}^{2} \cdot h\right)}{d}}{\ell}\right)\right), D\right), d\right)\right)\right)\right) \]
      3. /-lowering-/.f64N/A

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

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

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

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

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

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

Alternative 2: 87.0% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 h l) < -5.00000000000000026e300

    1. Initial program 32.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified32.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. 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-rr84.9%

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

    if -5.00000000000000026e300 < (/.f64 h l) < -1e-209

    1. Initial program 81.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified71.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{\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. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e-209 < (/.f64 h l)

    1. Initial program 88.5%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified83.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. *-commutativeN/A

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

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

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

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

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 + \frac{\color{blue}{\frac{\frac{h}{\ell}}{\frac{-4}{\frac{M}{\frac{d}{D \cdot M}}}} \cdot 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 \cdot \ell}\right)}, D\right), d\right)\right)\right)\right) \]
    7. Step-by-step derivation
      1. *-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(\frac{-1}{4}, \left(\frac{D \cdot \left({M}^{2} \cdot h\right)}{d \cdot \ell}\right)\right), D\right), d\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(\mathsf{*.f64}\left(\frac{-1}{4}, \left(\frac{\frac{D \cdot \left({M}^{2} \cdot h\right)}{d}}{\ell}\right)\right), D\right), d\right)\right)\right)\right) \]
      3. /-lowering-/.f64N/A

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

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

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

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

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

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

Alternative 3: 86.1% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 h l) < -5.00000000000000026e300

    1. Initial program 32.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified32.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. 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-rr84.9%

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

    if -5.00000000000000026e300 < (/.f64 h l) < -9.99999999999999934e-276

    1. Initial program 82.9%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified72.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. 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. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999934e-276 < (/.f64 h l)

    1. Initial program 87.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified83.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} \]
    5. Step-by-step derivation
      1. Simplified93.7%

        \[\leadsto \color{blue}{w0} \]
    6. Recombined 3 regimes into one program.
    7. Final simplification87.5%

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

    Alternative 4: 85.3% accurate, 1.6× speedup?

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

      1. Initial program 27.9%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified27.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
      5. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -inf.0 < (/.f64 h l) < -9.99999999999999934e-276

      1. Initial program 82.5%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified72.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. 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. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.99999999999999934e-276 < (/.f64 h l)

      1. Initial program 87.8%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Simplified83.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} \]
      5. Step-by-step derivation
        1. Simplified93.7%

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

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

      Alternative 5: 76.7% accurate, 1.7× speedup?

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

        1. Initial program 80.0%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Simplified74.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.4%

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

          if 1.64999999999999986e-85 < M < 1.75000000000000012e42

          1. Initial program 86.3%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Simplified86.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. Taylor expanded in h around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.75000000000000012e42 < M

          1. Initial program 77.6%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Simplified62.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 inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 76.9% accurate, 8.3× speedup?

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

          1. Initial program 80.0%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Simplified74.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.4%

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

            if 8.00000000000000068e-86 < M

            1. Initial program 80.6%

              \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
            2. Simplified70.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
            5. Step-by-step derivation
              1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 7: 76.4% accurate, 8.3× speedup?

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

            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.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. Simplified77.0%

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

              if 3.5499999999999998 < D

              1. Initial program 72.7%

                \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
              2. Simplified67.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
              5. Step-by-step derivation
                1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 8: 67.0% accurate, 8.3× speedup?

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

              1. Initial program 77.1%

                \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
              2. Simplified70.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
              5. Step-by-step derivation
                1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 5.3999999999999999e-49 < d

              1. Initial program 86.9%

                \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
              2. Simplified79.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. Simplified84.3%

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

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

              Alternative 9: 73.8% accurate, 8.3× speedup?

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

                1. Initial program 79.8%

                  \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                2. Simplified74.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. Taylor expanded in h around 0

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

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

                  if 3.9999999999999996e-96 < M

                  1. Initial program 81.1%

                    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                  2. Simplified71.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                  5. Step-by-step derivation
                    1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 10: 72.7% accurate, 9.0× speedup?

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

                  1. Initial program 80.9%

                    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                  2. Simplified76.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. Simplified72.5%

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

                    if 4.69999999999999974e50 < M

                    1. Initial program 77.6%

                      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                    2. Simplified62.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                    5. Step-by-step derivation
                      1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 72.7% accurate, 9.0× speedup?

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

                    1. Initial program 80.9%

                      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                    2. Simplified76.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. Simplified72.5%

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

                      if 5.7000000000000002e50 < M

                      1. Initial program 77.6%

                        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                      2. Simplified62.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                      5. Step-by-step derivation
                        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 12: 72.5% accurate, 9.0× speedup?

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

                      1. Initial program 80.9%

                        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                      2. Simplified76.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. Simplified72.5%

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

                        if 3.50000000000000023e45 < M

                        1. Initial program 77.6%

                          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                        2. Simplified62.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                        5. Step-by-step derivation
                          1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 71.6% accurate, 9.0× speedup?

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

                        1. Initial program 80.9%

                          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                        2. Simplified76.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. Simplified72.5%

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

                          if 5.5999999999999999e45 < M

                          1. Initial program 77.6%

                            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                          2. Simplified62.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 \mathsf{*.f64}\left(w0, \color{blue}{\left(1 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                          5. Step-by-step derivation
                            1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 14: 67.0% accurate, 216.0× speedup?

                        \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ w0 \end{array} \]
                        M_m = (fabs.f64 M)
                        D_m = (fabs.f64 D)
                        NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
                        (FPCore (w0 M_m D_m h l d) :precision binary64 w0)
                        M_m = fabs(M);
                        D_m = fabs(D);
                        assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
                        double code(double w0, double M_m, double D_m, double h, double l, double d) {
                        	return w0;
                        }
                        
                        M_m = abs(m)
                        D_m = abs(d)
                        NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
                        real(8) function code(w0, m_m, d_m, h, l, d)
                            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
                            code = w0
                        end function
                        
                        M_m = Math.abs(M);
                        D_m = Math.abs(D);
                        assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
                        public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
                        	return w0;
                        }
                        
                        M_m = math.fabs(M)
                        D_m = math.fabs(D)
                        [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d])
                        def code(w0, M_m, D_m, h, l, d):
                        	return w0
                        
                        M_m = abs(M)
                        D_m = abs(D)
                        w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
                        function code(w0, M_m, D_m, h, l, d)
                        	return w0
                        end
                        
                        M_m = abs(M);
                        D_m = abs(D);
                        w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
                        function tmp = code(w0, M_m, D_m, h, l, d)
                        	tmp = w0;
                        end
                        
                        M_m = N[Abs[M], $MachinePrecision]
                        D_m = N[Abs[D], $MachinePrecision]
                        NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
                        code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := w0
                        
                        \begin{array}{l}
                        M_m = \left|M\right|
                        \\
                        D_m = \left|D\right|
                        \\
                        [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
                        \\
                        w0
                        \end{array}
                        
                        Derivation
                        1. Initial program 80.2%

                          \[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} \]
                        5. Step-by-step derivation
                          1. Simplified69.8%

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

                          Reproduce

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