Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.3% → 89.1%
Time: 14.7s
Alternatives: 15
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 81.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: 89.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\frac{M \cdot D}{d \cdot -2}}{\ell}, \frac{M \cdot D}{d \cdot 2} \cdot 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)) 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)) * 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)) * 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] * h), $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{M \cdot D}{d \cdot 2} \cdot h, 1\right)}
\end{array}
Derivation
  1. Initial program 79.8%

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

      \[\leadsto w0 \cdot \sqrt{\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.2%

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

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

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

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

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

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

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

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

Alternative 2: 85.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -20000000000:\\ \;\;\;\;w0 \cdot \sqrt{D \cdot \frac{\frac{M \cdot \left(D \cdot -0.25\right)}{d \cdot \ell} \cdot \left(M \cdot h\right)}{d}}\\ \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)) -20000000000.0)
   (* w0 (sqrt (* D (/ (* (/ (* M (* D -0.25)) (* d l)) (* M h)) 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)) <= -20000000000.0) {
		tmp = w0 * sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / 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)) <= (-20000000000.0d0)) then
        tmp = w0 * sqrt((d * ((((m * (d * (-0.25d0))) / (d_1 * l)) * (m * h)) / 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)) <= -20000000000.0) {
		tmp = w0 * Math.sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / 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)) <= -20000000000.0:
		tmp = w0 * math.sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / 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)) <= -20000000000.0)
		tmp = Float64(w0 * sqrt(Float64(D * Float64(Float64(Float64(Float64(M * Float64(D * -0.25)) / Float64(d * l)) * Float64(M * h)) / 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)) <= -20000000000.0)
		tmp = w0 * sqrt((D * ((((M * (D * -0.25)) / (d * l)) * (M * h)) / 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], -20000000000.0], N[(w0 * N[Sqrt[N[(D * N[(N[(N[(N[(M * N[(D * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(M * h), $MachinePrecision]), $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 -20000000000:\\
\;\;\;\;w0 \cdot \sqrt{D \cdot \frac{\frac{M \cdot \left(D \cdot -0.25\right)}{d \cdot \ell} \cdot \left(M \cdot h\right)}{d}}\\

\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)) < -2e10

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{\color{blue}{\frac{\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(M \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
    6. Step-by-step derivation
      1. Applied rewrites48.3%

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

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

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

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

          1. Initial program 85.9%

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

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

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

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

          Alternative 3: 84.4% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot \frac{h}{\ell} \leq -20000000000:\\ \;\;\;\;w0 \cdot \sqrt{D \cdot \left(\frac{D \cdot -0.25}{d \cdot \ell} \cdot \left(M \cdot \frac{M \cdot h}{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)) -20000000000.0)
             (* w0 (sqrt (* D (* (/ (* D -0.25) (* d l)) (* M (/ (* M h) 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)) <= -20000000000.0) {
          		tmp = w0 * sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / 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)) <= (-20000000000.0d0)) then
                  tmp = w0 * sqrt((d * (((d * (-0.25d0)) / (d_1 * l)) * (m * ((m * h) / 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)) <= -20000000000.0) {
          		tmp = w0 * Math.sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / 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)) <= -20000000000.0:
          		tmp = w0 * math.sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / 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)) <= -20000000000.0)
          		tmp = Float64(w0 * sqrt(Float64(D * Float64(Float64(Float64(D * -0.25) / Float64(d * l)) * Float64(M * Float64(Float64(M * h) / 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)) <= -20000000000.0)
          		tmp = w0 * sqrt((D * (((D * -0.25) / (d * l)) * (M * ((M * h) / 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], -20000000000.0], N[(w0 * N[Sqrt[N[(D * N[(N[(N[(D * -0.25), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(M * N[(N[(M * h), $MachinePrecision] / d), $MachinePrecision]), $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 -20000000000:\\
          \;\;\;\;w0 \cdot \sqrt{D \cdot \left(\frac{D \cdot -0.25}{d \cdot \ell} \cdot \left(M \cdot \frac{M \cdot h}{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)) < -2e10

            1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto w0 \cdot \sqrt{\color{blue}{\frac{\left(-0.25 \cdot \left(D \cdot D\right)\right) \cdot \left(\left(M \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
            6. Step-by-step derivation
              1. Applied rewrites48.3%

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

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

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

                1. Initial program 85.9%

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

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

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

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

                Alternative 4: 82.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 -5 \cdot 10^{+57}:\\ \;\;\;\;w0 \cdot \sqrt{\frac{\left(D \cdot -0.25\right) \cdot \left(M \cdot \left(D \cdot \left(M \cdot h\right)\right)\right)}{d \cdot \left(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+57)
                   (* w0 (sqrt (/ (* (* D -0.25) (* M (* D (* M h)))) (* d (* 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+57) {
                		tmp = w0 * sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (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+57)) then
                        tmp = w0 * sqrt((((d * (-0.25d0)) * (m * (d * (m * h)))) / (d_1 * (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+57) {
                		tmp = w0 * Math.sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (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+57:
                		tmp = w0 * math.sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (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+57)
                		tmp = Float64(w0 * sqrt(Float64(Float64(Float64(D * -0.25) * Float64(M * Float64(D * Float64(M * h)))) / Float64(d * 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+57)
                		tmp = w0 * sqrt((((D * -0.25) * (M * (D * (M * h)))) / (d * (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+57], N[(w0 * N[Sqrt[N[(N[(N[(D * -0.25), $MachinePrecision] * N[(M * N[(D * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $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 -5 \cdot 10^{+57}:\\
                \;\;\;\;w0 \cdot \sqrt{\frac{\left(D \cdot -0.25\right) \cdot \left(M \cdot \left(D \cdot \left(M \cdot h\right)\right)\right)}{d \cdot \left(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)) < -4.99999999999999972e57

                  1. Initial program 62.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 inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      1. Initial program 86.1%

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

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

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

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

                      Alternative 5: 82.8% 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^{+57}:\\ \;\;\;\;w0 \cdot \sqrt{\frac{M \cdot \left(D \cdot \left(M \cdot \left(h \cdot \left(D \cdot -0.25\right)\right)\right)\right)}{d \cdot \left(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+57)
                         (* w0 (sqrt (/ (* M (* D (* M (* h (* D -0.25))))) (* d (* 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+57) {
                      		tmp = w0 * sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (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+57)) then
                              tmp = w0 * sqrt(((m * (d * (m * (h * (d * (-0.25d0)))))) / (d_1 * (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+57) {
                      		tmp = w0 * Math.sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (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+57:
                      		tmp = w0 * math.sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (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+57)
                      		tmp = Float64(w0 * sqrt(Float64(Float64(M * Float64(D * Float64(M * Float64(h * Float64(D * -0.25))))) / Float64(d * 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+57)
                      		tmp = w0 * sqrt(((M * (D * (M * (h * (D * -0.25))))) / (d * (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+57], N[(w0 * N[Sqrt[N[(N[(M * N[(D * N[(M * N[(h * N[(D * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $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 -5 \cdot 10^{+57}:\\
                      \;\;\;\;w0 \cdot \sqrt{\frac{M \cdot \left(D \cdot \left(M \cdot \left(h \cdot \left(D \cdot -0.25\right)\right)\right)\right)}{d \cdot \left(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)) < -4.99999999999999972e57

                        1. Initial program 62.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 inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            1. Initial program 86.1%

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

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

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

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

                            Alternative 6: 80.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 -5 \cdot 10^{+57}:\\ \;\;\;\;w0 \cdot \sqrt{\frac{D \cdot \left(D \cdot -0.25\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(M \cdot \left(M \cdot h\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+57)
                               (* w0 (sqrt (* (/ (* D (* D -0.25)) (* d (* d l))) (* M (* M h)))))
                               (* 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+57) {
                            		tmp = w0 * sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h))));
                            	} 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+57)) then
                                    tmp = w0 * sqrt((((d * (d * (-0.25d0))) / (d_1 * (d_1 * l))) * (m * (m * h))))
                                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+57) {
                            		tmp = w0 * Math.sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h))));
                            	} 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+57:
                            		tmp = w0 * math.sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h))))
                            	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+57)
                            		tmp = Float64(w0 * sqrt(Float64(Float64(Float64(D * Float64(D * -0.25)) / Float64(d * Float64(d * l))) * Float64(M * Float64(M * h)))));
                            	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+57)
                            		tmp = w0 * sqrt((((D * (D * -0.25)) / (d * (d * l))) * (M * (M * h))));
                            	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+57], N[(w0 * N[Sqrt[N[(N[(N[(D * N[(D * -0.25), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * N[(M * h), $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 -5 \cdot 10^{+57}:\\
                            \;\;\;\;w0 \cdot \sqrt{\frac{D \cdot \left(D \cdot -0.25\right)}{d \cdot \left(d \cdot \ell\right)} \cdot \left(M \cdot \left(M \cdot h\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)) < -4.99999999999999972e57

                              1. Initial program 62.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 inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  1. Initial program 86.1%

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

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

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

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

                                  Alternative 7: 79.7% 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 -20000000000:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{h \cdot -0.125}{d} \cdot \frac{M \cdot \left(w0 \cdot M\right)}{d \cdot \ell}, 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)) -20000000000.0)
                                     (fma (* D D) (* (/ (* h -0.125) d) (/ (* M (* w0 M)) (* 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)) <= -20000000000.0) {
                                  		tmp = fma((D * D), (((h * -0.125) / d) * ((M * (w0 * M)) / (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)) <= -20000000000.0)
                                  		tmp = fma(Float64(D * D), Float64(Float64(Float64(h * -0.125) / d) * Float64(Float64(M * Float64(w0 * M)) / 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], -20000000000.0], N[(N[(D * D), $MachinePrecision] * N[(N[(N[(h * -0.125), $MachinePrecision] / d), $MachinePrecision] * N[(N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision] / 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 -20000000000:\\
                                  \;\;\;\;\mathsf{fma}\left(D \cdot D, \frac{h \cdot -0.125}{d} \cdot \frac{M \cdot \left(w0 \cdot M\right)}{d \cdot \ell}, 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)) < -2e10

                                    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

                                      1. Initial program 85.9%

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

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

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

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

                                      Alternative 8: 79.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^{+110}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \left(h \cdot -0.125\right) \cdot \frac{M \cdot \left(w0 \cdot M\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+110)
                                         (fma (* D D) (* (* h -0.125) (/ (* 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+110) {
                                      		tmp = fma((D * D), ((h * -0.125) * ((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+110)
                                      		tmp = fma(Float64(D * D), Float64(Float64(h * -0.125) * Float64(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+110], N[(N[(D * D), $MachinePrecision] * N[(N[(h * -0.125), $MachinePrecision] * N[(N[(M * N[(w0 * M), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $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^{+110}:\\
                                      \;\;\;\;\mathsf{fma}\left(D \cdot D, \left(h \cdot -0.125\right) \cdot \frac{M \cdot \left(w0 \cdot M\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)) < -2e110

                                        1. Initial program 61.0%

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

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

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

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

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

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

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

                                            \[\leadsto \color{blue}{\mathsf{fma}\left({D}^{2}, \frac{-1}{8} \cdot \frac{{M}^{2} \cdot \left(h \cdot w0\right)}{{d}^{2} \cdot \ell}, w0\right)} \]
                                        5. Applied rewrites45.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)}{\left(d \cdot d\right) \cdot \ell}, w0\right)} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites48.6%

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

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

                                          1. Initial program 86.3%

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

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

                                              \[\leadsto w0 \cdot \color{blue}{1} \]
                                          5. Recombined 2 regimes into one program.
                                          6. Final simplification82.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^{+110}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot D, \left(h \cdot -0.125\right) \cdot \frac{M \cdot \left(w0 \cdot M\right)}{d \cdot \left(d \cdot \ell\right)}, w0\right)\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot 1\\ \end{array} \]
                                          7. Add Preprocessing

                                          Alternative 9: 78.8% 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 -4 \cdot 10^{+208}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot \left(-0.125 \cdot \left(w0 \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\right)}{\ell \cdot \left(d \cdot d\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)) -4e+208)
                                             (/ (* (* D D) (* -0.125 (* w0 (* M (* M h))))) (* 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)) <= -4e+208) {
                                          		tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (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)) <= (-4d+208)) then
                                                  tmp = ((d * d) * ((-0.125d0) * (w0 * (m * (m * h))))) / (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)) <= -4e+208) {
                                          		tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (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)) <= -4e+208:
                                          		tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (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)) <= -4e+208)
                                          		tmp = Float64(Float64(Float64(D * D) * Float64(-0.125 * Float64(w0 * Float64(M * Float64(M * h))))) / 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)) <= -4e+208)
                                          		tmp = ((D * D) * (-0.125 * (w0 * (M * (M * h))))) / (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], -4e+208], N[(N[(N[(D * D), $MachinePrecision] * N[(-0.125 * N[(w0 * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $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 -4 \cdot 10^{+208}:\\
                                          \;\;\;\;\frac{\left(D \cdot D\right) \cdot \left(-0.125 \cdot \left(w0 \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\right)}{\ell \cdot \left(d \cdot d\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)) < -3.9999999999999999e208

                                            1. Initial program 59.8%

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

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

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

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

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

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

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

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

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(M \cdot w0\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}, w0\right)} \]
                                            6. Taylor expanded in 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}} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites44.9%

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

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

                                                if -3.9999999999999999e208 < (*.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 rewrites92.8%

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

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

                                                Alternative 10: 78.7% 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^{+228}:\\ \;\;\;\;\frac{\left(D \cdot D\right) \cdot \left(-0.125 \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(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)) -2e+228)
                                                   (/ (* (* D D) (* -0.125 (* w0 (* h (* M M))))) (* d (* 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)) <= -2e+228) {
                                                		tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (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)) <= (-2d+228)) then
                                                        tmp = ((d * d) * ((-0.125d0) * (w0 * (h * (m * m))))) / (d_1 * (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)) <= -2e+228) {
                                                		tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (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)) <= -2e+228:
                                                		tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (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)) <= -2e+228)
                                                		tmp = Float64(Float64(Float64(D * D) * Float64(-0.125 * Float64(w0 * Float64(h * Float64(M * M))))) / Float64(d * 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)) <= -2e+228)
                                                		tmp = ((D * D) * (-0.125 * (w0 * (h * (M * M))))) / (d * (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], -2e+228], N[(N[(N[(D * D), $MachinePrecision] * N[(-0.125 * N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $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^{+228}:\\
                                                \;\;\;\;\frac{\left(D \cdot D\right) \cdot \left(-0.125 \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{d \cdot \left(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)) < -1.9999999999999998e228

                                                  1. Initial program 57.9%

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

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

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

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

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

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

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

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

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(M \cdot w0\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}, w0\right)} \]
                                                  6. Taylor expanded in 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}} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites47.0%

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

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

                                                      if -1.9999999999999998e228 < (*.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 rewrites91.4%

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

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

                                                      Alternative 11: 79.0% 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^{+225}:\\ \;\;\;\;D \cdot \frac{-0.125 \cdot \left(D \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{\ell \cdot \left(d \cdot d\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+225)
                                                         (* D (/ (* -0.125 (* D (* w0 (* h (* M M))))) (* 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)) <= -5e+225) {
                                                      		tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (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)) <= (-5d+225)) then
                                                              tmp = d * (((-0.125d0) * (d * (w0 * (h * (m * m))))) / (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)) <= -5e+225) {
                                                      		tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (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)) <= -5e+225:
                                                      		tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (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)) <= -5e+225)
                                                      		tmp = Float64(D * Float64(Float64(-0.125 * Float64(D * Float64(w0 * Float64(h * Float64(M * M))))) / 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)) <= -5e+225)
                                                      		tmp = D * ((-0.125 * (D * (w0 * (h * (M * M))))) / (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], -5e+225], N[(D * N[(N[(-0.125 * N[(D * N[(w0 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * 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^{+225}:\\
                                                      \;\;\;\;D \cdot \frac{-0.125 \cdot \left(D \cdot \left(w0 \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)\right)}{\ell \cdot \left(d \cdot d\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)) < -4.99999999999999981e225

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

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

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

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

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

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

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

                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{-0.125 \cdot \left(h \cdot \left(M \cdot \left(M \cdot w0\right)\right)\right)}{\left(d \cdot d\right) \cdot \ell}, w0\right)} \]
                                                        6. Taylor expanded in 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}} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites46.3%

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

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

                                                          if -4.99999999999999981e225 < (*.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 rewrites91.9%

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

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

                                                          Alternative 12: 87.7% accurate, 1.7× speedup?

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

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

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

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

                                                            if 5e103 < (*.f64 #s(literal 2 binary64) d)

                                                            1. Initial program 77.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. Applied rewrites77.2%

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

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

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

                                                          Alternative 13: 78.2% accurate, 1.8× speedup?

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

                                                            1. Initial program 82.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 rewrites78.7%

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

                                                              if 2.00000000000000007e-284 < (*.f64 M D)

                                                              1. Initial program 74.9%

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

                                                                  \[\leadsto w0 \cdot \sqrt{\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. Applied rewrites62.4%

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

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

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

                                                            Alternative 14: 73.1% accurate, 2.0× speedup?

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

                                                              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. Taylor expanded in M around 0

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

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

                                                                if 1.99999999999999989e34 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d))

                                                                1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

                                                                Alternative 15: 68.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.8%

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

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

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

                                                                  Reproduce

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