Henrywood and Agarwal, Equation (9a)

Percentage Accurate: 81.1% → 88.6%
Time: 15.1s
Alternatives: 16
Speedup: 0.7×

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.1% 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: 88.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{M \cdot D}{2 \cdot d}\\ \mathbf{if}\;{t\_0}^{2} \cdot \frac{h}{\ell} \leq 10^{-27}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{h}{\ell} \cdot \frac{M \cdot D}{d \cdot -2}, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(t\_0, \frac{\frac{\left(M \cdot D\right) \cdot h}{2 \cdot d}}{-\ell}, 1\right)}\\ \end{array} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (let* ((t_0 (/ (* M D) (* 2.0 d))))
   (if (<= (* (pow t_0 2.0) (/ h l)) 1e-27)
     (* w0 (sqrt (fma t_0 (* (/ h l) (/ (* M D) (* d -2.0))) 1.0)))
     (* w0 (sqrt (fma t_0 (/ (/ (* (* M D) h) (* 2.0 d)) (- l)) 1.0))))))
double code(double w0, double M, double D, double h, double l, double d) {
	double t_0 = (M * D) / (2.0 * d);
	double tmp;
	if ((pow(t_0, 2.0) * (h / l)) <= 1e-27) {
		tmp = w0 * sqrt(fma(t_0, ((h / l) * ((M * D) / (d * -2.0))), 1.0));
	} else {
		tmp = w0 * sqrt(fma(t_0, ((((M * D) * h) / (2.0 * d)) / -l), 1.0));
	}
	return tmp;
}
function code(w0, M, D, h, l, d)
	t_0 = Float64(Float64(M * D) / Float64(2.0 * d))
	tmp = 0.0
	if (Float64((t_0 ^ 2.0) * Float64(h / l)) <= 1e-27)
		tmp = Float64(w0 * sqrt(fma(t_0, Float64(Float64(h / l) * Float64(Float64(M * D) / Float64(d * -2.0))), 1.0)));
	else
		tmp = Float64(w0 * sqrt(fma(t_0, Float64(Float64(Float64(Float64(M * D) * h) / Float64(2.0 * d)) / Float64(-l)), 1.0)));
	end
	return tmp
end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[t$95$0, 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], 1e-27], N[(w0 * N[Sqrt[N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] / N[(d * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(t$95$0 * N[(N[(N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision] / (-l)), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\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)) < 1e-27

    1. Initial program 86.0%

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

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

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

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

        \[\leadsto w0 \cdot \sqrt{\left(\mathsf{neg}\left(\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}\right)\right) \cdot \frac{h}{\ell} + 1} \]
      5. distribute-rgt-neg-inN/A

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

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

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

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

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

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\ \mathbf{if}\;t\_0 \leq 10^{-86}:\\ \;\;\;\;w0\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+121}:\\ \;\;\;\;w0 \cdot \sqrt{1 - D \cdot \left(M \cdot \frac{\left(M \cdot D\right) \cdot h}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(w0 \cdot \left(h \cdot -0.125\right)\right)\right)}{d \cdot \ell}, \frac{D}{d}, w0\right)\\ \end{array} \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (let* ((t_0 (pow (/ (* M D) (* 2.0 d)) 2.0)))
   (if (<= t_0 1e-86)
     w0
     (if (<= t_0 5e+121)
       (*
        w0
        (sqrt (- 1.0 (* D (* M (/ (* (* M D) h) (* l (* (* d d) 4.0))))))))
       (fma (/ (* (* M D) (* M (* w0 (* h -0.125)))) (* d l)) (/ D d) w0)))))
double code(double w0, double M, double D, double h, double l, double d) {
	double t_0 = pow(((M * D) / (2.0 * d)), 2.0);
	double tmp;
	if (t_0 <= 1e-86) {
		tmp = w0;
	} else if (t_0 <= 5e+121) {
		tmp = w0 * sqrt((1.0 - (D * (M * (((M * D) * h) / (l * ((d * d) * 4.0)))))));
	} else {
		tmp = fma((((M * D) * (M * (w0 * (h * -0.125)))) / (d * l)), (D / d), w0);
	}
	return tmp;
}
function code(w0, M, D, h, l, d)
	t_0 = Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0
	tmp = 0.0
	if (t_0 <= 1e-86)
		tmp = w0;
	elseif (t_0 <= 5e+121)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(D * Float64(M * Float64(Float64(Float64(M * D) * h) / Float64(l * Float64(Float64(d * d) * 4.0))))))));
	else
		tmp = fma(Float64(Float64(Float64(M * D) * Float64(M * Float64(w0 * Float64(h * -0.125)))) / Float64(d * l)), Float64(D / d), w0);
	end
	return tmp
end
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$0, 1e-86], w0, If[LessEqual[t$95$0, 5e+121], N[(w0 * N[Sqrt[N[(1.0 - N[(D * N[(M * N[(N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision] / N[(l * N[(N[(d * d), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * N[(w0 * N[(h * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(D / d), $MachinePrecision] + w0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+121}:\\
\;\;\;\;w0 \cdot \sqrt{1 - D \cdot \left(M \cdot \frac{\left(M \cdot D\right) \cdot h}{\ell \cdot \left(\left(d \cdot d\right) \cdot 4\right)}\right)}\\

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


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

    1. Initial program 93.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. Simplified98.0%

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

      if 1.00000000000000008e-86 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) < 5.00000000000000007e121

      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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 5.00000000000000007e121 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))

      1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 85.6% accurate, 0.7× speedup?

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

      1. Initial program 86.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. sub-negN/A

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

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

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

          \[\leadsto w0 \cdot \sqrt{\left(\mathsf{neg}\left(\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}}\right)\right) \cdot \frac{h}{\ell} + 1} \]
        5. distribute-rgt-neg-inN/A

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

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

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

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

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

      1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 85.5% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 10^{-27}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \frac{\frac{M \cdot D}{d}}{d \cdot 4}\right)}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot h}{d \cdot \left(\ell \cdot 4\right)} \cdot \frac{M}{d}, -D, 1\right)}\\ \end{array} \end{array} \]
    (FPCore (w0 M D h l d)
     :precision binary64
     (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) 1e-27)
       (* w0 (sqrt (- 1.0 (* (/ h l) (* (* M D) (/ (/ (* M D) d) (* d 4.0)))))))
       (*
        w0
        (sqrt (fma (* (/ (* (* M D) h) (* d (* l 4.0))) (/ M d)) (- D) 1.0)))))
    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)) <= 1e-27) {
    		tmp = w0 * sqrt((1.0 - ((h / l) * ((M * D) * (((M * D) / d) / (d * 4.0))))));
    	} else {
    		tmp = w0 * sqrt(fma(((((M * D) * h) / (d * (l * 4.0))) * (M / d)), -D, 1.0));
    	}
    	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)) <= 1e-27)
    		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * Float64(Float64(M * D) * Float64(Float64(Float64(M * D) / d) / Float64(d * 4.0)))))));
    	else
    		tmp = Float64(w0 * sqrt(fma(Float64(Float64(Float64(Float64(M * D) * h) / Float64(d * Float64(l * 4.0))) * Float64(M / d)), Float64(-D), 1.0)));
    	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], 1e-27], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[(M * D), $MachinePrecision] * N[(N[(N[(M * D), $MachinePrecision] / d), $MachinePrecision] / N[(d * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[Sqrt[N[(N[(N[(N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision] / N[(d * N[(l * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] * (-D) + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 10^{-27}:\\
    \;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot \left(\left(M \cdot D\right) \cdot \frac{\frac{M \cdot D}{d}}{d \cdot 4}\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot h}{d \cdot \left(\ell \cdot 4\right)} \cdot \frac{M}{d}, -D, 1\right)}\\
    
    
    \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)) < 1e-27

      1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 80.7% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(w0 \cdot \left(h \cdot -0.125\right)\right)\right)}{d \cdot \ell}, \frac{D}{d}, 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+37)
       (fma (/ (* (* M D) (* M (* w0 (* h -0.125)))) (* d l)) (/ D d) w0)
       w0))
    double code(double w0, double M, double D, double h, double l, double d) {
    	double tmp;
    	if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -5e+37) {
    		tmp = fma((((M * D) * (M * (w0 * (h * -0.125)))) / (d * l)), (D / d), w0);
    	} else {
    		tmp = w0;
    	}
    	return tmp;
    }
    
    function code(w0, M, D, h, l, d)
    	tmp = 0.0
    	if (Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)) <= -5e+37)
    		tmp = fma(Float64(Float64(Float64(M * D) * Float64(M * Float64(w0 * Float64(h * -0.125)))) / Float64(d * l)), Float64(D / d), w0);
    	else
    		tmp = w0;
    	end
    	return tmp
    end
    
    code[w0_, M_, D_, h_, l_, d_] := If[LessEqual[N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision], -5e+37], N[(N[(N[(N[(M * D), $MachinePrecision] * N[(M * N[(w0 * N[(h * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(D / d), $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 -5 \cdot 10^{+37}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot \left(w0 \cdot \left(h \cdot -0.125\right)\right)\right)}{d \cdot \ell}, \frac{D}{d}, 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.99999999999999989e37

      1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 90.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. Simplified96.1%

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

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

        1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 90.6%

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

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

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

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

          1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 90.6%

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

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

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

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

          Alternative 8: 79.5% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+85}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(\frac{w0 \cdot \left(M \cdot \left(M \cdot h\right)\right)}{d} \cdot \frac{-0.125}{d \cdot \ell}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \end{array} \]
          (FPCore (w0 M D h l d)
           :precision binary64
           (if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) -5e+85)
             (* (* D D) (* (/ (* w0 (* M (* M h))) d) (/ -0.125 (* 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)) <= -5e+85) {
          		tmp = (D * D) * (((w0 * (M * (M * h))) / d) * (-0.125 / (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)) <= (-5d+85)) then
                  tmp = (d * d) * (((w0 * (m * (m * h))) / d_1) * ((-0.125d0) / (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)) <= -5e+85) {
          		tmp = (D * D) * (((w0 * (M * (M * h))) / d) * (-0.125 / (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)) <= -5e+85:
          		tmp = (D * D) * (((w0 * (M * (M * h))) / d) * (-0.125 / (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)) <= -5e+85)
          		tmp = Float64(Float64(D * D) * Float64(Float64(Float64(w0 * Float64(M * Float64(M * h))) / d) * Float64(-0.125 / 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)) <= -5e+85)
          		tmp = (D * D) * (((w0 * (M * (M * h))) / d) * (-0.125 / (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], -5e+85], N[(N[(D * D), $MachinePrecision] * N[(N[(N[(w0 * N[(M * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(-0.125 / N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+85}:\\
          \;\;\;\;\left(D \cdot D\right) \cdot \left(\frac{w0 \cdot \left(M \cdot \left(M \cdot h\right)\right)}{d} \cdot \frac{-0.125}{d \cdot \ell}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;w0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64)) (/.f64 h l)) < -5.0000000000000001e85

            1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 90.6%

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

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

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

            Alternative 9: 79.6% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -5 \cdot 10^{+85}:\\ \;\;\;\;\left(D \cdot D\right) \cdot \left(\left(M \cdot h\right) \cdot \left(\frac{w0}{d \cdot \left(d \cdot \ell\right)} \cdot \left(M \cdot -0.125\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)) -5e+85)
               (* (* D D) (* (* M h) (* (/ w0 (* d (* d l))) (* M -0.125))))
               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+85) {
            		tmp = (D * D) * ((M * h) * ((w0 / (d * (d * l))) * (M * -0.125)));
            	} 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)) <= (-5d+85)) then
                    tmp = (d * d) * ((m * h) * ((w0 / (d_1 * (d_1 * l))) * (m * (-0.125d0))))
                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)) <= -5e+85) {
            		tmp = (D * D) * ((M * h) * ((w0 / (d * (d * l))) * (M * -0.125)));
            	} 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)) <= -5e+85:
            		tmp = (D * D) * ((M * h) * ((w0 / (d * (d * l))) * (M * -0.125)))
            	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+85)
            		tmp = Float64(Float64(D * D) * Float64(Float64(M * h) * Float64(Float64(w0 / Float64(d * Float64(d * l))) * Float64(M * -0.125))));
            	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)) <= -5e+85)
            		tmp = (D * D) * ((M * h) * ((w0 / (d * (d * l))) * (M * -0.125)));
            	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], -5e+85], N[(N[(D * D), $MachinePrecision] * N[(N[(M * h), $MachinePrecision] * N[(N[(w0 / N[(d * N[(d * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M * -0.125), $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 -5 \cdot 10^{+85}:\\
            \;\;\;\;\left(D \cdot D\right) \cdot \left(\left(M \cdot h\right) \cdot \left(\frac{w0}{d \cdot \left(d \cdot \ell\right)} \cdot \left(M \cdot -0.125\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)) < -5.0000000000000001e85

              1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 90.6%

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

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

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

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

                1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 90.6%

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

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

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

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

                Alternative 11: 76.9% accurate, 1.6× speedup?

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

                  1. Initial program 84.4%

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

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

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

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

                    1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 12: 76.3% accurate, 1.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 10^{-43}:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot h}{d \cdot \left(\ell \cdot 4\right)} \cdot \frac{M}{d}, -D, 1\right)}\\ \end{array} \end{array} \]
                  (FPCore (w0 M D h l d)
                   :precision binary64
                   (if (<= (/ (* M D) (* 2.0 d)) 1e-43)
                     w0
                     (*
                      w0
                      (sqrt (fma (* (/ (* (* M D) h) (* d (* l 4.0))) (/ M d)) (- 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-43) {
                  		tmp = w0;
                  	} else {
                  		tmp = w0 * sqrt(fma(((((M * D) * h) / (d * (l * 4.0))) * (M / d)), -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-43)
                  		tmp = w0;
                  	else
                  		tmp = Float64(w0 * sqrt(fma(Float64(Float64(Float64(Float64(M * D) * h) / Float64(d * Float64(l * 4.0))) * Float64(M / d)), Float64(-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-43], w0, N[(w0 * N[Sqrt[N[(N[(N[(N[(N[(M * D), $MachinePrecision] * h), $MachinePrecision] / N[(d * N[(l * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision] * (-D) + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 10^{-43}:\\
                  \;\;\;\;w0\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;w0 \cdot \sqrt{\mathsf{fma}\left(\frac{\left(M \cdot D\right) \cdot h}{d \cdot \left(\ell \cdot 4\right)} \cdot \frac{M}{d}, -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)) < 1.00000000000000008e-43

                    1. Initial program 84.4%

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

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

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

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

                      1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 13: 75.2% accurate, 1.7× speedup?

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

                      1. Initial program 83.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. Simplified74.3%

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

                        if 1e-210 < (*.f64 M D) < 2.0000000000000001e142

                        1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 2.0000000000000001e142 < (*.f64 M D)

                        1. Initial program 67.3%

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

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

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

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

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

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

                            \[\leadsto w0 \cdot \sqrt{\color{blue}{\left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{M \cdot D}{2 \cdot d}\right)} \cdot \frac{h}{\mathsf{neg}\left(\ell\right)} + 1} \]
                          7. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 14: 76.1% accurate, 1.8× speedup?

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

                        1. Initial program 83.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. Simplified74.3%

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

                          if 1e-210 < (*.f64 M D) < 2.00000000000000013e294

                          1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 2.00000000000000013e294 < (*.f64 M D)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 15: 72.4% accurate, 2.0× speedup?

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

                          1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{D \cdot \left(\left(M \cdot \left(M \cdot w0\right)\right) \cdot \left(h \cdot -0.125\right)\right)}{d \cdot \left(d \cdot \ell\right)}, D, w0\right)} \]
                          5. Recombined 2 regimes into one program.
                          6. Add Preprocessing

                          Alternative 16: 68.7% 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 80.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. Simplified63.3%

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

                            Reproduce

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