Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.0% → 86.4%
Time: 10.7s
Alternatives: 8
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 8 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.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t\_0 \leq 10^{-11}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < 9.99999999999999939e-12

    1. Initial program 91.1%

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

    if 9.99999999999999939e-12 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.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. Add Preprocessing
    3. Taylor expanded in M around 0

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

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

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

    Alternative 2: 79.8% accurate, 0.8× speedup?

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

      1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 85.9%

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

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

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

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

      Alternative 3: 79.7% accurate, 0.8× speedup?

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

        1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 85.8%

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

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

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

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

        Alternative 4: 78.3% accurate, 0.8× speedup?

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

          1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 86.8%

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

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

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

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

          Alternative 5: 78.7% accurate, 0.8× speedup?

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

            1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(D \cdot D, \left(M \cdot \left(M \cdot \frac{h}{\color{blue}{{d}^{2} \cdot \ell}}\right)\right) \cdot \frac{1}{8}, -1\right) \cdot \left(\mathsf{neg}\left(w0\right)\right) \]
            10. Step-by-step derivation
              1. unpow2N/A

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

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

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

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

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

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

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

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

            1. Initial program 86.8%

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

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

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

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

            Alternative 6: 77.6% accurate, 0.8× speedup?

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

              1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

              1. Initial program 86.8%

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

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

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

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

              Alternative 7: 78.6% accurate, 0.8× speedup?

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

                1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 87.2%

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

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

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

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

                Alternative 8: 68.2% accurate, 157.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 82.2%

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

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

                    \[\leadsto w0 \cdot \color{blue}{1} \]
                  2. Final simplification69.2%

                    \[\leadsto w0 \]
                  3. Add Preprocessing

                  Reproduce

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