Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.9% → 89.7%
Time: 16.8s
Alternatives: 14
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 81.9% accurate, 1.0× speedup?

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

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

Alternative 1: 89.7% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 M D) < 5.00000000000000003e159

    1. Initial program 83.6%

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}} \]
      4. div-invN/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
      5. times-fracN/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      6. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      9. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      10. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      12. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{1}{h}}} \]
      13. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\frac{1}{h}}} \]
      14. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
      15. /-lowering-/.f6491.7

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
    4. Applied egg-rr91.7%

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

    if 5.00000000000000003e159 < (*.f64 M D) < 2.0000000000000001e190

    1. Initial program 28.0%

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}} \]
      4. div-invN/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
      5. times-fracN/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      6. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      9. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      10. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      12. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{1}{h}}} \]
      13. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\frac{1}{h}}} \]
      14. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
      15. /-lowering-/.f6428.0

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
    4. Applied egg-rr28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\color{blue}{\ell \cdot {d}^{2}}}} \]
      14. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
      15. *-lowering-*.f6428.0

        \[\leadsto w0 \cdot \sqrt{\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
    7. Simplified28.0%

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

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

        \[\leadsto \color{blue}{\sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}} \cdot w0} \]
    9. Applied egg-rr26.4%

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

    if 2.0000000000000001e190 < (*.f64 M D)

    1. Initial program 75.5%

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{h}{\ell} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right)\right) \cdot \frac{D}{d}}} \]
    4. Applied egg-rr65.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{d \cdot \ell} \cdot M\right) \cdot \color{blue}{\left(M \cdot 0.25\right)}\right) \cdot \frac{D}{d}} \]
    6. Applied egg-rr71.4%

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\color{blue}{\left(h \cdot \frac{D}{d}\right)} \cdot M}{\ell} \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
      7. /-lowering-/.f6476.2

        \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(h \cdot \color{blue}{\frac{D}{d}}\right) \cdot M}{\ell} \cdot \left(M \cdot 0.25\right)\right) \cdot \frac{D}{d}} \]
    8. Applied egg-rr76.2%

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

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

Alternative 2: 87.4% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \cdot D\_m \leq 4 \cdot 10^{-169}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 4 \cdot 10^{+150}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)}{d \cdot \ell} \cdot \frac{h}{d}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(M\_m \cdot 0.25\right) \cdot \left(\frac{D\_m}{d} \cdot \left(\frac{M\_m}{d \cdot \ell} \cdot \left(D\_m \cdot h\right)\right)\right)}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
 :precision binary64
 (if (<= (* M_m D_m) 4e-169)
   (* w0 (fma (* D_m D_m) (/ (/ (* -0.125 (/ (* M_m (* M_m h)) l)) d) d) 1.0))
   (if (<= (* M_m D_m) 4e+150)
     (*
      w0
      (sqrt
       (fma -0.25 (* (/ (* (* M_m D_m) (* M_m D_m)) (* d l)) (/ h d)) 1.0)))
     (*
      w0
      (sqrt
       (-
        1.0
        (* (* M_m 0.25) (* (/ D_m d) (* (/ M_m (* d l)) (* D_m h))))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
	double tmp;
	if ((M_m * D_m) <= 4e-169) {
		tmp = w0 * fma((D_m * D_m), (((-0.125 * ((M_m * (M_m * h)) / l)) / d) / d), 1.0);
	} else if ((M_m * D_m) <= 4e+150) {
		tmp = w0 * sqrt(fma(-0.25, ((((M_m * D_m) * (M_m * D_m)) / (d * l)) * (h / d)), 1.0));
	} else {
		tmp = w0 * sqrt((1.0 - ((M_m * 0.25) * ((D_m / d) * ((M_m / (d * l)) * (D_m * h))))));
	}
	return tmp;
}
M_m = abs(M)
D_m = abs(D)
w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
function code(w0, M_m, D_m, h, l, d)
	tmp = 0.0
	if (Float64(M_m * D_m) <= 4e-169)
		tmp = Float64(w0 * fma(Float64(D_m * D_m), Float64(Float64(Float64(-0.125 * Float64(Float64(M_m * Float64(M_m * h)) / l)) / d) / d), 1.0));
	elseif (Float64(M_m * D_m) <= 4e+150)
		tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(Float64(Float64(M_m * D_m) * Float64(M_m * D_m)) / Float64(d * l)) * Float64(h / d)), 1.0)));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(M_m * 0.25) * Float64(Float64(D_m / d) * Float64(Float64(M_m / Float64(d * l)) * Float64(D_m * h)))))));
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 4e-169], N[(w0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(-0.125 * N[(N[(M$95$m * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 4e+150], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(M$95$m * 0.25), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(M$95$m / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(D$95$m * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M\_m \cdot D\_m \leq 4 \cdot 10^{-169}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 M D) < 4.00000000000000008e-169

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified58.8%

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

      \[\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)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{\frac{-0.125 \cdot \frac{M \cdot \color{blue}{\left(M \cdot h\right)}}{\ell}}{d}}{d}, 1\right) \]
    10. Applied egg-rr63.3%

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

    if 4.00000000000000008e-169 < (*.f64 M D) < 3.99999999999999992e150

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      17. *-lowering-*.f6464.0

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified64.0%

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

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

        \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}} \cdot w0} \]
    7. Applied egg-rr63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\mathsf{fma}\left(\frac{-1}{4}, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\color{blue}{d \cdot \ell}} \cdot \frac{h}{d}, 1\right)} \cdot w0 \]
      14. /-lowering-/.f6495.4

        \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \color{blue}{\frac{h}{d}}, 1\right)} \cdot w0 \]
    9. Applied egg-rr95.4%

      \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \color{blue}{\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \frac{h}{d}}, 1\right)} \cdot w0 \]

    if 3.99999999999999992e150 < (*.f64 M D)

    1. Initial program 70.1%

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{h}{\ell} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right)\right) \cdot \frac{D}{d}}} \]
    4. Applied egg-rr62.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{\color{blue}{d \cdot \ell}} \cdot M\right) \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
      11. *-lowering-*.f6466.9

        \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{d \cdot \ell} \cdot M\right) \cdot \color{blue}{\left(M \cdot 0.25\right)}\right) \cdot \frac{D}{d}} \]
    6. Applied egg-rr66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{D}{d} \cdot \left(\left(D \cdot h\right) \cdot \frac{M}{d \cdot \ell}\right)\right) \cdot \color{blue}{\left(M \cdot 0.25\right)}} \]
    8. Applied egg-rr77.8%

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

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

Alternative 3: 87.4% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \cdot D\_m \leq 4 \cdot 10^{-169}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 4 \cdot 10^{+150}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)}{d \cdot \ell} \cdot \frac{h}{d}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\left(M\_m \cdot 0.25\right) \cdot \left(M\_m \cdot \frac{D\_m \cdot h}{d \cdot \ell}\right)\right)}\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
 :precision binary64
 (if (<= (* M_m D_m) 4e-169)
   (* w0 (fma (* D_m D_m) (/ (/ (* -0.125 (/ (* M_m (* M_m h)) l)) d) d) 1.0))
   (if (<= (* M_m D_m) 4e+150)
     (*
      w0
      (sqrt
       (fma -0.25 (* (/ (* (* M_m D_m) (* M_m D_m)) (* d l)) (/ h d)) 1.0)))
     (*
      w0
      (sqrt
       (-
        1.0
        (* (/ D_m d) (* (* M_m 0.25) (* M_m (/ (* D_m h) (* d l)))))))))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
	double tmp;
	if ((M_m * D_m) <= 4e-169) {
		tmp = w0 * fma((D_m * D_m), (((-0.125 * ((M_m * (M_m * h)) / l)) / d) / d), 1.0);
	} else if ((M_m * D_m) <= 4e+150) {
		tmp = w0 * sqrt(fma(-0.25, ((((M_m * D_m) * (M_m * D_m)) / (d * l)) * (h / d)), 1.0));
	} else {
		tmp = w0 * sqrt((1.0 - ((D_m / d) * ((M_m * 0.25) * (M_m * ((D_m * h) / (d * l)))))));
	}
	return tmp;
}
M_m = abs(M)
D_m = abs(D)
w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
function code(w0, M_m, D_m, h, l, d)
	tmp = 0.0
	if (Float64(M_m * D_m) <= 4e-169)
		tmp = Float64(w0 * fma(Float64(D_m * D_m), Float64(Float64(Float64(-0.125 * Float64(Float64(M_m * Float64(M_m * h)) / l)) / d) / d), 1.0));
	elseif (Float64(M_m * D_m) <= 4e+150)
		tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(Float64(Float64(M_m * D_m) * Float64(M_m * D_m)) / Float64(d * l)) * Float64(h / d)), 1.0)));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / d) * Float64(Float64(M_m * 0.25) * Float64(M_m * Float64(Float64(D_m * h) / Float64(d * l))))))));
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 4e-169], N[(w0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(-0.125 * N[(N[(M$95$m * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 4e+150], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(M$95$m * 0.25), $MachinePrecision] * N[(M$95$m * N[(N[(D$95$m * h), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M\_m \cdot D\_m \leq 4 \cdot 10^{-169}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 M D) < 4.00000000000000008e-169

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified58.8%

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

      \[\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)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{\frac{-0.125 \cdot \frac{M \cdot \color{blue}{\left(M \cdot h\right)}}{\ell}}{d}}{d}, 1\right) \]
    10. Applied egg-rr63.3%

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

    if 4.00000000000000008e-169 < (*.f64 M D) < 3.99999999999999992e150

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      17. *-lowering-*.f6464.0

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified64.0%

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

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

        \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}} \cdot w0} \]
    7. Applied egg-rr63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\mathsf{fma}\left(\frac{-1}{4}, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\color{blue}{d \cdot \ell}} \cdot \frac{h}{d}, 1\right)} \cdot w0 \]
      14. /-lowering-/.f6495.4

        \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \color{blue}{\frac{h}{d}}, 1\right)} \cdot w0 \]
    9. Applied egg-rr95.4%

      \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \color{blue}{\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \frac{h}{d}}, 1\right)} \cdot w0 \]

    if 3.99999999999999992e150 < (*.f64 M D)

    1. Initial program 70.1%

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{h}{\ell} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right)\right) \cdot \frac{D}{d}}} \]
    4. Applied egg-rr62.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{\color{blue}{d \cdot \ell}} \cdot M\right) \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
      11. *-lowering-*.f6466.9

        \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{d \cdot \ell} \cdot M\right) \cdot \color{blue}{\left(M \cdot 0.25\right)}\right) \cdot \frac{D}{d}} \]
    6. Applied egg-rr66.9%

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

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

Alternative 4: 84.1% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \cdot D\_m \leq 4 \cdot 10^{-169}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+154}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)}{d \cdot \ell} \cdot \frac{h}{d}, 1\right)}\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 2 \cdot 10^{+190}:\\ \;\;\;\;w0 \cdot \left(D\_m \cdot \sqrt{-0.25 \cdot \left(M\_m \cdot \left(h \cdot \frac{M\_m}{\ell \cdot \left(d \cdot d\right)}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D\_m, w0 \cdot \left(\frac{h}{d} \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot -0.125\right)}{d \cdot \ell}\right), w0\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
 :precision binary64
 (if (<= (* M_m D_m) 4e-169)
   (* w0 (fma (* D_m D_m) (/ (/ (* -0.125 (/ (* M_m (* M_m h)) l)) d) d) 1.0))
   (if (<= (* M_m D_m) 1e+154)
     (*
      w0
      (sqrt
       (fma -0.25 (* (/ (* (* M_m D_m) (* M_m D_m)) (* d l)) (/ h d)) 1.0)))
     (if (<= (* M_m D_m) 2e+190)
       (* w0 (* D_m (sqrt (* -0.25 (* M_m (* h (/ M_m (* l (* d d)))))))))
       (fma
        D_m
        (* w0 (* (/ h d) (/ (* (* M_m M_m) (* D_m -0.125)) (* d l))))
        w0)))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
	double tmp;
	if ((M_m * D_m) <= 4e-169) {
		tmp = w0 * fma((D_m * D_m), (((-0.125 * ((M_m * (M_m * h)) / l)) / d) / d), 1.0);
	} else if ((M_m * D_m) <= 1e+154) {
		tmp = w0 * sqrt(fma(-0.25, ((((M_m * D_m) * (M_m * D_m)) / (d * l)) * (h / d)), 1.0));
	} else if ((M_m * D_m) <= 2e+190) {
		tmp = w0 * (D_m * sqrt((-0.25 * (M_m * (h * (M_m / (l * (d * d))))))));
	} else {
		tmp = fma(D_m, (w0 * ((h / d) * (((M_m * M_m) * (D_m * -0.125)) / (d * l)))), w0);
	}
	return tmp;
}
M_m = abs(M)
D_m = abs(D)
w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
function code(w0, M_m, D_m, h, l, d)
	tmp = 0.0
	if (Float64(M_m * D_m) <= 4e-169)
		tmp = Float64(w0 * fma(Float64(D_m * D_m), Float64(Float64(Float64(-0.125 * Float64(Float64(M_m * Float64(M_m * h)) / l)) / d) / d), 1.0));
	elseif (Float64(M_m * D_m) <= 1e+154)
		tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(Float64(Float64(M_m * D_m) * Float64(M_m * D_m)) / Float64(d * l)) * Float64(h / d)), 1.0)));
	elseif (Float64(M_m * D_m) <= 2e+190)
		tmp = Float64(w0 * Float64(D_m * sqrt(Float64(-0.25 * Float64(M_m * Float64(h * Float64(M_m / Float64(l * Float64(d * d)))))))));
	else
		tmp = fma(D_m, Float64(w0 * Float64(Float64(h / d) * Float64(Float64(Float64(M_m * M_m) * Float64(D_m * -0.125)) / Float64(d * l)))), w0);
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 4e-169], N[(w0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(-0.125 * N[(N[(M$95$m * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 1e+154], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 2e+190], N[(w0 * N[(D$95$m * N[Sqrt[N[(-0.25 * N[(M$95$m * N[(h * N[(M$95$m / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(D$95$m * N[(w0 * N[(N[(h / d), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * -0.125), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M\_m \cdot D\_m \leq 4 \cdot 10^{-169}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\

\mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+154}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)}{d \cdot \ell} \cdot \frac{h}{d}, 1\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 M D) < 4.00000000000000008e-169

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified58.8%

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

      \[\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)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{\frac{-0.125 \cdot \frac{M \cdot \color{blue}{\left(M \cdot h\right)}}{\ell}}{d}}{d}, 1\right) \]
    10. Applied egg-rr63.3%

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

    if 4.00000000000000008e-169 < (*.f64 M D) < 1.00000000000000004e154

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      17. *-lowering-*.f6462.3

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified62.3%

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

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

        \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}} \cdot w0} \]
    7. Applied egg-rr63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\mathsf{fma}\left(\frac{-1}{4}, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\color{blue}{d \cdot \ell}} \cdot \frac{h}{d}, 1\right)} \cdot w0 \]
      14. /-lowering-/.f6495.5

        \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \color{blue}{\frac{h}{d}}, 1\right)} \cdot w0 \]
    9. Applied egg-rr95.5%

      \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \color{blue}{\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \frac{h}{d}}, 1\right)} \cdot w0 \]

    if 1.00000000000000004e154 < (*.f64 M D) < 2.0000000000000001e190

    1. Initial program 28.0%

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}} \]
      4. div-invN/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
      5. times-fracN/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      6. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      9. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      10. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      12. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{1}{h}}} \]
      13. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\frac{1}{h}}} \]
      14. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
      15. /-lowering-/.f6428.0

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
    4. Applied egg-rr28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\color{blue}{\ell \cdot {d}^{2}}}} \]
      14. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
      15. *-lowering-*.f6428.0

        \[\leadsto w0 \cdot \sqrt{\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
    7. Simplified28.0%

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

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

        \[\leadsto \color{blue}{\sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}} \cdot w0} \]
    9. Applied egg-rr26.4%

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

    if 2.0000000000000001e190 < (*.f64 M D)

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      17. *-lowering-*.f6446.0

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified46.0%

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

      \[\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)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

      \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
    10. Applied egg-rr41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.6% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} t_0 := \ell \cdot \left(d \cdot d\right)\\ \mathbf{if}\;M\_m \cdot D\_m \leq 2 \cdot 10^{-147}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+154}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right) \cdot \frac{h}{t\_0}, 1\right)}\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 2 \cdot 10^{+190}:\\ \;\;\;\;w0 \cdot \left(D\_m \cdot \sqrt{-0.25 \cdot \left(M\_m \cdot \left(h \cdot \frac{M\_m}{t\_0}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D\_m, w0 \cdot \left(\frac{h}{d} \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot -0.125\right)}{d \cdot \ell}\right), w0\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
 :precision binary64
 (let* ((t_0 (* l (* d d))))
   (if (<= (* M_m D_m) 2e-147)
     (*
      w0
      (fma (* D_m D_m) (/ (/ (* -0.125 (/ (* M_m (* M_m h)) l)) d) d) 1.0))
     (if (<= (* M_m D_m) 1e+154)
       (* w0 (sqrt (fma -0.25 (* (* (* M_m D_m) (* M_m D_m)) (/ h t_0)) 1.0)))
       (if (<= (* M_m D_m) 2e+190)
         (* w0 (* D_m (sqrt (* -0.25 (* M_m (* h (/ M_m t_0)))))))
         (fma
          D_m
          (* w0 (* (/ h d) (/ (* (* M_m M_m) (* D_m -0.125)) (* d l))))
          w0))))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
	double t_0 = l * (d * d);
	double tmp;
	if ((M_m * D_m) <= 2e-147) {
		tmp = w0 * fma((D_m * D_m), (((-0.125 * ((M_m * (M_m * h)) / l)) / d) / d), 1.0);
	} else if ((M_m * D_m) <= 1e+154) {
		tmp = w0 * sqrt(fma(-0.25, (((M_m * D_m) * (M_m * D_m)) * (h / t_0)), 1.0));
	} else if ((M_m * D_m) <= 2e+190) {
		tmp = w0 * (D_m * sqrt((-0.25 * (M_m * (h * (M_m / t_0))))));
	} else {
		tmp = fma(D_m, (w0 * ((h / d) * (((M_m * M_m) * (D_m * -0.125)) / (d * l)))), w0);
	}
	return tmp;
}
M_m = abs(M)
D_m = abs(D)
w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
function code(w0, M_m, D_m, h, l, d)
	t_0 = Float64(l * Float64(d * d))
	tmp = 0.0
	if (Float64(M_m * D_m) <= 2e-147)
		tmp = Float64(w0 * fma(Float64(D_m * D_m), Float64(Float64(Float64(-0.125 * Float64(Float64(M_m * Float64(M_m * h)) / l)) / d) / d), 1.0));
	elseif (Float64(M_m * D_m) <= 1e+154)
		tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(Float64(M_m * D_m) * Float64(M_m * D_m)) * Float64(h / t_0)), 1.0)));
	elseif (Float64(M_m * D_m) <= 2e+190)
		tmp = Float64(w0 * Float64(D_m * sqrt(Float64(-0.25 * Float64(M_m * Float64(h * Float64(M_m / t_0)))))));
	else
		tmp = fma(D_m, Float64(w0 * Float64(Float64(h / d) * Float64(Float64(Float64(M_m * M_m) * Float64(D_m * -0.125)) / Float64(d * l)))), w0);
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := Block[{t$95$0 = N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 2e-147], N[(w0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(-0.125 * N[(N[(M$95$m * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 1e+154], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(h / t$95$0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 2e+190], N[(w0 * N[(D$95$m * N[Sqrt[N[(-0.25 * N[(M$95$m * N[(h * N[(M$95$m / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(D$95$m * N[(w0 * N[(N[(h / d), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * -0.125), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := \ell \cdot \left(d \cdot d\right)\\
\mathbf{if}\;M\_m \cdot D\_m \leq 2 \cdot 10^{-147}:\\
\;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{\frac{-0.125 \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\

\mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+154}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right) \cdot \frac{h}{t\_0}, 1\right)}\\

\mathbf{elif}\;M\_m \cdot D\_m \leq 2 \cdot 10^{+190}:\\
\;\;\;\;w0 \cdot \left(D\_m \cdot \sqrt{-0.25 \cdot \left(M\_m \cdot \left(h \cdot \frac{M\_m}{t\_0}\right)\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 M D) < 1.9999999999999999e-147

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      17. *-lowering-*.f6459.2

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

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

      \[\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)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{\frac{-0.125 \cdot \frac{M \cdot \color{blue}{\left(M \cdot h\right)}}{\ell}}{d}}{d}, 1\right) \]
    10. Applied egg-rr63.6%

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

    if 1.9999999999999999e-147 < (*.f64 M D) < 1.00000000000000004e154

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}} \cdot w0} \]
    7. Applied egg-rr62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\mathsf{fma}\left(\frac{-1}{4}, \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\color{blue}{\ell \cdot \left(d \cdot d\right)}}, 1\right)} \cdot w0 \]
      15. *-lowering-*.f6487.4

        \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}, 1\right)} \cdot w0 \]
    9. Applied egg-rr87.4%

      \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \color{blue}{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}}, 1\right)} \cdot w0 \]

    if 1.00000000000000004e154 < (*.f64 M D) < 2.0000000000000001e190

    1. Initial program 28.0%

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}} \]
      4. div-invN/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
      5. times-fracN/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      6. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      9. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      10. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
      11. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      12. /-lowering-/.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{1}{h}}} \]
      13. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\frac{1}{h}}} \]
      14. *-lowering-*.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
      15. /-lowering-/.f6428.0

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
    4. Applied egg-rr28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\color{blue}{\ell \cdot {d}^{2}}}} \]
      14. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
      15. *-lowering-*.f6428.0

        \[\leadsto w0 \cdot \sqrt{\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
    7. Simplified28.0%

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

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

        \[\leadsto \color{blue}{\sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}} \cdot w0} \]
    9. Applied egg-rr26.4%

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

    if 2.0000000000000001e190 < (*.f64 M D)

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
      9. unpow2N/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
      16. unpow2N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      17. *-lowering-*.f6446.0

        \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
    5. Simplified46.0%

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

      \[\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)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

      \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-inN/A

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
    10. Applied egg-rr41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot D \leq 2 \cdot 10^{-147}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{\frac{-0.125 \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell}}{d}}{d}, 1\right)\\ \mathbf{elif}\;M \cdot D \leq 10^{+154}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}, 1\right)}\\ \mathbf{elif}\;M \cdot D \leq 2 \cdot 10^{+190}:\\ \;\;\;\;w0 \cdot \left(D \cdot \sqrt{-0.25 \cdot \left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D, w0 \cdot \left(\frac{h}{d} \cdot \frac{\left(M \cdot M\right) \cdot \left(D \cdot -0.125\right)}{d \cdot \ell}\right), w0\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 81.4% accurate, 1.7× speedup?

\[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} t_0 := \ell \cdot \left(d \cdot d\right)\\ \mathbf{if}\;M\_m \cdot D\_m \leq 2 \cdot 10^{-147}:\\ \;\;\;\;w0\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+154}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right) \cdot \frac{h}{t\_0}, 1\right)}\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 2 \cdot 10^{+190}:\\ \;\;\;\;w0 \cdot \left(D\_m \cdot \sqrt{-0.25 \cdot \left(M\_m \cdot \left(h \cdot \frac{M\_m}{t\_0}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D\_m, w0 \cdot \left(\frac{h}{d} \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot -0.125\right)}{d \cdot \ell}\right), w0\right)\\ \end{array} \end{array} \]
M_m = (fabs.f64 M)
D_m = (fabs.f64 D)
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
(FPCore (w0 M_m D_m h l d)
 :precision binary64
 (let* ((t_0 (* l (* d d))))
   (if (<= (* M_m D_m) 2e-147)
     w0
     (if (<= (* M_m D_m) 1e+154)
       (* w0 (sqrt (fma -0.25 (* (* (* M_m D_m) (* M_m D_m)) (/ h t_0)) 1.0)))
       (if (<= (* M_m D_m) 2e+190)
         (* w0 (* D_m (sqrt (* -0.25 (* M_m (* h (/ M_m t_0)))))))
         (fma
          D_m
          (* w0 (* (/ h d) (/ (* (* M_m M_m) (* D_m -0.125)) (* d l))))
          w0))))))
M_m = fabs(M);
D_m = fabs(D);
assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
double code(double w0, double M_m, double D_m, double h, double l, double d) {
	double t_0 = l * (d * d);
	double tmp;
	if ((M_m * D_m) <= 2e-147) {
		tmp = w0;
	} else if ((M_m * D_m) <= 1e+154) {
		tmp = w0 * sqrt(fma(-0.25, (((M_m * D_m) * (M_m * D_m)) * (h / t_0)), 1.0));
	} else if ((M_m * D_m) <= 2e+190) {
		tmp = w0 * (D_m * sqrt((-0.25 * (M_m * (h * (M_m / t_0))))));
	} else {
		tmp = fma(D_m, (w0 * ((h / d) * (((M_m * M_m) * (D_m * -0.125)) / (d * l)))), w0);
	}
	return tmp;
}
M_m = abs(M)
D_m = abs(D)
w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
function code(w0, M_m, D_m, h, l, d)
	t_0 = Float64(l * Float64(d * d))
	tmp = 0.0
	if (Float64(M_m * D_m) <= 2e-147)
		tmp = w0;
	elseif (Float64(M_m * D_m) <= 1e+154)
		tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(Float64(M_m * D_m) * Float64(M_m * D_m)) * Float64(h / t_0)), 1.0)));
	elseif (Float64(M_m * D_m) <= 2e+190)
		tmp = Float64(w0 * Float64(D_m * sqrt(Float64(-0.25 * Float64(M_m * Float64(h * Float64(M_m / t_0)))))));
	else
		tmp = fma(D_m, Float64(w0 * Float64(Float64(h / d) * Float64(Float64(Float64(M_m * M_m) * Float64(D_m * -0.125)) / Float64(d * l)))), w0);
	end
	return tmp
end
M_m = N[Abs[M], $MachinePrecision]
D_m = N[Abs[D], $MachinePrecision]
NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := Block[{t$95$0 = N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 2e-147], w0, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 1e+154], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(h / t$95$0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 2e+190], N[(w0 * N[(D$95$m * N[Sqrt[N[(-0.25 * N[(M$95$m * N[(h * N[(M$95$m / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(D$95$m * N[(w0 * N[(N[(h / d), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * -0.125), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
D_m = \left|D\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := \ell \cdot \left(d \cdot d\right)\\
\mathbf{if}\;M\_m \cdot D\_m \leq 2 \cdot 10^{-147}:\\
\;\;\;\;w0\\

\mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+154}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right) \cdot \frac{h}{t\_0}, 1\right)}\\

\mathbf{elif}\;M\_m \cdot D\_m \leq 2 \cdot 10^{+190}:\\
\;\;\;\;w0 \cdot \left(D\_m \cdot \sqrt{-0.25 \cdot \left(M\_m \cdot \left(h \cdot \frac{M\_m}{t\_0}\right)\right)}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 M D) < 1.9999999999999999e-147

    1. Initial program 81.3%

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

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

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

      if 1.9999999999999999e-147 < (*.f64 M D) < 1.00000000000000004e154

      1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
        9. unpow2N/A

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
        16. unpow2N/A

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

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

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

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

          \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}} \cdot w0} \]
      7. Applied egg-rr62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sqrt{\mathsf{fma}\left(\frac{-1}{4}, \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\color{blue}{\ell \cdot \left(d \cdot d\right)}}, 1\right)} \cdot w0 \]
        15. *-lowering-*.f6487.4

          \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}, 1\right)} \cdot w0 \]
      9. Applied egg-rr87.4%

        \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \color{blue}{\left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}}, 1\right)} \cdot w0 \]

      if 1.00000000000000004e154 < (*.f64 M D) < 2.0000000000000001e190

      1. Initial program 28.0%

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}} \]
        4. div-invN/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
        5. times-fracN/A

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        6. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        7. /-lowering-/.f64N/A

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        9. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        10. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        11. /-lowering-/.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        12. /-lowering-/.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{1}{h}}} \]
        13. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\frac{1}{h}}} \]
        14. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
        15. /-lowering-/.f6428.0

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
      4. Applied egg-rr28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\color{blue}{\ell \cdot {d}^{2}}}} \]
        14. unpow2N/A

          \[\leadsto w0 \cdot \sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
        15. *-lowering-*.f6428.0

          \[\leadsto w0 \cdot \sqrt{\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}} \]
      7. Simplified28.0%

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

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

          \[\leadsto \color{blue}{\sqrt{\left(\frac{-1}{4} \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}} \cdot w0} \]
      9. Applied egg-rr26.4%

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

      if 2.0000000000000001e190 < (*.f64 M D)

      1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
        9. unpow2N/A

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
        16. unpow2N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
        17. *-lowering-*.f6446.0

          \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      5. Simplified46.0%

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

        \[\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)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

        \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
      9. Step-by-step derivation
        1. distribute-rgt-inN/A

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
      10. Applied egg-rr41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;M \cdot D \leq 2 \cdot 10^{-147}:\\ \;\;\;\;w0\\ \mathbf{elif}\;M \cdot D \leq 10^{+154}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(\left(M \cdot D\right) \cdot \left(M \cdot D\right)\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}, 1\right)}\\ \mathbf{elif}\;M \cdot D \leq 2 \cdot 10^{+190}:\\ \;\;\;\;w0 \cdot \left(D \cdot \sqrt{-0.25 \cdot \left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D, w0 \cdot \left(\frac{h}{d} \cdot \frac{\left(M \cdot M\right) \cdot \left(D \cdot -0.125\right)}{d \cdot \ell}\right), w0\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 7: 87.1% accurate, 1.7× speedup?

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

      1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
        9. unpow2N/A

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
        16. unpow2N/A

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      5. Simplified58.8%

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

        \[\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)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{\frac{-0.125 \cdot \frac{M \cdot \color{blue}{\left(M \cdot h\right)}}{\ell}}{d}}{d}, 1\right) \]
      10. Applied egg-rr63.3%

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

      if 4.00000000000000008e-169 < (*.f64 M D) < 3.99999999999999992e150

      1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
        9. unpow2N/A

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
        16. unpow2N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
        17. *-lowering-*.f6464.0

          \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      5. Simplified64.0%

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

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

          \[\leadsto \color{blue}{\sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}} \cdot w0} \]
      7. Applied egg-rr63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sqrt{\mathsf{fma}\left(\frac{-1}{4}, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\color{blue}{d \cdot \ell}} \cdot \frac{h}{d}, 1\right)} \cdot w0 \]
        14. /-lowering-/.f6495.4

          \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \color{blue}{\frac{h}{d}}, 1\right)} \cdot w0 \]
      9. Applied egg-rr95.4%

        \[\leadsto \sqrt{\mathsf{fma}\left(-0.25, \color{blue}{\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \frac{h}{d}}, 1\right)} \cdot w0 \]

      if 3.99999999999999992e150 < (*.f64 M D)

      1. Initial program 70.1%

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{h}{\ell} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right)\right) \cdot \frac{D}{d}}} \]
      4. Applied egg-rr62.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{\color{blue}{d \cdot \ell}} \cdot M\right) \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
        11. *-lowering-*.f6466.9

          \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{d \cdot \ell} \cdot M\right) \cdot \color{blue}{\left(M \cdot 0.25\right)}\right) \cdot \frac{D}{d}} \]
      6. Applied egg-rr66.9%

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\color{blue}{\left(h \cdot \frac{D}{d}\right)} \cdot M}{\ell} \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
        7. /-lowering-/.f6470.6

          \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(h \cdot \color{blue}{\frac{D}{d}}\right) \cdot M}{\ell} \cdot \left(M \cdot 0.25\right)\right) \cdot \frac{D}{d}} \]
      8. Applied egg-rr70.6%

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

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

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

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

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

    Alternative 8: 86.2% accurate, 1.8× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{+53}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{\left(2 \cdot d\right) \cdot \ell}, \frac{\left(M\_m \cdot D\_m\right) \cdot h}{0 - 2 \cdot d}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\left(M\_m \cdot 0.25\right) \cdot \left(M\_m \cdot \left(\frac{D\_m}{d} \cdot \frac{h}{\ell}\right)\right)\right)}\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    (FPCore (w0 M_m D_m h l d)
     :precision binary64
     (if (<= (* M_m D_m) 5e+53)
       (*
        w0
        (sqrt
         (fma
          (/ (* M_m D_m) (* (* 2.0 d) l))
          (/ (* (* M_m D_m) h) (- 0.0 (* 2.0 d)))
          1.0)))
       (*
        w0
        (sqrt
         (- 1.0 (* (/ D_m d) (* (* M_m 0.25) (* M_m (* (/ D_m d) (/ h l))))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
    double code(double w0, double M_m, double D_m, double h, double l, double d) {
    	double tmp;
    	if ((M_m * D_m) <= 5e+53) {
    		tmp = w0 * sqrt(fma(((M_m * D_m) / ((2.0 * d) * l)), (((M_m * D_m) * h) / (0.0 - (2.0 * d))), 1.0));
    	} else {
    		tmp = w0 * sqrt((1.0 - ((D_m / d) * ((M_m * 0.25) * (M_m * ((D_m / d) * (h / l)))))));
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
    function code(w0, M_m, D_m, h, l, d)
    	tmp = 0.0
    	if (Float64(M_m * D_m) <= 5e+53)
    		tmp = Float64(w0 * sqrt(fma(Float64(Float64(M_m * D_m) / Float64(Float64(2.0 * d) * l)), Float64(Float64(Float64(M_m * D_m) * h) / Float64(0.0 - Float64(2.0 * d))), 1.0)));
    	else
    		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / d) * Float64(Float64(M_m * 0.25) * Float64(M_m * Float64(Float64(D_m / d) * Float64(h / l))))))));
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 5e+53], N[(w0 * N[Sqrt[N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(N[(2.0 * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * h), $MachinePrecision] / N[(0.0 - N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(M$95$m * 0.25), $MachinePrecision] * N[(M$95$m * N[(N[(D$95$m / d), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{+53}:\\
    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{\left(2 \cdot d\right) \cdot \ell}, \frac{\left(M\_m \cdot D\_m\right) \cdot h}{0 - 2 \cdot d}, 1\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\left(M\_m \cdot 0.25\right) \cdot \left(M\_m \cdot \left(\frac{D\_m}{d} \cdot \frac{h}{\ell}\right)\right)\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 M D) < 5.0000000000000004e53

      1. Initial program 82.8%

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}} \]
        4. div-invN/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
        5. times-fracN/A

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        6. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        7. /-lowering-/.f64N/A

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        9. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        10. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        11. /-lowering-/.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        12. /-lowering-/.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{1}{h}}} \]
        13. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\frac{1}{h}}} \]
        14. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
        15. /-lowering-/.f6491.5

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
      4. Applied egg-rr91.5%

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      5. Step-by-step derivation
        1. sub-negN/A

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

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

          \[\leadsto w0 \cdot \sqrt{\color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \left(\mathsf{neg}\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)} + 1} \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto w0 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}, \mathsf{neg}\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right), 1\right)}} \]
      6. Applied egg-rr87.5%

        \[\leadsto w0 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\frac{M \cdot D}{\left(2 \cdot d\right) \cdot \ell}, -\frac{\left(M \cdot D\right) \cdot h}{2 \cdot d}, 1\right)}} \]

      if 5.0000000000000004e53 < (*.f64 M D)

      1. Initial program 78.6%

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{h}{\ell} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right)\right) \cdot \frac{D}{d}}} \]
      4. Applied egg-rr62.1%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{\color{blue}{d \cdot \ell}} \cdot M\right) \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
        11. *-lowering-*.f6472.2

          \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{d \cdot \ell} \cdot M\right) \cdot \color{blue}{\left(M \cdot 0.25\right)}\right) \cdot \frac{D}{d}} \]
      6. Applied egg-rr72.2%

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\left(\color{blue}{\frac{h}{\ell}} \cdot \frac{D}{d}\right) \cdot M\right) \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
        5. /-lowering-/.f6472.0

          \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\left(\frac{h}{\ell} \cdot \color{blue}{\frac{D}{d}}\right) \cdot M\right) \cdot \left(M \cdot 0.25\right)\right) \cdot \frac{D}{d}} \]
      8. Applied egg-rr72.0%

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

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

    Alternative 9: 87.2% accurate, 1.9× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 5 \cdot 10^{-165}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{\left(2 \cdot d\right) \cdot \ell}, \frac{\left(M\_m \cdot D\_m\right) \cdot h}{0 - 2 \cdot d}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{M\_m \cdot \left(h \cdot \frac{D\_m}{d}\right)}{\ell} \cdot \left(M\_m \cdot 0.25\right)\right)}\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    (FPCore (w0 M_m D_m h l d)
     :precision binary64
     (if (<= M_m 5e-165)
       (*
        w0
        (sqrt
         (fma
          (/ (* M_m D_m) (* (* 2.0 d) l))
          (/ (* (* M_m D_m) h) (- 0.0 (* 2.0 d)))
          1.0)))
       (*
        w0
        (sqrt
         (- 1.0 (* (/ D_m d) (* (/ (* M_m (* h (/ D_m d))) l) (* M_m 0.25))))))))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
    double code(double w0, double M_m, double D_m, double h, double l, double d) {
    	double tmp;
    	if (M_m <= 5e-165) {
    		tmp = w0 * sqrt(fma(((M_m * D_m) / ((2.0 * d) * l)), (((M_m * D_m) * h) / (0.0 - (2.0 * d))), 1.0));
    	} else {
    		tmp = w0 * sqrt((1.0 - ((D_m / d) * (((M_m * (h * (D_m / d))) / l) * (M_m * 0.25)))));
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
    function code(w0, M_m, D_m, h, l, d)
    	tmp = 0.0
    	if (M_m <= 5e-165)
    		tmp = Float64(w0 * sqrt(fma(Float64(Float64(M_m * D_m) / Float64(Float64(2.0 * d) * l)), Float64(Float64(Float64(M_m * D_m) * h) / Float64(0.0 - Float64(2.0 * d))), 1.0)));
    	else
    		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / d) * Float64(Float64(Float64(M_m * Float64(h * Float64(D_m / d))) / l) * Float64(M_m * 0.25))))));
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[M$95$m, 5e-165], N[(w0 * N[Sqrt[N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(N[(2.0 * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * h), $MachinePrecision] / N[(0.0 - N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(N[(M$95$m * N[(h * N[(D$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(M$95$m * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;M\_m \leq 5 \cdot 10^{-165}:\\
    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{\left(2 \cdot d\right) \cdot \ell}, \frac{\left(M\_m \cdot D\_m\right) \cdot h}{0 - 2 \cdot d}, 1\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{M\_m \cdot \left(h \cdot \frac{D\_m}{d}\right)}{\ell} \cdot \left(M\_m \cdot 0.25\right)\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if M < 4.99999999999999981e-165

      1. Initial program 84.0%

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}}{\frac{\ell}{h}}} \]
        4. div-invN/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
        5. times-fracN/A

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        6. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        7. /-lowering-/.f64N/A

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        9. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        10. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}} \]
        11. /-lowering-/.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
        12. /-lowering-/.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{1}{h}}} \]
        13. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{\color{blue}{M \cdot D}}{2 \cdot d}}{\frac{1}{h}}} \]
        14. *-lowering-*.f64N/A

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
      4. Applied egg-rr92.1%

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
      5. Step-by-step derivation
        1. sub-negN/A

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

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

          \[\leadsto w0 \cdot \sqrt{\color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \left(\mathsf{neg}\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right)\right)} + 1} \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto w0 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\ell}, \mathsf{neg}\left(\frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}\right), 1\right)}} \]
      6. Applied egg-rr88.2%

        \[\leadsto w0 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\frac{M \cdot D}{\left(2 \cdot d\right) \cdot \ell}, -\frac{\left(M \cdot D\right) \cdot h}{2 \cdot d}, 1\right)}} \]

      if 4.99999999999999981e-165 < M

      1. Initial program 78.2%

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\left(\frac{h}{\ell} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M}{2}\right)\right) \cdot \frac{D}{d}}} \]
      4. Applied egg-rr67.7%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \left(\left(\frac{h \cdot D}{d \cdot \ell} \cdot M\right) \cdot \color{blue}{\left(M \cdot 0.25\right)}\right) \cdot \frac{D}{d}} \]
      6. Applied egg-rr85.4%

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\color{blue}{\left(h \cdot \frac{D}{d}\right)} \cdot M}{\ell} \cdot \left(M \cdot \frac{1}{4}\right)\right) \cdot \frac{D}{d}} \]
        7. /-lowering-/.f6489.9

          \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\left(h \cdot \color{blue}{\frac{D}{d}}\right) \cdot M}{\ell} \cdot \left(M \cdot 0.25\right)\right) \cdot \frac{D}{d}} \]
      8. Applied egg-rr89.9%

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

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

    Alternative 10: 77.8% accurate, 2.4× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;D\_m \leq 2 \cdot 10^{+44}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{-0.125}{d} \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{d \cdot \ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D\_m, w0 \cdot \left(\left(M\_m \cdot \left(h \cdot \frac{M\_m}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot \left(D\_m \cdot -0.125\right)\right), w0\right)\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    (FPCore (w0 M_m D_m h l d)
     :precision binary64
     (if (<= D_m 2e+44)
       (* w0 (fma (* D_m D_m) (* (/ -0.125 d) (/ (* M_m (* M_m h)) (* d l))) 1.0))
       (fma D_m (* w0 (* (* M_m (* h (/ M_m (* l (* d d))))) (* D_m -0.125))) w0)))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
    double code(double w0, double M_m, double D_m, double h, double l, double d) {
    	double tmp;
    	if (D_m <= 2e+44) {
    		tmp = w0 * fma((D_m * D_m), ((-0.125 / d) * ((M_m * (M_m * h)) / (d * l))), 1.0);
    	} else {
    		tmp = fma(D_m, (w0 * ((M_m * (h * (M_m / (l * (d * d))))) * (D_m * -0.125))), w0);
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
    function code(w0, M_m, D_m, h, l, d)
    	tmp = 0.0
    	if (D_m <= 2e+44)
    		tmp = Float64(w0 * fma(Float64(D_m * D_m), Float64(Float64(-0.125 / d) * Float64(Float64(M_m * Float64(M_m * h)) / Float64(d * l))), 1.0));
    	else
    		tmp = fma(D_m, Float64(w0 * Float64(Float64(M_m * Float64(h * Float64(M_m / Float64(l * Float64(d * d))))) * Float64(D_m * -0.125))), w0);
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[D$95$m, 2e+44], N[(w0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(-0.125 / d), $MachinePrecision] * N[(N[(M$95$m * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(D$95$m * N[(w0 * N[(N[(M$95$m * N[(h * N[(M$95$m / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;D\_m \leq 2 \cdot 10^{+44}:\\
    \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \frac{-0.125}{d} \cdot \frac{M\_m \cdot \left(M\_m \cdot h\right)}{d \cdot \ell}, 1\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(D\_m, w0 \cdot \left(\left(M\_m \cdot \left(h \cdot \frac{M\_m}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot \left(D\_m \cdot -0.125\right)\right), w0\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if D < 2.0000000000000002e44

      1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
        9. unpow2N/A

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
        16. unpow2N/A

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      5. Simplified62.8%

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

        \[\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)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{-0.125}{d} \cdot \frac{M \cdot \left(M \cdot h\right)}{\color{blue}{d \cdot \ell}}, 1\right) \]
      10. Applied egg-rr66.2%

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

      if 2.0000000000000002e44 < D

      1. Initial program 78.7%

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
        9. unpow2N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left({D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
        10. associate-*r*N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
        11. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
        12. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\color{blue}{\left({D}^{2} \cdot M\right)} \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
        13. unpow2N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
        14. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
        15. *-lowering-*.f64N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
        16. unpow2N/A

          \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
        17. *-lowering-*.f6439.2

          \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
      5. Simplified39.2%

        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
      6. Taylor expanded in D around 0

        \[\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)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto w0 \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} + 1\right)} \]
        2. *-commutativeN/A

          \[\leadsto w0 \cdot \left(\color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}} + 1\right) \]
        3. associate-/l*N/A

          \[\leadsto w0 \cdot \left(\color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} \cdot \frac{-1}{8} + 1\right) \]
        4. associate-*r*N/A

          \[\leadsto w0 \cdot \left(\color{blue}{{D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)} + 1\right) \]
        5. *-commutativeN/A

          \[\leadsto w0 \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} + 1\right) \]
        6. accelerator-lowering-fma.f64N/A

          \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)} \]
      8. Simplified32.9%

        \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
      9. Step-by-step derivation
        1. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0 + 1 \cdot w0} \]
        2. associate-*l*N/A

          \[\leadsto \color{blue}{\left(D \cdot \left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right)\right)} \cdot w0 + 1 \cdot w0 \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{D \cdot \left(\left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0\right)} + 1 \cdot w0 \]
        4. *-lft-identityN/A

          \[\leadsto D \cdot \left(\left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0\right) + \color{blue}{w0} \]
        5. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
      10. Applied egg-rr57.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(\left(D \cdot \left(-0.125 \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
      11. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\color{blue}{\left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot M\right)\right)} \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right) \]
        2. associate-*l*N/A

          \[\leadsto \mathsf{fma}\left(D, \color{blue}{\left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right)\right)} \cdot w0, w0\right) \]
        3. associate-/l*N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\frac{\left(M \cdot M\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}}\right) \cdot w0, w0\right) \]
        4. associate-*r*N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \frac{\color{blue}{M \cdot \left(M \cdot h\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma}\left(D, \color{blue}{\left(\left(D \cdot \frac{-1}{8}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right)} \cdot w0, w0\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\color{blue}{\left(D \cdot \frac{-1}{8}\right)} \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right) \]
        7. associate-/l*N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(M \cdot \frac{M \cdot h}{\ell \cdot \left(d \cdot d\right)}\right)}\right) \cdot w0, w0\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(M \cdot \frac{M \cdot h}{\ell \cdot \left(d \cdot d\right)}\right)}\right) \cdot w0, w0\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \frac{\color{blue}{h \cdot M}}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot w0, w0\right) \]
        10. associate-/l*N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \color{blue}{\left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)}\right)\right) \cdot w0, w0\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \color{blue}{\left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)}\right)\right) \cdot w0, w0\right) \]
        12. /-lowering-/.f64N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \left(h \cdot \color{blue}{\frac{M}{\ell \cdot \left(d \cdot d\right)}}\right)\right)\right) \cdot w0, w0\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \left(h \cdot \frac{M}{\color{blue}{\ell \cdot \left(d \cdot d\right)}}\right)\right)\right) \cdot w0, w0\right) \]
        14. *-lowering-*.f6468.1

          \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot -0.125\right) \cdot \left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}\right)\right)\right) \cdot w0, w0\right) \]
      12. Applied egg-rr68.1%

        \[\leadsto \mathsf{fma}\left(D, \color{blue}{\left(\left(D \cdot -0.125\right) \cdot \left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)\right)\right)} \cdot w0, w0\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification66.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 2 \cdot 10^{+44}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot D, \frac{-0.125}{d} \cdot \frac{M \cdot \left(M \cdot h\right)}{d \cdot \ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D, w0 \cdot \left(\left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot \left(D \cdot -0.125\right)\right), w0\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 79.4% accurate, 2.7× speedup?

    \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;D\_m \leq 5.2 \cdot 10^{+59}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D\_m, w0 \cdot \left(\left(M\_m \cdot \left(h \cdot \frac{M\_m}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot \left(D\_m \cdot -0.125\right)\right), w0\right)\\ \end{array} \end{array} \]
    M_m = (fabs.f64 M)
    D_m = (fabs.f64 D)
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    (FPCore (w0 M_m D_m h l d)
     :precision binary64
     (if (<= D_m 5.2e+59)
       w0
       (fma D_m (* w0 (* (* M_m (* h (/ M_m (* l (* d d))))) (* D_m -0.125))) w0)))
    M_m = fabs(M);
    D_m = fabs(D);
    assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
    double code(double w0, double M_m, double D_m, double h, double l, double d) {
    	double tmp;
    	if (D_m <= 5.2e+59) {
    		tmp = w0;
    	} else {
    		tmp = fma(D_m, (w0 * ((M_m * (h * (M_m / (l * (d * d))))) * (D_m * -0.125))), w0);
    	}
    	return tmp;
    }
    
    M_m = abs(M)
    D_m = abs(D)
    w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
    function code(w0, M_m, D_m, h, l, d)
    	tmp = 0.0
    	if (D_m <= 5.2e+59)
    		tmp = w0;
    	else
    		tmp = fma(D_m, Float64(w0 * Float64(Float64(M_m * Float64(h * Float64(M_m / Float64(l * Float64(d * d))))) * Float64(D_m * -0.125))), w0);
    	end
    	return tmp
    end
    
    M_m = N[Abs[M], $MachinePrecision]
    D_m = N[Abs[D], $MachinePrecision]
    NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
    code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[D$95$m, 5.2e+59], w0, N[(D$95$m * N[(w0 * N[(N[(M$95$m * N[(h * N[(M$95$m / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision]]
    
    \begin{array}{l}
    M_m = \left|M\right|
    \\
    D_m = \left|D\right|
    \\
    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;D\_m \leq 5.2 \cdot 10^{+59}:\\
    \;\;\;\;w0\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(D\_m, w0 \cdot \left(\left(M\_m \cdot \left(h \cdot \frac{M\_m}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot \left(D\_m \cdot -0.125\right)\right), w0\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if D < 5.19999999999999999e59

      1. Initial program 83.1%

        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
      2. Add Preprocessing
      3. Taylor expanded in M around 0

        \[\leadsto \color{blue}{w0} \]
      4. Step-by-step derivation
        1. Simplified75.8%

          \[\leadsto \color{blue}{w0} \]

        if 5.19999999999999999e59 < D

        1. Initial program 77.8%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Add Preprocessing
        3. Taylor expanded in w0 around 0

          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
          2. sqrt-lowering-sqrt.f64N/A

            \[\leadsto w0 \cdot \color{blue}{\sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
          3. --lowering--.f64N/A

            \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
          4. associate-*r/N/A

            \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}}} \]
          5. /-lowering-/.f64N/A

            \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}}} \]
          6. *-lowering-*.f64N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}}{{d}^{2} \cdot \ell}} \]
          7. associate-*r*N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
          8. *-lowering-*.f64N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
          9. unpow2N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left({D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
          10. associate-*r*N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
          11. *-lowering-*.f64N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
          12. *-lowering-*.f64N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\color{blue}{\left({D}^{2} \cdot M\right)} \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
          13. unpow2N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
          14. *-lowering-*.f64N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
          15. *-lowering-*.f64N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
          16. unpow2N/A

            \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
          17. *-lowering-*.f6438.8

            \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
        5. Simplified38.8%

          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
        6. Taylor expanded in D around 0

          \[\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)} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto w0 \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} + 1\right)} \]
          2. *-commutativeN/A

            \[\leadsto w0 \cdot \left(\color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}} + 1\right) \]
          3. associate-/l*N/A

            \[\leadsto w0 \cdot \left(\color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} \cdot \frac{-1}{8} + 1\right) \]
          4. associate-*r*N/A

            \[\leadsto w0 \cdot \left(\color{blue}{{D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)} + 1\right) \]
          5. *-commutativeN/A

            \[\leadsto w0 \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} + 1\right) \]
          6. accelerator-lowering-fma.f64N/A

            \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)} \]
        8. Simplified32.2%

          \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
        9. Step-by-step derivation
          1. distribute-rgt-inN/A

            \[\leadsto \color{blue}{\left(\left(D \cdot D\right) \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0 + 1 \cdot w0} \]
          2. associate-*l*N/A

            \[\leadsto \color{blue}{\left(D \cdot \left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right)\right)} \cdot w0 + 1 \cdot w0 \]
          3. associate-*l*N/A

            \[\leadsto \color{blue}{D \cdot \left(\left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0\right)} + 1 \cdot w0 \]
          4. *-lft-identityN/A

            \[\leadsto D \cdot \left(\left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0\right) + \color{blue}{w0} \]
          5. accelerator-lowering-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(D \cdot \frac{\left(\frac{-1}{8} \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
        10. Applied egg-rr57.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(\left(D \cdot \left(-0.125 \cdot \left(M \cdot M\right)\right)\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
        11. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\color{blue}{\left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot M\right)\right)} \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right) \]
          2. associate-*l*N/A

            \[\leadsto \mathsf{fma}\left(D, \color{blue}{\left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right)\right)} \cdot w0, w0\right) \]
          3. associate-/l*N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\frac{\left(M \cdot M\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}}\right) \cdot w0, w0\right) \]
          4. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \frac{\color{blue}{M \cdot \left(M \cdot h\right)}}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(D, \color{blue}{\left(\left(D \cdot \frac{-1}{8}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right)} \cdot w0, w0\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\color{blue}{\left(D \cdot \frac{-1}{8}\right)} \cdot \frac{M \cdot \left(M \cdot h\right)}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right) \]
          7. associate-/l*N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(M \cdot \frac{M \cdot h}{\ell \cdot \left(d \cdot d\right)}\right)}\right) \cdot w0, w0\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(M \cdot \frac{M \cdot h}{\ell \cdot \left(d \cdot d\right)}\right)}\right) \cdot w0, w0\right) \]
          9. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \frac{\color{blue}{h \cdot M}}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot w0, w0\right) \]
          10. associate-/l*N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \color{blue}{\left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)}\right)\right) \cdot w0, w0\right) \]
          11. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \color{blue}{\left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)}\right)\right) \cdot w0, w0\right) \]
          12. /-lowering-/.f64N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \left(h \cdot \color{blue}{\frac{M}{\ell \cdot \left(d \cdot d\right)}}\right)\right)\right) \cdot w0, w0\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot \frac{-1}{8}\right) \cdot \left(M \cdot \left(h \cdot \frac{M}{\color{blue}{\ell \cdot \left(d \cdot d\right)}}\right)\right)\right) \cdot w0, w0\right) \]
          14. *-lowering-*.f6468.5

            \[\leadsto \mathsf{fma}\left(D, \left(\left(D \cdot -0.125\right) \cdot \left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}\right)\right)\right) \cdot w0, w0\right) \]
        12. Applied egg-rr68.5%

          \[\leadsto \mathsf{fma}\left(D, \color{blue}{\left(\left(D \cdot -0.125\right) \cdot \left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)\right)\right)} \cdot w0, w0\right) \]
      5. Recombined 2 regimes into one program.
      6. Final simplification74.5%

        \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq 5.2 \cdot 10^{+59}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(D, w0 \cdot \left(\left(M \cdot \left(h \cdot \frac{M}{\ell \cdot \left(d \cdot d\right)}\right)\right) \cdot \left(D \cdot -0.125\right)\right), w0\right)\\ \end{array} \]
      7. Add Preprocessing

      Alternative 12: 72.6% accurate, 2.7× speedup?

      \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 7.3 \cdot 10^{+74}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \frac{\left(D\_m \cdot D\_m\right) \cdot \left(-0.125 \cdot \left(h \cdot \left(M\_m \cdot M\_m\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\ \end{array} \end{array} \]
      M_m = (fabs.f64 M)
      D_m = (fabs.f64 D)
      NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
      (FPCore (w0 M_m D_m h l d)
       :precision binary64
       (if (<= M_m 7.3e+74)
         w0
         (* w0 (/ (* (* D_m D_m) (* -0.125 (* h (* M_m M_m)))) (* d (* d l))))))
      M_m = fabs(M);
      D_m = fabs(D);
      assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
      double code(double w0, double M_m, double D_m, double h, double l, double d) {
      	double tmp;
      	if (M_m <= 7.3e+74) {
      		tmp = w0;
      	} else {
      		tmp = w0 * (((D_m * D_m) * (-0.125 * (h * (M_m * M_m)))) / (d * (d * l)));
      	}
      	return tmp;
      }
      
      M_m = abs(m)
      D_m = abs(d)
      NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
      real(8) function code(w0, m_m, d_m, h, l, d)
          real(8), intent (in) :: w0
          real(8), intent (in) :: m_m
          real(8), intent (in) :: d_m
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: d
          real(8) :: tmp
          if (m_m <= 7.3d+74) then
              tmp = w0
          else
              tmp = w0 * (((d_m * d_m) * ((-0.125d0) * (h * (m_m * m_m)))) / (d * (d * l)))
          end if
          code = tmp
      end function
      
      M_m = Math.abs(M);
      D_m = Math.abs(D);
      assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
      public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
      	double tmp;
      	if (M_m <= 7.3e+74) {
      		tmp = w0;
      	} else {
      		tmp = w0 * (((D_m * D_m) * (-0.125 * (h * (M_m * M_m)))) / (d * (d * l)));
      	}
      	return tmp;
      }
      
      M_m = math.fabs(M)
      D_m = math.fabs(D)
      [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d])
      def code(w0, M_m, D_m, h, l, d):
      	tmp = 0
      	if M_m <= 7.3e+74:
      		tmp = w0
      	else:
      		tmp = w0 * (((D_m * D_m) * (-0.125 * (h * (M_m * M_m)))) / (d * (d * l)))
      	return tmp
      
      M_m = abs(M)
      D_m = abs(D)
      w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
      function code(w0, M_m, D_m, h, l, d)
      	tmp = 0.0
      	if (M_m <= 7.3e+74)
      		tmp = w0;
      	else
      		tmp = Float64(w0 * Float64(Float64(Float64(D_m * D_m) * Float64(-0.125 * Float64(h * Float64(M_m * M_m)))) / Float64(d * Float64(d * l))));
      	end
      	return tmp
      end
      
      M_m = abs(M);
      D_m = abs(D);
      w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
      function tmp_2 = code(w0, M_m, D_m, h, l, d)
      	tmp = 0.0;
      	if (M_m <= 7.3e+74)
      		tmp = w0;
      	else
      		tmp = w0 * (((D_m * D_m) * (-0.125 * (h * (M_m * M_m)))) / (d * (d * l)));
      	end
      	tmp_2 = tmp;
      end
      
      M_m = N[Abs[M], $MachinePrecision]
      D_m = N[Abs[D], $MachinePrecision]
      NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
      code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[M$95$m, 7.3e+74], w0, N[(w0 * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(-0.125 * N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      M_m = \left|M\right|
      \\
      D_m = \left|D\right|
      \\
      [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;M\_m \leq 7.3 \cdot 10^{+74}:\\
      \;\;\;\;w0\\
      
      \mathbf{else}:\\
      \;\;\;\;w0 \cdot \frac{\left(D\_m \cdot D\_m\right) \cdot \left(-0.125 \cdot \left(h \cdot \left(M\_m \cdot M\_m\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if M < 7.3000000000000005e74

        1. Initial program 84.7%

          \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
        2. Add Preprocessing
        3. Taylor expanded in M around 0

          \[\leadsto \color{blue}{w0} \]
        4. Step-by-step derivation
          1. Simplified72.9%

            \[\leadsto \color{blue}{w0} \]

          if 7.3000000000000005e74 < M

          1. Initial program 64.2%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Add Preprocessing
          3. Taylor expanded in w0 around 0

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
            2. sqrt-lowering-sqrt.f64N/A

              \[\leadsto w0 \cdot \color{blue}{\sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
            3. --lowering--.f64N/A

              \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
            4. associate-*r/N/A

              \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}}} \]
            5. /-lowering-/.f64N/A

              \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}}} \]
            6. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}}{{d}^{2} \cdot \ell}} \]
            7. associate-*r*N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
            8. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
            9. unpow2N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left({D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
            10. associate-*r*N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
            11. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
            12. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\color{blue}{\left({D}^{2} \cdot M\right)} \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
            13. unpow2N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
            14. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
            15. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
            16. unpow2N/A

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
            17. *-lowering-*.f6438.7

              \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
          5. Simplified38.7%

            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
          6. Taylor expanded in D around 0

            \[\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)} \]
          7. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto w0 \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} + 1\right)} \]
            2. *-commutativeN/A

              \[\leadsto w0 \cdot \left(\color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}} + 1\right) \]
            3. associate-/l*N/A

              \[\leadsto w0 \cdot \left(\color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} \cdot \frac{-1}{8} + 1\right) \]
            4. associate-*r*N/A

              \[\leadsto w0 \cdot \left(\color{blue}{{D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)} + 1\right) \]
            5. *-commutativeN/A

              \[\leadsto w0 \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} + 1\right) \]
            6. accelerator-lowering-fma.f64N/A

              \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)} \]
          8. Simplified16.8%

            \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
          9. Taylor expanded in D around inf

            \[\leadsto w0 \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)} \]
          10. Step-by-step derivation
            1. associate-*r/N/A

              \[\leadsto w0 \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto w0 \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}} \]
            3. *-commutativeN/A

              \[\leadsto w0 \cdot \frac{\frac{-1}{8} \cdot \color{blue}{\left(\left({M}^{2} \cdot h\right) \cdot {D}^{2}\right)}}{{d}^{2} \cdot \ell} \]
            4. associate-*r*N/A

              \[\leadsto w0 \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot h\right)\right) \cdot {D}^{2}}}{{d}^{2} \cdot \ell} \]
            5. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot h\right)\right) \cdot {D}^{2}}}{{d}^{2} \cdot \ell} \]
            6. *-commutativeN/A

              \[\leadsto w0 \cdot \frac{\color{blue}{\left(\left({M}^{2} \cdot h\right) \cdot \frac{-1}{8}\right)} \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
            7. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \frac{\color{blue}{\left(\left({M}^{2} \cdot h\right) \cdot \frac{-1}{8}\right)} \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
            8. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \frac{\left(\color{blue}{\left({M}^{2} \cdot h\right)} \cdot \frac{-1}{8}\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
            9. unpow2N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot h\right) \cdot \frac{-1}{8}\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
            10. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot h\right) \cdot \frac{-1}{8}\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
            11. unpow2N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(D \cdot D\right)}}{{d}^{2} \cdot \ell} \]
            12. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(D \cdot D\right)}}{{d}^{2} \cdot \ell} \]
            13. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \left(D \cdot D\right)}{\color{blue}{{d}^{2} \cdot \ell}} \]
            14. unpow2N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
            15. *-lowering-*.f6413.7

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
          11. Simplified13.7%

            \[\leadsto w0 \cdot \color{blue}{\frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}} \]
          12. Step-by-step derivation
            1. associate-*l*N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \left(D \cdot D\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}} \]
            2. *-commutativeN/A

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot \ell\right) \cdot d}} \]
            3. *-lowering-*.f64N/A

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot \ell\right) \cdot d}} \]
            4. *-lowering-*.f6416.8

              \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot \ell\right)} \cdot d} \]
          13. Applied egg-rr16.8%

            \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot \ell\right) \cdot d}} \]
        5. Recombined 2 regimes into one program.
        6. Final simplification65.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 7.3 \cdot 10^{+74}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \frac{\left(D \cdot D\right) \cdot \left(-0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 13: 72.4% accurate, 2.7× speedup?

        \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 5 \cdot 10^{+74}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot \left(h \cdot -0.125\right)\right)\right) \cdot \frac{D\_m}{\ell \cdot \left(d \cdot d\right)}\right)\\ \end{array} \end{array} \]
        M_m = (fabs.f64 M)
        D_m = (fabs.f64 D)
        NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
        (FPCore (w0 M_m D_m h l d)
         :precision binary64
         (if (<= M_m 5e+74)
           w0
           (* w0 (* (* (* M_m M_m) (* D_m (* h -0.125))) (/ D_m (* l (* d d)))))))
        M_m = fabs(M);
        D_m = fabs(D);
        assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
        double code(double w0, double M_m, double D_m, double h, double l, double d) {
        	double tmp;
        	if (M_m <= 5e+74) {
        		tmp = w0;
        	} else {
        		tmp = w0 * (((M_m * M_m) * (D_m * (h * -0.125))) * (D_m / (l * (d * d))));
        	}
        	return tmp;
        }
        
        M_m = abs(m)
        D_m = abs(d)
        NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
        real(8) function code(w0, m_m, d_m, h, l, d)
            real(8), intent (in) :: w0
            real(8), intent (in) :: m_m
            real(8), intent (in) :: d_m
            real(8), intent (in) :: h
            real(8), intent (in) :: l
            real(8), intent (in) :: d
            real(8) :: tmp
            if (m_m <= 5d+74) then
                tmp = w0
            else
                tmp = w0 * (((m_m * m_m) * (d_m * (h * (-0.125d0)))) * (d_m / (l * (d * d))))
            end if
            code = tmp
        end function
        
        M_m = Math.abs(M);
        D_m = Math.abs(D);
        assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
        public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
        	double tmp;
        	if (M_m <= 5e+74) {
        		tmp = w0;
        	} else {
        		tmp = w0 * (((M_m * M_m) * (D_m * (h * -0.125))) * (D_m / (l * (d * d))));
        	}
        	return tmp;
        }
        
        M_m = math.fabs(M)
        D_m = math.fabs(D)
        [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d])
        def code(w0, M_m, D_m, h, l, d):
        	tmp = 0
        	if M_m <= 5e+74:
        		tmp = w0
        	else:
        		tmp = w0 * (((M_m * M_m) * (D_m * (h * -0.125))) * (D_m / (l * (d * d))))
        	return tmp
        
        M_m = abs(M)
        D_m = abs(D)
        w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
        function code(w0, M_m, D_m, h, l, d)
        	tmp = 0.0
        	if (M_m <= 5e+74)
        		tmp = w0;
        	else
        		tmp = Float64(w0 * Float64(Float64(Float64(M_m * M_m) * Float64(D_m * Float64(h * -0.125))) * Float64(D_m / Float64(l * Float64(d * d)))));
        	end
        	return tmp
        end
        
        M_m = abs(M);
        D_m = abs(D);
        w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
        function tmp_2 = code(w0, M_m, D_m, h, l, d)
        	tmp = 0.0;
        	if (M_m <= 5e+74)
        		tmp = w0;
        	else
        		tmp = w0 * (((M_m * M_m) * (D_m * (h * -0.125))) * (D_m / (l * (d * d))));
        	end
        	tmp_2 = tmp;
        end
        
        M_m = N[Abs[M], $MachinePrecision]
        D_m = N[Abs[D], $MachinePrecision]
        NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
        code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := If[LessEqual[M$95$m, 5e+74], w0, N[(w0 * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * N[(D$95$m * N[(h * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        M_m = \left|M\right|
        \\
        D_m = \left|D\right|
        \\
        [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;M\_m \leq 5 \cdot 10^{+74}:\\
        \;\;\;\;w0\\
        
        \mathbf{else}:\\
        \;\;\;\;w0 \cdot \left(\left(\left(M\_m \cdot M\_m\right) \cdot \left(D\_m \cdot \left(h \cdot -0.125\right)\right)\right) \cdot \frac{D\_m}{\ell \cdot \left(d \cdot d\right)}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if M < 4.99999999999999963e74

          1. Initial program 84.7%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Add Preprocessing
          3. Taylor expanded in M around 0

            \[\leadsto \color{blue}{w0} \]
          4. Step-by-step derivation
            1. Simplified72.9%

              \[\leadsto \color{blue}{w0} \]

            if 4.99999999999999963e74 < M

            1. Initial program 64.2%

              \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
            2. Add Preprocessing
            3. Taylor expanded in w0 around 0

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
              2. sqrt-lowering-sqrt.f64N/A

                \[\leadsto w0 \cdot \color{blue}{\sqrt{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
              3. --lowering--.f64N/A

                \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
              4. associate-*r/N/A

                \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}}} \]
              5. /-lowering-/.f64N/A

                \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}}} \]
              6. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{1}{4} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}}{{d}^{2} \cdot \ell}} \]
              7. associate-*r*N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
              8. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \color{blue}{\left(\left({D}^{2} \cdot {M}^{2}\right) \cdot h\right)}}{{d}^{2} \cdot \ell}} \]
              9. unpow2N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left({D}^{2} \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
              10. associate-*r*N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
              11. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\color{blue}{\left(\left({D}^{2} \cdot M\right) \cdot M\right)} \cdot h\right)}{{d}^{2} \cdot \ell}} \]
              12. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\color{blue}{\left({D}^{2} \cdot M\right)} \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
              13. unpow2N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
              14. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\color{blue}{\left(D \cdot D\right)} \cdot M\right) \cdot M\right) \cdot h\right)}{{d}^{2} \cdot \ell}} \]
              15. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{{d}^{2} \cdot \ell}}} \]
              16. unpow2N/A

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{1}{4} \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
              17. *-lowering-*.f6438.7

                \[\leadsto w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}} \]
            5. Simplified38.7%

              \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
            6. Taylor expanded in D around 0

              \[\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)} \]
            7. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto w0 \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} + 1\right)} \]
              2. *-commutativeN/A

                \[\leadsto w0 \cdot \left(\color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}} + 1\right) \]
              3. associate-/l*N/A

                \[\leadsto w0 \cdot \left(\color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} \cdot \frac{-1}{8} + 1\right) \]
              4. associate-*r*N/A

                \[\leadsto w0 \cdot \left(\color{blue}{{D}^{2} \cdot \left(\frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)} + 1\right) \]
              5. *-commutativeN/A

                \[\leadsto w0 \cdot \left({D}^{2} \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}\right)} + 1\right) \]
              6. accelerator-lowering-fma.f64N/A

                \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot h}{{d}^{2} \cdot \ell}, 1\right)} \]
            8. Simplified16.8%

              \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(-0.125 \cdot \left(M \cdot M\right)\right) \cdot h}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
            9. Taylor expanded in D around inf

              \[\leadsto w0 \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)} \]
            10. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto w0 \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}} \]
              2. /-lowering-/.f64N/A

                \[\leadsto w0 \cdot \color{blue}{\frac{\frac{-1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot \ell}} \]
              3. *-commutativeN/A

                \[\leadsto w0 \cdot \frac{\frac{-1}{8} \cdot \color{blue}{\left(\left({M}^{2} \cdot h\right) \cdot {D}^{2}\right)}}{{d}^{2} \cdot \ell} \]
              4. associate-*r*N/A

                \[\leadsto w0 \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot h\right)\right) \cdot {D}^{2}}}{{d}^{2} \cdot \ell} \]
              5. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \frac{\color{blue}{\left(\frac{-1}{8} \cdot \left({M}^{2} \cdot h\right)\right) \cdot {D}^{2}}}{{d}^{2} \cdot \ell} \]
              6. *-commutativeN/A

                \[\leadsto w0 \cdot \frac{\color{blue}{\left(\left({M}^{2} \cdot h\right) \cdot \frac{-1}{8}\right)} \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
              7. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \frac{\color{blue}{\left(\left({M}^{2} \cdot h\right) \cdot \frac{-1}{8}\right)} \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
              8. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \frac{\left(\color{blue}{\left({M}^{2} \cdot h\right)} \cdot \frac{-1}{8}\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
              9. unpow2N/A

                \[\leadsto w0 \cdot \frac{\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot h\right) \cdot \frac{-1}{8}\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
              10. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \frac{\left(\left(\color{blue}{\left(M \cdot M\right)} \cdot h\right) \cdot \frac{-1}{8}\right) \cdot {D}^{2}}{{d}^{2} \cdot \ell} \]
              11. unpow2N/A

                \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(D \cdot D\right)}}{{d}^{2} \cdot \ell} \]
              12. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \color{blue}{\left(D \cdot D\right)}}{{d}^{2} \cdot \ell} \]
              13. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \left(D \cdot D\right)}{\color{blue}{{d}^{2} \cdot \ell}} \]
              14. unpow2N/A

                \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
              15. *-lowering-*.f6413.7

                \[\leadsto w0 \cdot \frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125\right) \cdot \left(D \cdot D\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
            11. Simplified13.7%

              \[\leadsto w0 \cdot \color{blue}{\frac{\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot -0.125\right) \cdot \left(D \cdot D\right)}{\left(d \cdot d\right) \cdot \ell}} \]
            12. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto w0 \cdot \frac{\color{blue}{\left(\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot D\right) \cdot D}}{\left(d \cdot d\right) \cdot \ell} \]
              2. *-commutativeN/A

                \[\leadsto w0 \cdot \frac{\left(\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot D\right) \cdot D}{\color{blue}{\ell \cdot \left(d \cdot d\right)}} \]
              3. associate-/l*N/A

                \[\leadsto w0 \cdot \color{blue}{\left(\left(\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right)} \]
              4. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \color{blue}{\left(\left(\left(\left(\left(M \cdot M\right) \cdot h\right) \cdot \frac{-1}{8}\right) \cdot D\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right)} \]
              5. associate-*l*N/A

                \[\leadsto w0 \cdot \left(\left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(h \cdot \frac{-1}{8}\right)\right)} \cdot D\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right) \]
              6. associate-*l*N/A

                \[\leadsto w0 \cdot \left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(h \cdot \frac{-1}{8}\right) \cdot D\right)\right)} \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \left(\color{blue}{\left(\left(M \cdot M\right) \cdot \left(\left(h \cdot \frac{-1}{8}\right) \cdot D\right)\right)} \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right) \]
              8. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \left(\left(\color{blue}{\left(M \cdot M\right)} \cdot \left(\left(h \cdot \frac{-1}{8}\right) \cdot D\right)\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right) \]
              9. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \left(\left(\left(M \cdot M\right) \cdot \color{blue}{\left(\left(h \cdot \frac{-1}{8}\right) \cdot D\right)}\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right) \]
              10. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \left(\left(\left(M \cdot M\right) \cdot \left(\color{blue}{\left(h \cdot \frac{-1}{8}\right)} \cdot D\right)\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right) \]
              11. /-lowering-/.f64N/A

                \[\leadsto w0 \cdot \left(\left(\left(M \cdot M\right) \cdot \left(\left(h \cdot \frac{-1}{8}\right) \cdot D\right)\right) \cdot \color{blue}{\frac{D}{\ell \cdot \left(d \cdot d\right)}}\right) \]
              12. *-lowering-*.f64N/A

                \[\leadsto w0 \cdot \left(\left(\left(M \cdot M\right) \cdot \left(\left(h \cdot \frac{-1}{8}\right) \cdot D\right)\right) \cdot \frac{D}{\color{blue}{\ell \cdot \left(d \cdot d\right)}}\right) \]
              13. *-lowering-*.f6417.1

                \[\leadsto w0 \cdot \left(\left(\left(M \cdot M\right) \cdot \left(\left(h \cdot -0.125\right) \cdot D\right)\right) \cdot \frac{D}{\ell \cdot \color{blue}{\left(d \cdot d\right)}}\right) \]
            13. Applied egg-rr17.1%

              \[\leadsto w0 \cdot \color{blue}{\left(\left(\left(M \cdot M\right) \cdot \left(\left(h \cdot -0.125\right) \cdot D\right)\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right)} \]
          5. Recombined 2 regimes into one program.
          6. Final simplification65.9%

            \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 5 \cdot 10^{+74}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(\left(\left(M \cdot M\right) \cdot \left(D \cdot \left(h \cdot -0.125\right)\right)\right) \cdot \frac{D}{\ell \cdot \left(d \cdot d\right)}\right)\\ \end{array} \]
          7. Add Preprocessing

          Alternative 14: 68.6% accurate, 157.0× speedup?

          \[\begin{array}{l} M_m = \left|M\right| \\ D_m = \left|D\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ w0 \end{array} \]
          M_m = (fabs.f64 M)
          D_m = (fabs.f64 D)
          NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
          (FPCore (w0 M_m D_m h l d) :precision binary64 w0)
          M_m = fabs(M);
          D_m = fabs(D);
          assert(w0 < M_m && M_m < D_m && D_m < h && h < l && l < d);
          double code(double w0, double M_m, double D_m, double h, double l, double d) {
          	return w0;
          }
          
          M_m = abs(m)
          D_m = abs(d)
          NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
          real(8) function code(w0, m_m, d_m, h, l, d)
              real(8), intent (in) :: w0
              real(8), intent (in) :: m_m
              real(8), intent (in) :: d_m
              real(8), intent (in) :: h
              real(8), intent (in) :: l
              real(8), intent (in) :: d
              code = w0
          end function
          
          M_m = Math.abs(M);
          D_m = Math.abs(D);
          assert w0 < M_m && M_m < D_m && D_m < h && h < l && l < d;
          public static double code(double w0, double M_m, double D_m, double h, double l, double d) {
          	return w0;
          }
          
          M_m = math.fabs(M)
          D_m = math.fabs(D)
          [w0, M_m, D_m, h, l, d] = sort([w0, M_m, D_m, h, l, d])
          def code(w0, M_m, D_m, h, l, d):
          	return w0
          
          M_m = abs(M)
          D_m = abs(D)
          w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
          function code(w0, M_m, D_m, h, l, d)
          	return w0
          end
          
          M_m = abs(M);
          D_m = abs(D);
          w0, M_m, D_m, h, l, d = num2cell(sort([w0, M_m, D_m, h, l, d])){:}
          function tmp = code(w0, M_m, D_m, h, l, d)
          	tmp = w0;
          end
          
          M_m = N[Abs[M], $MachinePrecision]
          D_m = N[Abs[D], $MachinePrecision]
          NOTE: w0, M_m, D_m, h, l, and d should be sorted in increasing order before calling this function.
          code[w0_, M$95$m_, D$95$m_, h_, l_, d_] := w0
          
          \begin{array}{l}
          M_m = \left|M\right|
          \\
          D_m = \left|D\right|
          \\
          [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
          \\
          w0
          \end{array}
          
          Derivation
          1. Initial program 82.1%

            \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
          2. Add Preprocessing
          3. Taylor expanded in M around 0

            \[\leadsto \color{blue}{w0} \]
          4. Step-by-step derivation
            1. Simplified70.7%

              \[\leadsto \color{blue}{w0} \]
            2. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2024197 
            (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))))))