Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.4% → 88.3%
Time: 15.8s
Alternatives: 15
Speedup: 1.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 81.4% accurate, 1.0× speedup?

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

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

Alternative 1: 88.3% accurate, 1.6× speedup?

\[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;M\_m \leq 2 \cdot 10^{-90}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{2 \cdot d}, \frac{\frac{\left(M\_m \cdot D\_m\right) \cdot h}{2 \cdot d}}{-\ell}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 + \frac{\frac{D\_m}{d} \cdot \left(\left(M\_m \cdot M\_m\right) \cdot 0.25\right)}{\ell} \cdot \frac{\frac{D\_m}{d}}{\frac{-1}{h}}}\\ \end{array} \end{array} \]
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 2e-90)
   (*
    w0
    (sqrt
     (fma
      (/ (* M_m D_m) (* 2.0 d))
      (/ (/ (* (* M_m D_m) h) (* 2.0 d)) (- l))
      1.0)))
   (*
    w0
    (sqrt
     (+
      1.0
      (*
       (/ (* (/ D_m d) (* (* M_m M_m) 0.25)) l)
       (/ (/ D_m d) (/ -1.0 h))))))))
D_m = fabs(D);
M_m = fabs(M);
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 <= 2e-90) {
		tmp = w0 * sqrt(fma(((M_m * D_m) / (2.0 * d)), ((((M_m * D_m) * h) / (2.0 * d)) / -l), 1.0));
	} else {
		tmp = w0 * sqrt((1.0 + ((((D_m / d) * ((M_m * M_m) * 0.25)) / l) * ((D_m / d) / (-1.0 / h)))));
	}
	return tmp;
}
D_m = abs(D)
M_m = abs(M)
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 <= 2e-90)
		tmp = Float64(w0 * sqrt(fma(Float64(Float64(M_m * D_m) / Float64(2.0 * d)), Float64(Float64(Float64(Float64(M_m * D_m) * h) / Float64(2.0 * d)) / Float64(-l)), 1.0)));
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 + Float64(Float64(Float64(Float64(D_m / d) * Float64(Float64(M_m * M_m) * 0.25)) / l) * Float64(Float64(D_m / d) / Float64(-1.0 / h))))));
	end
	return tmp
end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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, 2e-90], N[(w0 * N[Sqrt[N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * h), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] / (-l)), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 + N[(N[(N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] / N[(-1.0 / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 2 \cdot 10^{-90}:\\
\;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{2 \cdot d}, \frac{\frac{\left(M\_m \cdot D\_m\right) \cdot h}{2 \cdot d}}{-\ell}, 1\right)}\\

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


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

    1. Initial program 82.9%

      \[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. lift-*.f64N/A

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) + 1}} \]
    4. Applied egg-rr90.3%

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

    if 1.99999999999999999e-90 < M

    1. Initial program 77.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. lift-*.f64N/A

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}} \cdot \frac{h}{\ell}} \]
      5. 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}}}} \]
      6. 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}}}} \]
      7. lift-pow.f64N/A

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}}{\frac{\ell}{h}}} \]
      8. 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}}} \]
      9. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.9% accurate, 0.4× speedup?

\[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} t_0 := {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+163}:\\ \;\;\;\;D\_m \cdot \left(w0 \cdot \sqrt{\frac{M\_m \cdot \left(-0.25 \cdot \left(M\_m \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\right)\\ \mathbf{elif}\;t\_0 \leq -4 \cdot 10^{-5}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25 \cdot \frac{h}{d \cdot \ell}, M\_m \cdot \frac{D\_m \cdot \left(M\_m \cdot D\_m\right)}{d}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
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 (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l))))
   (if (<= t_0 -2e+163)
     (* D_m (* w0 (sqrt (/ (* M_m (* -0.25 (* M_m h))) (* d (* d l))))))
     (if (<= t_0 -4e-5)
       (*
        w0
        (sqrt
         (fma (* -0.25 (/ h (* d l))) (* M_m (/ (* D_m (* M_m D_m)) d)) 1.0)))
       w0))))
D_m = fabs(D);
M_m = fabs(M);
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 = pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l);
	double tmp;
	if (t_0 <= -2e+163) {
		tmp = D_m * (w0 * sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))));
	} else if (t_0 <= -4e-5) {
		tmp = w0 * sqrt(fma((-0.25 * (h / (d * l))), (M_m * ((D_m * (M_m * D_m)) / d)), 1.0));
	} else {
		tmp = w0;
	}
	return tmp;
}
D_m = abs(D)
M_m = abs(M)
w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
function code(w0, M_m, D_m, h, l, d)
	t_0 = Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))
	tmp = 0.0
	if (t_0 <= -2e+163)
		tmp = Float64(D_m * Float64(w0 * sqrt(Float64(Float64(M_m * Float64(-0.25 * Float64(M_m * h))) / Float64(d * Float64(d * l))))));
	elseif (t_0 <= -4e-5)
		tmp = Float64(w0 * sqrt(fma(Float64(-0.25 * Float64(h / Float64(d * l))), Float64(M_m * Float64(Float64(D_m * Float64(M_m * D_m)) / d)), 1.0)));
	else
		tmp = w0;
	end
	return tmp
end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $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[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+163], N[(D$95$m * N[(w0 * N[Sqrt[N[(N[(M$95$m * N[(-0.25 * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -4e-5], N[(w0 * N[Sqrt[N[(N[(-0.25 * N[(h / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M$95$m * N[(N[(D$95$m * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
\\
\begin{array}{l}
t_0 := {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+163}:\\
\;\;\;\;D\_m \cdot \left(w0 \cdot \sqrt{\frac{M\_m \cdot \left(-0.25 \cdot \left(M\_m \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\right)\\

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

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


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

    1. Initial program 60.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
      11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e163 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.00000000000000033e-5

    1. Initial program 99.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. lower-*.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. lower-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. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000033e-5 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))

    1. Initial program 89.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 M around 0

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

        \[\leadsto w0 \cdot \color{blue}{1} \]
      2. Step-by-step derivation
        1. *-rgt-identity97.0

          \[\leadsto \color{blue}{w0} \]
      3. Applied egg-rr97.0%

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

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

    Alternative 3: 84.8% accurate, 0.4× speedup?

    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} t_0 := {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+163}:\\ \;\;\;\;D\_m \cdot \left(w0 \cdot \sqrt{\frac{M\_m \cdot \left(-0.25 \cdot \left(M\_m \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\right)\\ \mathbf{elif}\;t\_0 \leq -40:\\ \;\;\;\;w0 \cdot \sqrt{\left(-0.25 \cdot \frac{h}{d \cdot \ell}\right) \cdot \left(M\_m \cdot \frac{D\_m \cdot \left(M\_m \cdot D\_m\right)}{d}\right)}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
    D_m = (fabs.f64 D)
    M_m = (fabs.f64 M)
    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 (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l))))
       (if (<= t_0 -2e+163)
         (* D_m (* w0 (sqrt (/ (* M_m (* -0.25 (* M_m h))) (* d (* d l))))))
         (if (<= t_0 -40.0)
           (*
            w0
            (sqrt (* (* -0.25 (/ h (* d l))) (* M_m (/ (* D_m (* M_m D_m)) d)))))
           w0))))
    D_m = fabs(D);
    M_m = fabs(M);
    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 = pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l);
    	double tmp;
    	if (t_0 <= -2e+163) {
    		tmp = D_m * (w0 * sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))));
    	} else if (t_0 <= -40.0) {
    		tmp = w0 * sqrt(((-0.25 * (h / (d * l))) * (M_m * ((D_m * (M_m * D_m)) / d))));
    	} else {
    		tmp = w0;
    	}
    	return tmp;
    }
    
    D_m = abs(d)
    M_m = abs(m)
    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)) ** 2.0d0) * (h / l)
        if (t_0 <= (-2d+163)) then
            tmp = d_m * (w0 * sqrt(((m_m * ((-0.25d0) * (m_m * h))) / (d * (d * l)))))
        else if (t_0 <= (-40.0d0)) then
            tmp = w0 * sqrt((((-0.25d0) * (h / (d * l))) * (m_m * ((d_m * (m_m * d_m)) / d))))
        else
            tmp = w0
        end if
        code = tmp
    end function
    
    D_m = Math.abs(D);
    M_m = Math.abs(M);
    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 = Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l);
    	double tmp;
    	if (t_0 <= -2e+163) {
    		tmp = D_m * (w0 * Math.sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))));
    	} else if (t_0 <= -40.0) {
    		tmp = w0 * Math.sqrt(((-0.25 * (h / (d * l))) * (M_m * ((D_m * (M_m * D_m)) / d))));
    	} else {
    		tmp = w0;
    	}
    	return tmp;
    }
    
    D_m = math.fabs(D)
    M_m = math.fabs(M)
    [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 = math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)
    	tmp = 0
    	if t_0 <= -2e+163:
    		tmp = D_m * (w0 * math.sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))))
    	elif t_0 <= -40.0:
    		tmp = w0 * math.sqrt(((-0.25 * (h / (d * l))) * (M_m * ((D_m * (M_m * D_m)) / d))))
    	else:
    		tmp = w0
    	return tmp
    
    D_m = abs(D)
    M_m = abs(M)
    w0, M_m, D_m, h, l, d = sort([w0, M_m, D_m, h, l, d])
    function code(w0, M_m, D_m, h, l, d)
    	t_0 = Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))
    	tmp = 0.0
    	if (t_0 <= -2e+163)
    		tmp = Float64(D_m * Float64(w0 * sqrt(Float64(Float64(M_m * Float64(-0.25 * Float64(M_m * h))) / Float64(d * Float64(d * l))))));
    	elseif (t_0 <= -40.0)
    		tmp = Float64(w0 * sqrt(Float64(Float64(-0.25 * Float64(h / Float64(d * l))) * Float64(M_m * Float64(Float64(D_m * Float64(M_m * D_m)) / d)))));
    	else
    		tmp = w0;
    	end
    	return tmp
    end
    
    D_m = abs(D);
    M_m = abs(M);
    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)) ^ 2.0) * (h / l);
    	tmp = 0.0;
    	if (t_0 <= -2e+163)
    		tmp = D_m * (w0 * sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))));
    	elseif (t_0 <= -40.0)
    		tmp = w0 * sqrt(((-0.25 * (h / (d * l))) * (M_m * ((D_m * (M_m * D_m)) / d))));
    	else
    		tmp = w0;
    	end
    	tmp_2 = tmp;
    end
    
    D_m = N[Abs[D], $MachinePrecision]
    M_m = N[Abs[M], $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[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+163], N[(D$95$m * N[(w0 * N[Sqrt[N[(N[(M$95$m * N[(-0.25 * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -40.0], N[(w0 * N[Sqrt[N[(N[(-0.25 * N[(h / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M$95$m * N[(N[(D$95$m * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]]]
    
    \begin{array}{l}
    D_m = \left|D\right|
    \\
    M_m = \left|M\right|
    \\
    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
    \\
    \begin{array}{l}
    t_0 := {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
    \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+163}:\\
    \;\;\;\;D\_m \cdot \left(w0 \cdot \sqrt{\frac{M\_m \cdot \left(-0.25 \cdot \left(M\_m \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\right)\\
    
    \mathbf{elif}\;t\_0 \leq -40:\\
    \;\;\;\;w0 \cdot \sqrt{\left(-0.25 \cdot \frac{h}{d \cdot \ell}\right) \cdot \left(M\_m \cdot \frac{D\_m \cdot \left(M\_m \cdot D\_m\right)}{d}\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;w0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -1.9999999999999999e163

      1. Initial program 60.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
        11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.9999999999999999e163 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -40

      1. Initial program 99.4%

        \[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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
        11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 89.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 M around 0

        \[\leadsto w0 \cdot \color{blue}{1} \]
      4. Step-by-step derivation
        1. Simplified96.7%

          \[\leadsto w0 \cdot \color{blue}{1} \]
        2. Step-by-step derivation
          1. *-rgt-identity96.7

            \[\leadsto \color{blue}{w0} \]
        3. Applied egg-rr96.7%

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

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

      Alternative 4: 87.9% accurate, 0.7× speedup?

      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\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}\;{t\_0}^{2} \cdot \frac{h}{\ell} \leq 2 \cdot 10^{-14}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{h}{\ell} \cdot \frac{M\_m \cdot D\_m}{d \cdot -2}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot \left(\left(M\_m \cdot M\_m\right) \cdot 0.25\right)}{\ell}\right)}\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      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 (<= (* (pow t_0 2.0) (/ h l)) 2e-14)
           (* w0 (sqrt (fma t_0 (* (/ h l) (/ (* M_m D_m) (* d -2.0))) 1.0)))
           (*
            w0
            (sqrt
             (-
              1.0
              (* (/ D_m d) (* (/ D_m d) (/ (* h (* (* M_m M_m) 0.25)) l)))))))))
      D_m = fabs(D);
      M_m = fabs(M);
      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 ((pow(t_0, 2.0) * (h / l)) <= 2e-14) {
      		tmp = w0 * sqrt(fma(t_0, ((h / l) * ((M_m * D_m) / (d * -2.0))), 1.0));
      	} else {
      		tmp = w0 * sqrt((1.0 - ((D_m / d) * ((D_m / d) * ((h * ((M_m * M_m) * 0.25)) / l)))));
      	}
      	return tmp;
      }
      
      D_m = abs(D)
      M_m = abs(M)
      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((t_0 ^ 2.0) * Float64(h / l)) <= 2e-14)
      		tmp = Float64(w0 * sqrt(fma(t_0, Float64(Float64(h / l) * Float64(Float64(M_m * D_m) / Float64(d * -2.0))), 1.0)));
      	else
      		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / d) * Float64(Float64(D_m / d) * Float64(Float64(h * Float64(Float64(M_m * M_m) * 0.25)) / l))))));
      	end
      	return tmp
      end
      
      D_m = N[Abs[D], $MachinePrecision]
      M_m = N[Abs[M], $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[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], 2e-14], N[(w0 * N[Sqrt[N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(h * N[(N[(M$95$m * M$95$m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\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}\;{t\_0}^{2} \cdot \frac{h}{\ell} \leq 2 \cdot 10^{-14}:\\
      \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{h}{\ell} \cdot \frac{M\_m \cdot D\_m}{d \cdot -2}, 1\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot \left(\left(M\_m \cdot M\_m\right) \cdot 0.25\right)}{\ell}\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < 2e-14

        1. Initial program 87.9%

          \[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. lift-*.f64N/A

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

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

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

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{\left(\mathsf{neg}\left(\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\right)\right) + 1} \]
          10. distribute-lft-neg-inN/A

            \[\leadsto w0 \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell}} + 1} \]
          11. lift-pow.f64N/A

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

            \[\leadsto w0 \cdot \sqrt{\left(\mathsf{neg}\left(\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}\right)\right) \cdot \frac{h}{\ell} + 1} \]
          13. distribute-rgt-neg-inN/A

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

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

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

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

        1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\frac{D}{d} \cdot D}{d} \cdot \left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{\frac{1}{2}}{2}\right)\right) \cdot \frac{h}{\ell}} \]
          18. metadata-eval0.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 5: 86.3% accurate, 0.7× speedup?

      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -4 \cdot 10^{-5}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D\_m \cdot \frac{M\_m}{2 \cdot d}, h \cdot \frac{M\_m \cdot D\_m}{\ell \cdot \left(d \cdot -2\right)}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      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 (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -4e-5)
         (*
          w0
          (sqrt
           (fma
            (* D_m (/ M_m (* 2.0 d)))
            (* h (/ (* M_m D_m) (* l (* d -2.0))))
            1.0)))
         w0))
      D_m = fabs(D);
      M_m = fabs(M);
      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 ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -4e-5) {
      		tmp = w0 * sqrt(fma((D_m * (M_m / (2.0 * d))), (h * ((M_m * D_m) / (l * (d * -2.0)))), 1.0));
      	} else {
      		tmp = w0;
      	}
      	return tmp;
      }
      
      D_m = abs(D)
      M_m = abs(M)
      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((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -4e-5)
      		tmp = Float64(w0 * sqrt(fma(Float64(D_m * Float64(M_m / Float64(2.0 * d))), Float64(h * Float64(Float64(M_m * D_m) / Float64(l * Float64(d * -2.0)))), 1.0)));
      	else
      		tmp = w0;
      	end
      	return tmp
      end
      
      D_m = N[Abs[D], $MachinePrecision]
      M_m = N[Abs[M], $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[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -4e-5], N[(w0 * N[Sqrt[N[(N[(D$95$m * N[(M$95$m / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(l * N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\right|
      \\
      [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -4 \cdot 10^{-5}:\\
      \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D\_m \cdot \frac{M\_m}{2 \cdot d}, h \cdot \frac{M\_m \cdot D\_m}{\ell \cdot \left(d \cdot -2\right)}, 1\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;w0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.00000000000000033e-5

        1. Initial program 65.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
          11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\color{blue}{D \cdot \frac{M}{2 \cdot d}}, h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)}, 1\right)} \]
          5. lower-/.f6467.9

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

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

        if -4.00000000000000033e-5 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))

        1. Initial program 89.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 M around 0

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

            \[\leadsto w0 \cdot \color{blue}{1} \]
          2. Step-by-step derivation
            1. *-rgt-identity97.0

              \[\leadsto \color{blue}{w0} \]
          3. Applied egg-rr97.0%

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

        Alternative 6: 83.9% accurate, 0.7× speedup?

        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -4 \cdot 10^{-5}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{-0.25 \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right)}{d}, \frac{h}{d \cdot \ell}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
        D_m = (fabs.f64 D)
        M_m = (fabs.f64 M)
        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 (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -4e-5)
           (*
            w0
            (sqrt (fma (/ (* -0.25 (* (* M_m D_m) (* M_m D_m))) d) (/ h (* d l)) 1.0)))
           w0))
        D_m = fabs(D);
        M_m = fabs(M);
        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 ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -4e-5) {
        		tmp = w0 * sqrt(fma(((-0.25 * ((M_m * D_m) * (M_m * D_m))) / d), (h / (d * l)), 1.0));
        	} else {
        		tmp = w0;
        	}
        	return tmp;
        }
        
        D_m = abs(D)
        M_m = abs(M)
        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((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -4e-5)
        		tmp = Float64(w0 * sqrt(fma(Float64(Float64(-0.25 * Float64(Float64(M_m * D_m) * Float64(M_m * D_m))) / d), Float64(h / Float64(d * l)), 1.0)));
        	else
        		tmp = w0;
        	end
        	return tmp
        end
        
        D_m = N[Abs[D], $MachinePrecision]
        M_m = N[Abs[M], $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[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -4e-5], N[(w0 * N[Sqrt[N[(N[(N[(-0.25 * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(h / N[(d * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
        
        \begin{array}{l}
        D_m = \left|D\right|
        \\
        M_m = \left|M\right|
        \\
        [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -4 \cdot 10^{-5}:\\
        \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{-0.25 \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right)}{d}, \frac{h}{d \cdot \ell}, 1\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;w0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -4.00000000000000033e-5

          1. Initial program 65.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. lower-*.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. lower-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. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -4.00000000000000033e-5 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l))

          1. Initial program 89.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 M around 0

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

              \[\leadsto w0 \cdot \color{blue}{1} \]
            2. Step-by-step derivation
              1. *-rgt-identity97.0

                \[\leadsto \color{blue}{w0} \]
            3. Applied egg-rr97.0%

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

          Alternative 7: 83.8% accurate, 0.7× speedup?

          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -40:\\ \;\;\;\;w0 \cdot \sqrt{\frac{-0.25 \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right)}{d} \cdot \frac{h}{d \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
          D_m = (fabs.f64 D)
          M_m = (fabs.f64 M)
          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 (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -40.0)
             (* w0 (sqrt (* (/ (* -0.25 (* (* M_m D_m) (* M_m D_m))) d) (/ h (* d l)))))
             w0))
          D_m = fabs(D);
          M_m = fabs(M);
          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 ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -40.0) {
          		tmp = w0 * sqrt((((-0.25 * ((M_m * D_m) * (M_m * D_m))) / d) * (h / (d * l))));
          	} else {
          		tmp = w0;
          	}
          	return tmp;
          }
          
          D_m = abs(d)
          M_m = abs(m)
          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 * d_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-40.0d0)) then
                  tmp = w0 * sqrt(((((-0.25d0) * ((m_m * d_m) * (m_m * d_m))) / d) * (h / (d * l))))
              else
                  tmp = w0
              end if
              code = tmp
          end function
          
          D_m = Math.abs(D);
          M_m = Math.abs(M);
          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 ((Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -40.0) {
          		tmp = w0 * Math.sqrt((((-0.25 * ((M_m * D_m) * (M_m * D_m))) / d) * (h / (d * l))));
          	} else {
          		tmp = w0;
          	}
          	return tmp;
          }
          
          D_m = math.fabs(D)
          M_m = math.fabs(M)
          [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 (math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -40.0:
          		tmp = w0 * math.sqrt((((-0.25 * ((M_m * D_m) * (M_m * D_m))) / d) * (h / (d * l))))
          	else:
          		tmp = w0
          	return tmp
          
          D_m = abs(D)
          M_m = abs(M)
          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((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -40.0)
          		tmp = Float64(w0 * sqrt(Float64(Float64(Float64(-0.25 * Float64(Float64(M_m * D_m) * Float64(M_m * D_m))) / d) * Float64(h / Float64(d * l)))));
          	else
          		tmp = w0;
          	end
          	return tmp
          end
          
          D_m = abs(D);
          M_m = abs(M);
          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 * D_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -40.0)
          		tmp = w0 * sqrt((((-0.25 * ((M_m * D_m) * (M_m * D_m))) / d) * (h / (d * l))));
          	else
          		tmp = w0;
          	end
          	tmp_2 = tmp;
          end
          
          D_m = N[Abs[D], $MachinePrecision]
          M_m = N[Abs[M], $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[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -40.0], N[(w0 * N[Sqrt[N[(N[(N[(-0.25 * N[(N[(M$95$m * D$95$m), $MachinePrecision] * N[(M$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(h / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
          
          \begin{array}{l}
          D_m = \left|D\right|
          \\
          M_m = \left|M\right|
          \\
          [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -40:\\
          \;\;\;\;w0 \cdot \sqrt{\frac{-0.25 \cdot \left(\left(M\_m \cdot D\_m\right) \cdot \left(M\_m \cdot D\_m\right)\right)}{d} \cdot \frac{h}{d \cdot \ell}}\\
          
          \mathbf{else}:\\
          \;\;\;\;w0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -40

            1. Initial program 65.4%

              \[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 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}}} \]
            4. Step-by-step derivation
              1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 89.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 M around 0

              \[\leadsto w0 \cdot \color{blue}{1} \]
            4. Step-by-step derivation
              1. Simplified96.7%

                \[\leadsto w0 \cdot \color{blue}{1} \]
              2. Step-by-step derivation
                1. *-rgt-identity96.7

                  \[\leadsto \color{blue}{w0} \]
              3. Applied egg-rr96.7%

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

            Alternative 8: 84.1% accurate, 0.8× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -40:\\ \;\;\;\;D\_m \cdot \left(w0 \cdot \sqrt{\frac{M\_m \cdot \left(-0.25 \cdot \left(M\_m \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
            D_m = (fabs.f64 D)
            M_m = (fabs.f64 M)
            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 (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -40.0)
               (* D_m (* w0 (sqrt (/ (* M_m (* -0.25 (* M_m h))) (* d (* d l))))))
               w0))
            D_m = fabs(D);
            M_m = fabs(M);
            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 ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -40.0) {
            		tmp = D_m * (w0 * sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))));
            	} else {
            		tmp = w0;
            	}
            	return tmp;
            }
            
            D_m = abs(d)
            M_m = abs(m)
            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 * d_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-40.0d0)) then
                    tmp = d_m * (w0 * sqrt(((m_m * ((-0.25d0) * (m_m * h))) / (d * (d * l)))))
                else
                    tmp = w0
                end if
                code = tmp
            end function
            
            D_m = Math.abs(D);
            M_m = Math.abs(M);
            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 ((Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -40.0) {
            		tmp = D_m * (w0 * Math.sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))));
            	} else {
            		tmp = w0;
            	}
            	return tmp;
            }
            
            D_m = math.fabs(D)
            M_m = math.fabs(M)
            [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 (math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -40.0:
            		tmp = D_m * (w0 * math.sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))))
            	else:
            		tmp = w0
            	return tmp
            
            D_m = abs(D)
            M_m = abs(M)
            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((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -40.0)
            		tmp = Float64(D_m * Float64(w0 * sqrt(Float64(Float64(M_m * Float64(-0.25 * Float64(M_m * h))) / Float64(d * Float64(d * l))))));
            	else
            		tmp = w0;
            	end
            	return tmp
            end
            
            D_m = abs(D);
            M_m = abs(M);
            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 * D_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -40.0)
            		tmp = D_m * (w0 * sqrt(((M_m * (-0.25 * (M_m * h))) / (d * (d * l)))));
            	else
            		tmp = w0;
            	end
            	tmp_2 = tmp;
            end
            
            D_m = N[Abs[D], $MachinePrecision]
            M_m = N[Abs[M], $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[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -40.0], N[(D$95$m * N[(w0 * N[Sqrt[N[(N[(M$95$m * N[(-0.25 * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -40:\\
            \;\;\;\;D\_m \cdot \left(w0 \cdot \sqrt{\frac{M\_m \cdot \left(-0.25 \cdot \left(M\_m \cdot h\right)\right)}{d \cdot \left(d \cdot \ell\right)}}\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;w0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -40

              1. Initial program 65.4%

                \[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. lift-*.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto w0 \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) + 1}} \]
              4. Applied egg-rr72.3%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
                11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 89.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 M around 0

                \[\leadsto w0 \cdot \color{blue}{1} \]
              4. Step-by-step derivation
                1. Simplified96.7%

                  \[\leadsto w0 \cdot \color{blue}{1} \]
                2. Step-by-step derivation
                  1. *-rgt-identity96.7

                    \[\leadsto \color{blue}{w0} \]
                3. Applied egg-rr96.7%

                  \[\leadsto \color{blue}{w0} \]
              5. Recombined 2 regimes into one program.
              6. Final simplification74.1%

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

              Alternative 9: 78.0% accurate, 0.8× speedup?

              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1 \cdot 10^{+182}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{h}{d \cdot \left(d \cdot \ell\right)}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
              D_m = (fabs.f64 D)
              M_m = (fabs.f64 M)
              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 (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -1e+182)
                 (* w0 (fma (* D_m D_m) (* (* (* M_m M_m) -0.125) (/ h (* d (* d l)))) 1.0))
                 w0))
              D_m = fabs(D);
              M_m = fabs(M);
              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 ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -1e+182) {
              		tmp = w0 * fma((D_m * D_m), (((M_m * M_m) * -0.125) * (h / (d * (d * l)))), 1.0);
              	} else {
              		tmp = w0;
              	}
              	return tmp;
              }
              
              D_m = abs(D)
              M_m = abs(M)
              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((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -1e+182)
              		tmp = Float64(w0 * fma(Float64(D_m * D_m), Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(h / Float64(d * Float64(d * l)))), 1.0));
              	else
              		tmp = w0;
              	end
              	return tmp
              end
              
              D_m = N[Abs[D], $MachinePrecision]
              M_m = N[Abs[M], $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[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -1e+182], N[(w0 * N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(h / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], w0]
              
              \begin{array}{l}
              D_m = \left|D\right|
              \\
              M_m = \left|M\right|
              \\
              [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
              \\
              \begin{array}{l}
              \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1 \cdot 10^{+182}:\\
              \;\;\;\;w0 \cdot \mathsf{fma}\left(D\_m \cdot D\_m, \left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{h}{d \cdot \left(d \cdot \ell\right)}, 1\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;w0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -1.0000000000000001e182

                1. Initial program 60.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
                  11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \color{blue}{h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)}}, 1\right)} \]
                7. Taylor expanded in M 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)} \]
                8. 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. lower-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)} \]
                9. Simplified45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 89.6%

                  \[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 w0 \cdot \color{blue}{1} \]
                4. Step-by-step derivation
                  1. Simplified91.5%

                    \[\leadsto w0 \cdot \color{blue}{1} \]
                  2. Step-by-step derivation
                    1. *-rgt-identity91.5

                      \[\leadsto \color{blue}{w0} \]
                  3. Applied egg-rr91.5%

                    \[\leadsto \color{blue}{w0} \]
                5. Recombined 2 regimes into one program.
                6. Final simplification79.1%

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

                Alternative 10: 77.5% accurate, 0.8× speedup?

                \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1 \cdot 10^{+182}:\\ \;\;\;\;\left(D\_m \cdot D\_m\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                D_m = (fabs.f64 D)
                M_m = (fabs.f64 M)
                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 (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -1e+182)
                   (* (* D_m D_m) (/ (* -0.125 (* h (* w0 (* M_m M_m)))) (* l (* d d))))
                   w0))
                D_m = fabs(D);
                M_m = fabs(M);
                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 ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -1e+182) {
                		tmp = (D_m * D_m) * ((-0.125 * (h * (w0 * (M_m * M_m)))) / (l * (d * d)));
                	} else {
                		tmp = w0;
                	}
                	return tmp;
                }
                
                D_m = abs(d)
                M_m = abs(m)
                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 * d_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-1d+182)) then
                        tmp = (d_m * d_m) * (((-0.125d0) * (h * (w0 * (m_m * m_m)))) / (l * (d * d)))
                    else
                        tmp = w0
                    end if
                    code = tmp
                end function
                
                D_m = Math.abs(D);
                M_m = Math.abs(M);
                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 ((Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -1e+182) {
                		tmp = (D_m * D_m) * ((-0.125 * (h * (w0 * (M_m * M_m)))) / (l * (d * d)));
                	} else {
                		tmp = w0;
                	}
                	return tmp;
                }
                
                D_m = math.fabs(D)
                M_m = math.fabs(M)
                [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 (math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -1e+182:
                		tmp = (D_m * D_m) * ((-0.125 * (h * (w0 * (M_m * M_m)))) / (l * (d * d)))
                	else:
                		tmp = w0
                	return tmp
                
                D_m = abs(D)
                M_m = abs(M)
                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((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -1e+182)
                		tmp = Float64(Float64(D_m * D_m) * Float64(Float64(-0.125 * Float64(h * Float64(w0 * Float64(M_m * M_m)))) / Float64(l * Float64(d * d))));
                	else
                		tmp = w0;
                	end
                	return tmp
                end
                
                D_m = abs(D);
                M_m = abs(M);
                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 * D_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -1e+182)
                		tmp = (D_m * D_m) * ((-0.125 * (h * (w0 * (M_m * M_m)))) / (l * (d * d)));
                	else
                		tmp = w0;
                	end
                	tmp_2 = tmp;
                end
                
                D_m = N[Abs[D], $MachinePrecision]
                M_m = N[Abs[M], $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[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -1e+182], N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(-0.125 * N[(h * N[(w0 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
                
                \begin{array}{l}
                D_m = \left|D\right|
                \\
                M_m = \left|M\right|
                \\
                [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1 \cdot 10^{+182}:\\
                \;\;\;\;\left(D\_m \cdot D\_m\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(w0 \cdot \left(M\_m \cdot M\_m\right)\right)\right)}{\ell \cdot \left(d \cdot d\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;w0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -1.0000000000000001e182

                  1. Initial program 60.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
                    11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \color{blue}{h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)}}, 1\right)} \]
                  7. Taylor expanded in M 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)} \]
                  8. 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. lower-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)} \]
                  9. Simplified45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot w0\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
                  12. Simplified45.6%

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

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

                  1. Initial program 89.6%

                    \[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 w0 \cdot \color{blue}{1} \]
                  4. Step-by-step derivation
                    1. Simplified91.5%

                      \[\leadsto w0 \cdot \color{blue}{1} \]
                    2. Step-by-step derivation
                      1. *-rgt-identity91.5

                        \[\leadsto \color{blue}{w0} \]
                    3. Applied egg-rr91.5%

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

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

                  Alternative 11: 77.3% accurate, 0.8× speedup?

                  \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1 \cdot 10^{+182}:\\ \;\;\;\;w0 \cdot \left(\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
                  D_m = (fabs.f64 D)
                  M_m = (fabs.f64 M)
                  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 (<= (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ h l)) -1e+182)
                     (* w0 (* (* (* D_m D_m) -0.125) (/ (* h (* M_m M_m)) (* l (* d d)))))
                     w0))
                  D_m = fabs(D);
                  M_m = fabs(M);
                  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 ((pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -1e+182) {
                  		tmp = w0 * (((D_m * D_m) * -0.125) * ((h * (M_m * M_m)) / (l * (d * d))));
                  	} else {
                  		tmp = w0;
                  	}
                  	return tmp;
                  }
                  
                  D_m = abs(d)
                  M_m = abs(m)
                  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 * d_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-1d+182)) then
                          tmp = w0 * (((d_m * d_m) * (-0.125d0)) * ((h * (m_m * m_m)) / (l * (d * d))))
                      else
                          tmp = w0
                      end if
                      code = tmp
                  end function
                  
                  D_m = Math.abs(D);
                  M_m = Math.abs(M);
                  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 ((Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -1e+182) {
                  		tmp = w0 * (((D_m * D_m) * -0.125) * ((h * (M_m * M_m)) / (l * (d * d))));
                  	} else {
                  		tmp = w0;
                  	}
                  	return tmp;
                  }
                  
                  D_m = math.fabs(D)
                  M_m = math.fabs(M)
                  [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 (math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (h / l)) <= -1e+182:
                  		tmp = w0 * (((D_m * D_m) * -0.125) * ((h * (M_m * M_m)) / (l * (d * d))))
                  	else:
                  		tmp = w0
                  	return tmp
                  
                  D_m = abs(D)
                  M_m = abs(M)
                  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((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -1e+182)
                  		tmp = Float64(w0 * Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(h * Float64(M_m * M_m)) / Float64(l * Float64(d * d)))));
                  	else
                  		tmp = w0;
                  	end
                  	return tmp
                  end
                  
                  D_m = abs(D);
                  M_m = abs(M);
                  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 * D_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -1e+182)
                  		tmp = w0 * (((D_m * D_m) * -0.125) * ((h * (M_m * M_m)) / (l * (d * d))));
                  	else
                  		tmp = w0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  D_m = N[Abs[D], $MachinePrecision]
                  M_m = N[Abs[M], $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[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -1e+182], N[(w0 * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(h * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
                  
                  \begin{array}{l}
                  D_m = \left|D\right|
                  \\
                  M_m = \left|M\right|
                  \\
                  [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;{\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1 \cdot 10^{+182}:\\
                  \;\;\;\;w0 \cdot \left(\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \frac{h \cdot \left(M\_m \cdot M\_m\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;w0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -1.0000000000000001e182

                    1. Initial program 60.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
                      11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

                      \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \color{blue}{h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)}}, 1\right)} \]
                    7. Taylor expanded in M 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)} \]
                    8. 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. lower-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)} \]
                    9. Simplified45.8%

                      \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(\left(M \cdot M\right) \cdot h\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)} \]
                    10. 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)} \]
                    11. Step-by-step derivation
                      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto w0 \cdot \left(\left(\left(D \cdot D\right) \cdot \frac{-1}{8}\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}\right) \]
                      16. lower-*.f6445.7

                        \[\leadsto w0 \cdot \left(\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}\right) \]
                    12. Simplified45.7%

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

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

                    1. Initial program 89.6%

                      \[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 w0 \cdot \color{blue}{1} \]
                    4. Step-by-step derivation
                      1. Simplified91.5%

                        \[\leadsto w0 \cdot \color{blue}{1} \]
                      2. Step-by-step derivation
                        1. *-rgt-identity91.5

                          \[\leadsto \color{blue}{w0} \]
                      3. Applied egg-rr91.5%

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

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

                    Alternative 12: 87.0% accurate, 1.6× speedup?

                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} t_0 := \left(M\_m \cdot M\_m\right) \cdot 0.25\\ \mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{-307}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot t\_0}{\ell}\right)}\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+111}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D\_m \cdot \frac{M\_m}{2 \cdot d}, h \cdot \frac{M\_m \cdot D\_m}{\ell \cdot \left(d \cdot -2\right)}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\left(\frac{D\_m}{d} \cdot t\_0\right) \cdot \frac{h}{-\ell}, \frac{D\_m}{d}, 1\right)}\\ \end{array} \end{array} \]
                    D_m = (fabs.f64 D)
                    M_m = (fabs.f64 M)
                    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 M_m) 0.25)))
                       (if (<= (* M_m D_m) 5e-307)
                         (* w0 (sqrt (- 1.0 (* (/ D_m d) (* (/ D_m d) (/ (* h t_0) l))))))
                         (if (<= (* M_m D_m) 1e+111)
                           (*
                            w0
                            (sqrt
                             (fma
                              (* D_m (/ M_m (* 2.0 d)))
                              (* h (/ (* M_m D_m) (* l (* d -2.0))))
                              1.0)))
                           (* w0 (sqrt (fma (* (* (/ D_m d) t_0) (/ h (- l))) (/ D_m d) 1.0)))))))
                    D_m = fabs(D);
                    M_m = fabs(M);
                    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 * M_m) * 0.25;
                    	double tmp;
                    	if ((M_m * D_m) <= 5e-307) {
                    		tmp = w0 * sqrt((1.0 - ((D_m / d) * ((D_m / d) * ((h * t_0) / l)))));
                    	} else if ((M_m * D_m) <= 1e+111) {
                    		tmp = w0 * sqrt(fma((D_m * (M_m / (2.0 * d))), (h * ((M_m * D_m) / (l * (d * -2.0)))), 1.0));
                    	} else {
                    		tmp = w0 * sqrt(fma((((D_m / d) * t_0) * (h / -l)), (D_m / d), 1.0));
                    	}
                    	return tmp;
                    }
                    
                    D_m = abs(D)
                    M_m = abs(M)
                    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 * M_m) * 0.25)
                    	tmp = 0.0
                    	if (Float64(M_m * D_m) <= 5e-307)
                    		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / d) * Float64(Float64(D_m / d) * Float64(Float64(h * t_0) / l))))));
                    	elseif (Float64(M_m * D_m) <= 1e+111)
                    		tmp = Float64(w0 * sqrt(fma(Float64(D_m * Float64(M_m / Float64(2.0 * d))), Float64(h * Float64(Float64(M_m * D_m) / Float64(l * Float64(d * -2.0)))), 1.0)));
                    	else
                    		tmp = Float64(w0 * sqrt(fma(Float64(Float64(Float64(D_m / d) * t_0) * Float64(h / Float64(-l))), Float64(D_m / d), 1.0)));
                    	end
                    	return tmp
                    end
                    
                    D_m = N[Abs[D], $MachinePrecision]
                    M_m = N[Abs[M], $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 * M$95$m), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 5e-307], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(h * t$95$0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 1e+111], N[(w0 * N[Sqrt[N[(N[(D$95$m * N[(M$95$m / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(l * N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(N[(N[(D$95$m / d), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(h / (-l)), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / d), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    D_m = \left|D\right|
                    \\
                    M_m = \left|M\right|
                    \\
                    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
                    \\
                    \begin{array}{l}
                    t_0 := \left(M\_m \cdot M\_m\right) \cdot 0.25\\
                    \mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{-307}:\\
                    \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot t\_0}{\ell}\right)}\\
                    
                    \mathbf{elif}\;M\_m \cdot D\_m \leq 10^{+111}:\\
                    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D\_m \cdot \frac{M\_m}{2 \cdot d}, h \cdot \frac{M\_m \cdot D\_m}{\ell \cdot \left(d \cdot -2\right)}, 1\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\left(\frac{D\_m}{d} \cdot t\_0\right) \cdot \frac{h}{-\ell}, \frac{D\_m}{d}, 1\right)}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if (*.f64 M D) < 5.00000000000000014e-307

                      1. Initial program 84.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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\frac{D}{d} \cdot D}{d} \cdot \left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{\frac{1}{2}}{2}\right)\right) \cdot \frac{h}{\ell}} \]
                        18. metadata-eval71.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 5.00000000000000014e-307 < (*.f64 M D) < 9.99999999999999957e110

                      1. Initial program 86.9%

                        \[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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
                        11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\color{blue}{D \cdot \frac{M}{2 \cdot d}}, h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot -2\right)}, 1\right)} \]
                        5. lower-/.f6491.7

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

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

                      if 9.99999999999999957e110 < (*.f64 M D)

                      1. Initial program 60.5%

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

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

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

                    Alternative 13: 87.8% accurate, 1.6× speedup?

                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} t_0 := w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot \left(\left(M\_m \cdot M\_m\right) \cdot 0.25\right)}{\ell}\right)}\\ \mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{-307}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;M\_m \cdot D\_m \leq 5 \cdot 10^{+230}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D\_m \cdot \frac{M\_m}{2 \cdot d}, h \cdot \frac{M\_m \cdot D\_m}{\ell \cdot \left(d \cdot -2\right)}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    D_m = (fabs.f64 D)
                    M_m = (fabs.f64 M)
                    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
                             (*
                              w0
                              (sqrt
                               (-
                                1.0
                                (* (/ D_m d) (* (/ D_m d) (/ (* h (* (* M_m M_m) 0.25)) l))))))))
                       (if (<= (* M_m D_m) 5e-307)
                         t_0
                         (if (<= (* M_m D_m) 5e+230)
                           (*
                            w0
                            (sqrt
                             (fma
                              (* D_m (/ M_m (* 2.0 d)))
                              (* h (/ (* M_m D_m) (* l (* d -2.0))))
                              1.0)))
                           t_0))))
                    D_m = fabs(D);
                    M_m = fabs(M);
                    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 = w0 * sqrt((1.0 - ((D_m / d) * ((D_m / d) * ((h * ((M_m * M_m) * 0.25)) / l)))));
                    	double tmp;
                    	if ((M_m * D_m) <= 5e-307) {
                    		tmp = t_0;
                    	} else if ((M_m * D_m) <= 5e+230) {
                    		tmp = w0 * sqrt(fma((D_m * (M_m / (2.0 * d))), (h * ((M_m * D_m) / (l * (d * -2.0)))), 1.0));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    D_m = abs(D)
                    M_m = abs(M)
                    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(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / d) * Float64(Float64(D_m / d) * Float64(Float64(h * Float64(Float64(M_m * M_m) * 0.25)) / l))))))
                    	tmp = 0.0
                    	if (Float64(M_m * D_m) <= 5e-307)
                    		tmp = t_0;
                    	elseif (Float64(M_m * D_m) <= 5e+230)
                    		tmp = Float64(w0 * sqrt(fma(Float64(D_m * Float64(M_m / Float64(2.0 * d))), Float64(h * Float64(Float64(M_m * D_m) / Float64(l * Float64(d * -2.0)))), 1.0)));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    D_m = N[Abs[D], $MachinePrecision]
                    M_m = N[Abs[M], $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[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(h * N[(N[(M$95$m * M$95$m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 5e-307], t$95$0, If[LessEqual[N[(M$95$m * D$95$m), $MachinePrecision], 5e+230], N[(w0 * N[Sqrt[N[(N[(D$95$m * N[(M$95$m / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(l * N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    D_m = \left|D\right|
                    \\
                    M_m = \left|M\right|
                    \\
                    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
                    \\
                    \begin{array}{l}
                    t_0 := w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot \left(\left(M\_m \cdot M\_m\right) \cdot 0.25\right)}{\ell}\right)}\\
                    \mathbf{if}\;M\_m \cdot D\_m \leq 5 \cdot 10^{-307}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;M\_m \cdot D\_m \leq 5 \cdot 10^{+230}:\\
                    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D\_m \cdot \frac{M\_m}{2 \cdot d}, h \cdot \frac{M\_m \cdot D\_m}{\ell \cdot \left(d \cdot -2\right)}, 1\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 M D) < 5.00000000000000014e-307 or 5.0000000000000003e230 < (*.f64 M D)

                      1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \sqrt{1 - \left(\frac{\frac{D}{d} \cdot D}{d} \cdot \left(\color{blue}{\left(M \cdot M\right)} \cdot \frac{\frac{1}{2}}{2}\right)\right) \cdot \frac{h}{\ell}} \]
                        18. metadata-eval68.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 5.00000000000000014e-307 < (*.f64 M D) < 5.0000000000000003e230

                      1. Initial program 82.3%

                        \[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. lift-*.f64N/A

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) + 1}} \]
                      4. Applied egg-rr88.3%

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(M \cdot D\right) \cdot h}{\left(\mathsf{neg}\left(\color{blue}{2 \cdot d}\right)\right) \cdot \ell}, 1\right)} \]
                        11. distribute-lft-neg-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 14: 87.5% accurate, 1.7× speedup?

                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ \begin{array}{l} \mathbf{if}\;2 \cdot d \leq 10^{+21}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{2 \cdot d}, \frac{\frac{\left(M\_m \cdot D\_m\right) \cdot h}{2 \cdot d}}{-\ell}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot \left(\left(M\_m \cdot M\_m\right) \cdot 0.25\right)}{\ell}\right)}\\ \end{array} \end{array} \]
                    D_m = (fabs.f64 D)
                    M_m = (fabs.f64 M)
                    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 (<= (* 2.0 d) 1e+21)
                       (*
                        w0
                        (sqrt
                         (fma
                          (/ (* M_m D_m) (* 2.0 d))
                          (/ (/ (* (* M_m D_m) h) (* 2.0 d)) (- l))
                          1.0)))
                       (*
                        w0
                        (sqrt
                         (- 1.0 (* (/ D_m d) (* (/ D_m d) (/ (* h (* (* M_m M_m) 0.25)) l))))))))
                    D_m = fabs(D);
                    M_m = fabs(M);
                    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 ((2.0 * d) <= 1e+21) {
                    		tmp = w0 * sqrt(fma(((M_m * D_m) / (2.0 * d)), ((((M_m * D_m) * h) / (2.0 * d)) / -l), 1.0));
                    	} else {
                    		tmp = w0 * sqrt((1.0 - ((D_m / d) * ((D_m / d) * ((h * ((M_m * M_m) * 0.25)) / l)))));
                    	}
                    	return tmp;
                    }
                    
                    D_m = abs(D)
                    M_m = abs(M)
                    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(2.0 * d) <= 1e+21)
                    		tmp = Float64(w0 * sqrt(fma(Float64(Float64(M_m * D_m) / Float64(2.0 * d)), Float64(Float64(Float64(Float64(M_m * D_m) * h) / Float64(2.0 * d)) / Float64(-l)), 1.0)));
                    	else
                    		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / d) * Float64(Float64(D_m / d) * Float64(Float64(h * Float64(Float64(M_m * M_m) * 0.25)) / l))))));
                    	end
                    	return tmp
                    end
                    
                    D_m = N[Abs[D], $MachinePrecision]
                    M_m = N[Abs[M], $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[(2.0 * d), $MachinePrecision], 1e+21], N[(w0 * N[Sqrt[N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * h), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] / (-l)), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(D$95$m / d), $MachinePrecision] * N[(N[(h * N[(N[(M$95$m * M$95$m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    D_m = \left|D\right|
                    \\
                    M_m = \left|M\right|
                    \\
                    [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;2 \cdot d \leq 10^{+21}:\\
                    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M\_m \cdot D\_m}{2 \cdot d}, \frac{\frac{\left(M\_m \cdot D\_m\right) \cdot h}{2 \cdot d}}{-\ell}, 1\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;w0 \cdot \sqrt{1 - \frac{D\_m}{d} \cdot \left(\frac{D\_m}{d} \cdot \frac{h \cdot \left(\left(M\_m \cdot M\_m\right) \cdot 0.25\right)}{\ell}\right)}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 #s(literal 2 binary64) d) < 1e21

                      1. Initial program 79.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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

                      if 1e21 < (*.f64 #s(literal 2 binary64) d)

                      1. Initial program 86.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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \sqrt{1 - \frac{D}{d} \cdot \left(\frac{D}{d} \cdot \color{blue}{\frac{\left(\left(M \cdot M\right) \cdot \frac{1}{4}\right) \cdot h}{\ell}}\right)} \]
                        18. lower-*.f6476.5

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

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

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

                    Alternative 15: 67.7% accurate, 157.0× speedup?

                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [w0, M_m, D_m, h, l, d] = \mathsf{sort}([w0, M_m, D_m, h, l, d])\\ \\ w0 \end{array} \]
                    D_m = (fabs.f64 D)
                    M_m = (fabs.f64 M)
                    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)
                    D_m = fabs(D);
                    M_m = fabs(M);
                    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;
                    }
                    
                    D_m = abs(d)
                    M_m = abs(m)
                    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
                    
                    D_m = Math.abs(D);
                    M_m = Math.abs(M);
                    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;
                    }
                    
                    D_m = math.fabs(D)
                    M_m = math.fabs(M)
                    [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
                    
                    D_m = abs(D)
                    M_m = abs(M)
                    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
                    
                    D_m = abs(D);
                    M_m = abs(M);
                    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
                    
                    D_m = N[Abs[D], $MachinePrecision]
                    M_m = N[Abs[M], $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}
                    D_m = \left|D\right|
                    \\
                    M_m = \left|M\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 81.4%

                      \[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 w0 \cdot \color{blue}{1} \]
                    4. Step-by-step derivation
                      1. Simplified67.2%

                        \[\leadsto w0 \cdot \color{blue}{1} \]
                      2. Step-by-step derivation
                        1. *-rgt-identity67.2

                          \[\leadsto \color{blue}{w0} \]
                      3. Applied egg-rr67.2%

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

                      Reproduce

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