Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.5% → 88.6%
Time: 17.5s
Alternatives: 11
Speedup: 1.8×

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 11 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.5% 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: 88.6% accurate, 1.8× 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}{\frac{d}{M\_m}}\\ w0 \cdot \sqrt{1 + \frac{\frac{t\_0}{\frac{\frac{-4}{h}}{t\_0}}}{\ell}} \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 M_m))))
   (* w0 (sqrt (+ 1.0 (/ (/ t_0 (/ (/ -4.0 h) t_0)) 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 t_0 = D_m / (d / M_m);
	return w0 * sqrt((1.0 + ((t_0 / ((-4.0 / h) / t_0)) / l)));
}
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
    t_0 = d_m / (d / m_m)
    code = w0 * sqrt((1.0d0 + ((t_0 / (((-4.0d0) / h) / t_0)) / l)))
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 / M_m);
	return w0 * Math.sqrt((1.0 + ((t_0 / ((-4.0 / h) / t_0)) / l)));
}
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 / M_m)
	return w0 * math.sqrt((1.0 + ((t_0 / ((-4.0 / h) / t_0)) / l)))
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(D_m / Float64(d / M_m))
	return Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(t_0 / Float64(Float64(-4.0 / h) / t_0)) / l))))
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)
	t_0 = D_m / (d / M_m);
	tmp = w0 * sqrt((1.0 + ((t_0 / ((-4.0 / h) / t_0)) / l)));
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[(D$95$m / N[(d / M$95$m), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 + N[(N[(t$95$0 / N[(N[(-4.0 / h), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / l), $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}{\frac{d}{M\_m}}\\
w0 \cdot \sqrt{1 + \frac{\frac{t\_0}{\frac{\frac{-4}{h}}{t\_0}}}{\ell}}
\end{array}
\end{array}
Derivation
  1. Initial program 78.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.8% accurate, 1.8× 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}{\frac{d}{M\_m}}\\ w0 \cdot \sqrt{1 + \left(t\_0 \cdot \frac{h}{-4}\right) \cdot \frac{t\_0}{\ell}} \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 M_m))))
   (* w0 (sqrt (+ 1.0 (* (* t_0 (/ h -4.0)) (/ t_0 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 t_0 = D_m / (d / M_m);
	return w0 * sqrt((1.0 + ((t_0 * (h / -4.0)) * (t_0 / l))));
}
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
    t_0 = d_m / (d / m_m)
    code = w0 * sqrt((1.0d0 + ((t_0 * (h / (-4.0d0))) * (t_0 / l))))
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 / M_m);
	return w0 * Math.sqrt((1.0 + ((t_0 * (h / -4.0)) * (t_0 / l))));
}
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 / M_m)
	return w0 * math.sqrt((1.0 + ((t_0 * (h / -4.0)) * (t_0 / l))))
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(D_m / Float64(d / M_m))
	return Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(t_0 * Float64(h / -4.0)) * Float64(t_0 / l)))))
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)
	t_0 = D_m / (d / M_m);
	tmp = w0 * sqrt((1.0 + ((t_0 * (h / -4.0)) * (t_0 / l))));
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[(D$95$m / N[(d / M$95$m), $MachinePrecision]), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(1.0 + N[(N[(t$95$0 * N[(h / -4.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / 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}
t_0 := \frac{D\_m}{\frac{d}{M\_m}}\\
w0 \cdot \sqrt{1 + \left(t\_0 \cdot \frac{h}{-4}\right) \cdot \frac{t\_0}{\ell}}
\end{array}
\end{array}
Derivation
  1. Initial program 78.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 71.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}\;d \leq 2 \cdot 10^{-98}:\\ \;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \frac{\frac{h \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}{d}}{d}\\ \mathbf{else}:\\ \;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \left(w0 \cdot \left(h \cdot \left(M\_m \cdot M\_m\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 (<= d 2e-98)
   (+ w0 (* (/ -0.125 l) (/ (/ (* h (* (* D_m D_m) (* M_m (* w0 M_m)))) d) d)))
   (+
    w0
    (* (/ -0.125 l) (* (/ D_m d) (* (/ D_m d) (* w0 (* h (* M_m 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 tmp;
	if (d <= 2e-98) {
		tmp = w0 + ((-0.125 / l) * (((h * ((D_m * D_m) * (M_m * (w0 * M_m)))) / d) / d));
	} else {
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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) :: tmp
    if (d <= 2d-98) then
        tmp = w0 + (((-0.125d0) / l) * (((h * ((d_m * d_m) * (m_m * (w0 * m_m)))) / d) / d))
    else
        tmp = w0 + (((-0.125d0) / l) * ((d_m / d) * ((d_m / d) * (w0 * (h * (m_m * 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 tmp;
	if (d <= 2e-98) {
		tmp = w0 + ((-0.125 / l) * (((h * ((D_m * D_m) * (M_m * (w0 * M_m)))) / d) / d));
	} else {
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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):
	tmp = 0
	if d <= 2e-98:
		tmp = w0 + ((-0.125 / l) * (((h * ((D_m * D_m) * (M_m * (w0 * M_m)))) / d) / d))
	else:
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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)
	tmp = 0.0
	if (d <= 2e-98)
		tmp = Float64(w0 + Float64(Float64(-0.125 / l) * Float64(Float64(Float64(h * Float64(Float64(D_m * D_m) * Float64(M_m * Float64(w0 * M_m)))) / d) / d)));
	else
		tmp = Float64(w0 + Float64(Float64(-0.125 / l) * Float64(Float64(D_m / d) * Float64(Float64(D_m / d) * Float64(w0 * Float64(h * Float64(M_m * 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)
	tmp = 0.0;
	if (d <= 2e-98)
		tmp = w0 + ((-0.125 / l) * (((h * ((D_m * D_m) * (M_m * (w0 * M_m)))) / d) / d));
	else
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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_] := If[LessEqual[d, 2e-98], N[(w0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(N[(h * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * N[(w0 * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(w0 * N[(h * N[(M$95$m * M$95$m), $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}\;d \leq 2 \cdot 10^{-98}:\\
\;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \frac{\frac{h \cdot \left(\left(D\_m \cdot D\_m\right) \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right)}{d}}{d}\\

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


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

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999988e-98 < d

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 74.7% 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 4 \cdot 10^{-79}:\\ \;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \left(\left(w0 \cdot D\_m\right) \cdot \left(D\_m \cdot \frac{M\_m \cdot h}{\frac{d}{\frac{M\_m}{d}}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \left(\frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \left(w0 \cdot \left(h \cdot \left(M\_m \cdot M\_m\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 (<= d 4e-79)
   (+ w0 (* (/ -0.125 l) (* (* w0 D_m) (* D_m (/ (* M_m h) (/ d (/ M_m d)))))))
   (+
    w0
    (* (/ -0.125 l) (* (/ D_m d) (* (/ D_m d) (* w0 (* h (* M_m 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 tmp;
	if (d <= 4e-79) {
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / d))))));
	} else {
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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) :: tmp
    if (d <= 4d-79) then
        tmp = w0 + (((-0.125d0) / l) * ((w0 * d_m) * (d_m * ((m_m * h) / (d / (m_m / d))))))
    else
        tmp = w0 + (((-0.125d0) / l) * ((d_m / d) * ((d_m / d) * (w0 * (h * (m_m * 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 tmp;
	if (d <= 4e-79) {
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / d))))));
	} else {
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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):
	tmp = 0
	if d <= 4e-79:
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / d))))))
	else:
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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)
	tmp = 0.0
	if (d <= 4e-79)
		tmp = Float64(w0 + Float64(Float64(-0.125 / l) * Float64(Float64(w0 * D_m) * Float64(D_m * Float64(Float64(M_m * h) / Float64(d / Float64(M_m / d)))))));
	else
		tmp = Float64(w0 + Float64(Float64(-0.125 / l) * Float64(Float64(D_m / d) * Float64(Float64(D_m / d) * Float64(w0 * Float64(h * Float64(M_m * 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)
	tmp = 0.0;
	if (d <= 4e-79)
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / d))))));
	else
		tmp = w0 + ((-0.125 / l) * ((D_m / d) * ((D_m / d) * (w0 * (h * (M_m * 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_] := If[LessEqual[d, 4e-79], N[(w0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(w0 * D$95$m), $MachinePrecision] * N[(D$95$m * N[(N[(M$95$m * h), $MachinePrecision] / N[(d / N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(w0 * N[(h * N[(M$95$m * M$95$m), $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}\;d \leq 4 \cdot 10^{-79}:\\
\;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \left(\left(w0 \cdot D\_m\right) \cdot \left(D\_m \cdot \frac{M\_m \cdot h}{\frac{d}{\frac{M\_m}{d}}}\right)\right)\\

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


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

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e-79 < d

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 73.2% 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 8.5 \cdot 10^{-28}:\\ \;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \left(\left(w0 \cdot D\_m\right) \cdot \left(D\_m \cdot \frac{M\_m \cdot h}{\frac{d}{\frac{M\_m}{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 8.5e-28)
   (+ w0 (* (/ -0.125 l) (* (* w0 D_m) (* D_m (/ (* M_m h) (/ d (/ M_m 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 <= 8.5e-28) {
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / 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 <= 8.5d-28) then
        tmp = w0 + (((-0.125d0) / l) * ((w0 * d_m) * (d_m * ((m_m * h) / (d / (m_m / 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 <= 8.5e-28) {
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / 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 <= 8.5e-28:
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / 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 <= 8.5e-28)
		tmp = Float64(w0 + Float64(Float64(-0.125 / l) * Float64(Float64(w0 * D_m) * Float64(D_m * Float64(Float64(M_m * h) / Float64(d / Float64(M_m / 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 <= 8.5e-28)
		tmp = w0 + ((-0.125 / l) * ((w0 * D_m) * (D_m * ((M_m * h) / (d / (M_m / 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, 8.5e-28], N[(w0 + N[(N[(-0.125 / l), $MachinePrecision] * N[(N[(w0 * D$95$m), $MachinePrecision] * N[(D$95$m * N[(N[(M$95$m * h), $MachinePrecision] / N[(d / N[(M$95$m / d), $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}\;d \leq 8.5 \cdot 10^{-28}:\\
\;\;\;\;w0 + \frac{-0.125}{\ell} \cdot \left(\left(w0 \cdot D\_m\right) \cdot \left(D\_m \cdot \frac{M\_m \cdot h}{\frac{d}{\frac{M\_m}{d}}}\right)\right)\\

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


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

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999925e-28 < d

    1. Initial program 84.3%

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

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

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

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

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

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

      1. Initial program 80.1%

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

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

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

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

        if 2.30000000000000002e49 < M

        1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 80.1%

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

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

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

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

          if 2.2e52 < M

          1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 80.1%

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

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

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

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

            if 2.24999999999999991e49 < M

            1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 9: 63.2% accurate, 21.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}\;d \leq 4.4 \cdot 10^{-209}:\\ \;\;\;\;\frac{d}{\frac{d}{w0}}\\ \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 4.4e-209) (/ d (/ d w0)) 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 <= 4.4e-209) {
          		tmp = d / (d / w0);
          	} 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 <= 4.4d-209) then
                  tmp = d / (d / w0)
              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 <= 4.4e-209) {
          		tmp = d / (d / w0);
          	} 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 <= 4.4e-209:
          		tmp = d / (d / w0)
          	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 <= 4.4e-209)
          		tmp = Float64(d / Float64(d / w0));
          	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 <= 4.4e-209)
          		tmp = d / (d / w0);
          	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, 4.4e-209], N[(d / N[(d / w0), $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 4.4 \cdot 10^{-209}:\\
          \;\;\;\;\frac{d}{\frac{d}{w0}}\\
          
          \mathbf{else}:\\
          \;\;\;\;w0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if d < 4.40000000000000019e-209

            1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \left({d}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{d}, d\right)\right) \]
              3. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \left(d \cdot d\right)\right), \mathsf{*.f64}\left(d, d\right)\right) \]
              4. *-lowering-*.f6420.2%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(d, d\right)\right), \mathsf{*.f64}\left(d, d\right)\right) \]
            12. Simplified20.2%

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

                \[\leadsto \frac{\left(d \cdot d\right) \cdot w0}{\color{blue}{d} \cdot d} \]
              2. times-fracN/A

                \[\leadsto \frac{d \cdot d}{d} \cdot \color{blue}{\frac{w0}{d}} \]
              3. clear-numN/A

                \[\leadsto \frac{d \cdot d}{d} \cdot \frac{1}{\color{blue}{\frac{d}{w0}}} \]
              4. un-div-invN/A

                \[\leadsto \frac{\frac{d \cdot d}{d}}{\color{blue}{\frac{d}{w0}}} \]
              5. associate-/l*N/A

                \[\leadsto \frac{d \cdot \frac{d}{d}}{\frac{\color{blue}{d}}{w0}} \]
              6. *-inversesN/A

                \[\leadsto \frac{d \cdot 1}{\frac{d}{w0}} \]
              7. *-rgt-identityN/A

                \[\leadsto \frac{d}{\frac{\color{blue}{d}}{w0}} \]
              8. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(d, \color{blue}{\left(\frac{d}{w0}\right)}\right) \]
              9. /-lowering-/.f6457.4%

                \[\leadsto \mathsf{/.f64}\left(d, \mathsf{/.f64}\left(d, \color{blue}{w0}\right)\right) \]
            14. Applied egg-rr57.4%

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

            if 4.40000000000000019e-209 < d

            1. Initial program 81.5%

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

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

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

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

            Alternative 10: 63.7% accurate, 21.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}\;d \leq 4.6 \cdot 10^{-199}:\\ \;\;\;\;d \cdot \frac{w0}{d}\\ \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 4.6e-199) (* d (/ w0 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 <= 4.6e-199) {
            		tmp = d * (w0 / 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 <= 4.6d-199) then
                    tmp = d * (w0 / 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 <= 4.6e-199) {
            		tmp = d * (w0 / 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 <= 4.6e-199:
            		tmp = d * (w0 / 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 <= 4.6e-199)
            		tmp = Float64(d * Float64(w0 / 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 <= 4.6e-199)
            		tmp = d * (w0 / 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, 4.6e-199], N[(d * N[(w0 / d), $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 4.6 \cdot 10^{-199}:\\
            \;\;\;\;d \cdot \frac{w0}{d}\\
            
            \mathbf{else}:\\
            \;\;\;\;w0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if d < 4.6000000000000003e-199

              1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \left({d}^{2}\right)\right), \mathsf{*.f64}\left(\color{blue}{d}, d\right)\right) \]
                3. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \left(d \cdot d\right)\right), \mathsf{*.f64}\left(d, d\right)\right) \]
                4. *-lowering-*.f6419.8%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(d, d\right)\right), \mathsf{*.f64}\left(d, d\right)\right) \]
              12. Simplified19.8%

                \[\leadsto \frac{\color{blue}{w0 \cdot \left(d \cdot d\right)}}{d \cdot d} \]
              13. Step-by-step derivation
                1. times-fracN/A

                  \[\leadsto \frac{w0}{d} \cdot \color{blue}{\frac{d \cdot d}{d}} \]
                2. associate-/l*N/A

                  \[\leadsto \frac{w0}{d} \cdot \left(d \cdot \color{blue}{\frac{d}{d}}\right) \]
                3. *-inversesN/A

                  \[\leadsto \frac{w0}{d} \cdot \left(d \cdot 1\right) \]
                4. *-rgt-identityN/A

                  \[\leadsto \frac{w0}{d} \cdot d \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\frac{w0}{d}\right), \color{blue}{d}\right) \]
                6. /-lowering-/.f6458.7%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(w0, d\right), d\right) \]
              14. Applied egg-rr58.7%

                \[\leadsto \color{blue}{\frac{w0}{d} \cdot d} \]

              if 4.6000000000000003e-199 < d

              1. Initial program 82.0%

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq 4.6 \cdot 10^{-199}:\\ \;\;\;\;d \cdot \frac{w0}{d}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
              8. Add Preprocessing

              Alternative 11: 68.1% 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 78.7%

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

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

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

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

                Reproduce

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