Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.7% → 89.3%
Time: 17.0s
Alternatives: 16
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 81.7% accurate, 1.0× speedup?

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

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

Alternative 1: 89.3% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
w0 \cdot \sqrt{1 + \frac{t\_0}{\ell} \cdot \frac{t\_0}{\frac{-1}{h}}}
\end{array}
\end{array}
Derivation
  1. Initial program 81.5%

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
    5. times-fracN/A

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

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

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

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

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

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

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

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

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

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
    15. /-lowering-/.f6493.2

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
  4. Applied egg-rr93.2%

    \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
  5. Final simplification93.2%

    \[\leadsto w0 \cdot \sqrt{1 + \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{-1}{h}}} \]
  6. Add Preprocessing

Alternative 2: 84.0% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

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

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

      1. Initial program 51.6%

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
        4. 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}}} \]
        5. /-lowering-/.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}}} \]
        6. *-lowering-*.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}} \]
        7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 84.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 -20:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(M \cdot \left(D \cdot h\right)\right) \cdot \frac{M \cdot D}{d \cdot \left(d \cdot \ell\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)) -20.0)
       (* w0 (sqrt (fma -0.25 (* (* M (* D h)) (/ (* M D) (* 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)) <= -20.0) {
    		tmp = w0 * sqrt(fma(-0.25, ((M * (D * h)) * ((M * D) / (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)) <= -20.0)
    		tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(M * Float64(D * h)) * Float64(Float64(M * D) / 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], -20.0], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(M * N[(D * h), $MachinePrecision]), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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 -20:\\
    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(M \cdot \left(D \cdot h\right)\right) \cdot \frac{M \cdot D}{d \cdot \left(d \cdot \ell\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)) < -20

      1. Initial program 69.5%

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

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

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

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

          \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
        4. 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}}} \]
        5. /-lowering-/.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}}} \]
        6. *-lowering-*.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}} \]
        7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 86.3%

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

        \[\leadsto \color{blue}{w0} \]
      4. Step-by-step derivation
        1. Simplified96.3%

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

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

      Alternative 4: 83.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 -20:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(M \cdot D\right) \cdot \left(h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot d\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)) -20.0)
         (* w0 (sqrt (fma -0.25 (* (* M D) (* h (/ (* M D) (* l (* d d))))) 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)) <= -20.0) {
      		tmp = w0 * sqrt(fma(-0.25, ((M * D) * (h * ((M * D) / (l * (d * d))))), 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)) <= -20.0)
      		tmp = Float64(w0 * sqrt(fma(-0.25, Float64(Float64(M * D) * Float64(h * Float64(Float64(M * D) / Float64(l * Float64(d * d))))), 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], -20.0], N[(w0 * N[Sqrt[N[(-0.25 * N[(N[(M * D), $MachinePrecision] * N[(h * N[(N[(M * D), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $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 -20:\\
      \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(-0.25, \left(M \cdot D\right) \cdot \left(h \cdot \frac{M \cdot D}{\ell \cdot \left(d \cdot d\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)) < -20

        1. Initial program 69.5%

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

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

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

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

            \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
          4. 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}}} \]
          5. /-lowering-/.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}}} \]
          6. *-lowering-*.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}} \]
          7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 86.3%

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

          \[\leadsto \color{blue}{w0} \]
        4. Step-by-step derivation
          1. Simplified96.3%

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

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

        Alternative 5: 80.9% 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 -20:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}, h \cdot -0.25, 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)) -20.0)
           (* w0 (sqrt (fma (/ (* D (* D (* M M))) (* l (* d d))) (* h -0.25) 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)) <= -20.0) {
        		tmp = w0 * sqrt(fma(((D * (D * (M * M))) / (l * (d * d))), (h * -0.25), 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)) <= -20.0)
        		tmp = Float64(w0 * sqrt(fma(Float64(Float64(D * Float64(D * Float64(M * M))) / Float64(l * Float64(d * d))), Float64(h * -0.25), 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], -20.0], N[(w0 * N[Sqrt[N[(N[(N[(D * N[(D * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * -0.25), $MachinePrecision] + 1.0), $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 -20:\\
        \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{D \cdot \left(D \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}, h \cdot -0.25, 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)) < -20

          1. Initial program 69.5%

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

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

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

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

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
            5. times-fracN/A

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

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

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

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

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

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

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

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

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

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
            15. /-lowering-/.f6481.4

              \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
          4. Applied egg-rr81.4%

            \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
          5. Taylor expanded in M around 0

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 86.3%

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

            \[\leadsto \color{blue}{w0} \]
          4. Step-by-step derivation
            1. Simplified96.3%

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

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

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

            1. Initial program 68.2%

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

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

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

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

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
              5. times-fracN/A

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

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

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

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

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

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

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

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

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

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
              15. /-lowering-/.f6480.6

                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
            4. Applied egg-rr80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 86.5%

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

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

                \[\leadsto \color{blue}{w0} \]
            5. Recombined 2 regimes into one program.
            6. Add Preprocessing

            Alternative 7: 79.5% 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 -5 \cdot 10^{+156}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0, 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)) -5e+156)
               (fma (/ (* (* M (* D D)) (* M (* h -0.125))) (* d (* d l))) w0 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)) <= -5e+156) {
            		tmp = fma((((M * (D * D)) * (M * (h * -0.125))) / (d * (d * l))), w0, 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)) <= -5e+156)
            		tmp = fma(Float64(Float64(Float64(M * Float64(D * D)) * Float64(M * Float64(h * -0.125))) / Float64(d * Float64(d * l))), w0, 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], -5e+156], N[(N[(N[(N[(M * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * w0 + 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 -5 \cdot 10^{+156}:\\
            \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, w0, 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)) < -4.99999999999999992e156

              1. Initial program 64.7%

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

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

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

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

                  \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                4. 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}}} \]
                5. /-lowering-/.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}}} \]
                6. *-lowering-*.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}} \]
                7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
              6. Taylor expanded in D 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)} \]
              7. 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. accelerator-lowering-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)} \]
              8. Simplified49.5%

                \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot -0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
              9. Step-by-step derivation
                1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{\left(\left(D \cdot D\right) \cdot M\right) \cdot \left(M \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \color{blue}{\left(d \cdot \ell\right)}}, w0, w0\right) \]
              10. Applied egg-rr54.8%

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

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

              1. Initial program 86.9%

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

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

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

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

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

                1. Initial program 62.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 w0 around 0

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

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

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

                    \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                  4. 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}}} \]
                  5. /-lowering-/.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}}} \]
                  6. *-lowering-*.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}} \]
                  7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
                6. Taylor expanded in D 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)} \]
                7. 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. accelerator-lowering-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)} \]
                8. Simplified52.0%

                  \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot -0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
                9. Step-by-step derivation
                  1. distribute-rgt-inN/A

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

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

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(D, \left(D \cdot \frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot \frac{-1}{8}}{\ell \cdot \left(d \cdot d\right)}\right) \cdot w0, w0\right)} \]
                10. Applied egg-rr58.0%

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

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

                1. Initial program 87.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} \]
                4. Step-by-step derivation
                  1. Simplified90.5%

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

                Alternative 9: 80.5% 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^{+264}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot \left(\left(M \cdot h\right) \cdot \left(M \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\right)}\right)\right), D, 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+264)
                   (* w0 (fma (* D (* (* M h) (* M (/ -0.125 (* d (* d l)))))) D 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+264) {
                		tmp = w0 * fma((D * ((M * h) * (M * (-0.125 / (d * (d * l)))))), D, 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+264)
                		tmp = Float64(w0 * fma(Float64(D * Float64(Float64(M * h) * Float64(M * Float64(-0.125 / Float64(d * Float64(d * l)))))), D, 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+264], N[(w0 * N[(N[(D * N[(N[(M * h), $MachinePrecision] * N[(M * N[(-0.125 / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * D + 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^{+264}:\\
                \;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot \left(\left(M \cdot h\right) \cdot \left(M \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\right)}\right)\right), D, 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.00000000000000009e264

                  1. Initial program 62.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 w0 around 0

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

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

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

                      \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                    4. 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}}} \]
                    5. /-lowering-/.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}}} \]
                    6. *-lowering-*.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}} \]
                    7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
                  6. Taylor expanded in D 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)} \]
                  7. 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. accelerator-lowering-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)} \]
                  8. Simplified52.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 87.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} \]
                  4. Step-by-step derivation
                    1. Simplified90.5%

                      \[\leadsto \color{blue}{w0} \]
                  5. Recombined 2 regimes into one program.
                  6. Add Preprocessing

                  Alternative 10: 78.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^{+302}:\\ \;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot D, \left(M \cdot M\right) \cdot \left(h \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\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+302)
                     (* w0 (fma (* D D) (* (* M M) (* h (/ -0.125 (* 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+302) {
                  		tmp = w0 * fma((D * D), ((M * M) * (h * (-0.125 / (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+302)
                  		tmp = Float64(w0 * fma(Float64(D * D), Float64(Float64(M * M) * Float64(h * Float64(-0.125 / 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+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(M * M), $MachinePrecision] * N[(h * N[(-0.125 / N[(d * N[(d * l), $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^{+302}:\\
                  \;\;\;\;w0 \cdot \mathsf{fma}\left(D \cdot D, \left(M \cdot M\right) \cdot \left(h \cdot \frac{-0.125}{d \cdot \left(d \cdot \ell\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.0000000000000002e302

                    1. Initial program 62.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 w0 around 0

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

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

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

                        \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                      4. 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}}} \]
                      5. /-lowering-/.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}}} \]
                      6. *-lowering-*.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}} \]
                      7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
                    6. Taylor expanded in D 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)} \]
                    7. 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. accelerator-lowering-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)} \]
                    8. Simplified52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -2.0000000000000002e302 < (*.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 \color{blue}{w0} \]
                    4. Step-by-step derivation
                      1. Simplified90.1%

                        \[\leadsto \color{blue}{w0} \]
                    5. Recombined 2 regimes into one program.
                    6. Add Preprocessing

                    Alternative 11: 78.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^{+302}:\\ \;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)}\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+302)
                       (* w0 (* (* D D) (/ (* -0.125 (* h (* M M))) (* 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+302) {
                    		tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (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+302)) then
                            tmp = w0 * ((d * d) * (((-0.125d0) * (h * (m * m))) / (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+302) {
                    		tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (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+302:
                    		tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (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+302)
                    		tmp = Float64(w0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(h * Float64(M * M))) / 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+302)
                    		tmp = w0 * ((D * D) * ((-0.125 * (h * (M * M))) / (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+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * N[(d * l), $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^{+302}:\\
                    \;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{d \cdot \left(d \cdot \ell\right)}\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.0000000000000002e302

                      1. Initial program 62.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 w0 around 0

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

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

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

                          \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                        4. 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}}} \]
                        5. /-lowering-/.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}}} \]
                        6. *-lowering-*.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}} \]
                        7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
                      6. Taylor expanded in D 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)} \]
                      7. 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. accelerator-lowering-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)} \]
                      8. Simplified52.9%

                        \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot -0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
                      9. 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)} \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{\frac{-1}{8} \cdot \left(\left(M \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}\right) \]
                        16. *-lowering-*.f6450.9

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

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

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

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

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

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

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

                      if -2.0000000000000002e302 < (*.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 \color{blue}{w0} \]
                      4. Step-by-step derivation
                        1. Simplified90.1%

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

                      Alternative 12: 78.4% 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^{+302}:\\ \;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}\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+302)
                         (* w0 (* (* D D) (/ (* -0.125 (* h (* 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+302) {
                      		tmp = w0 * ((D * D) * ((-0.125 * (h * (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+302)) then
                              tmp = w0 * ((d * d) * (((-0.125d0) * (h * (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+302) {
                      		tmp = w0 * ((D * D) * ((-0.125 * (h * (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+302:
                      		tmp = w0 * ((D * D) * ((-0.125 * (h * (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+302)
                      		tmp = Float64(w0 * Float64(Float64(D * D) * Float64(Float64(-0.125 * Float64(h * 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+302)
                      		tmp = w0 * ((D * D) * ((-0.125 * (h * (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+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(-0.125 * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[(d * d), $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^{+302}:\\
                      \;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{-0.125 \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\ell \cdot \left(d \cdot d\right)}\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.0000000000000002e302

                        1. Initial program 62.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 w0 around 0

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

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

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

                            \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                          4. 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}}} \]
                          5. /-lowering-/.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}}} \]
                          6. *-lowering-*.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}} \]
                          7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
                        6. Taylor expanded in D 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)} \]
                        7. 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. accelerator-lowering-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)} \]
                        8. Simplified52.9%

                          \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot -0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
                        9. 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)} \]
                        10. Step-by-step derivation
                          1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{\frac{-1}{8} \cdot \left(\left(M \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}\right) \]
                          16. *-lowering-*.f6450.9

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

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

                        if -2.0000000000000002e302 < (*.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 \color{blue}{w0} \]
                        4. Step-by-step derivation
                          1. Simplified90.1%

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

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

                        Alternative 13: 78.5% 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^{+302}:\\ \;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right)\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+302)
                           (* w0 (* (* D D) (* (* (* M M) -0.125) (/ h (* 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+302) {
                        		tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (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+302)) then
                                tmp = w0 * ((d * d) * (((m * m) * (-0.125d0)) * (h / (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+302) {
                        		tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (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+302:
                        		tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (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+302)
                        		tmp = Float64(w0 * Float64(Float64(D * D) * Float64(Float64(Float64(M * M) * -0.125) * Float64(h / 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+302)
                        		tmp = w0 * ((D * D) * (((M * M) * -0.125) * (h / (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+302], N[(w0 * N[(N[(D * D), $MachinePrecision] * N[(N[(N[(M * M), $MachinePrecision] * -0.125), $MachinePrecision] * N[(h / 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^{+302}:\\
                        \;\;\;\;w0 \cdot \left(\left(D \cdot D\right) \cdot \left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{h}{\ell \cdot \left(d \cdot d\right)}\right)\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.0000000000000002e302

                          1. Initial program 62.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 w0 around 0

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

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

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

                              \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                            4. 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}}} \]
                            5. /-lowering-/.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}}} \]
                            6. *-lowering-*.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}} \]
                            7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(\left(\left(\left(D \cdot D\right) \cdot M\right) \cdot M\right) \cdot h\right)}{\left(d \cdot d\right) \cdot \ell}}} \]
                          6. Taylor expanded in D 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)} \]
                          7. 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. accelerator-lowering-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)} \]
                          8. Simplified52.9%

                            \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(D \cdot D, \frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot -0.125}{\ell \cdot \left(d \cdot d\right)}, 1\right)} \]
                          9. 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)} \]
                          10. Step-by-step derivation
                            1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto w0 \cdot \left(\left(D \cdot D\right) \cdot \frac{\frac{-1}{8} \cdot \left(\left(M \cdot M\right) \cdot h\right)}{\color{blue}{\left(d \cdot d\right)} \cdot \ell}\right) \]
                            16. *-lowering-*.f6450.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if -2.0000000000000002e302 < (*.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 \color{blue}{w0} \]
                          4. Step-by-step derivation
                            1. Simplified90.1%

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

                          Alternative 14: 76.2% accurate, 1.6× speedup?

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

                            1. Initial program 85.7%

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

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

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

                              if 1e-179 < (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d))

                              1. Initial program 72.6%

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

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

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

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

                                  \[\leadsto w0 \cdot \sqrt{\color{blue}{1 - \frac{1}{4} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}}} \]
                                4. 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}}} \]
                                5. /-lowering-/.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}}} \]
                                6. *-lowering-*.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}} \]
                                7. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 15: 87.5% accurate, 1.9× speedup?

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

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

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

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

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

                                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}{\color{blue}{\ell \cdot \frac{1}{h}}}} \]
                              5. times-fracN/A

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

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

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

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

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

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

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

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

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

                                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{\color{blue}{2 \cdot d}}}{\frac{1}{h}}} \]
                              15. /-lowering-/.f6493.2

                                \[\leadsto w0 \cdot \sqrt{1 - \frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\color{blue}{\frac{1}{h}}}} \]
                            4. Applied egg-rr93.2%

                              \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d}}{\frac{1}{h}}}} \]
                            5. Step-by-step derivation
                              1. div-invN/A

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

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

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

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

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

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

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

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

                            Alternative 16: 68.6% 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 81.5%

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

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

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

                              Reproduce

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