Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.3% → 88.9%
Time: 15.9s
Alternatives: 16
Speedup: 2.3×

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 16 alternatives:

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

Initial Program: 81.3% accurate, 1.0× speedup?

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

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

Alternative 1: 88.9% accurate, 1.6× speedup?

\[\begin{array}{l} \\ w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\frac{M \cdot D}{d \cdot -2}}{\ell}, \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}, 1\right)} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (*
  w0
  (sqrt
   (fma
    (/ (/ (* M D) (* d -2.0)) l)
    (/ (/ (* M D) (* d 2.0)) (/ 1.0 h))
    1.0))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt(fma((((M * D) / (d * -2.0)) / l), (((M * D) / (d * 2.0)) / (1.0 / h)), 1.0));
}
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) / Float64(d * -2.0)) / l), Float64(Float64(Float64(M * D) / Float64(d * 2.0)) / Float64(1.0 / h)), 1.0)))
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] / N[(d * -2.0), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 / h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\frac{M \cdot D}{d \cdot -2}}{\ell}, \frac{\frac{M \cdot D}{d \cdot 2}}{\frac{1}{h}}, 1\right)}
\end{array}
Derivation
  1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+172}:\\ \;\;\;\;\left(M \cdot \left(\left(h \cdot \left(D \cdot D\right)\right) \cdot \frac{-0.125}{d}\right)\right) \cdot \left(w0 \cdot \frac{M}{d \cdot \ell}\right)\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot 1\\ \end{array} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+172)
   (* (* M (* (* h (* D D)) (/ -0.125 d))) (* w0 (/ M (* d l))))
   (* w0 1.0)))
double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
		tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l)));
	} else {
		tmp = w0 * 1.0;
	}
	return tmp;
}
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
    real(8) :: tmp
    if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+172)) then
        tmp = (m * ((h * (d * d)) * ((-0.125d0) / d_1))) * (w0 * (m / (d_1 * l)))
    else
        tmp = w0 * 1.0d0
    end if
    code = tmp
end function
public static double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
		tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l)));
	} else {
		tmp = w0 * 1.0;
	}
	return tmp;
}
def code(w0, M, D, h, l, d):
	tmp = 0
	if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172:
		tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l)))
	else:
		tmp = w0 * 1.0
	return tmp
function code(w0, M, D, h, l, d)
	tmp = 0.0
	if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+172)
		tmp = Float64(Float64(M * Float64(Float64(h * Float64(D * D)) * Float64(-0.125 / d))) * Float64(w0 * Float64(M / Float64(d * l))));
	else
		tmp = Float64(w0 * 1.0);
	end
	return tmp
end
function tmp_2 = code(w0, M, D, h, l, d)
	tmp = 0.0;
	if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+172)
		tmp = (M * ((h * (D * D)) * (-0.125 / d))) * (w0 * (M / (d * l)));
	else
		tmp = w0 * 1.0;
	end
	tmp_2 = tmp;
end
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+172], N[(N[(M * N[(N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 * N[(M / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+172}:\\
\;\;\;\;\left(M \cdot \left(\left(h \cdot \left(D \cdot D\right)\right) \cdot \frac{-0.125}{d}\right)\right) \cdot \left(w0 \cdot \frac{M}{d \cdot \ell}\right)\\

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


\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.0000000000000001e172

    1. Initial program 55.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. Applied rewrites4.8%

        \[\leadsto w0 \cdot \color{blue}{1} \]
      2. 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}} \]
      3. 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)} \]
      4. Applied rewrites42.0%

        \[\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)}{d \cdot \left(d \cdot \ell\right)}, w0\right)} \]
      5. Taylor expanded in D around inf

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

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

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

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

        1. Initial program 86.4%

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

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

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

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

        Alternative 3: 79.1% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+172}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(\left(w0 \cdot \frac{M}{d \cdot \ell}\right) \cdot \left(M \cdot \frac{h \cdot -0.125}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot 1\\ \end{array} \end{array} \]
        (FPCore (w0 M D h l d)
         :precision binary64
         (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -5e+172)
           (* (* D D) (* (* w0 (/ M (* d l))) (* M (/ (* h -0.125) d))))
           (* w0 1.0)))
        double code(double w0, double M, double D, double h, double l, double d) {
        	double tmp;
        	if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
        		tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d)));
        	} else {
        		tmp = w0 * 1.0;
        	}
        	return tmp;
        }
        
        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
            real(8) :: tmp
            if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-5d+172)) then
                tmp = (d * d) * ((w0 * (m / (d_1 * l))) * (m * ((h * (-0.125d0)) / d_1)))
            else
                tmp = w0 * 1.0d0
            end if
            code = tmp
        end function
        
        public static double code(double w0, double M, double D, double h, double l, double d) {
        	double tmp;
        	if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172) {
        		tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d)));
        	} else {
        		tmp = w0 * 1.0;
        	}
        	return tmp;
        }
        
        def code(w0, M, D, h, l, d):
        	tmp = 0
        	if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -5e+172:
        		tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d)))
        	else:
        		tmp = w0 * 1.0
        	return tmp
        
        function code(w0, M, D, h, l, d)
        	tmp = 0.0
        	if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -5e+172)
        		tmp = Float64(Float64(D * D) * Float64(Float64(w0 * Float64(M / Float64(d * l))) * Float64(M * Float64(Float64(h * -0.125) / d))));
        	else
        		tmp = Float64(w0 * 1.0);
        	end
        	return tmp
        end
        
        function tmp_2 = code(w0, M, D, h, l, d)
        	tmp = 0.0;
        	if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -5e+172)
        		tmp = (D * D) * ((w0 * (M / (d * l))) * (M * ((h * -0.125) / d)));
        	else
        		tmp = w0 * 1.0;
        	end
        	tmp_2 = tmp;
        end
        
        code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+172], N[(N[(D * D), $MachinePrecision] * N[(N[(w0 * N[(M / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * N[(N[(h * -0.125), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+172}:\\
        \;\;\;\;\left(D \cdot D\right) \cdot \left(\left(w0 \cdot \frac{M}{d \cdot \ell}\right) \cdot \left(M \cdot \frac{h \cdot -0.125}{d}\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;w0 \cdot 1\\
        
        
        \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.0000000000000001e172

          1. Initial program 55.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. Applied rewrites4.8%

              \[\leadsto w0 \cdot \color{blue}{1} \]
            2. 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}} \]
            3. 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)} \]
            4. Applied rewrites42.0%

              \[\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)}{d \cdot \left(d \cdot \ell\right)}, w0\right)} \]
            5. Taylor expanded in D around inf

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

                \[\leadsto \left(D \cdot D\right) \cdot \color{blue}{\frac{-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)}{\left(d \cdot d\right) \cdot \ell}} \]
              2. Step-by-step derivation
                1. Applied rewrites44.2%

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

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

                1. Initial program 86.4%

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

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

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

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

                Alternative 4: 78.5% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+114}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(M \cdot \left(h \cdot \left(w0 \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot 1\\ \end{array} \end{array} \]
                (FPCore (w0 M D h l d)
                 :precision binary64
                 (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+114)
                   (fma (* D D) (/ (* -0.125 (* M (* h (* w0 M)))) (* d (* d l))) w0)
                   (* w0 1.0)))
                double code(double w0, double M, double D, double h, double l, double d) {
                	double tmp;
                	if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+114) {
                		tmp = fma((D * D), ((-0.125 * (M * (h * (w0 * M)))) / (d * (d * l))), w0);
                	} else {
                		tmp = w0 * 1.0;
                	}
                	return tmp;
                }
                
                function code(w0, M, D, h, l, d)
                	tmp = 0.0
                	if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+114)
                		tmp = fma(Float64(D * D), Float64(Float64(-0.125 * Float64(M * Float64(h * Float64(w0 * M)))) / Float64(d * Float64(d * l))), w0);
                	else
                		tmp = Float64(w0 * 1.0);
                	end
                	return tmp
                end
                
                code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+114], N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * N[(h * N[(w0 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+114}:\\
                \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(M \cdot \left(h \cdot \left(w0 \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;w0 \cdot 1\\
                
                
                \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)) < -2e114

                  1. Initial program 56.7%

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

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

                      \[\leadsto w0 \cdot \color{blue}{1} \]
                    2. 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}} \]
                    3. 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)} \]
                    4. Applied rewrites40.8%

                      \[\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)}{d \cdot \left(d \cdot \ell\right)}, w0\right)} \]
                    5. Step-by-step derivation
                      1. Applied rewrites42.8%

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

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

                      1. Initial program 86.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. Applied rewrites91.1%

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

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

                      Alternative 5: 78.3% accurate, 0.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+114}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot 1\\ \end{array} \end{array} \]
                      (FPCore (w0 M D h l d)
                       :precision binary64
                       (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+114)
                         (fma (* D D) (/ (* -0.125 (* h (* M (* w0 M)))) (* d (* d l))) w0)
                         (* w0 1.0)))
                      double code(double w0, double M, double D, double h, double l, double d) {
                      	double tmp;
                      	if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+114) {
                      		tmp = fma((D * D), ((-0.125 * (h * (M * (w0 * M)))) / (d * (d * l))), w0);
                      	} else {
                      		tmp = w0 * 1.0;
                      	}
                      	return tmp;
                      }
                      
                      function code(w0, M, D, h, l, d)
                      	tmp = 0.0
                      	if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+114)
                      		tmp = fma(Float64(D * D), Float64(Float64(-0.125 * Float64(h * Float64(M * Float64(w0 * M)))) / Float64(d * Float64(d * l))), w0);
                      	else
                      		tmp = Float64(w0 * 1.0);
                      	end
                      	return tmp
                      end
                      
                      code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+114], N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(h * N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + w0), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+114}:\\
                      \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(w0 \cdot M\right)\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;w0 \cdot 1\\
                      
                      
                      \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)) < -2e114

                        1. Initial program 56.7%

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

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

                            \[\leadsto w0 \cdot \color{blue}{1} \]
                          2. 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}} \]
                          3. 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)} \]
                          4. Applied rewrites40.8%

                            \[\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)}{d \cdot \left(d \cdot \ell\right)}, w0\right)} \]

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

                          1. Initial program 86.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. Applied rewrites91.1%

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

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

                          Alternative 6: 77.6% accurate, 0.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+210}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(\left(-0.125 \cdot \left(M \cdot \left(M \cdot h\right)\right)\right) \cdot \frac{w0}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot 1\\ \end{array} \end{array} \]
                          (FPCore (w0 M D h l d)
                           :precision binary64
                           (if (<= (* (pow (/ (* M D) (* d 2.0)) 2.0) (/ h l)) -2e+210)
                             (* (* D D) (* (* -0.125 (* M (* M h))) (/ w0 (* l (* d d)))))
                             (* w0 1.0)))
                          double code(double w0, double M, double D, double h, double l, double d) {
                          	double tmp;
                          	if ((pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+210) {
                          		tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d))));
                          	} else {
                          		tmp = w0 * 1.0;
                          	}
                          	return tmp;
                          }
                          
                          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
                              real(8) :: tmp
                              if (((((m * d) / (d_1 * 2.0d0)) ** 2.0d0) * (h / l)) <= (-2d+210)) then
                                  tmp = (d * d) * (((-0.125d0) * (m * (m * h))) * (w0 / (l * (d_1 * d_1))))
                              else
                                  tmp = w0 * 1.0d0
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double w0, double M, double D, double h, double l, double d) {
                          	double tmp;
                          	if ((Math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+210) {
                          		tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d))));
                          	} else {
                          		tmp = w0 * 1.0;
                          	}
                          	return tmp;
                          }
                          
                          def code(w0, M, D, h, l, d):
                          	tmp = 0
                          	if (math.pow(((M * D) / (d * 2.0)), 2.0) * (h / l)) <= -2e+210:
                          		tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d))))
                          	else:
                          		tmp = w0 * 1.0
                          	return tmp
                          
                          function code(w0, M, D, h, l, d)
                          	tmp = 0.0
                          	if (Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * Float64(h / l)) <= -2e+210)
                          		tmp = Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(M * Float64(M * h))) * Float64(w0 / Float64(l * Float64(d * d)))));
                          	else
                          		tmp = Float64(w0 * 1.0);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(w0, M, D, h, l, d)
                          	tmp = 0.0;
                          	if (((((M * D) / (d * 2.0)) ^ 2.0) * (h / l)) <= -2e+210)
                          		tmp = (D * D) * ((-0.125 * (M * (M * h))) * (w0 / (l * (d * d))));
                          	else
                          		tmp = w0 * 1.0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -2e+210], N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(w0 / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w0 * 1.0), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -2 \cdot 10^{+210}:\\
                          \;\;\;\;\left(D \cdot D\right) \cdot \left(\left(-0.125 \cdot \left(M \cdot \left(M \cdot h\right)\right)\right) \cdot \frac{w0}{\ell \cdot \left(d \cdot d\right)}\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;w0 \cdot 1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -1.99999999999999985e210

                            1. Initial program 52.7%

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

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

                                \[\leadsto w0 \cdot \color{blue}{1} \]
                              2. 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}} \]
                              3. 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)} \]
                              4. Applied rewrites42.5%

                                \[\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)}{d \cdot \left(d \cdot \ell\right)}, w0\right)} \]
                              5. Taylor expanded in D around inf

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

                                  \[\leadsto \left(D \cdot D\right) \cdot \color{blue}{\frac{-0.125 \cdot \left(\left(\left(M \cdot M\right) \cdot h\right) \cdot w0\right)}{\left(d \cdot d\right) \cdot \ell}} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites40.7%

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

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

                                  1. Initial program 86.6%

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

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

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

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

                                  Alternative 7: 78.4% accurate, 2.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \cdot D \leq 2.5 \cdot 10^{-11}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M}{d} \cdot \frac{D \cdot \left(M \cdot D\right)}{-4 \cdot \left(d \cdot \ell\right)}, h, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D}{d}, \frac{M \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \left(h \cdot -0.25\right), 1\right)}\\ \end{array} \end{array} \]
                                  (FPCore (w0 M D h l d)
                                   :precision binary64
                                   (if (<= (* M D) 2.5e-11)
                                     (* w0 (sqrt (fma (* (/ M d) (/ (* D (* M D)) (* -4.0 (* d l)))) h 1.0)))
                                     (* w0 (sqrt (fma (/ D d) (* (/ (* M (* M D)) (* d l)) (* h -0.25)) 1.0)))))
                                  double code(double w0, double M, double D, double h, double l, double d) {
                                  	double tmp;
                                  	if ((M * D) <= 2.5e-11) {
                                  		tmp = w0 * sqrt(fma(((M / d) * ((D * (M * D)) / (-4.0 * (d * l)))), h, 1.0));
                                  	} else {
                                  		tmp = w0 * sqrt(fma((D / d), (((M * (M * D)) / (d * l)) * (h * -0.25)), 1.0));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(w0, M, D, h, l, d)
                                  	tmp = 0.0
                                  	if (Float64(M * D) <= 2.5e-11)
                                  		tmp = Float64(w0 * sqrt(fma(Float64(Float64(M / d) * Float64(Float64(D * Float64(M * D)) / Float64(-4.0 * Float64(d * l)))), h, 1.0)));
                                  	else
                                  		tmp = Float64(w0 * sqrt(fma(Float64(D / d), Float64(Float64(Float64(M * Float64(M * D)) / Float64(d * l)) * Float64(h * -0.25)), 1.0)));
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 2.5e-11], N[(w0 * N[Sqrt[N[(N[(N[(M / d), $MachinePrecision] * N[(N[(D * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(D / d), $MachinePrecision] * N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * -0.25), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;M \cdot D \leq 2.5 \cdot 10^{-11}:\\
                                  \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M}{d} \cdot \frac{D \cdot \left(M \cdot D\right)}{-4 \cdot \left(d \cdot \ell\right)}, h, 1\right)}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D}{d}, \frac{M \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \left(h \cdot -0.25\right), 1\right)}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (*.f64 M D) < 2.50000000000000009e-11

                                    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 2.50000000000000009e-11 < (*.f64 M D)

                                    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto w0 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)}, -0.25 \cdot h, 1\right)}} \]
                                    8. Step-by-step derivation
                                      1. Applied rewrites70.0%

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

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

                                    Alternative 8: 88.1% accurate, 2.1× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{M \cdot D}{d}\\ w0 \cdot \sqrt{\mathsf{fma}\left(t\_0 \cdot \frac{t\_0}{\ell \cdot -4}, h, 1\right)} \end{array} \end{array} \]
                                    (FPCore (w0 M D h l d)
                                     :precision binary64
                                     (let* ((t_0 (/ (* M D) d)))
                                       (* w0 (sqrt (fma (* t_0 (/ t_0 (* l -4.0))) h 1.0)))))
                                    double code(double w0, double M, double D, double h, double l, double d) {
                                    	double t_0 = (M * D) / d;
                                    	return w0 * sqrt(fma((t_0 * (t_0 / (l * -4.0))), h, 1.0));
                                    }
                                    
                                    function code(w0, M, D, h, l, d)
                                    	t_0 = Float64(Float64(M * D) / d)
                                    	return Float64(w0 * sqrt(fma(Float64(t_0 * Float64(t_0 / Float64(l * -4.0))), h, 1.0)))
                                    end
                                    
                                    code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision]}, N[(w0 * N[Sqrt[N[(N[(t$95$0 * N[(t$95$0 / N[(l * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \frac{M \cdot D}{d}\\
                                    w0 \cdot \sqrt{\mathsf{fma}\left(t\_0 \cdot \frac{t\_0}{\ell \cdot -4}, h, 1\right)}
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 9: 75.6% accurate, 2.1× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \cdot D \leq 10^{-187}:\\ \;\;\;\;w0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot \left(-4 \cdot \left(d \cdot \ell\right)\right)}, h, 1\right)}\\ \end{array} \end{array} \]
                                    (FPCore (w0 M D h l d)
                                     :precision binary64
                                     (if (<= (* M D) 1e-187)
                                       (* w0 1.0)
                                       (* w0 (sqrt (fma (* (* M D) (/ (* M D) (* d (* -4.0 (* d l))))) h 1.0)))))
                                    double code(double w0, double M, double D, double h, double l, double d) {
                                    	double tmp;
                                    	if ((M * D) <= 1e-187) {
                                    		tmp = w0 * 1.0;
                                    	} else {
                                    		tmp = w0 * sqrt(fma(((M * D) * ((M * D) / (d * (-4.0 * (d * l))))), h, 1.0));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(w0, M, D, h, l, d)
                                    	tmp = 0.0
                                    	if (Float64(M * D) <= 1e-187)
                                    		tmp = Float64(w0 * 1.0);
                                    	else
                                    		tmp = Float64(w0 * sqrt(fma(Float64(Float64(M * D) * Float64(Float64(M * D) / Float64(d * Float64(-4.0 * Float64(d * l))))), h, 1.0)));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 1e-187], N[(w0 * 1.0), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(N[(M * D), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;M \cdot D \leq 10^{-187}:\\
                                    \;\;\;\;w0 \cdot 1\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot \left(-4 \cdot \left(d \cdot \ell\right)\right)}, h, 1\right)}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if (*.f64 M D) < 1e-187

                                      1. Initial program 80.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. Applied rewrites76.5%

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

                                        if 1e-187 < (*.f64 M D)

                                        1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \sqrt{\mathsf{fma}\left(\left(M \cdot D\right) \cdot \frac{M \cdot D}{d \cdot \color{blue}{\left(\left(d \cdot \ell\right) \cdot \left(\mathsf{neg}\left(4\right)\right)\right)}}, h, 1\right)} \cdot w0 \]
                                          23. metadata-eval81.1

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

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

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

                                      Alternative 10: 73.4% accurate, 2.1× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \cdot D \leq 2 \cdot 10^{-120}:\\ \;\;\;\;w0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D, \left(h \cdot -0.25\right) \cdot \frac{M \cdot \left(M \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)}\\ \end{array} \end{array} \]
                                      (FPCore (w0 M D h l d)
                                       :precision binary64
                                       (if (<= (* M D) 2e-120)
                                         (* w0 1.0)
                                         (* w0 (sqrt (fma D (* (* h -0.25) (/ (* M (* M D)) (* d (* d l)))) 1.0)))))
                                      double code(double w0, double M, double D, double h, double l, double d) {
                                      	double tmp;
                                      	if ((M * D) <= 2e-120) {
                                      		tmp = w0 * 1.0;
                                      	} else {
                                      		tmp = w0 * sqrt(fma(D, ((h * -0.25) * ((M * (M * D)) / (d * (d * l)))), 1.0));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(w0, M, D, h, l, d)
                                      	tmp = 0.0
                                      	if (Float64(M * D) <= 2e-120)
                                      		tmp = Float64(w0 * 1.0);
                                      	else
                                      		tmp = Float64(w0 * sqrt(fma(D, Float64(Float64(h * -0.25) * Float64(Float64(M * Float64(M * D)) / Float64(d * Float64(d * l)))), 1.0)));
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 2e-120], N[(w0 * 1.0), $MachinePrecision], N[(w0 * N[Sqrt[N[(D * N[(N[(h * -0.25), $MachinePrecision] * N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;M \cdot D \leq 2 \cdot 10^{-120}:\\
                                      \;\;\;\;w0 \cdot 1\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D, \left(h \cdot -0.25\right) \cdot \frac{M \cdot \left(M \cdot D\right)}{d \cdot \left(d \cdot \ell\right)}, 1\right)}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if (*.f64 M D) < 1.99999999999999996e-120

                                        1. Initial program 78.5%

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

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

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

                                          if 1.99999999999999996e-120 < (*.f64 M D)

                                          1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 11: 74.5% accurate, 2.1× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;M \cdot D \leq 10^{-187}:\\ \;\;\;\;w0 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D, M \cdot \left(\left(h \cdot -0.25\right) \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot d\right)}\right), 1\right)}\\ \end{array} \end{array} \]
                                        (FPCore (w0 M D h l d)
                                         :precision binary64
                                         (if (<= (* M D) 1e-187)
                                           (* w0 1.0)
                                           (* w0 (sqrt (fma D (* M (* (* h -0.25) (/ (* M D) (* l (* d d))))) 1.0)))))
                                        double code(double w0, double M, double D, double h, double l, double d) {
                                        	double tmp;
                                        	if ((M * D) <= 1e-187) {
                                        		tmp = w0 * 1.0;
                                        	} else {
                                        		tmp = w0 * sqrt(fma(D, (M * ((h * -0.25) * ((M * D) / (l * (d * d))))), 1.0));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(w0, M, D, h, l, d)
                                        	tmp = 0.0
                                        	if (Float64(M * D) <= 1e-187)
                                        		tmp = Float64(w0 * 1.0);
                                        	else
                                        		tmp = Float64(w0 * sqrt(fma(D, Float64(M * Float64(Float64(h * -0.25) * Float64(Float64(M * D) / Float64(l * Float64(d * d))))), 1.0)));
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(M * D), $MachinePrecision], 1e-187], N[(w0 * 1.0), $MachinePrecision], N[(w0 * N[Sqrt[N[(D * N[(M * N[(N[(h * -0.25), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;M \cdot D \leq 10^{-187}:\\
                                        \;\;\;\;w0 \cdot 1\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(D, M \cdot \left(\left(h \cdot -0.25\right) \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot d\right)}\right), 1\right)}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (*.f64 M D) < 1e-187

                                          1. Initial program 80.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. Applied rewrites76.5%

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

                                            if 1e-187 < (*.f64 M D)

                                            1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(D, \frac{M \cdot \left(M \cdot D\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(h \cdot -0.25\right), 1\right)} \cdot w0} \]
                                            10. Step-by-step derivation
                                              1. Applied rewrites78.1%

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

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

                                            Alternative 12: 85.3% accurate, 2.1× speedup?

                                            \[\begin{array}{l} \\ w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot 0.5}{d}, h \cdot \frac{M \cdot D}{\left(d \cdot -2\right) \cdot \ell}, 1\right)} \end{array} \]
                                            (FPCore (w0 M D h l d)
                                             :precision binary64
                                             (*
                                              w0
                                              (sqrt (fma (/ (* (* M D) 0.5) d) (* h (/ (* M D) (* (* d -2.0) l))) 1.0))))
                                            double code(double w0, double M, double D, double h, double l, double d) {
                                            	return w0 * sqrt(fma((((M * D) * 0.5) / d), (h * ((M * D) / ((d * -2.0) * l))), 1.0));
                                            }
                                            
                                            function code(w0, M, D, h, l, d)
                                            	return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) * 0.5) / d), Float64(h * Float64(Float64(M * D) / Float64(Float64(d * -2.0) * l))), 1.0)))
                                            end
                                            
                                            code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] * 0.5), $MachinePrecision] / d), $MachinePrecision] * N[(h * N[(N[(M * D), $MachinePrecision] / N[(N[(d * -2.0), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot 0.5}{d}, h \cdot \frac{M \cdot D}{\left(d \cdot -2\right) \cdot \ell}, 1\right)}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 13: 84.6% accurate, 2.3× speedup?

                                            \[\begin{array}{l} \\ w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{-4 \cdot \left(d \cdot \ell\right)}, h, 1\right)} \end{array} \]
                                            (FPCore (w0 M D h l d)
                                             :precision binary64
                                             (* w0 (sqrt (fma (* (/ (* M D) d) (/ (* M D) (* -4.0 (* d l)))) h 1.0))))
                                            double code(double w0, double M, double D, double h, double l, double d) {
                                            	return w0 * sqrt(fma((((M * D) / d) * ((M * D) / (-4.0 * (d * l)))), h, 1.0));
                                            }
                                            
                                            function code(w0, M, D, h, l, d)
                                            	return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) / d) * Float64(Float64(M * D) / Float64(-4.0 * Float64(d * l)))), h, 1.0)))
                                            end
                                            
                                            code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{-4 \cdot \left(d \cdot \ell\right)}, h, 1\right)}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 14: 83.5% accurate, 2.3× speedup?

                                            \[\begin{array}{l} \\ w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{-4 \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{M}{d}\right), h, 1\right)} \end{array} \]
                                            (FPCore (w0 M D h l d)
                                             :precision binary64
                                             (* w0 (sqrt (fma (* (/ (* M D) (* -4.0 (* d l))) (* D (/ M d))) h 1.0))))
                                            double code(double w0, double M, double D, double h, double l, double d) {
                                            	return w0 * sqrt(fma((((M * D) / (-4.0 * (d * l))) * (D * (M / d))), h, 1.0));
                                            }
                                            
                                            function code(w0, M, D, h, l, d)
                                            	return Float64(w0 * sqrt(fma(Float64(Float64(Float64(M * D) / Float64(-4.0 * Float64(d * l))) * Float64(D * Float64(M / d))), h, 1.0)))
                                            end
                                            
                                            code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(N[(N[(M * D), $MachinePrecision] / N[(-4.0 * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * h + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            w0 \cdot \sqrt{\mathsf{fma}\left(\frac{M \cdot D}{-4 \cdot \left(d \cdot \ell\right)} \cdot \left(D \cdot \frac{M}{d}\right), h, 1\right)}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 15: 77.9% accurate, 2.3× speedup?

                                            \[\begin{array}{l} \\ w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D}{d}, \frac{M \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \left(h \cdot -0.25\right), 1\right)} \end{array} \]
                                            (FPCore (w0 M D h l d)
                                             :precision binary64
                                             (* w0 (sqrt (fma (/ D d) (* (/ (* M (* M D)) (* d l)) (* h -0.25)) 1.0))))
                                            double code(double w0, double M, double D, double h, double l, double d) {
                                            	return w0 * sqrt(fma((D / d), (((M * (M * D)) / (d * l)) * (h * -0.25)), 1.0));
                                            }
                                            
                                            function code(w0, M, D, h, l, d)
                                            	return Float64(w0 * sqrt(fma(Float64(D / d), Float64(Float64(Float64(M * Float64(M * D)) / Float64(d * l)) * Float64(h * -0.25)), 1.0)))
                                            end
                                            
                                            code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(N[(D / d), $MachinePrecision] * N[(N[(N[(M * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(h * -0.25), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D}{d}, \frac{M \cdot \left(M \cdot D\right)}{d \cdot \ell} \cdot \left(h \cdot -0.25\right), 1\right)}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto w0 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)}, -0.25 \cdot h, 1\right)}} \]
                                            8. Step-by-step derivation
                                              1. Applied rewrites79.5%

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

                                              Alternative 16: 67.6% accurate, 26.2× speedup?

                                              \[\begin{array}{l} \\ w0 \cdot 1 \end{array} \]
                                              (FPCore (w0 M D h l d) :precision binary64 (* w0 1.0))
                                              double code(double w0, double M, double D, double h, double l, double d) {
                                              	return w0 * 1.0;
                                              }
                                              
                                              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 * 1.0d0
                                              end function
                                              
                                              public static double code(double w0, double M, double D, double h, double l, double d) {
                                              	return w0 * 1.0;
                                              }
                                              
                                              def code(w0, M, D, h, l, d):
                                              	return w0 * 1.0
                                              
                                              function code(w0, M, D, h, l, d)
                                              	return Float64(w0 * 1.0)
                                              end
                                              
                                              function tmp = code(w0, M, D, h, l, d)
                                              	tmp = w0 * 1.0;
                                              end
                                              
                                              code[w0_, M_, D_, h_, l_, d_] := N[(w0 * 1.0), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              w0 \cdot 1
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 79.4%

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

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

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

                                                Reproduce

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