Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.4% → 87.8%
Time: 17.7s
Alternatives: 18
Speedup: 1.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 18 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 87.8% accurate, 0.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;w0 \cdot \mathsf{hypot}\left(1, {d\_m}^{-0.5} \cdot {\left(\frac{\ell}{\frac{M \cdot \frac{M \cdot D\_m}{d\_m}}{\frac{-4}{D\_m \cdot h}}}\right)}^{-0.5}\right)\\


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

    1. Initial program 99.9%

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

    if 5.00000000000000029e278 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)))

    1. Initial program 46.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, M\right)\right)\right), -4\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
    5. Applied egg-rr64.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{hypot.f64}\left(1, \color{blue}{\left({\left(\frac{d \cdot \ell}{\frac{h \cdot D}{\frac{-4}{\frac{M}{\frac{d}{D \cdot M}}}}}\right)}^{\left(\frac{-1}{2}\right)}\right)}\right)\right) \]
    7. Applied egg-rr64.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(w0, \mathsf{hypot.f64}\left(1, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(d, \frac{-1}{2}\right), \mathsf{pow.f64}\left(\left(\frac{\ell}{\frac{h \cdot D}{-4} \cdot \frac{M \cdot \left(M \cdot D\right)}{d}}\right), \color{blue}{\frac{-1}{2}}\right)\right)\right)\right) \]
    9. Applied egg-rr35.4%

      \[\leadsto w0 \cdot \mathsf{hypot}\left(1, \color{blue}{{d}^{-0.5} \cdot {\left(\frac{\ell}{\frac{M \cdot \frac{D \cdot M}{d}}{\frac{-4}{h \cdot D}}}\right)}^{-0.5}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.0%

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

Alternative 2: 88.4% accurate, 0.6× speedup?

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

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


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

    1. Initial program 99.9%

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

    if 2.00000000000000011e258 < (-.f64 #s(literal 1 binary64) (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)))

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.2% accurate, 1.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.00000000000000027e-63

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, M\right)\right)\right), -4\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
    5. Applied egg-rr86.9%

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

    if -4.00000000000000027e-63 < l

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.3% accurate, 1.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -3.59999999999999981e-90

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, M\right)\right)\right), -4\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
    5. Applied egg-rr85.3%

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

    if -3.59999999999999981e-90 < l

    1. Initial program 80.0%

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

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

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

Alternative 5: 78.6% accurate, 1.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if d < 9.9999999999999995e59

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999995e59 < d

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 70.7% accurate, 6.0× speedup?

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

\mathbf{elif}\;M \leq 2.2 \cdot 10^{-21}:\\
\;\;\;\;w0 \cdot \left(1 + t\_0 \cdot \frac{D\_m \cdot \left(h \cdot \left(D\_m \cdot \left(M \cdot M\right)\right)\right)}{\ell}\right)\\

\mathbf{elif}\;M \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;w0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if M < 5.9000000000000003e-130 or 2.2000000000000001e-21 < M < 1.5999999999999999e36

    1. Initial program 82.1%

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

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

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

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

      if 5.9000000000000003e-130 < M < 2.2000000000000001e-21

      1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\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(\mathsf{/.f64}\left(M, \mathsf{/.f64}\left(d, \mathsf{*.f64}\left(D, M\right)\right)\right), -4\right)\right), d\right), \mathsf{/.f64}\left(D, \ell\right)\right)\right)\right)\right) \]
      5. Applied egg-rr99.9%

        \[\leadsto w0 \cdot \sqrt{1 + \color{blue}{\frac{h \cdot \frac{\frac{M}{\frac{d}{D \cdot M}}}{-4}}{d} \cdot \frac{D}{\ell}}} \]
      6. 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}} \]
      7. Step-by-step derivation
        1. *-lft-identityN/A

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

          \[\leadsto 1 \cdot w0 + \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}} \]
        3. associate-*r*N/A

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

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

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

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

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

          \[\leadsto 1 \cdot w0 + \left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right) \cdot w0 \]
        9. distribute-rgt-inN/A

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

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

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

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

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

      if 1.5999999999999999e36 < M

      1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 70.5% accurate, 6.0× speedup?

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

      1. Initial program 82.2%

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

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

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

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

        if 5.2e-154 < M < 2.6e-23 or 2.2e36 < M

        1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 8: 75.0% accurate, 7.7× speedup?

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

        1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.5999999999999999e-6 < d

        1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{neg}\left(\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} - 1\right) \cdot w0\right) \]
          3. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 9: 77.5% accurate, 8.3× speedup?

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

        1. Initial program 81.0%

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

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

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

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

          if 3.59999999999999996e58 < D

          1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 10: 76.8% accurate, 8.3× speedup?

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

          1. Initial program 81.6%

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

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

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

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

            if 1.64999999999999987e89 < D

            1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 11: 70.1% accurate, 9.0× speedup?

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

            1. Initial program 82.0%

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

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

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

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

              if 1.1e36 < M

              1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 12: 70.0% accurate, 9.0× speedup?

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

              1. Initial program 82.0%

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

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

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

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

                if 3.70000000000000029e36 < M

                1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 13: 70.2% accurate, 9.0× speedup?

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

                1. Initial program 82.0%

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

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

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

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

                  if 4.20000000000000009e36 < M

                  1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 14: 70.1% accurate, 9.0× speedup?

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

                  1. Initial program 82.0%

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

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

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

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

                    if 2.9e36 < M

                    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 15: 70.0% accurate, 9.0× speedup?

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

                    1. Initial program 82.0%

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

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

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

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

                      if 3.4999999999999998e36 < M

                      1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({M}^{2} \cdot h\right), w0\right), \frac{-1}{8}\right), \left({\color{blue}{d}}^{2} \cdot \ell\right)\right)\right) \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({M}^{2}\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                        15. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(M \cdot M\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                        16. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                        17. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\left({d}^{2}\right), \color{blue}{\ell}\right)\right)\right) \]
                        18. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right)\right) \]
                        19. *-lowering-*.f6419.2%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right)\right) \]
                      9. Simplified19.2%

                        \[\leadsto \color{blue}{\left(D \cdot D\right) \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right) \cdot -0.125}{\left(d \cdot d\right) \cdot \ell}} \]
                      10. Step-by-step derivation
                        1. associate-*r/N/A

                          \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right) \cdot \frac{-1}{8}\right)}{\color{blue}{\left(d \cdot d\right) \cdot \ell}} \]
                        2. *-commutativeN/A

                          \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)\right)}{\left(d \cdot \color{blue}{d}\right) \cdot \ell} \]
                        3. associate-*l*N/A

                          \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(M \cdot \left(M \cdot h\right)\right) \cdot w0\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                        4. *-commutativeN/A

                          \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot w0\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                        5. associate-*r*N/A

                          \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                        6. associate-*r*N/A

                          \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
                        7. associate-*r*N/A

                          \[\leadsto \frac{\left(D \cdot \left(D \cdot \frac{-1}{8}\right)\right) \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)}{\left(\color{blue}{d} \cdot d\right) \cdot \ell} \]
                        8. associate-*r/N/A

                          \[\leadsto \left(D \cdot \left(D \cdot \frac{-1}{8}\right)\right) \cdot \color{blue}{\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                        9. *-commutativeN/A

                          \[\leadsto \left(\left(D \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{\color{blue}{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}}{\left(d \cdot d\right) \cdot \ell} \]
                        10. associate-*r*N/A

                          \[\leadsto \left(\left(D \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \color{blue}{\left(d \cdot \ell\right)}} \]
                        11. associate-*r*N/A

                          \[\leadsto \left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(D \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)}\right)} \]
                        12. *-commutativeN/A

                          \[\leadsto \left(D \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \color{blue}{\left(D \cdot \frac{-1}{8}\right)} \]
                        13. associate-*l*N/A

                          \[\leadsto D \cdot \color{blue}{\left(\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{-1}{8}\right)\right)} \]
                        14. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{-1}{8}\right)\right)}\right) \]
                      11. Applied egg-rr25.9%

                        \[\leadsto \color{blue}{D \cdot \left(\frac{M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot -0.125\right)\right)} \]
                      12. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(M \cdot \left(w0 \cdot h\right)\right) \cdot M\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                        2. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\left(M \cdot w0\right) \cdot h\right) \cdot M\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                        3. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(M \cdot w0\right) \cdot \left(h \cdot M\right)\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(M \cdot w0\right), \left(h \cdot M\right)\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                        5. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(w0 \cdot M\right), \left(h \cdot M\right)\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w0, M\right), \left(h \cdot M\right)\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                        7. *-lowering-*.f6425.7%

                          \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w0, M\right), \mathsf{*.f64}\left(h, M\right)\right), \mathsf{*.f64}\left(d, \mathsf{*.f64}\left(d, \ell\right)\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                      13. Applied egg-rr25.7%

                        \[\leadsto D \cdot \left(\frac{\color{blue}{\left(w0 \cdot M\right) \cdot \left(h \cdot M\right)}}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot -0.125\right)\right) \]
                    6. Recombined 2 regimes into one program.
                    7. Final simplification61.0%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.5 \cdot 10^{+36}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;D \cdot \left(\left(D \cdot -0.125\right) \cdot \frac{\left(M \cdot w0\right) \cdot \left(M \cdot h\right)}{d \cdot \left(d \cdot \ell\right)}\right)\\ \end{array} \]
                    8. Add Preprocessing

                    Alternative 16: 69.9% accurate, 9.0× speedup?

                    \[\begin{array}{l} D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M, D_m, h, l, d_m] = \mathsf{sort}([w0, M, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M \leq 4.2 \cdot 10^{+36}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;D\_m \cdot \left(\left(D\_m \cdot -0.125\right) \cdot \frac{M \cdot \left(M \cdot \left(h \cdot w0\right)\right)}{d\_m \cdot \left(d\_m \cdot \ell\right)}\right)\\ \end{array} \end{array} \]
                    D_m = (fabs.f64 D)
                    d_m = (fabs.f64 d)
                    NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                    (FPCore (w0 M D_m h l d_m)
                     :precision binary64
                     (if (<= M 4.2e+36)
                       w0
                       (* D_m (* (* D_m -0.125) (/ (* M (* M (* h w0))) (* d_m (* d_m l)))))))
                    D_m = fabs(D);
                    d_m = fabs(d);
                    assert(w0 < M && M < D_m && D_m < h && h < l && l < d_m);
                    double code(double w0, double M, double D_m, double h, double l, double d_m) {
                    	double tmp;
                    	if (M <= 4.2e+36) {
                    		tmp = w0;
                    	} else {
                    		tmp = D_m * ((D_m * -0.125) * ((M * (M * (h * w0))) / (d_m * (d_m * l))));
                    	}
                    	return tmp;
                    }
                    
                    D_m = abs(d)
                    d_m = abs(d)
                    NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                    real(8) function code(w0, m, d_m, h, l, d_m_1)
                        real(8), intent (in) :: w0
                        real(8), intent (in) :: m
                        real(8), intent (in) :: d_m
                        real(8), intent (in) :: h
                        real(8), intent (in) :: l
                        real(8), intent (in) :: d_m_1
                        real(8) :: tmp
                        if (m <= 4.2d+36) then
                            tmp = w0
                        else
                            tmp = d_m * ((d_m * (-0.125d0)) * ((m * (m * (h * w0))) / (d_m_1 * (d_m_1 * l))))
                        end if
                        code = tmp
                    end function
                    
                    D_m = Math.abs(D);
                    d_m = Math.abs(d);
                    assert w0 < M && M < D_m && D_m < h && h < l && l < d_m;
                    public static double code(double w0, double M, double D_m, double h, double l, double d_m) {
                    	double tmp;
                    	if (M <= 4.2e+36) {
                    		tmp = w0;
                    	} else {
                    		tmp = D_m * ((D_m * -0.125) * ((M * (M * (h * w0))) / (d_m * (d_m * l))));
                    	}
                    	return tmp;
                    }
                    
                    D_m = math.fabs(D)
                    d_m = math.fabs(d)
                    [w0, M, D_m, h, l, d_m] = sort([w0, M, D_m, h, l, d_m])
                    def code(w0, M, D_m, h, l, d_m):
                    	tmp = 0
                    	if M <= 4.2e+36:
                    		tmp = w0
                    	else:
                    		tmp = D_m * ((D_m * -0.125) * ((M * (M * (h * w0))) / (d_m * (d_m * l))))
                    	return tmp
                    
                    D_m = abs(D)
                    d_m = abs(d)
                    w0, M, D_m, h, l, d_m = sort([w0, M, D_m, h, l, d_m])
                    function code(w0, M, D_m, h, l, d_m)
                    	tmp = 0.0
                    	if (M <= 4.2e+36)
                    		tmp = w0;
                    	else
                    		tmp = Float64(D_m * Float64(Float64(D_m * -0.125) * Float64(Float64(M * Float64(M * Float64(h * w0))) / Float64(d_m * Float64(d_m * l)))));
                    	end
                    	return tmp
                    end
                    
                    D_m = abs(D);
                    d_m = abs(d);
                    w0, M, D_m, h, l, d_m = num2cell(sort([w0, M, D_m, h, l, d_m])){:}
                    function tmp_2 = code(w0, M, D_m, h, l, d_m)
                    	tmp = 0.0;
                    	if (M <= 4.2e+36)
                    		tmp = w0;
                    	else
                    		tmp = D_m * ((D_m * -0.125) * ((M * (M * (h * w0))) / (d_m * (d_m * l))));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    D_m = N[Abs[D], $MachinePrecision]
                    d_m = N[Abs[d], $MachinePrecision]
                    NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                    code[w0_, M_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M, 4.2e+36], w0, N[(D$95$m * N[(N[(D$95$m * -0.125), $MachinePrecision] * N[(N[(M * N[(M * N[(h * w0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d$95$m * N[(d$95$m * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    D_m = \left|D\right|
                    \\
                    d_m = \left|d\right|
                    \\
                    [w0, M, D_m, h, l, d_m] = \mathsf{sort}([w0, M, D_m, h, l, d_m])\\
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;M \leq 4.2 \cdot 10^{+36}:\\
                    \;\;\;\;w0\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;D\_m \cdot \left(\left(D\_m \cdot -0.125\right) \cdot \frac{M \cdot \left(M \cdot \left(h \cdot w0\right)\right)}{d\_m \cdot \left(d\_m \cdot \ell\right)}\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if M < 4.20000000000000009e36

                      1. Initial program 82.0%

                        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                      2. Simplified86.2%

                        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D \cdot \frac{M \cdot \frac{M \cdot D}{d}}{-4}\right)}{d}}{\ell}}} \]
                      3. Add Preprocessing
                      4. Taylor expanded in h around 0

                        \[\leadsto \color{blue}{w0} \]
                      5. Step-by-step derivation
                        1. Simplified71.1%

                          \[\leadsto \color{blue}{w0} \]

                        if 4.20000000000000009e36 < M

                        1. Initial program 84.6%

                          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                        2. Simplified79.9%

                          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D \cdot \frac{M \cdot \frac{M \cdot D}{d}}{-4}\right)}{d}}{\ell}}} \]
                        3. Add Preprocessing
                        4. Taylor expanded in h around 0

                          \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                        5. Step-by-step derivation
                          1. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                          2. associate-*r/N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right)\right) \]
                          3. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right) \]
                          4. associate-*r*N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right) \]
                          5. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot {D}^{2}\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right) \]
                          6. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2}\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({\color{blue}{d}}^{2} \cdot \ell\right)\right)\right) \]
                          7. unpow2N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          8. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          9. *-commutativeN/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(h \cdot w0\right) \cdot {M}^{2}\right)\right), \left({d}^{\color{blue}{2}} \cdot \ell\right)\right)\right) \]
                          10. *-commutativeN/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(w0 \cdot h\right) \cdot {M}^{2}\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          11. associate-*l*N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(w0 \cdot \left(h \cdot {M}^{2}\right)\right)\right), \left({d}^{\color{blue}{2}} \cdot \ell\right)\right)\right) \]
                          12. *-commutativeN/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(w0 \cdot \left({M}^{2} \cdot h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          13. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \left({M}^{2} \cdot h\right)\right)\right), \left({d}^{\color{blue}{2}} \cdot \ell\right)\right)\right) \]
                          14. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\left({M}^{2}\right), h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          15. unpow2N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          16. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          17. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \mathsf{*.f64}\left(\left({d}^{2}\right), \color{blue}{\ell}\right)\right)\right) \]
                          18. unpow2N/A

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right)\right) \]
                          19. *-lowering-*.f6437.9%

                            \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right)\right) \]
                        6. Simplified37.9%

                          \[\leadsto \color{blue}{w0 + \frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(w0 \cdot \left(\left(M \cdot M\right) \cdot h\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                        7. Taylor expanded in D around inf

                          \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                        8. Step-by-step derivation
                          1. associate-/l*N/A

                            \[\leadsto \frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right) \]
                          2. associate-*r*N/A

                            \[\leadsto \left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}} \]
                          3. *-commutativeN/A

                            \[\leadsto \left({D}^{2} \cdot \frac{-1}{8}\right) \cdot \frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell} \]
                          4. associate-*r*N/A

                            \[\leadsto {D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)} \]
                          5. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                          6. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)\right) \]
                          7. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)\right) \]
                          8. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right) \]
                          9. associate-*l/N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\left({M}^{2} \cdot \left(h \cdot w0\right)\right) \cdot \frac{-1}{8}}{\color{blue}{{d}^{2} \cdot \ell}}\right)\right) \]
                          10. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left({M}^{2} \cdot \left(h \cdot w0\right)\right) \cdot \frac{-1}{8}\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right) \]
                          11. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({M}^{2} \cdot \left(h \cdot w0\right)\right), \frac{-1}{8}\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right) \]
                          12. associate-*r*N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left({M}^{2} \cdot h\right) \cdot w0\right), \frac{-1}{8}\right), \left({\color{blue}{d}}^{2} \cdot \ell\right)\right)\right) \]
                          13. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({M}^{2} \cdot h\right), w0\right), \frac{-1}{8}\right), \left({\color{blue}{d}}^{2} \cdot \ell\right)\right)\right) \]
                          14. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({M}^{2}\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          15. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(M \cdot M\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          16. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                          17. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\left({d}^{2}\right), \color{blue}{\ell}\right)\right)\right) \]
                          18. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right)\right) \]
                          19. *-lowering-*.f6419.2%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right)\right) \]
                        9. Simplified19.2%

                          \[\leadsto \color{blue}{\left(D \cdot D\right) \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right) \cdot -0.125}{\left(d \cdot d\right) \cdot \ell}} \]
                        10. Step-by-step derivation
                          1. associate-*r/N/A

                            \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right) \cdot \frac{-1}{8}\right)}{\color{blue}{\left(d \cdot d\right) \cdot \ell}} \]
                          2. *-commutativeN/A

                            \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)\right)}{\left(d \cdot \color{blue}{d}\right) \cdot \ell} \]
                          3. associate-*l*N/A

                            \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(M \cdot \left(M \cdot h\right)\right) \cdot w0\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                          4. *-commutativeN/A

                            \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot w0\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                          5. associate-*r*N/A

                            \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                          6. associate-*r*N/A

                            \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
                          7. associate-*r*N/A

                            \[\leadsto \frac{\left(D \cdot \left(D \cdot \frac{-1}{8}\right)\right) \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)}{\left(\color{blue}{d} \cdot d\right) \cdot \ell} \]
                          8. associate-*r/N/A

                            \[\leadsto \left(D \cdot \left(D \cdot \frac{-1}{8}\right)\right) \cdot \color{blue}{\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                          9. *-commutativeN/A

                            \[\leadsto \left(\left(D \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{\color{blue}{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}}{\left(d \cdot d\right) \cdot \ell} \]
                          10. associate-*r*N/A

                            \[\leadsto \left(\left(D \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \color{blue}{\left(d \cdot \ell\right)}} \]
                          11. associate-*r*N/A

                            \[\leadsto \left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(D \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)}\right)} \]
                          12. *-commutativeN/A

                            \[\leadsto \left(D \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \color{blue}{\left(D \cdot \frac{-1}{8}\right)} \]
                          13. associate-*l*N/A

                            \[\leadsto D \cdot \color{blue}{\left(\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{-1}{8}\right)\right)} \]
                          14. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{-1}{8}\right)\right)}\right) \]
                        11. Applied egg-rr25.9%

                          \[\leadsto \color{blue}{D \cdot \left(\frac{M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot -0.125\right)\right)} \]
                      6. Recombined 2 regimes into one program.
                      7. Final simplification61.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 4.2 \cdot 10^{+36}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;D \cdot \left(\left(D \cdot -0.125\right) \cdot \frac{M \cdot \left(M \cdot \left(h \cdot w0\right)\right)}{d \cdot \left(d \cdot \ell\right)}\right)\\ \end{array} \]
                      8. Add Preprocessing

                      Alternative 17: 70.0% accurate, 9.0× speedup?

                      \[\begin{array}{l} D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M, D_m, h, l, d_m] = \mathsf{sort}([w0, M, D_m, h, l, d_m])\\ \\ \begin{array}{l} \mathbf{if}\;M \leq 3.8 \cdot 10^{+36}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;D\_m \cdot \left(\left(D\_m \cdot -0.125\right) \cdot \left(\left(\frac{M}{d\_m} \cdot \frac{M}{d\_m}\right) \cdot \frac{h \cdot w0}{\ell}\right)\right)\\ \end{array} \end{array} \]
                      D_m = (fabs.f64 D)
                      d_m = (fabs.f64 d)
                      NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                      (FPCore (w0 M D_m h l d_m)
                       :precision binary64
                       (if (<= M 3.8e+36)
                         w0
                         (* D_m (* (* D_m -0.125) (* (* (/ M d_m) (/ M d_m)) (/ (* h w0) l))))))
                      D_m = fabs(D);
                      d_m = fabs(d);
                      assert(w0 < M && M < D_m && D_m < h && h < l && l < d_m);
                      double code(double w0, double M, double D_m, double h, double l, double d_m) {
                      	double tmp;
                      	if (M <= 3.8e+36) {
                      		tmp = w0;
                      	} else {
                      		tmp = D_m * ((D_m * -0.125) * (((M / d_m) * (M / d_m)) * ((h * w0) / l)));
                      	}
                      	return tmp;
                      }
                      
                      D_m = abs(d)
                      d_m = abs(d)
                      NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                      real(8) function code(w0, m, d_m, h, l, d_m_1)
                          real(8), intent (in) :: w0
                          real(8), intent (in) :: m
                          real(8), intent (in) :: d_m
                          real(8), intent (in) :: h
                          real(8), intent (in) :: l
                          real(8), intent (in) :: d_m_1
                          real(8) :: tmp
                          if (m <= 3.8d+36) then
                              tmp = w0
                          else
                              tmp = d_m * ((d_m * (-0.125d0)) * (((m / d_m_1) * (m / d_m_1)) * ((h * w0) / l)))
                          end if
                          code = tmp
                      end function
                      
                      D_m = Math.abs(D);
                      d_m = Math.abs(d);
                      assert w0 < M && M < D_m && D_m < h && h < l && l < d_m;
                      public static double code(double w0, double M, double D_m, double h, double l, double d_m) {
                      	double tmp;
                      	if (M <= 3.8e+36) {
                      		tmp = w0;
                      	} else {
                      		tmp = D_m * ((D_m * -0.125) * (((M / d_m) * (M / d_m)) * ((h * w0) / l)));
                      	}
                      	return tmp;
                      }
                      
                      D_m = math.fabs(D)
                      d_m = math.fabs(d)
                      [w0, M, D_m, h, l, d_m] = sort([w0, M, D_m, h, l, d_m])
                      def code(w0, M, D_m, h, l, d_m):
                      	tmp = 0
                      	if M <= 3.8e+36:
                      		tmp = w0
                      	else:
                      		tmp = D_m * ((D_m * -0.125) * (((M / d_m) * (M / d_m)) * ((h * w0) / l)))
                      	return tmp
                      
                      D_m = abs(D)
                      d_m = abs(d)
                      w0, M, D_m, h, l, d_m = sort([w0, M, D_m, h, l, d_m])
                      function code(w0, M, D_m, h, l, d_m)
                      	tmp = 0.0
                      	if (M <= 3.8e+36)
                      		tmp = w0;
                      	else
                      		tmp = Float64(D_m * Float64(Float64(D_m * -0.125) * Float64(Float64(Float64(M / d_m) * Float64(M / d_m)) * Float64(Float64(h * w0) / l))));
                      	end
                      	return tmp
                      end
                      
                      D_m = abs(D);
                      d_m = abs(d);
                      w0, M, D_m, h, l, d_m = num2cell(sort([w0, M, D_m, h, l, d_m])){:}
                      function tmp_2 = code(w0, M, D_m, h, l, d_m)
                      	tmp = 0.0;
                      	if (M <= 3.8e+36)
                      		tmp = w0;
                      	else
                      		tmp = D_m * ((D_m * -0.125) * (((M / d_m) * (M / d_m)) * ((h * w0) / l)));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      D_m = N[Abs[D], $MachinePrecision]
                      d_m = N[Abs[d], $MachinePrecision]
                      NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                      code[w0_, M_, D$95$m_, h_, l_, d$95$m_] := If[LessEqual[M, 3.8e+36], w0, N[(D$95$m * N[(N[(D$95$m * -0.125), $MachinePrecision] * N[(N[(N[(M / d$95$m), $MachinePrecision] * N[(M / d$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(h * w0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      D_m = \left|D\right|
                      \\
                      d_m = \left|d\right|
                      \\
                      [w0, M, D_m, h, l, d_m] = \mathsf{sort}([w0, M, D_m, h, l, d_m])\\
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;M \leq 3.8 \cdot 10^{+36}:\\
                      \;\;\;\;w0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;D\_m \cdot \left(\left(D\_m \cdot -0.125\right) \cdot \left(\left(\frac{M}{d\_m} \cdot \frac{M}{d\_m}\right) \cdot \frac{h \cdot w0}{\ell}\right)\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if M < 3.80000000000000025e36

                        1. Initial program 82.0%

                          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                        2. Simplified86.2%

                          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D \cdot \frac{M \cdot \frac{M \cdot D}{d}}{-4}\right)}{d}}{\ell}}} \]
                        3. Add Preprocessing
                        4. Taylor expanded in h around 0

                          \[\leadsto \color{blue}{w0} \]
                        5. Step-by-step derivation
                          1. Simplified71.1%

                            \[\leadsto \color{blue}{w0} \]

                          if 3.80000000000000025e36 < M

                          1. Initial program 84.6%

                            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                          2. Simplified79.9%

                            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D \cdot \frac{M \cdot \frac{M \cdot D}{d}}{-4}\right)}{d}}{\ell}}} \]
                          3. Add Preprocessing
                          4. Taylor expanded in h around 0

                            \[\leadsto \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                          5. Step-by-step derivation
                            1. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                            2. associate-*r/N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \left(\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{\color{blue}{{d}^{2} \cdot \ell}}\right)\right) \]
                            3. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\left(\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right)\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right) \]
                            4. associate-*r*N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\left(\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right) \]
                            5. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{8} \cdot {D}^{2}\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right) \]
                            6. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left({D}^{2}\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({\color{blue}{d}}^{2} \cdot \ell\right)\right)\right) \]
                            7. unpow2N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \left(D \cdot D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            8. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left({M}^{2} \cdot \left(h \cdot w0\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            9. *-commutativeN/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(h \cdot w0\right) \cdot {M}^{2}\right)\right), \left({d}^{\color{blue}{2}} \cdot \ell\right)\right)\right) \]
                            10. *-commutativeN/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(\left(w0 \cdot h\right) \cdot {M}^{2}\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            11. associate-*l*N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(w0 \cdot \left(h \cdot {M}^{2}\right)\right)\right), \left({d}^{\color{blue}{2}} \cdot \ell\right)\right)\right) \]
                            12. *-commutativeN/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \left(w0 \cdot \left({M}^{2} \cdot h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            13. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \left({M}^{2} \cdot h\right)\right)\right), \left({d}^{\color{blue}{2}} \cdot \ell\right)\right)\right) \]
                            14. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\left({M}^{2}\right), h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            15. unpow2N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\left(M \cdot M\right), h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            16. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            17. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \mathsf{*.f64}\left(\left({d}^{2}\right), \color{blue}{\ell}\right)\right)\right) \]
                            18. unpow2N/A

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right)\right) \]
                            19. *-lowering-*.f6437.9%

                              \[\leadsto \mathsf{+.f64}\left(w0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(D, D\right)\right), \mathsf{*.f64}\left(w0, \mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right)\right) \]
                          6. Simplified37.9%

                            \[\leadsto \color{blue}{w0 + \frac{\left(-0.125 \cdot \left(D \cdot D\right)\right) \cdot \left(w0 \cdot \left(\left(M \cdot M\right) \cdot h\right)\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                          7. Taylor expanded in D around inf

                            \[\leadsto \color{blue}{\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                          8. Step-by-step derivation
                            1. associate-/l*N/A

                              \[\leadsto \frac{-1}{8} \cdot \left({D}^{2} \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}}\right) \]
                            2. associate-*r*N/A

                              \[\leadsto \left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \color{blue}{\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}} \]
                            3. *-commutativeN/A

                              \[\leadsto \left({D}^{2} \cdot \frac{-1}{8}\right) \cdot \frac{\color{blue}{{M}^{2} \cdot \left(h \cdot w0\right)}}{{d}^{2} \cdot \ell} \]
                            4. associate-*r*N/A

                              \[\leadsto {D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)} \]
                            5. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\left({D}^{2}\right), \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
                            6. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\left(D \cdot D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)\right) \]
                            7. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\color{blue}{\frac{-1}{8}} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}\right)\right) \]
                            8. *-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\frac{-1}{8}}\right)\right) \]
                            9. associate-*l/N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \left(\frac{\left({M}^{2} \cdot \left(h \cdot w0\right)\right) \cdot \frac{-1}{8}}{\color{blue}{{d}^{2} \cdot \ell}}\right)\right) \]
                            10. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\left(\left({M}^{2} \cdot \left(h \cdot w0\right)\right) \cdot \frac{-1}{8}\right), \color{blue}{\left({d}^{2} \cdot \ell\right)}\right)\right) \]
                            11. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({M}^{2} \cdot \left(h \cdot w0\right)\right), \frac{-1}{8}\right), \left(\color{blue}{{d}^{2}} \cdot \ell\right)\right)\right) \]
                            12. associate-*r*N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\left({M}^{2} \cdot h\right) \cdot w0\right), \frac{-1}{8}\right), \left({\color{blue}{d}}^{2} \cdot \ell\right)\right)\right) \]
                            13. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({M}^{2} \cdot h\right), w0\right), \frac{-1}{8}\right), \left({\color{blue}{d}}^{2} \cdot \ell\right)\right)\right) \]
                            14. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({M}^{2}\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            15. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(M \cdot M\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            16. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \left({d}^{2} \cdot \ell\right)\right)\right) \]
                            17. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\left({d}^{2}\right), \color{blue}{\ell}\right)\right)\right) \]
                            18. unpow2N/A

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\left(d \cdot d\right), \ell\right)\right)\right) \]
                            19. *-lowering-*.f6419.2%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(D, D\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(M, M\right), h\right), w0\right), \frac{-1}{8}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(d, d\right), \ell\right)\right)\right) \]
                          9. Simplified19.2%

                            \[\leadsto \color{blue}{\left(D \cdot D\right) \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right) \cdot -0.125}{\left(d \cdot d\right) \cdot \ell}} \]
                          10. Step-by-step derivation
                            1. associate-*r/N/A

                              \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right) \cdot \frac{-1}{8}\right)}{\color{blue}{\left(d \cdot d\right) \cdot \ell}} \]
                            2. *-commutativeN/A

                              \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)\right)}{\left(d \cdot \color{blue}{d}\right) \cdot \ell} \]
                            3. associate-*l*N/A

                              \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(M \cdot \left(M \cdot h\right)\right) \cdot w0\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                            4. *-commutativeN/A

                              \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot w0\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                            5. associate-*r*N/A

                              \[\leadsto \frac{\left(D \cdot D\right) \cdot \left(\frac{-1}{8} \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell} \]
                            6. associate-*r*N/A

                              \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
                            7. associate-*r*N/A

                              \[\leadsto \frac{\left(D \cdot \left(D \cdot \frac{-1}{8}\right)\right) \cdot \left(M \cdot \left(\left(h \cdot M\right) \cdot w0\right)\right)}{\left(\color{blue}{d} \cdot d\right) \cdot \ell} \]
                            8. associate-*r/N/A

                              \[\leadsto \left(D \cdot \left(D \cdot \frac{-1}{8}\right)\right) \cdot \color{blue}{\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                            9. *-commutativeN/A

                              \[\leadsto \left(\left(D \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{\color{blue}{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}}{\left(d \cdot d\right) \cdot \ell} \]
                            10. associate-*r*N/A

                              \[\leadsto \left(\left(D \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \color{blue}{\left(d \cdot \ell\right)}} \]
                            11. associate-*r*N/A

                              \[\leadsto \left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(D \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)}\right)} \]
                            12. *-commutativeN/A

                              \[\leadsto \left(D \cdot \frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \color{blue}{\left(D \cdot \frac{-1}{8}\right)} \]
                            13. associate-*l*N/A

                              \[\leadsto D \cdot \color{blue}{\left(\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{-1}{8}\right)\right)} \]
                            14. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(D, \color{blue}{\left(\frac{M \cdot \left(\left(h \cdot M\right) \cdot w0\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{-1}{8}\right)\right)}\right) \]
                          11. Applied egg-rr25.9%

                            \[\leadsto \color{blue}{D \cdot \left(\frac{M \cdot \left(M \cdot \left(w0 \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot -0.125\right)\right)} \]
                          12. Step-by-step derivation
                            1. times-fracN/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(\frac{M}{d} \cdot \frac{M \cdot \left(w0 \cdot h\right)}{d \cdot \ell}\right), \mathsf{*.f64}\left(\color{blue}{D}, \frac{-1}{8}\right)\right)\right) \]
                            2. times-fracN/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(\frac{M}{d} \cdot \left(\frac{M}{d} \cdot \frac{w0 \cdot h}{\ell}\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                            3. associate-*r*N/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\left(\left(\frac{M}{d} \cdot \frac{M}{d}\right) \cdot \frac{w0 \cdot h}{\ell}\right), \mathsf{*.f64}\left(\color{blue}{D}, \frac{-1}{8}\right)\right)\right) \]
                            4. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{M}{d} \cdot \frac{M}{d}\right), \left(\frac{w0 \cdot h}{\ell}\right)\right), \mathsf{*.f64}\left(\color{blue}{D}, \frac{-1}{8}\right)\right)\right) \]
                            5. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{M}{d}\right), \left(\frac{M}{d}\right)\right), \left(\frac{w0 \cdot h}{\ell}\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                            6. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, d\right), \left(\frac{M}{d}\right)\right), \left(\frac{w0 \cdot h}{\ell}\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                            7. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, d\right), \mathsf{/.f64}\left(M, d\right)\right), \left(\frac{w0 \cdot h}{\ell}\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                            8. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, d\right), \mathsf{/.f64}\left(M, d\right)\right), \mathsf{/.f64}\left(\left(w0 \cdot h\right), \ell\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                            9. *-lowering-*.f6427.6%

                              \[\leadsto \mathsf{*.f64}\left(D, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(M, d\right), \mathsf{/.f64}\left(M, d\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(w0, h\right), \ell\right)\right), \mathsf{*.f64}\left(D, \frac{-1}{8}\right)\right)\right) \]
                          13. Applied egg-rr27.6%

                            \[\leadsto D \cdot \left(\color{blue}{\left(\left(\frac{M}{d} \cdot \frac{M}{d}\right) \cdot \frac{w0 \cdot h}{\ell}\right)} \cdot \left(D \cdot -0.125\right)\right) \]
                        6. Recombined 2 regimes into one program.
                        7. Final simplification61.4%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.8 \cdot 10^{+36}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;D \cdot \left(\left(D \cdot -0.125\right) \cdot \left(\left(\frac{M}{d} \cdot \frac{M}{d}\right) \cdot \frac{h \cdot w0}{\ell}\right)\right)\\ \end{array} \]
                        8. Add Preprocessing

                        Alternative 18: 68.2% accurate, 216.0× speedup?

                        \[\begin{array}{l} D_m = \left|D\right| \\ d_m = \left|d\right| \\ [w0, M, D_m, h, l, d_m] = \mathsf{sort}([w0, M, D_m, h, l, d_m])\\ \\ w0 \end{array} \]
                        D_m = (fabs.f64 D)
                        d_m = (fabs.f64 d)
                        NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                        (FPCore (w0 M D_m h l d_m) :precision binary64 w0)
                        D_m = fabs(D);
                        d_m = fabs(d);
                        assert(w0 < M && M < D_m && D_m < h && h < l && l < d_m);
                        double code(double w0, double M, double D_m, double h, double l, double d_m) {
                        	return w0;
                        }
                        
                        D_m = abs(d)
                        d_m = abs(d)
                        NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                        real(8) function code(w0, m, d_m, h, l, d_m_1)
                            real(8), intent (in) :: w0
                            real(8), intent (in) :: m
                            real(8), intent (in) :: d_m
                            real(8), intent (in) :: h
                            real(8), intent (in) :: l
                            real(8), intent (in) :: d_m_1
                            code = w0
                        end function
                        
                        D_m = Math.abs(D);
                        d_m = Math.abs(d);
                        assert w0 < M && M < D_m && D_m < h && h < l && l < d_m;
                        public static double code(double w0, double M, double D_m, double h, double l, double d_m) {
                        	return w0;
                        }
                        
                        D_m = math.fabs(D)
                        d_m = math.fabs(d)
                        [w0, M, D_m, h, l, d_m] = sort([w0, M, D_m, h, l, d_m])
                        def code(w0, M, D_m, h, l, d_m):
                        	return w0
                        
                        D_m = abs(D)
                        d_m = abs(d)
                        w0, M, D_m, h, l, d_m = sort([w0, M, D_m, h, l, d_m])
                        function code(w0, M, D_m, h, l, d_m)
                        	return w0
                        end
                        
                        D_m = abs(D);
                        d_m = abs(d);
                        w0, M, D_m, h, l, d_m = num2cell(sort([w0, M, D_m, h, l, d_m])){:}
                        function tmp = code(w0, M, D_m, h, l, d_m)
                        	tmp = w0;
                        end
                        
                        D_m = N[Abs[D], $MachinePrecision]
                        d_m = N[Abs[d], $MachinePrecision]
                        NOTE: w0, M, D_m, h, l, and d_m should be sorted in increasing order before calling this function.
                        code[w0_, M_, D$95$m_, h_, l_, d$95$m_] := w0
                        
                        \begin{array}{l}
                        D_m = \left|D\right|
                        \\
                        d_m = \left|d\right|
                        \\
                        [w0, M, D_m, h, l, d_m] = \mathsf{sort}([w0, M, D_m, h, l, d_m])\\
                        \\
                        w0
                        \end{array}
                        
                        Derivation
                        1. Initial program 82.6%

                          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                        2. Simplified84.8%

                          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 + \frac{\frac{h \cdot \left(D \cdot \frac{M \cdot \frac{M \cdot D}{d}}{-4}\right)}{d}}{\ell}}} \]
                        3. Add Preprocessing
                        4. Taylor expanded in h around 0

                          \[\leadsto \color{blue}{w0} \]
                        5. Step-by-step derivation
                          1. Simplified68.4%

                            \[\leadsto \color{blue}{w0} \]
                          2. Add Preprocessing

                          Reproduce

                          ?
                          herbie shell --seed 2024145 
                          (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))))))