Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 80.5% → 86.2%
Time: 12.1s
Alternatives: 7
Speedup: 0.5×

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

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

Initial Program: 80.5% 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: 86.2% accurate, 0.5× speedup?

\[\begin{array}{l} [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \leq \infty:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
 :precision binary64
 (if (<=
      (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))
      INFINITY)
   (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0)))))
   w0))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if ((w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))) <= ((double) INFINITY)) {
		tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / 2.0) * (M / d)), 2.0))));
	} else {
		tmp = w0;
	}
	return tmp;
}
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if ((w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))) <= Double.POSITIVE_INFINITY) {
		tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0))));
	} else {
		tmp = w0;
	}
	return tmp;
}
[M, D] = sort([M, D])
def code(w0, M, D, h, l, d):
	tmp = 0
	if (w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))) <= math.inf:
		tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0))))
	else:
		tmp = w0
	return tmp
M, D = sort([M, D])
function code(w0, M, D, h, l, d)
	tmp = 0.0
	if (Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))))) <= Inf)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0)))));
	else
		tmp = w0;
	end
	return tmp
end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
	tmp = 0.0;
	if ((w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))))) <= Inf)
		tmp = w0 * sqrt((1.0 - ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0))));
	else
		tmp = w0;
	end
	tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[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], Infinity], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], w0]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \leq \infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < +inf.0

    1. Initial program 86.1%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified86.5%

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

    if +inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)))))

    1. Initial program 0.0%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified13.0%

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

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

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

Alternative 2: 71.0% accurate, 1.8× speedup?

\[\begin{array}{l} [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;M \leq 4.6 \cdot 10^{-119}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right)}\\ \end{array} \end{array} \]
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
 :precision binary64
 (if (<= M 4.6e-119)
   w0
   (* w0 (sqrt (- 1.0 (* 0.25 (* (* (/ D d) (/ D d)) (/ (* h (* M M)) l))))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 4.6e-119) {
		tmp = w0;
	} else {
		tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))));
	}
	return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 4.6d-119) then
        tmp = w0
    else
        tmp = w0 * sqrt((1.0d0 - (0.25d0 * (((d / d_1) * (d / d_1)) * ((h * (m * m)) / l)))))
    end if
    code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 4.6e-119) {
		tmp = w0;
	} else {
		tmp = w0 * Math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))));
	}
	return tmp;
}
[M, D] = sort([M, D])
def code(w0, M, D, h, l, d):
	tmp = 0
	if M <= 4.6e-119:
		tmp = w0
	else:
		tmp = w0 * math.sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))))
	return tmp
M, D = sort([M, D])
function code(w0, M, D, h, l, d)
	tmp = 0.0
	if (M <= 4.6e-119)
		tmp = w0;
	else
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(0.25 * Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(Float64(h * Float64(M * M)) / l))))));
	end
	return tmp
end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
	tmp = 0.0;
	if (M <= 4.6e-119)
		tmp = w0;
	else
		tmp = w0 * sqrt((1.0 - (0.25 * (((D / d) * (D / d)) * ((h * (M * M)) / l)))));
	end
	tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 4.6e-119], w0, N[(w0 * N[Sqrt[N[(1.0 - N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 4.6 \cdot 10^{-119}:\\
\;\;\;\;w0\\

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


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

    1. Initial program 82.0%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified84.8%

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

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

    if 4.59999999999999987e-119 < M

    1. Initial program 70.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified69.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 4.6 \cdot 10^{-119}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - 0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(M \cdot M\right)}{\ell}\right)}\\ \end{array} \]

Alternative 3: 70.2% accurate, 9.4× speedup?

\[\begin{array}{l} [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;M \leq 1.25 \cdot 10^{-118}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(1 + -0.125 \cdot \left(h \cdot \left(\frac{M \cdot D}{d \cdot d} \cdot \frac{M \cdot D}{\ell}\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
 :precision binary64
 (if (<= M 1.25e-118)
   w0
   (* w0 (+ 1.0 (* -0.125 (* h (* (/ (* M D) (* d d)) (/ (* M D) l))))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 1.25e-118) {
		tmp = w0;
	} else {
		tmp = w0 * (1.0 + (-0.125 * (h * (((M * D) / (d * d)) * ((M * D) / l)))));
	}
	return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 1.25d-118) then
        tmp = w0
    else
        tmp = w0 * (1.0d0 + ((-0.125d0) * (h * (((m * d) / (d_1 * d_1)) * ((m * d) / l)))))
    end if
    code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 1.25e-118) {
		tmp = w0;
	} else {
		tmp = w0 * (1.0 + (-0.125 * (h * (((M * D) / (d * d)) * ((M * D) / l)))));
	}
	return tmp;
}
[M, D] = sort([M, D])
def code(w0, M, D, h, l, d):
	tmp = 0
	if M <= 1.25e-118:
		tmp = w0
	else:
		tmp = w0 * (1.0 + (-0.125 * (h * (((M * D) / (d * d)) * ((M * D) / l)))))
	return tmp
M, D = sort([M, D])
function code(w0, M, D, h, l, d)
	tmp = 0.0
	if (M <= 1.25e-118)
		tmp = w0;
	else
		tmp = Float64(w0 * Float64(1.0 + Float64(-0.125 * Float64(h * Float64(Float64(Float64(M * D) / Float64(d * d)) * Float64(Float64(M * D) / l))))));
	end
	return tmp
end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
	tmp = 0.0;
	if (M <= 1.25e-118)
		tmp = w0;
	else
		tmp = w0 * (1.0 + (-0.125 * (h * (((M * D) / (d * d)) * ((M * D) / l)))));
	end
	tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 1.25e-118], w0, N[(w0 * N[(1.0 + N[(-0.125 * N[(h * N[(N[(N[(M * D), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 1.25 \cdot 10^{-118}:\\
\;\;\;\;w0\\

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


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

    1. Initial program 82.0%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified84.8%

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

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

    if 1.25000000000000004e-118 < M

    1. Initial program 70.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified69.6%

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

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

        \[\leadsto w0 \cdot \left(1 + \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot -0.125}\right) \]
      2. times-frac49.3%

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

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

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

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

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

      \[\leadsto w0 \cdot \left(1 + \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}} \cdot -0.125\right) \]
    7. Step-by-step derivation
      1. associate-*r*50.4%

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

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

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

        \[\leadsto w0 \cdot \left(1 + \frac{\left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right) \cdot h}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \cdot -0.125\right) \]
      5. associate-*r*55.6%

        \[\leadsto w0 \cdot \left(1 + \frac{\left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right) \cdot h}{\color{blue}{d \cdot \left(d \cdot \ell\right)}} \cdot -0.125\right) \]
      6. associate-*l/55.6%

        \[\leadsto w0 \cdot \left(1 + \color{blue}{\left(\frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{d \cdot \left(d \cdot \ell\right)} \cdot h\right)} \cdot -0.125\right) \]
      7. *-commutative55.6%

        \[\leadsto w0 \cdot \left(1 + \color{blue}{\left(h \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{d \cdot \left(d \cdot \ell\right)}\right)} \cdot -0.125\right) \]
      8. unswap-sqr62.0%

        \[\leadsto w0 \cdot \left(1 + \left(h \cdot \frac{\color{blue}{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}}{d \cdot \left(d \cdot \ell\right)}\right) \cdot -0.125\right) \]
      9. associate-*r*56.9%

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

      \[\leadsto w0 \cdot \left(1 + \color{blue}{\left(h \cdot \frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\left(d \cdot d\right) \cdot \ell}\right)} \cdot -0.125\right) \]
    9. Step-by-step derivation
      1. times-frac58.5%

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

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

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

Alternative 4: 70.5% accurate, 9.4× speedup?

\[\begin{array}{l} [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;M \leq 5 \cdot 10^{-119}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(1 + \frac{\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell} \cdot -0.125\right)\\ \end{array} \end{array} \]
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
 :precision binary64
 (if (<= M 5e-119)
   w0
   (* w0 (+ 1.0 (* (/ (* (* (/ D d) (/ D d)) (* h (* M M))) l) -0.125)))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 5e-119) {
		tmp = w0;
	} else {
		tmp = w0 * (1.0 + (((((D / d) * (D / d)) * (h * (M * M))) / l) * -0.125));
	}
	return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 5d-119) then
        tmp = w0
    else
        tmp = w0 * (1.0d0 + (((((d / d_1) * (d / d_1)) * (h * (m * m))) / l) * (-0.125d0)))
    end if
    code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 5e-119) {
		tmp = w0;
	} else {
		tmp = w0 * (1.0 + (((((D / d) * (D / d)) * (h * (M * M))) / l) * -0.125));
	}
	return tmp;
}
[M, D] = sort([M, D])
def code(w0, M, D, h, l, d):
	tmp = 0
	if M <= 5e-119:
		tmp = w0
	else:
		tmp = w0 * (1.0 + (((((D / d) * (D / d)) * (h * (M * M))) / l) * -0.125))
	return tmp
M, D = sort([M, D])
function code(w0, M, D, h, l, d)
	tmp = 0.0
	if (M <= 5e-119)
		tmp = w0;
	else
		tmp = Float64(w0 * Float64(1.0 + Float64(Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) * Float64(h * Float64(M * M))) / l) * -0.125)));
	end
	return tmp
end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
	tmp = 0.0;
	if (M <= 5e-119)
		tmp = w0;
	else
		tmp = w0 * (1.0 + (((((D / d) * (D / d)) * (h * (M * M))) / l) * -0.125));
	end
	tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 5e-119], w0, N[(w0 * N[(1.0 + N[(N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 5 \cdot 10^{-119}:\\
\;\;\;\;w0\\

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


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

    1. Initial program 82.0%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified84.8%

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

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

    if 4.99999999999999993e-119 < M

    1. Initial program 70.8%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified69.6%

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

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

        \[\leadsto w0 \cdot \left(1 + \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot -0.125}\right) \]
      2. times-frac49.3%

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

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

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

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

      \[\leadsto w0 \cdot \color{blue}{\left(1 + \left(\frac{D \cdot D}{d \cdot d} \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}\right) \cdot -0.125\right)} \]
    6. Step-by-step derivation
      1. associate-*r/49.3%

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

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

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

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

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

Alternative 5: 68.4% accurate, 10.3× speedup?

\[\begin{array}{l} [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;M \leq 3.1 \cdot 10^{-38}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;-0.125 \cdot \left(\left(w0 \cdot M\right) \cdot \left(\left(M \cdot h\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d \cdot \ell}\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
 :precision binary64
 (if (<= M 3.1e-38)
   w0
   (* -0.125 (* (* w0 M) (* (* M h) (* (/ D d) (/ D (* d l))))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 3.1e-38) {
		tmp = w0;
	} else {
		tmp = -0.125 * ((w0 * M) * ((M * h) * ((D / d) * (D / (d * l)))));
	}
	return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 3.1d-38) then
        tmp = w0
    else
        tmp = (-0.125d0) * ((w0 * m) * ((m * h) * ((d / d_1) * (d / (d_1 * l)))))
    end if
    code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 3.1e-38) {
		tmp = w0;
	} else {
		tmp = -0.125 * ((w0 * M) * ((M * h) * ((D / d) * (D / (d * l)))));
	}
	return tmp;
}
[M, D] = sort([M, D])
def code(w0, M, D, h, l, d):
	tmp = 0
	if M <= 3.1e-38:
		tmp = w0
	else:
		tmp = -0.125 * ((w0 * M) * ((M * h) * ((D / d) * (D / (d * l)))))
	return tmp
M, D = sort([M, D])
function code(w0, M, D, h, l, d)
	tmp = 0.0
	if (M <= 3.1e-38)
		tmp = w0;
	else
		tmp = Float64(-0.125 * Float64(Float64(w0 * M) * Float64(Float64(M * h) * Float64(Float64(D / d) * Float64(D / Float64(d * l))))));
	end
	return tmp
end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
	tmp = 0.0;
	if (M <= 3.1e-38)
		tmp = w0;
	else
		tmp = -0.125 * ((w0 * M) * ((M * h) * ((D / d) * (D / (d * l)))));
	end
	tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 3.1e-38], w0, N[(-0.125 * N[(N[(w0 * M), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] * N[(N[(D / d), $MachinePrecision] * N[(D / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 3.1 \cdot 10^{-38}:\\
\;\;\;\;w0\\

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


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

    1. Initial program 82.5%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified85.1%

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

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

    if 3.09999999999999983e-38 < M

    1. Initial program 66.5%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified65.1%

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

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

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

        \[\leadsto w0 \cdot \left(\color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot -0.125} + 1\right) \]
      3. fma-def44.4%

        \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}, -0.125, 1\right)} \]
      4. associate-*r*45.9%

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

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\color{blue}{\left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right)} \cdot h}{{d}^{2} \cdot \ell}, -0.125, 1\right) \]
      8. associate-/l*53.6%

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{\color{blue}{\left(d \cdot d\right)} \cdot \ell}{h}}, -0.125, 1\right) \]
      11. associate-*l*49.0%

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

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

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

        \[\leadsto -0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
      2. associate-*r*32.5%

        \[\leadsto -0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}} \]
      3. associate-/l*32.6%

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

        \[\leadsto -0.125 \cdot \frac{\color{blue}{D \cdot D}}{\frac{d \cdot \left(d \cdot \ell\right)}{{M}^{2} \cdot \left(h \cdot w0\right)}} \]
      5. associate-*r*30.8%

        \[\leadsto -0.125 \cdot \frac{D \cdot D}{\frac{\color{blue}{\left(d \cdot d\right) \cdot \ell}}{{M}^{2} \cdot \left(h \cdot w0\right)}} \]
      6. associate-*r*30.8%

        \[\leadsto -0.125 \cdot \frac{D \cdot D}{\frac{\left(d \cdot d\right) \cdot \ell}{\color{blue}{\left({M}^{2} \cdot h\right) \cdot w0}}} \]
      7. *-commutative30.8%

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

        \[\leadsto -0.125 \cdot \frac{D \cdot D}{\frac{\left(d \cdot d\right) \cdot \ell}{\left(h \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot w0}} \]
      9. associate-*r*31.2%

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

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

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

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

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

        \[\leadsto -0.125 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot \left(d \cdot \ell\right)}}{\left(\left(h \cdot M\right) \cdot M\right) \cdot w0}} \]
      2. associate-/r/32.9%

        \[\leadsto -0.125 \cdot \color{blue}{\left(\frac{D \cdot D}{d \cdot \left(d \cdot \ell\right)} \cdot \left(\left(\left(h \cdot M\right) \cdot M\right) \cdot w0\right)\right)} \]
      3. associate-*l*33.1%

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

        \[\leadsto -0.125 \cdot \left(\frac{D \cdot D}{d \cdot \left(d \cdot \ell\right)} \cdot \left(\color{blue}{\left(M \cdot h\right)} \cdot \left(M \cdot w0\right)\right)\right) \]
      5. associate-*r*33.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 3.1 \cdot 10^{-38}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;-0.125 \cdot \left(\left(w0 \cdot M\right) \cdot \left(\left(M \cdot h\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d \cdot \ell}\right)\right)\right)\\ \end{array} \]

Alternative 6: 68.5% accurate, 10.3× speedup?

\[\begin{array}{l} [M, D] = \mathsf{sort}([M, D])\\ \\ \begin{array}{l} \mathbf{if}\;M \leq 2.12 \cdot 10^{-38}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;-0.125 \cdot \left(\frac{\frac{D}{d} \cdot \frac{D}{d}}{\ell} \cdot \left(\left(M \cdot h\right) \cdot \left(w0 \cdot M\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d)
 :precision binary64
 (if (<= M 2.12e-38)
   w0
   (* -0.125 (* (/ (* (/ D d) (/ D d)) l) (* (* M h) (* w0 M))))))
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 2.12e-38) {
		tmp = w0;
	} else {
		tmp = -0.125 * ((((D / d) * (D / d)) / l) * ((M * h) * (w0 * M)));
	}
	return tmp;
}
NOTE: M and D should be sorted in increasing order before calling this function.
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 <= 2.12d-38) then
        tmp = w0
    else
        tmp = (-0.125d0) * ((((d / d_1) * (d / d_1)) / l) * ((m * h) * (w0 * m)))
    end if
    code = tmp
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
	double tmp;
	if (M <= 2.12e-38) {
		tmp = w0;
	} else {
		tmp = -0.125 * ((((D / d) * (D / d)) / l) * ((M * h) * (w0 * M)));
	}
	return tmp;
}
[M, D] = sort([M, D])
def code(w0, M, D, h, l, d):
	tmp = 0
	if M <= 2.12e-38:
		tmp = w0
	else:
		tmp = -0.125 * ((((D / d) * (D / d)) / l) * ((M * h) * (w0 * M)))
	return tmp
M, D = sort([M, D])
function code(w0, M, D, h, l, d)
	tmp = 0.0
	if (M <= 2.12e-38)
		tmp = w0;
	else
		tmp = Float64(-0.125 * Float64(Float64(Float64(Float64(D / d) * Float64(D / d)) / l) * Float64(Float64(M * h) * Float64(w0 * M))));
	end
	return tmp
end
M, D = num2cell(sort([M, D])){:}
function tmp_2 = code(w0, M, D, h, l, d)
	tmp = 0.0;
	if (M <= 2.12e-38)
		tmp = w0;
	else
		tmp = -0.125 * ((((D / d) * (D / d)) / l) * ((M * h) * (w0 * M)));
	end
	tmp_2 = tmp;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[M, 2.12e-38], w0, N[(-0.125 * N[(N[(N[(N[(D / d), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] * N[(w0 * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;M \leq 2.12 \cdot 10^{-38}:\\
\;\;\;\;w0\\

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


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

    1. Initial program 82.5%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified85.1%

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

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

    if 2.12000000000000001e-38 < M

    1. Initial program 66.5%

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified65.1%

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

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

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

        \[\leadsto w0 \cdot \left(\color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot -0.125} + 1\right) \]
      3. fma-def44.4%

        \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}, -0.125, 1\right)} \]
      4. associate-*r*45.9%

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

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\color{blue}{\left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right)} \cdot h}{{d}^{2} \cdot \ell}, -0.125, 1\right) \]
      8. associate-/l*53.6%

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

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

        \[\leadsto w0 \cdot \mathsf{fma}\left(\frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{\color{blue}{\left(d \cdot d\right)} \cdot \ell}{h}}, -0.125, 1\right) \]
      11. associate-*l*49.0%

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

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

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

        \[\leadsto -0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell} \]
      2. associate-*r*32.5%

        \[\leadsto -0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot \left(h \cdot w0\right)\right)}{\color{blue}{d \cdot \left(d \cdot \ell\right)}} \]
      3. associate-/l*32.6%

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

        \[\leadsto -0.125 \cdot \frac{\color{blue}{D \cdot D}}{\frac{d \cdot \left(d \cdot \ell\right)}{{M}^{2} \cdot \left(h \cdot w0\right)}} \]
      5. associate-*r*30.8%

        \[\leadsto -0.125 \cdot \frac{D \cdot D}{\frac{\color{blue}{\left(d \cdot d\right) \cdot \ell}}{{M}^{2} \cdot \left(h \cdot w0\right)}} \]
      6. associate-*r*30.8%

        \[\leadsto -0.125 \cdot \frac{D \cdot D}{\frac{\left(d \cdot d\right) \cdot \ell}{\color{blue}{\left({M}^{2} \cdot h\right) \cdot w0}}} \]
      7. *-commutative30.8%

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

        \[\leadsto -0.125 \cdot \frac{D \cdot D}{\frac{\left(d \cdot d\right) \cdot \ell}{\left(h \cdot \color{blue}{\left(M \cdot M\right)}\right) \cdot w0}} \]
      9. associate-*r*31.2%

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

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

        \[\leadsto -0.125 \cdot \color{blue}{\left(\frac{D \cdot D}{\left(d \cdot d\right) \cdot \ell} \cdot \left(\left(\left(h \cdot M\right) \cdot M\right) \cdot w0\right)\right)} \]
      2. associate-*l*32.9%

        \[\leadsto -0.125 \cdot \left(\frac{D \cdot D}{\color{blue}{d \cdot \left(d \cdot \ell\right)}} \cdot \left(\left(\left(h \cdot M\right) \cdot M\right) \cdot w0\right)\right) \]
      3. associate-*l*33.1%

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

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

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

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

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

        \[\leadsto -0.125 \cdot \left(\color{blue}{\frac{\frac{D \cdot D}{{d}^{2}}}{\ell}} \cdot \left(\left(M \cdot h\right) \cdot \left(M \cdot w0\right)\right)\right) \]
      3. unpow229.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;M \leq 2.12 \cdot 10^{-38}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;-0.125 \cdot \left(\frac{\frac{D}{d} \cdot \frac{D}{d}}{\ell} \cdot \left(\left(M \cdot h\right) \cdot \left(w0 \cdot M\right)\right)\right)\\ \end{array} \]

Alternative 7: 68.0% accurate, 216.0× speedup?

\[\begin{array}{l} [M, D] = \mathsf{sort}([M, D])\\ \\ w0 \end{array} \]
NOTE: M and D should be sorted in increasing order before calling this function.
(FPCore (w0 M D h l d) :precision binary64 w0)
assert(M < D);
double code(double w0, double M, double D, double h, double l, double d) {
	return w0;
}
NOTE: M and D should be sorted in increasing order before calling this function.
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
end function
assert M < D;
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0;
}
[M, D] = sort([M, D])
def code(w0, M, D, h, l, d):
	return w0
M, D = sort([M, D])
function code(w0, M, D, h, l, d)
	return w0
end
M, D = num2cell(sort([M, D])){:}
function tmp = code(w0, M, D, h, l, d)
	tmp = w0;
end
NOTE: M and D should be sorted in increasing order before calling this function.
code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}
[M, D] = \mathsf{sort}([M, D])\\
\\
w0
\end{array}
Derivation
  1. Initial program 78.4%

    \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
  2. Simplified79.9%

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

    \[\leadsto \color{blue}{w0} \]
  4. Final simplification61.0%

    \[\leadsto w0 \]

Reproduce

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