Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.0% → 86.1%
Time: 16.6s
Alternatives: 6
Speedup: 1.8×

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 6 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.0% 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.1% accurate, 1.0× speedup?

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

\\
w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M \cdot \left(D \cdot 0.5\right)}{d}\right)}^{2}}{\ell}}
\end{array}
Derivation
  1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;D \leq 2.8 \cdot 10^{+17}:\\
\;\;\;\;w0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if D < 2.8e17

    1. Initial program 82.3%

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

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

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

    if 2.8e17 < D

    1. Initial program 75.6%

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

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - {\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot \frac{h}{\ell}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. unpow275.6%

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\left(D \cdot \frac{\frac{M}{2}}{d}\right) \cdot \color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}}\right) \cdot \frac{h}{\ell}} \]
      7. un-div-inv75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{D \cdot \frac{\frac{M}{2}}{d}}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{h}{\ell}} \]
      8. *-commutative75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M}{2}}{d} \cdot D}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      9. associate-*l/75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M}{2} \cdot D}{d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      10. associate-*r/75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M}{2} \cdot \frac{D}{d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      11. times-frac75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      12. associate-/l*75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{M \cdot \frac{D}{2 \cdot d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      13. div-inv75.6%

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{M \cdot \left(D \cdot \frac{\color{blue}{0.5}}{d}\right)}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      16. times-frac75.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 - \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{0.5}{\frac{2}{M} \cdot \frac{d}{D}}\right)}\right) \cdot \frac{h}{\ell}} \]
    10. Step-by-step derivation
      1. associate-*l/75.6%

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

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

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

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

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

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

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

Alternative 3: 73.1% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;D \leq 10^{+17}:\\
\;\;\;\;w0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if D < 1e17

    1. Initial program 82.3%

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

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

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

    if 1e17 < D

    1. Initial program 75.6%

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

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - {\left(D \cdot \frac{\frac{M}{2}}{d}\right)}^{2} \cdot \frac{h}{\ell}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. unpow275.6%

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \left(\left(D \cdot \frac{\frac{M}{2}}{d}\right) \cdot \color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}}\right) \cdot \frac{h}{\ell}} \]
      7. un-div-inv75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{D \cdot \frac{\frac{M}{2}}{d}}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{h}{\ell}} \]
      8. *-commutative75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M}{2}}{d} \cdot D}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      9. associate-*l/75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M}{2} \cdot D}{d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      10. associate-*r/75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M}{2} \cdot \frac{D}{d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      11. times-frac75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      12. associate-/l*75.6%

        \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{M \cdot \frac{D}{2 \cdot d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      13. div-inv75.6%

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \frac{M \cdot \left(D \cdot \frac{\color{blue}{0.5}}{d}\right)}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
      16. times-frac75.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 - \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{0.5}{\frac{2}{M} \cdot \frac{d}{D}}\right)}\right) \cdot \frac{h}{\ell}} \]
    10. Step-by-step derivation
      1. associate-*l/75.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{D \cdot \left(\left(\frac{M}{d} \cdot \frac{0.25}{\frac{d}{M \cdot D}}\right) \cdot \frac{h}{\ell}\right)}} \]
      3. associate-/r/77.6%

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

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

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

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

Alternative 4: 70.2% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;D \leq 1.18 \cdot 10^{+145}:\\
\;\;\;\;w0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if D < 1.17999999999999998e145

    1. Initial program 82.9%

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

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

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

    if 1.17999999999999998e145 < D

    1. Initial program 62.5%

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

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

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

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

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

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

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

        \[\leadsto w0 + -0.125 \cdot \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\color{blue}{{D}^{2}} \cdot {M}^{2}\right) \cdot \left(h \cdot w0\right)\right)\right)}{{d}^{2} \cdot \ell} \]
      4. pow-prod-down22.9%

        \[\leadsto w0 + -0.125 \cdot \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{{\left(D \cdot M\right)}^{2}} \cdot \left(h \cdot w0\right)\right)\right)}{{d}^{2} \cdot \ell} \]
      5. *-commutative22.9%

        \[\leadsto w0 + -0.125 \cdot \frac{\mathsf{expm1}\left(\mathsf{log1p}\left({\color{blue}{\left(M \cdot D\right)}}^{2} \cdot \left(h \cdot w0\right)\right)\right)}{{d}^{2} \cdot \ell} \]
    8. Applied egg-rr22.9%

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

        \[\leadsto w0 + -0.125 \cdot \color{blue}{\frac{1}{\frac{{d}^{2} \cdot \ell}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(M \cdot D\right)}^{2} \cdot \left(h \cdot w0\right)\right)\right)}}} \]
      2. inv-pow22.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ w0 \cdot \sqrt{1 - \frac{h \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{0.25}{\frac{d}{M \cdot D}}\right)\right)}{\ell}} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (/ (* h (* D (* (/ M d) (/ 0.25 (/ d (* M D)))))) l)))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.0 - ((h * (D * ((M / d) * (0.25 / (d / (M * D)))))) / 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 - ((h * (d * ((m / d_1) * (0.25d0 / (d_1 / (m * d)))))) / 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 - ((h * (D * ((M / d) * (0.25 / (d / (M * D)))))) / l)));
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - ((h * (D * ((M / d) * (0.25 / (d / (M * D)))))) / l)))
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * Float64(D * Float64(Float64(M / d) * Float64(0.25 / Float64(d / Float64(M * D)))))) / l))))
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((h * (D * ((M / d) * (0.25 / (d / (M * D)))))) / l)));
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[(D * N[(N[(M / d), $MachinePrecision] * N[(0.25 / N[(d / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
w0 \cdot \sqrt{1 - \frac{h \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{0.25}{\frac{d}{M \cdot D}}\right)\right)}{\ell}}
\end{array}
Derivation
  1. Initial program 81.1%

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

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

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

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 - \left(\left(D \cdot \frac{\frac{M}{2}}{d}\right) \cdot \color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}}\right) \cdot \frac{h}{\ell}} \]
    7. un-div-inv79.9%

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{D \cdot \frac{\frac{M}{2}}{d}}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{h}{\ell}} \]
    8. *-commutative79.9%

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M}{2}}{d} \cdot D}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
    9. associate-*l/81.0%

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{\frac{M}{2} \cdot D}{d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
    10. associate-*r/81.1%

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M}{2} \cdot \frac{D}{d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
    11. times-frac81.0%

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
    12. associate-/l*81.1%

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{M \cdot \frac{D}{2 \cdot d}}}{\frac{2 \cdot d}{M \cdot D}} \cdot \frac{h}{\ell}} \]
    13. div-inv81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto w0 \cdot \sqrt{1 - \left(D \cdot \color{blue}{\left(\frac{M}{d} \cdot \frac{0.5}{\frac{2}{M} \cdot \frac{d}{D}}\right)}\right) \cdot \frac{h}{\ell}} \]
  10. Step-by-step derivation
    1. associate-*l/79.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto w0 \cdot \sqrt{1 - \frac{h \cdot \left(D \cdot \left(\frac{M}{d} \cdot \frac{0.25}{\frac{d}{M \cdot D}}\right)\right)}{\ell}} \]
  15. Add Preprocessing

Alternative 6: 67.6% accurate, 216.0× speedup?

\[\begin{array}{l} \\ w0 \end{array} \]
(FPCore (w0 M D h l d) :precision binary64 w0)
double code(double w0, double M, double D, double h, double l, double d) {
	return w0;
}
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
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0;
}
def code(w0, M, D, h, l, d):
	return w0
function code(w0, M, D, h, l, d)
	return w0
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0;
end
code[w0_, M_, D_, h_, l_, d_] := w0
\begin{array}{l}

\\
w0
\end{array}
Derivation
  1. Initial program 81.1%

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

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

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

Reproduce

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