Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 80.8% → 83.6%
Time: 13.1s
Alternatives: 13
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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: 80.8% 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: 83.6% accurate, 1.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}\;D\_m \cdot M\_m \leq 5 \cdot 10^{+143}:\\ \;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{\frac{\frac{D\_m \cdot \left(M\_m \cdot \left(D\_m \cdot M\_m\right)\right)}{d}}{d \cdot 4}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(M\_m \cdot \frac{\left(M\_m \cdot 0.5\right) \cdot \left(D\_m \cdot h\right)}{d \cdot \ell}, \frac{D\_m}{d \cdot -2}, 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
 (if (<= (* D_m M_m) 5e+143)
   (*
    w0
    (sqrt (- 1.0 (* h (/ (/ (/ (* D_m (* M_m (* D_m M_m))) d) (* d 4.0)) l)))))
   (*
    w0
    (sqrt
     (fma
      (* M_m (/ (* (* M_m 0.5) (* D_m h)) (* d l)))
      (/ D_m (* d -2.0))
      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 tmp;
	if ((D_m * M_m) <= 5e+143) {
		tmp = w0 * sqrt((1.0 - (h * ((((D_m * (M_m * (D_m * M_m))) / d) / (d * 4.0)) / l))));
	} else {
		tmp = w0 * sqrt(fma((M_m * (((M_m * 0.5) * (D_m * h)) / (d * l))), (D_m / (d * -2.0)), 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)
	tmp = 0.0
	if (Float64(D_m * M_m) <= 5e+143)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(Float64(Float64(D_m * Float64(M_m * Float64(D_m * M_m))) / d) / Float64(d * 4.0)) / l)))));
	else
		tmp = Float64(w0 * sqrt(fma(Float64(M_m * Float64(Float64(Float64(M_m * 0.5) * Float64(D_m * h)) / Float64(d * l))), Float64(D_m / Float64(d * -2.0)), 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_] := If[LessEqual[N[(D$95$m * M$95$m), $MachinePrecision], 5e+143], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(N[(N[(D$95$m * N[(M$95$m * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(M$95$m * N[(N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D$95$m * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / N[(d * -2.0), $MachinePrecision]), $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}
\mathbf{if}\;D\_m \cdot M\_m \leq 5 \cdot 10^{+143}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{\frac{\frac{D\_m \cdot \left(M\_m \cdot \left(D\_m \cdot M\_m\right)\right)}{d}}{d \cdot 4}}{\ell}}\\

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


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

    1. Initial program 83.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. 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. associate-/r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000012e143 < (*.f64 M D)

    1. Initial program 87.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. 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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{\left(M\_m \cdot 0.5\right) \cdot \left(D\_m \cdot h\right)}{d \cdot \ell} \cdot \frac{M\_m \cdot \left(D\_m \cdot 0.5\right)}{d}}\\ \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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -0.01)
   (*
    w0
    (sqrt
     (-
      1.0
      (* (/ (* (* M_m 0.5) (* D_m h)) (* d l)) (/ (* M_m (* D_m 0.5)) 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01) {
		tmp = w0 * sqrt((1.0 - ((((M_m * 0.5) * (D_m * h)) / (d * l)) * ((M_m * (D_m * 0.5)) / 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 (((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-0.01d0)) then
        tmp = w0 * sqrt((1.0d0 - ((((m_m * 0.5d0) * (d_m * h)) / (d * l)) * ((m_m * (d_m * 0.5d0)) / 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01) {
		tmp = w0 * Math.sqrt((1.0 - ((((M_m * 0.5) * (D_m * h)) / (d * l)) * ((M_m * (D_m * 0.5)) / 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01:
		tmp = w0 * math.sqrt((1.0 - ((((M_m * 0.5) * (D_m * h)) / (d * l)) * ((M_m * (D_m * 0.5)) / 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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -0.01)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(Float64(M_m * 0.5) * Float64(D_m * h)) / Float64(d * l)) * Float64(Float64(M_m * Float64(D_m * 0.5)) / 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 (((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -0.01)
		tmp = w0 * sqrt((1.0 - ((((M_m * 0.5) * (D_m * h)) / (d * l)) * ((M_m * (D_m * 0.5)) / 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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -0.01], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D$95$m * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * N[(D$95$m * 0.5), $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}
\mathbf{if}\;{\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{\left(M\_m \cdot 0.5\right) \cdot \left(D\_m \cdot h\right)}{d \cdot \ell} \cdot \frac{M\_m \cdot \left(D\_m \cdot 0.5\right)}{d}}\\

\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)) < -0.0100000000000000002

    1. Initial program 70.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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.2%

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

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

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

          \[\leadsto \color{blue}{w0} \]
      3. Applied egg-rr98.4%

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

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

    Alternative 3: 84.2% 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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(M\_m \cdot \frac{\left(M\_m \cdot 0.5\right) \cdot \left(D\_m \cdot h\right)}{d \cdot \ell}, \frac{D\_m}{d \cdot -2}, 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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -0.01)
       (*
        w0
        (sqrt
         (fma
          (* M_m (/ (* (* M_m 0.5) (* D_m h)) (* d l)))
          (/ D_m (* 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01) {
    		tmp = w0 * sqrt(fma((M_m * (((M_m * 0.5) * (D_m * h)) / (d * l))), (D_m / (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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -0.01)
    		tmp = Float64(w0 * sqrt(fma(Float64(M_m * Float64(Float64(Float64(M_m * 0.5) * Float64(D_m * h)) / Float64(d * l))), Float64(D_m / 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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -0.01], N[(w0 * N[Sqrt[N[(N[(M$95$m * N[(N[(N[(M$95$m * 0.5), $MachinePrecision] * N[(D$95$m * h), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m / N[(d * -2.0), $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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\
    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(M\_m \cdot \frac{\left(M\_m \cdot 0.5\right) \cdot \left(D\_m \cdot h\right)}{d \cdot \ell}, \frac{D\_m}{d \cdot -2}, 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)) < -0.0100000000000000002

      1. Initial program 70.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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 90.2%

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

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

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

            \[\leadsto \color{blue}{w0} \]
        3. Applied egg-rr98.4%

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

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

      Alternative 4: 83.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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\ \;\;\;\;w0 \cdot \sqrt{1 - \left(\left(D\_m \cdot M\_m\right) \cdot \frac{h}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot 0.25\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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -0.01)
         (*
          w0
          (sqrt
           (- 1.0 (* (* (* D_m M_m) (/ h (* d (* d l)))) (* (* D_m M_m) 0.25)))))
         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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01) {
      		tmp = w0 * sqrt((1.0 - (((D_m * M_m) * (h / (d * (d * l)))) * ((D_m * M_m) * 0.25))));
      	} 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 (((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-0.01d0)) then
              tmp = w0 * sqrt((1.0d0 - (((d_m * m_m) * (h / (d * (d * l)))) * ((d_m * m_m) * 0.25d0))))
          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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01) {
      		tmp = w0 * Math.sqrt((1.0 - (((D_m * M_m) * (h / (d * (d * l)))) * ((D_m * M_m) * 0.25))));
      	} 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01:
      		tmp = w0 * math.sqrt((1.0 - (((D_m * M_m) * (h / (d * (d * l)))) * ((D_m * M_m) * 0.25))))
      	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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -0.01)
      		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(Float64(D_m * M_m) * Float64(h / Float64(d * Float64(d * l)))) * Float64(Float64(D_m * M_m) * 0.25)))));
      	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 (((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -0.01)
      		tmp = w0 * sqrt((1.0 - (((D_m * M_m) * (h / (d * (d * l)))) * ((D_m * M_m) * 0.25))));
      	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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -0.01], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(h / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] * 0.25), $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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\
      \;\;\;\;w0 \cdot \sqrt{1 - \left(\left(D\_m \cdot M\_m\right) \cdot \frac{h}{d \cdot \left(d \cdot \ell\right)}\right) \cdot \left(\left(D\_m \cdot M\_m\right) \cdot 0.25\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)) < -0.0100000000000000002

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 90.2%

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

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

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

              \[\leadsto \color{blue}{w0} \]
          3. Applied egg-rr98.4%

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

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

        Alternative 5: 83.6% 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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\ \;\;\;\;w0 \cdot \sqrt{1 - h \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{4 \cdot \left(d \cdot \left(d \cdot \ell\right)\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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -0.01)
           (*
            w0
            (sqrt (- 1.0 (* h (* (* D_m M_m) (/ (* D_m M_m) (* 4.0 (* 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01) {
        		tmp = w0 * sqrt((1.0 - (h * ((D_m * M_m) * ((D_m * M_m) / (4.0 * (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 (((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (h / l)) <= (-0.01d0)) then
                tmp = w0 * sqrt((1.0d0 - (h * ((d_m * m_m) * ((d_m * m_m) / (4.0d0 * (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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01) {
        		tmp = w0 * Math.sqrt((1.0 - (h * ((D_m * M_m) * ((D_m * M_m) / (4.0 * (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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -0.01:
        		tmp = w0 * math.sqrt((1.0 - (h * ((D_m * M_m) * ((D_m * M_m) / (4.0 * (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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -0.01)
        		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64(Float64(D_m * M_m) * Float64(Float64(D_m * M_m) / Float64(4.0 * 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 (((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (h / l)) <= -0.01)
        		tmp = w0 * sqrt((1.0 - (h * ((D_m * M_m) * ((D_m * M_m) / (4.0 * (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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -0.01], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[(D$95$m * M$95$m), $MachinePrecision] * N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(4.0 * N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -0.01:\\
        \;\;\;\;w0 \cdot \sqrt{1 - h \cdot \left(\left(D\_m \cdot M\_m\right) \cdot \frac{D\_m \cdot M\_m}{4 \cdot \left(d \cdot \left(d \cdot \ell\right)\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)) < -0.0100000000000000002

          1. Initial program 70.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. 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. associate-/r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 90.2%

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

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

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

                \[\leadsto \color{blue}{w0} \]
            3. Applied egg-rr98.4%

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

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

          Alternative 6: 78.6% 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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\ \;\;\;\;\mathsf{fma}\left(\frac{D\_m \cdot \left(M\_m \cdot \left(h \cdot \left(D\_m \cdot M\_m\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0 \cdot -0.125, w0\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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -5e+264)
             (fma (/ (* D_m (* M_m (* h (* D_m M_m)))) (* d (* d l))) (* w0 -0.125) w0)
             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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -5e+264) {
          		tmp = fma(((D_m * (M_m * (h * (D_m * M_m)))) / (d * (d * l))), (w0 * -0.125), w0);
          	} 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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+264)
          		tmp = fma(Float64(Float64(D_m * Float64(M_m * Float64(h * Float64(D_m * M_m)))) / Float64(d * Float64(d * l))), Float64(w0 * -0.125), w0);
          	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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+264], N[(N[(N[(D$95$m * N[(M$95$m * N[(h * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 * -0.125), $MachinePrecision] + w0), $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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{D\_m \cdot \left(M\_m \cdot \left(h \cdot \left(D\_m \cdot M\_m\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0 \cdot -0.125, w0\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)) < -5.00000000000000033e264

            1. Initial program 65.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 \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\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} + w0} \]
              2. *-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}} + w0 \]
              3. 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} + w0 \]
              4. 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)} + w0 \]
              5. *-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)} + w0 \]
              6. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 90.9%

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

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

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

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

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

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

            Alternative 7: 78.4% 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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\ \;\;\;\;\mathsf{fma}\left(\frac{D\_m \cdot \left(h \cdot \left(M\_m \cdot \left(D\_m \cdot M\_m\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0 \cdot -0.125, w0\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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -5e+264)
               (fma (/ (* D_m (* h (* M_m (* D_m M_m)))) (* d (* d l))) (* w0 -0.125) w0)
               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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -5e+264) {
            		tmp = fma(((D_m * (h * (M_m * (D_m * M_m)))) / (d * (d * l))), (w0 * -0.125), w0);
            	} 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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+264)
            		tmp = fma(Float64(Float64(D_m * Float64(h * Float64(M_m * Float64(D_m * M_m)))) / Float64(d * Float64(d * l))), Float64(w0 * -0.125), w0);
            	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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+264], N[(N[(N[(D$95$m * N[(h * N[(M$95$m * N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 * -0.125), $MachinePrecision] + w0), $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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\
            \;\;\;\;\mathsf{fma}\left(\frac{D\_m \cdot \left(h \cdot \left(M\_m \cdot \left(D\_m \cdot M\_m\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0 \cdot -0.125, w0\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)) < -5.00000000000000033e264

              1. Initial program 65.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 \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\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} + w0} \]
                2. *-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}} + w0 \]
                3. 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} + w0 \]
                4. 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)} + w0 \]
                5. *-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)} + w0 \]
                6. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 90.9%

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

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

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

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

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

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

              Alternative 8: 78.2% 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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\ \;\;\;\;\mathsf{fma}\left(D\_m \cdot \left(\left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right) \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\right)}\right), D\_m, w0\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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -5e+264)
                 (fma (* D_m (* (* h (* M_m (* w0 M_m))) (/ -0.125 (* d (* d l))))) D_m w0)
                 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -5e+264) {
              		tmp = fma((D_m * ((h * (M_m * (w0 * M_m))) * (-0.125 / (d * (d * l))))), D_m, w0);
              	} 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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+264)
              		tmp = fma(Float64(D_m * Float64(Float64(h * Float64(M_m * Float64(w0 * M_m))) * Float64(-0.125 / Float64(d * Float64(d * l))))), D_m, w0);
              	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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+264], N[(N[(D$95$m * N[(N[(h * N[(M$95$m * N[(w0 * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D$95$m + w0), $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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\
              \;\;\;\;\mathsf{fma}\left(D\_m \cdot \left(\left(h \cdot \left(M\_m \cdot \left(w0 \cdot M\_m\right)\right)\right) \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\right)}\right), D\_m, w0\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)) < -5.00000000000000033e264

                1. Initial program 65.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 \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\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} + w0} \]
                  2. *-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}} + w0 \]
                  3. 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} + w0 \]
                  4. 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)} + w0 \]
                  5. *-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)} + w0 \]
                  6. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 90.9%

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

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

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

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

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

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

                Alternative 9: 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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(h, \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{M\_m \cdot M\_m}{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 (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ h l)) -5e+264)
                   (* w0 (fma h (* (* -0.125 (* D_m D_m)) (/ (* M_m M_m) (* 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(((D_m * M_m) / (2.0 * d)), 2.0) * (h / l)) <= -5e+264) {
                		tmp = w0 * fma(h, ((-0.125 * (D_m * D_m)) * ((M_m * M_m) / (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(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+264)
                		tmp = Float64(w0 * fma(h, Float64(Float64(-0.125 * Float64(D_m * D_m)) * Float64(Float64(M_m * M_m) / 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[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+264], N[(w0 * N[(h * N[(N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / 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{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+264}:\\
                \;\;\;\;w0 \cdot \mathsf{fma}\left(h, \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{M\_m \cdot M\_m}{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)) < -5.00000000000000033e264

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 90.9%

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

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

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

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

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

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

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

                    1. Initial program 65.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 \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\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} + w0} \]
                      2. *-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}} + w0 \]
                      3. 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} + w0 \]
                      4. 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)} + w0 \]
                      5. *-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)} + w0 \]
                      6. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, -0.125 \cdot w0, w0\right)} \]
                    9. 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}} \]
                    10. 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. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    1. Initial program 90.9%

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

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

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

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

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

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

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

                      1. Initial program 65.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 \color{blue}{w0 + \frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{{d}^{2} \cdot \ell}} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\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} + w0} \]
                        2. *-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}} + w0 \]
                        3. 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} + w0 \]
                        4. 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)} + w0 \]
                        5. *-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)} + w0 \]
                        6. lower-fma.f64N/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{D \cdot \left(D \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, -0.125 \cdot w0, w0\right)} \]
                      9. 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}} \]
                      10. 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. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      1. Initial program 90.9%

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

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

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

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

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

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

                      Alternative 12: 86.3% accurate, 1.9× 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 \cdot \sqrt{1 - \frac{D\_m}{2 \cdot d} \cdot \left(M\_m \cdot \frac{\frac{D\_m \cdot \left(M\_m \cdot 0.5\right)}{d} \cdot h}{\ell}\right)} \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
                        (sqrt
                         (-
                          1.0
                          (* (/ D_m (* 2.0 d)) (* M_m (/ (* (/ (* D_m (* M_m 0.5)) d) h) 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) {
                      	return w0 * sqrt((1.0 - ((D_m / (2.0 * d)) * (M_m * ((((D_m * (M_m * 0.5)) / d) * h) / l)))));
                      }
                      
                      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 * sqrt((1.0d0 - ((d_m / (2.0d0 * d)) * (m_m * ((((d_m * (m_m * 0.5d0)) / d) * h) / l)))))
                      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 * Math.sqrt((1.0 - ((D_m / (2.0 * d)) * (M_m * ((((D_m * (M_m * 0.5)) / d) * h) / l)))));
                      }
                      
                      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 * math.sqrt((1.0 - ((D_m / (2.0 * d)) * (M_m * ((((D_m * (M_m * 0.5)) / d) * h) / l)))))
                      
                      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 Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(D_m / Float64(2.0 * d)) * Float64(M_m * Float64(Float64(Float64(Float64(D_m * Float64(M_m * 0.5)) / d) * h) / l))))))
                      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 * sqrt((1.0 - ((D_m / (2.0 * d)) * (M_m * ((((D_m * (M_m * 0.5)) / d) * h) / l)))));
                      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_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(D$95$m / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] * N[(M$95$m * N[(N[(N[(N[(D$95$m * N[(M$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * h), $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])\\
                      \\
                      w0 \cdot \sqrt{1 - \frac{D\_m}{2 \cdot d} \cdot \left(M\_m \cdot \frac{\frac{D\_m \cdot \left(M\_m \cdot 0.5\right)}{d} \cdot h}{\ell}\right)}
                      \end{array}
                      
                      Derivation
                      1. Initial program 84.0%

                        \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. 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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 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 84.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. Simplified68.9%

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

                            \[\leadsto \color{blue}{w0} \]
                        3. Applied egg-rr68.9%

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

                        Reproduce

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