Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.2% → 82.4%
Time: 17.5s
Alternatives: 12
Speedup: 3.7×

Specification

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

\\
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\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 12 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: 66.2% accurate, 1.0× speedup?

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

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

Alternative 1: 82.4% accurate, 1.8× speedup?

\[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;d \leq -2.3 \cdot 10^{-144}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\ \mathbf{elif}\;d \leq -3.9 \cdot 10^{-301}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{elif}\;d \leq 5.4 \cdot 10^{-164}:\\ \;\;\;\;\frac{\frac{\sqrt{d} \cdot \mathsf{fma}\left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\ell}} \cdot \sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_0\\ \end{array} \end{array} \]
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0
         (fma
          (/ (* M_m (* D_m (/ 0.5 d))) l)
          (* (* (- 0.25) D_m) (* (/ M_m d) h))
          1.0)))
   (if (<= d -2.3e-144)
     (* t_0 (* (sqrt (/ d l)) (/ (sqrt (- d)) (sqrt (- h)))))
     (if (<= d -3.9e-301)
       (*
        (- 1.0 (* (/ h l) (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
        (* (sqrt (/ 1.0 (* l h))) (- d)))
       (if (<= d 5.4e-164)
         (/
          (*
           (/
            (*
             (sqrt d)
             (fma (* (pow (* (/ M_m d) D_m) 2.0) 0.25) (* -0.5 (/ h l)) 1.0))
            (sqrt l))
           (sqrt d))
          (sqrt h))
         (* (* (/ -1.0 (sqrt h)) (/ (- d) (sqrt l))) t_0))))))
D_m = fabs(D);
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = fma(((M_m * (D_m * (0.5 / d))) / l), ((-0.25 * D_m) * ((M_m / d) * h)), 1.0);
	double tmp;
	if (d <= -2.3e-144) {
		tmp = t_0 * (sqrt((d / l)) * (sqrt(-d) / sqrt(-h)));
	} else if (d <= -3.9e-301) {
		tmp = (1.0 - ((h / l) * (pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (sqrt((1.0 / (l * h))) * -d);
	} else if (d <= 5.4e-164) {
		tmp = (((sqrt(d) * fma((pow(((M_m / d) * D_m), 2.0) * 0.25), (-0.5 * (h / l)), 1.0)) / sqrt(l)) * sqrt(d)) / sqrt(h);
	} else {
		tmp = ((-1.0 / sqrt(h)) * (-d / sqrt(l))) * t_0;
	}
	return tmp;
}
D_m = abs(D)
M_m = abs(M)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = fma(Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l), Float64(Float64(Float64(-0.25) * D_m) * Float64(Float64(M_m / d) * h)), 1.0)
	tmp = 0.0
	if (d <= -2.3e-144)
		tmp = Float64(t_0 * Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))));
	elseif (d <= -3.9e-301)
		tmp = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)));
	elseif (d <= 5.4e-164)
		tmp = Float64(Float64(Float64(Float64(sqrt(d) * fma(Float64((Float64(Float64(M_m / d) * D_m) ^ 2.0) * 0.25), Float64(-0.5 * Float64(h / l)), 1.0)) / sqrt(l)) * sqrt(d)) / sqrt(h));
	else
		tmp = Float64(Float64(Float64(-1.0 / sqrt(h)) * Float64(Float64(-d) / sqrt(l))) * t_0);
	end
	return tmp
end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[((-0.25) * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[d, -2.3e-144], N[(t$95$0 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.9e-301], N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.4e-164], N[(N[(N[(N[(N[Sqrt[d], $MachinePrecision] * N[(N[(N[Power[N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] * N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[((-d) / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
\mathbf{if}\;d \leq -2.3 \cdot 10^{-144}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\

\mathbf{elif}\;d \leq -3.9 \cdot 10^{-301}:\\
\;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\

\mathbf{elif}\;d \leq 5.4 \cdot 10^{-164}:\\
\;\;\;\;\frac{\frac{\sqrt{d} \cdot \mathsf{fma}\left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\ell}} \cdot \sqrt{d}}{\sqrt{h}}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -2.3e-144

    1. Initial program 76.5%

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

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

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

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

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

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

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

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
      3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
      14. lower-neg.f6487.8

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

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

    if -2.3e-144 < d < -3.9000000000000001e-301

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9000000000000001e-301 < d < 5.4000000000000003e-164

    1. Initial program 39.7%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Applied rewrites52.4%

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

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

    if 5.4000000000000003e-164 < d

    1. Initial program 78.7%

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

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

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

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

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

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

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

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
    6. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
      2. metadata-eval79.9

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
      3. lift-pow.f64N/A

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

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
      5. lower-sqrt.f6479.9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.3 \cdot 10^{-144}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\ \mathbf{elif}\;d \leq -3.9 \cdot 10^{-301}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{elif}\;d \leq 5.4 \cdot 10^{-164}:\\ \;\;\;\;\frac{\frac{\sqrt{d} \cdot \mathsf{fma}\left({\left(\frac{M}{d} \cdot D\right)}^{2} \cdot 0.25, -0.5 \cdot \frac{h}{\ell}, 1\right)}{\sqrt{\ell}} \cdot \sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 48.4% accurate, 0.5× speedup?

\[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-132}:\\ \;\;\;\;\frac{\left(\frac{D\_m \cdot D\_m}{d} \cdot \sqrt{\ell \cdot h}\right) \cdot \left(-0.125 \cdot \left(M\_m \cdot M\_m\right)\right)}{\ell \cdot \ell}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\ \end{array} \end{array} \]
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (let* ((t_0
         (*
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
          (-
           1.0
           (* (/ h l) (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))))
   (if (<= t_0 -5e-132)
     (/
      (* (* (/ (* D_m D_m) d) (sqrt (* l h))) (* -0.125 (* M_m M_m)))
      (* l l))
     (if (<= t_0 0.0)
       (* (sqrt (/ 1.0 (* l h))) (- d))
       (/ (sqrt (/ d l)) (sqrt (/ h d)))))))
D_m = fabs(D);
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
	double tmp;
	if (t_0 <= -5e-132) {
		tmp = ((((D_m * D_m) / d) * sqrt((l * h))) * (-0.125 * (M_m * M_m))) / (l * l);
	} else if (t_0 <= 0.0) {
		tmp = sqrt((1.0 / (l * h))) * -d;
	} else {
		tmp = sqrt((d / l)) / sqrt((h / d));
	}
	return tmp;
}
D_m = abs(d)
M_m = abs(m)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
real(8) function code(d, h, l, m_m, d_m)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m_m
    real(8), intent (in) :: d_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((m_m * d_m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
    if (t_0 <= (-5d-132)) then
        tmp = ((((d_m * d_m) / d) * sqrt((l * h))) * ((-0.125d0) * (m_m * m_m))) / (l * l)
    else if (t_0 <= 0.0d0) then
        tmp = sqrt((1.0d0 / (l * h))) * -d
    else
        tmp = sqrt((d / l)) / sqrt((h / d))
    end if
    code = tmp
end function
D_m = Math.abs(D);
M_m = Math.abs(M);
assert d < h && h < l && l < M_m && M_m < D_m;
public static double code(double d, double h, double l, double M_m, double D_m) {
	double t_0 = (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
	double tmp;
	if (t_0 <= -5e-132) {
		tmp = ((((D_m * D_m) / d) * Math.sqrt((l * h))) * (-0.125 * (M_m * M_m))) / (l * l);
	} else if (t_0 <= 0.0) {
		tmp = Math.sqrt((1.0 / (l * h))) * -d;
	} else {
		tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
	}
	return tmp;
}
D_m = math.fabs(D)
M_m = math.fabs(M)
[d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
def code(d, h, l, M_m, D_m):
	t_0 = (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0))))
	tmp = 0
	if t_0 <= -5e-132:
		tmp = ((((D_m * D_m) / d) * math.sqrt((l * h))) * (-0.125 * (M_m * M_m))) / (l * l)
	elif t_0 <= 0.0:
		tmp = math.sqrt((1.0 / (l * h))) * -d
	else:
		tmp = math.sqrt((d / l)) / math.sqrt((h / d))
	return tmp
D_m = abs(D)
M_m = abs(M)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	t_0 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))))
	tmp = 0.0
	if (t_0 <= -5e-132)
		tmp = Float64(Float64(Float64(Float64(Float64(D_m * D_m) / d) * sqrt(Float64(l * h))) * Float64(-0.125 * Float64(M_m * M_m))) / Float64(l * l));
	elseif (t_0 <= 0.0)
		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
	else
		tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d)));
	end
	return tmp
end
D_m = abs(D);
M_m = abs(M);
d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
function tmp_2 = code(d, h, l, M_m, D_m)
	t_0 = (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((M_m * D_m) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0))));
	tmp = 0.0;
	if (t_0 <= -5e-132)
		tmp = ((((D_m * D_m) / d) * sqrt((l * h))) * (-0.125 * (M_m * M_m))) / (l * l);
	elseif (t_0 <= 0.0)
		tmp = sqrt((1.0 / (l * h))) * -d;
	else
		tmp = sqrt((d / l)) / sqrt((h / d));
	end
	tmp_2 = tmp;
end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-132], N[(N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
D_m = \left|D\right|
\\
M_m = \left|M\right|
\\
[d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
\\
\begin{array}{l}
t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-132}:\\
\;\;\;\;\frac{\left(\frac{D\_m \cdot D\_m}{d} \cdot \sqrt{\ell \cdot h}\right) \cdot \left(-0.125 \cdot \left(M\_m \cdot M\_m\right)\right)}{\ell \cdot \ell}\\

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\


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

    1. Initial program 86.4%

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

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

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

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

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

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

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

      1. Initial program 30.4%

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

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

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

          \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
        3. rem-square-sqrtN/A

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

          \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
        5. mul-1-negN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
        6. lower-neg.f64N/A

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

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

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

          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
        10. lower-*.f6458.7

          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
      5. Applied rewrites58.7%

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

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

      1. Initial program 61.4%

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

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
        5. *-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
        6. lower-*.f6437.6

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
      5. Applied rewrites37.6%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
      6. Step-by-step derivation
        1. Applied rewrites64.6%

          \[\leadsto \frac{\sqrt{\frac{d}{\ell}}}{\color{blue}{\sqrt{\frac{h}{d}}}} \]
      7. Recombined 3 regimes into one program.
      8. Final simplification53.7%

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

      Alternative 3: 48.4% accurate, 0.5× speedup?

      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-132}:\\ \;\;\;\;\frac{\left(\frac{M\_m \cdot M\_m}{d} \cdot \sqrt{\ell \cdot h}\right) \cdot \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right)}{\ell \cdot \ell}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (let* ((t_0
               (*
                (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
                (-
                 1.0
                 (* (/ h l) (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ 1.0 2.0)))))))
         (if (<= t_0 -5e-132)
           (/
            (* (* (/ (* M_m M_m) d) (sqrt (* l h))) (* -0.125 (* D_m D_m)))
            (* l l))
           (if (<= t_0 0.0)
             (* (sqrt (/ 1.0 (* l h))) (- d))
             (/ (sqrt (/ d l)) (sqrt (/ h d)))))))
      D_m = fabs(D);
      M_m = fabs(M);
      assert(d < h && h < l && l < M_m && M_m < D_m);
      double code(double d, double h, double l, double M_m, double D_m) {
      	double t_0 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 - ((h / l) * (pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
      	double tmp;
      	if (t_0 <= -5e-132) {
      		tmp = ((((M_m * M_m) / d) * sqrt((l * h))) * (-0.125 * (D_m * D_m))) / (l * l);
      	} else if (t_0 <= 0.0) {
      		tmp = sqrt((1.0 / (l * h))) * -d;
      	} else {
      		tmp = sqrt((d / l)) / sqrt((h / d));
      	}
      	return tmp;
      }
      
      D_m = abs(d)
      M_m = abs(m)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      real(8) function code(d, h, l, m_m, d_m)
          real(8), intent (in) :: d
          real(8), intent (in) :: h
          real(8), intent (in) :: l
          real(8), intent (in) :: m_m
          real(8), intent (in) :: d_m
          real(8) :: t_0
          real(8) :: tmp
          t_0 = (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0))) * (1.0d0 - ((h / l) * ((((m_m * d_m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0))))
          if (t_0 <= (-5d-132)) then
              tmp = ((((m_m * m_m) / d) * sqrt((l * h))) * ((-0.125d0) * (d_m * d_m))) / (l * l)
          else if (t_0 <= 0.0d0) then
              tmp = sqrt((1.0d0 / (l * h))) * -d
          else
              tmp = sqrt((d / l)) / sqrt((h / d))
          end if
          code = tmp
      end function
      
      D_m = Math.abs(D);
      M_m = Math.abs(M);
      assert d < h && h < l && l < M_m && M_m < D_m;
      public static double code(double d, double h, double l, double M_m, double D_m) {
      	double t_0 = (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0))) * (1.0 - ((h / l) * (Math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0))));
      	double tmp;
      	if (t_0 <= -5e-132) {
      		tmp = ((((M_m * M_m) / d) * Math.sqrt((l * h))) * (-0.125 * (D_m * D_m))) / (l * l);
      	} else if (t_0 <= 0.0) {
      		tmp = Math.sqrt((1.0 / (l * h))) * -d;
      	} else {
      		tmp = Math.sqrt((d / l)) / Math.sqrt((h / d));
      	}
      	return tmp;
      }
      
      D_m = math.fabs(D)
      M_m = math.fabs(M)
      [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
      def code(d, h, l, M_m, D_m):
      	t_0 = (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) * (1.0 - ((h / l) * (math.pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0))))
      	tmp = 0
      	if t_0 <= -5e-132:
      		tmp = ((((M_m * M_m) / d) * math.sqrt((l * h))) * (-0.125 * (D_m * D_m))) / (l * l)
      	elif t_0 <= 0.0:
      		tmp = math.sqrt((1.0 / (l * h))) * -d
      	else:
      		tmp = math.sqrt((d / l)) / math.sqrt((h / d))
      	return tmp
      
      D_m = abs(D)
      M_m = abs(M)
      d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
      function code(d, h, l, M_m, D_m)
      	t_0 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))))
      	tmp = 0.0
      	if (t_0 <= -5e-132)
      		tmp = Float64(Float64(Float64(Float64(Float64(M_m * M_m) / d) * sqrt(Float64(l * h))) * Float64(-0.125 * Float64(D_m * D_m))) / Float64(l * l));
      	elseif (t_0 <= 0.0)
      		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
      	else
      		tmp = Float64(sqrt(Float64(d / l)) / sqrt(Float64(h / d)));
      	end
      	return tmp
      end
      
      D_m = abs(D);
      M_m = abs(M);
      d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
      function tmp_2 = code(d, h, l, M_m, D_m)
      	t_0 = (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))) * (1.0 - ((h / l) * ((((M_m * D_m) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0))));
      	tmp = 0.0;
      	if (t_0 <= -5e-132)
      		tmp = ((((M_m * M_m) / d) * sqrt((l * h))) * (-0.125 * (D_m * D_m))) / (l * l);
      	elseif (t_0 <= 0.0)
      		tmp = sqrt((1.0 / (l * h))) * -d;
      	else
      		tmp = sqrt((d / l)) / sqrt((h / d));
      	end
      	tmp_2 = tmp;
      end
      
      D_m = N[Abs[D], $MachinePrecision]
      M_m = N[Abs[M], $MachinePrecision]
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-132], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] * N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      t_0 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right)\\
      \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-132}:\\
      \;\;\;\;\frac{\left(\frac{M\_m \cdot M\_m}{d} \cdot \sqrt{\ell \cdot h}\right) \cdot \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right)}{\ell \cdot \ell}\\
      
      \mathbf{elif}\;t\_0 \leq 0:\\
      \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.9999999999999999e-132

        1. Initial program 86.4%

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

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

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

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

          \[\leadsto \frac{d \cdot \sqrt{\frac{{\ell}^{3}}{h}}}{\color{blue}{\ell} \cdot \ell} \]
        7. Step-by-step derivation
          1. Applied rewrites2.1%

            \[\leadsto \frac{\sqrt{\frac{{\ell}^{3}}{h}} \cdot d}{\color{blue}{\ell} \cdot \ell} \]
          2. Taylor expanded in h around inf

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

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

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

            1. Initial program 30.4%

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

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

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

                \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
              3. rem-square-sqrtN/A

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

                \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              5. mul-1-negN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
              6. lower-neg.f64N/A

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

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

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

                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
              10. lower-*.f6458.7

                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
            5. Applied rewrites58.7%

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

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

            1. Initial program 61.4%

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

              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
              3. lower-sqrt.f64N/A

                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
              4. lower-/.f64N/A

                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
              5. *-commutativeN/A

                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
              6. lower-*.f6437.6

                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
            5. Applied rewrites37.6%

              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
            6. Step-by-step derivation
              1. Applied rewrites64.6%

                \[\leadsto \frac{\sqrt{\frac{d}{\ell}}}{\color{blue}{\sqrt{\frac{h}{d}}}} \]
            7. Recombined 3 regimes into one program.
            8. Final simplification53.0%

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

            Alternative 4: 80.6% accurate, 2.0× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;d \leq -2.3 \cdot 10^{-144}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\ \mathbf{elif}\;d \leq -3.9 \cdot 10^{-301}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_0\\ \end{array} \end{array} \]
            D_m = (fabs.f64 D)
            M_m = (fabs.f64 M)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (let* ((t_0
                     (fma
                      (/ (* M_m (* D_m (/ 0.5 d))) l)
                      (* (* (- 0.25) D_m) (* (/ M_m d) h))
                      1.0)))
               (if (<= d -2.3e-144)
                 (* t_0 (* (sqrt (/ d l)) (/ (sqrt (- d)) (sqrt (- h)))))
                 (if (<= d -3.9e-301)
                   (*
                    (- 1.0 (* (/ h l) (* (pow (/ (* M_m D_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
                    (* (sqrt (/ 1.0 (* l h))) (- d)))
                   (* (* (/ -1.0 (sqrt h)) (/ (- d) (sqrt l))) t_0)))))
            D_m = fabs(D);
            M_m = fabs(M);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double t_0 = fma(((M_m * (D_m * (0.5 / d))) / l), ((-0.25 * D_m) * ((M_m / d) * h)), 1.0);
            	double tmp;
            	if (d <= -2.3e-144) {
            		tmp = t_0 * (sqrt((d / l)) * (sqrt(-d) / sqrt(-h)));
            	} else if (d <= -3.9e-301) {
            		tmp = (1.0 - ((h / l) * (pow(((M_m * D_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (sqrt((1.0 / (l * h))) * -d);
            	} else {
            		tmp = ((-1.0 / sqrt(h)) * (-d / sqrt(l))) * t_0;
            	}
            	return tmp;
            }
            
            D_m = abs(D)
            M_m = abs(M)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	t_0 = fma(Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l), Float64(Float64(Float64(-0.25) * D_m) * Float64(Float64(M_m / d) * h)), 1.0)
            	tmp = 0.0
            	if (d <= -2.3e-144)
            		tmp = Float64(t_0 * Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))));
            	elseif (d <= -3.9e-301)
            		tmp = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)));
            	else
            		tmp = Float64(Float64(Float64(-1.0 / sqrt(h)) * Float64(Float64(-d) / sqrt(l))) * t_0);
            	end
            	return tmp
            end
            
            D_m = N[Abs[D], $MachinePrecision]
            M_m = N[Abs[M], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[((-0.25) * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[d, -2.3e-144], N[(t$95$0 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -3.9e-301], N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[((-d) / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
            \mathbf{if}\;d \leq -2.3 \cdot 10^{-144}:\\
            \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\
            
            \mathbf{elif}\;d \leq -3.9 \cdot 10^{-301}:\\
            \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if d < -2.3e-144

              1. Initial program 76.5%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                14. lower-neg.f6487.8

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

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

              if -2.3e-144 < d < -3.9000000000000001e-301

              1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -3.9000000000000001e-301 < d

              1. Initial program 70.3%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 5: 80.8% accurate, 3.0× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;d \leq -7.2 \cdot 10^{-55}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\ \mathbf{elif}\;d \leq -6.7 \cdot 10^{-307}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_0\\ \end{array} \end{array} \]
            D_m = (fabs.f64 D)
            M_m = (fabs.f64 M)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (let* ((t_0
                     (fma
                      (/ (* M_m (* D_m (/ 0.5 d))) l)
                      (* (* (- 0.25) D_m) (* (/ M_m d) h))
                      1.0)))
               (if (<= d -7.2e-55)
                 (* t_0 (* (sqrt (/ d l)) (/ (sqrt (- d)) (sqrt (- h)))))
                 (if (<= d -6.7e-307)
                   (* (* (sqrt (/ 1.0 (* l h))) (- d)) t_0)
                   (* (* (/ -1.0 (sqrt h)) (/ (- d) (sqrt l))) t_0)))))
            D_m = fabs(D);
            M_m = fabs(M);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double t_0 = fma(((M_m * (D_m * (0.5 / d))) / l), ((-0.25 * D_m) * ((M_m / d) * h)), 1.0);
            	double tmp;
            	if (d <= -7.2e-55) {
            		tmp = t_0 * (sqrt((d / l)) * (sqrt(-d) / sqrt(-h)));
            	} else if (d <= -6.7e-307) {
            		tmp = (sqrt((1.0 / (l * h))) * -d) * t_0;
            	} else {
            		tmp = ((-1.0 / sqrt(h)) * (-d / sqrt(l))) * t_0;
            	}
            	return tmp;
            }
            
            D_m = abs(D)
            M_m = abs(M)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	t_0 = fma(Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l), Float64(Float64(Float64(-0.25) * D_m) * Float64(Float64(M_m / d) * h)), 1.0)
            	tmp = 0.0
            	if (d <= -7.2e-55)
            		tmp = Float64(t_0 * Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h)))));
            	elseif (d <= -6.7e-307)
            		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * t_0);
            	else
            		tmp = Float64(Float64(Float64(-1.0 / sqrt(h)) * Float64(Float64(-d) / sqrt(l))) * t_0);
            	end
            	return tmp
            end
            
            D_m = N[Abs[D], $MachinePrecision]
            M_m = N[Abs[M], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[((-0.25) * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[d, -7.2e-55], N[(t$95$0 * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.7e-307], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(-1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[((-d) / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
            \mathbf{if}\;d \leq -7.2 \cdot 10^{-55}:\\
            \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\
            
            \mathbf{elif}\;d \leq -6.7 \cdot 10^{-307}:\\
            \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if d < -7.2000000000000001e-55

              1. Initial program 78.0%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                14. lower-neg.f6491.0

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

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

              if -7.2000000000000001e-55 < d < -6.6999999999999999e-307

              1. Initial program 47.3%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                2. metadata-eval47.0

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                5. lower-sqrt.f6447.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -6.6999999999999999e-307 < d

              1. Initial program 70.8%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                2. metadata-eval71.6

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                5. lower-sqrt.f6471.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -7.2 \cdot 10^{-55}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\right)\\ \mathbf{elif}\;d \leq -6.7 \cdot 10^{-307}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 6: 73.4% accurate, 3.1× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}\\ t_1 := \mathsf{fma}\left(t\_0, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ t_2 := \mathsf{fma}\left(t\_0, \frac{\left(-0.25 \cdot D\_m\right) \cdot \left(M\_m \cdot h\right)}{d}, 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{if}\;h \leq -7.6 \cdot 10^{+151}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_1\\ \mathbf{elif}\;h \leq 1.5 \cdot 10^{+190}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
            D_m = (fabs.f64 D)
            M_m = (fabs.f64 M)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (let* ((t_0 (/ (* M_m (* D_m (/ 0.5 d))) l))
                    (t_1 (fma t_0 (* (* (- 0.25) D_m) (* (/ M_m d) h)) 1.0))
                    (t_2
                     (*
                      (fma t_0 (/ (* (* -0.25 D_m) (* M_m h)) d) 1.0)
                      (* (sqrt (/ d h)) (sqrt (/ d l))))))
               (if (<= h -7.6e+151)
                 t_2
                 (if (<= h -4e-310)
                   (* (* (sqrt (/ 1.0 (* l h))) (- d)) t_1)
                   (if (<= h 1.5e+190) (* (/ d (sqrt (* l h))) t_1) t_2)))))
            D_m = fabs(D);
            M_m = fabs(M);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double t_0 = (M_m * (D_m * (0.5 / d))) / l;
            	double t_1 = fma(t_0, ((-0.25 * D_m) * ((M_m / d) * h)), 1.0);
            	double t_2 = fma(t_0, (((-0.25 * D_m) * (M_m * h)) / d), 1.0) * (sqrt((d / h)) * sqrt((d / l)));
            	double tmp;
            	if (h <= -7.6e+151) {
            		tmp = t_2;
            	} else if (h <= -4e-310) {
            		tmp = (sqrt((1.0 / (l * h))) * -d) * t_1;
            	} else if (h <= 1.5e+190) {
            		tmp = (d / sqrt((l * h))) * t_1;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            D_m = abs(D)
            M_m = abs(M)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	t_0 = Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l)
            	t_1 = fma(t_0, Float64(Float64(Float64(-0.25) * D_m) * Float64(Float64(M_m / d) * h)), 1.0)
            	t_2 = Float64(fma(t_0, Float64(Float64(Float64(-0.25 * D_m) * Float64(M_m * h)) / d), 1.0) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))))
            	tmp = 0.0
            	if (h <= -7.6e+151)
            		tmp = t_2;
            	elseif (h <= -4e-310)
            		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * t_1);
            	elseif (h <= 1.5e+190)
            		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * t_1);
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            D_m = N[Abs[D], $MachinePrecision]
            M_m = N[Abs[M], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[((-0.25) * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 * N[(N[(N[(-0.25 * D$95$m), $MachinePrecision] * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -7.6e+151], t$95$2, If[LessEqual[h, -4e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[h, 1.5e+190], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], t$95$2]]]]]]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            t_0 := \frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}\\
            t_1 := \mathsf{fma}\left(t\_0, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
            t_2 := \mathsf{fma}\left(t\_0, \frac{\left(-0.25 \cdot D\_m\right) \cdot \left(M\_m \cdot h\right)}{d}, 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
            \mathbf{if}\;h \leq -7.6 \cdot 10^{+151}:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\
            \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_1\\
            
            \mathbf{elif}\;h \leq 1.5 \cdot 10^{+190}:\\
            \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if h < -7.6000000000000001e151 or 1.49999999999999991e190 < h

              1. Initial program 56.8%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -7.6000000000000001e151 < h < -3.999999999999988e-310

              1. Initial program 68.5%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                2. metadata-eval70.9

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                5. lower-sqrt.f6470.9

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                10. lower-*.f6484.0

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

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

              if -3.999999999999988e-310 < h < 1.49999999999999991e190

              1. Initial program 73.4%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                5. lower-sqrt.f6475.3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -7.6 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \frac{\left(-0.25 \cdot D\right) \cdot \left(M \cdot h\right)}{d}, 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\\ \mathbf{elif}\;h \leq 1.5 \cdot 10^{+190}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \frac{\left(-0.25 \cdot D\right) \cdot \left(M \cdot h\right)}{d}, 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 7: 78.1% accurate, 3.1× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}\\ t_1 := \mathsf{fma}\left(t\_0, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;h \leq -7.6 \cdot 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, \frac{\left(-0.25 \cdot D\_m\right) \cdot \left(M\_m \cdot h\right)}{d}, 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_1\\ \end{array} \end{array} \]
            D_m = (fabs.f64 D)
            M_m = (fabs.f64 M)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (let* ((t_0 (/ (* M_m (* D_m (/ 0.5 d))) l))
                    (t_1 (fma t_0 (* (* (- 0.25) D_m) (* (/ M_m d) h)) 1.0)))
               (if (<= h -7.6e+151)
                 (*
                  (fma t_0 (/ (* (* -0.25 D_m) (* M_m h)) d) 1.0)
                  (* (sqrt (/ d h)) (sqrt (/ d l))))
                 (if (<= h -4e-310)
                   (* (* (sqrt (/ 1.0 (* l h))) (- d)) t_1)
                   (* (* (/ -1.0 (sqrt h)) (/ (- d) (sqrt l))) t_1)))))
            D_m = fabs(D);
            M_m = fabs(M);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double t_0 = (M_m * (D_m * (0.5 / d))) / l;
            	double t_1 = fma(t_0, ((-0.25 * D_m) * ((M_m / d) * h)), 1.0);
            	double tmp;
            	if (h <= -7.6e+151) {
            		tmp = fma(t_0, (((-0.25 * D_m) * (M_m * h)) / d), 1.0) * (sqrt((d / h)) * sqrt((d / l)));
            	} else if (h <= -4e-310) {
            		tmp = (sqrt((1.0 / (l * h))) * -d) * t_1;
            	} else {
            		tmp = ((-1.0 / sqrt(h)) * (-d / sqrt(l))) * t_1;
            	}
            	return tmp;
            }
            
            D_m = abs(D)
            M_m = abs(M)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	t_0 = Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l)
            	t_1 = fma(t_0, Float64(Float64(Float64(-0.25) * D_m) * Float64(Float64(M_m / d) * h)), 1.0)
            	tmp = 0.0
            	if (h <= -7.6e+151)
            		tmp = Float64(fma(t_0, Float64(Float64(Float64(-0.25 * D_m) * Float64(M_m * h)) / d), 1.0) * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l))));
            	elseif (h <= -4e-310)
            		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * t_1);
            	else
            		tmp = Float64(Float64(Float64(-1.0 / sqrt(h)) * Float64(Float64(-d) / sqrt(l))) * t_1);
            	end
            	return tmp
            end
            
            D_m = N[Abs[D], $MachinePrecision]
            M_m = N[Abs[M], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[((-0.25) * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[h, -7.6e+151], N[(N[(t$95$0 * N[(N[(N[(-0.25 * D$95$m), $MachinePrecision] * N[(M$95$m * h), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -4e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(-1.0 / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[((-d) / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            t_0 := \frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}\\
            t_1 := \mathsf{fma}\left(t\_0, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
            \mathbf{if}\;h \leq -7.6 \cdot 10^{+151}:\\
            \;\;\;\;\mathsf{fma}\left(t\_0, \frac{\left(-0.25 \cdot D\_m\right) \cdot \left(M\_m \cdot h\right)}{d}, 1\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
            
            \mathbf{elif}\;h \leq -4 \cdot 10^{-310}:\\
            \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\frac{-1}{\sqrt{h}} \cdot \frac{-d}{\sqrt{\ell}}\right) \cdot t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if h < -7.6000000000000001e151

              1. Initial program 51.9%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                2. metadata-eval47.0

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                5. lower-sqrt.f6447.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -7.6000000000000001e151 < h < -3.999999999999988e-310

              1. Initial program 68.5%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                2. metadata-eval70.9

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

                  \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                5. lower-sqrt.f6470.9

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                10. lower-*.f6484.0

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

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

              if -3.999999999999988e-310 < h

              1. Initial program 71.3%

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

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

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

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

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

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

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

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
              6. Step-by-step derivation
                1. lift-/.f64N/A

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 8: 61.7% accurate, 3.4× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{-d}\\ t_1 := \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|} \cdot \left(\frac{M\_m \cdot M\_m}{d} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot 0.125\right)\right)\\ \mathbf{if}\;d \leq -1.45 \cdot 10^{+65}:\\ \;\;\;\;\sqrt{\frac{\frac{-d}{\ell}}{h}} \cdot t\_0\\ \mathbf{elif}\;d \leq -2.8 \cdot 10^{+23}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;d \leq -3.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{\frac{t\_0}{\sqrt{-\ell}}}{\sqrt{\frac{h}{d}}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \end{array} \end{array} \]
            D_m = (fabs.f64 D)
            M_m = (fabs.f64 M)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (let* ((t_0 (sqrt (- d)))
                    (t_1
                     (*
                      (/ (sqrt (/ h l)) (fabs l))
                      (* (/ (* M_m M_m) d) (* (* D_m D_m) 0.125)))))
               (if (<= d -1.45e+65)
                 (* (sqrt (/ (/ (- d) l) h)) t_0)
                 (if (<= d -2.8e+23)
                   t_1
                   (if (<= d -3.8e-75)
                     (/ (/ t_0 (sqrt (- l))) (sqrt (/ h d)))
                     (if (<= d -5e-311)
                       t_1
                       (*
                        (/ d (sqrt (* l h)))
                        (fma
                         (/ (* M_m (* D_m (/ 0.5 d))) l)
                         (* (* (- 0.25) D_m) (* (/ M_m d) h))
                         1.0))))))))
            D_m = fabs(D);
            M_m = fabs(M);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double t_0 = sqrt(-d);
            	double t_1 = (sqrt((h / l)) / fabs(l)) * (((M_m * M_m) / d) * ((D_m * D_m) * 0.125));
            	double tmp;
            	if (d <= -1.45e+65) {
            		tmp = sqrt(((-d / l) / h)) * t_0;
            	} else if (d <= -2.8e+23) {
            		tmp = t_1;
            	} else if (d <= -3.8e-75) {
            		tmp = (t_0 / sqrt(-l)) / sqrt((h / d));
            	} else if (d <= -5e-311) {
            		tmp = t_1;
            	} else {
            		tmp = (d / sqrt((l * h))) * fma(((M_m * (D_m * (0.5 / d))) / l), ((-0.25 * D_m) * ((M_m / d) * h)), 1.0);
            	}
            	return tmp;
            }
            
            D_m = abs(D)
            M_m = abs(M)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	t_0 = sqrt(Float64(-d))
            	t_1 = Float64(Float64(sqrt(Float64(h / l)) / abs(l)) * Float64(Float64(Float64(M_m * M_m) / d) * Float64(Float64(D_m * D_m) * 0.125)))
            	tmp = 0.0
            	if (d <= -1.45e+65)
            		tmp = Float64(sqrt(Float64(Float64(Float64(-d) / l) / h)) * t_0);
            	elseif (d <= -2.8e+23)
            		tmp = t_1;
            	elseif (d <= -3.8e-75)
            		tmp = Float64(Float64(t_0 / sqrt(Float64(-l))) / sqrt(Float64(h / d)));
            	elseif (d <= -5e-311)
            		tmp = t_1;
            	else
            		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l), Float64(Float64(Float64(-0.25) * D_m) * Float64(Float64(M_m / d) * h)), 1.0));
            	end
            	return tmp
            end
            
            D_m = N[Abs[D], $MachinePrecision]
            M_m = N[Abs[M], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.45e+65], N[(N[Sqrt[N[(N[((-d) / l), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, -2.8e+23], t$95$1, If[LessEqual[d, -3.8e-75], N[(N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-311], t$95$1, N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[((-0.25) * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            t_0 := \sqrt{-d}\\
            t_1 := \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|} \cdot \left(\frac{M\_m \cdot M\_m}{d} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot 0.125\right)\right)\\
            \mathbf{if}\;d \leq -1.45 \cdot 10^{+65}:\\
            \;\;\;\;\sqrt{\frac{\frac{-d}{\ell}}{h}} \cdot t\_0\\
            
            \mathbf{elif}\;d \leq -2.8 \cdot 10^{+23}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;d \leq -3.8 \cdot 10^{-75}:\\
            \;\;\;\;\frac{\frac{t\_0}{\sqrt{-\ell}}}{\sqrt{\frac{h}{d}}}\\
            
            \mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if d < -1.45e65

              1. Initial program 72.0%

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

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                5. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                6. lower-*.f641.9

                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
              5. Applied rewrites1.9%

                \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
              6. Step-by-step derivation
                1. Applied rewrites60.4%

                  \[\leadsto \frac{\sqrt{\frac{d}{\ell}}}{\color{blue}{\sqrt{\frac{h}{d}}}} \]
                2. Step-by-step derivation
                  1. Applied rewrites76.3%

                    \[\leadsto \sqrt{\frac{\frac{d}{\ell}}{-h}} \cdot \color{blue}{\sqrt{-d}} \]

                  if -1.45e65 < d < -2.8e23 or -3.79999999999999994e-75 < d < -5.00000000000023e-311

                  1. Initial program 51.4%

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

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

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

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

                    \[\leadsto \color{blue}{\left(\left(0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right) \cdot \sqrt{\frac{h}{{\ell}^{3}}}} \]
                  6. Step-by-step derivation
                    1. Applied rewrites50.3%

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

                    if -2.8e23 < d < -3.79999999999999994e-75

                    1. Initial program 86.5%

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

                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                      3. lower-sqrt.f64N/A

                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                      4. lower-/.f64N/A

                        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                      5. *-commutativeN/A

                        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                      6. lower-*.f642.7

                        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                    5. Applied rewrites2.7%

                      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                    6. Step-by-step derivation
                      1. Applied rewrites61.1%

                        \[\leadsto \frac{\sqrt{\frac{d}{\ell}}}{\color{blue}{\sqrt{\frac{h}{d}}}} \]
                      2. Step-by-step derivation
                        1. Applied rewrites64.3%

                          \[\leadsto \frac{\frac{\sqrt{-d}}{\sqrt{-\ell}}}{\sqrt{\color{blue}{\frac{h}{d}}}} \]

                        if -5.00000000000023e-311 < d

                        1. Initial program 71.3%

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

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

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

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

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

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

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
                        6. Step-by-step derivation
                          1. lift-/.f64N/A

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

                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                          3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                          14. lower-/.f6477.0

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.45 \cdot 10^{+65}:\\ \;\;\;\;\sqrt{\frac{\frac{-d}{\ell}}{h}} \cdot \sqrt{-d}\\ \mathbf{elif}\;d \leq -2.8 \cdot 10^{+23}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{elif}\;d \leq -3.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{\frac{\sqrt{-d}}{\sqrt{-\ell}}}{\sqrt{\frac{h}{d}}}\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|} \cdot \left(\frac{M \cdot M}{d} \cdot \left(\left(D \cdot D\right) \cdot 0.125\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{M \cdot \left(D \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 9: 74.3% accurate, 3.7× speedup?

                      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot t\_0\\ \end{array} \end{array} \]
                      D_m = (fabs.f64 D)
                      M_m = (fabs.f64 M)
                      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                      (FPCore (d h l M_m D_m)
                       :precision binary64
                       (let* ((t_0
                               (fma
                                (/ (* M_m (* D_m (/ 0.5 d))) l)
                                (* (* (- 0.25) D_m) (* (/ M_m d) h))
                                1.0)))
                         (if (<= l -4e-310)
                           (* (* (sqrt (/ 1.0 (* l h))) (- d)) t_0)
                           (* (/ d (sqrt (* l h))) t_0))))
                      D_m = fabs(D);
                      M_m = fabs(M);
                      assert(d < h && h < l && l < M_m && M_m < D_m);
                      double code(double d, double h, double l, double M_m, double D_m) {
                      	double t_0 = fma(((M_m * (D_m * (0.5 / d))) / l), ((-0.25 * D_m) * ((M_m / d) * h)), 1.0);
                      	double tmp;
                      	if (l <= -4e-310) {
                      		tmp = (sqrt((1.0 / (l * h))) * -d) * t_0;
                      	} else {
                      		tmp = (d / sqrt((l * h))) * t_0;
                      	}
                      	return tmp;
                      }
                      
                      D_m = abs(D)
                      M_m = abs(M)
                      d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                      function code(d, h, l, M_m, D_m)
                      	t_0 = fma(Float64(Float64(M_m * Float64(D_m * Float64(0.5 / d))) / l), Float64(Float64(Float64(-0.25) * D_m) * Float64(Float64(M_m / d) * h)), 1.0)
                      	tmp = 0.0
                      	if (l <= -4e-310)
                      		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * t_0);
                      	else
                      		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * t_0);
                      	end
                      	return tmp
                      end
                      
                      D_m = N[Abs[D], $MachinePrecision]
                      M_m = N[Abs[M], $MachinePrecision]
                      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                      code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(M$95$m * N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[((-0.25) * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -4e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      D_m = \left|D\right|
                      \\
                      M_m = \left|M\right|
                      \\
                      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                      \\
                      \begin{array}{l}
                      t_0 := \mathsf{fma}\left(\frac{M\_m \cdot \left(D\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(\left(-0.25\right) \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
                      \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
                      \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot t\_0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if l < -3.999999999999988e-310

                        1. Initial program 64.4%

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

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

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

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

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

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

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
                        6. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                          2. metadata-eval65.0

                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                          3. lift-pow.f64N/A

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

                            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                          5. lower-sqrt.f6465.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if -3.999999999999988e-310 < l

                        1. Initial program 71.3%

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

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

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

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

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

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

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

                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \]
                        6. Step-by-step derivation
                          1. lift-/.f64N/A

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

                            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \]
                          3. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \cdot \mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot D\right) \cdot M}{\ell}, -\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
                          14. lower-/.f6477.0

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

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

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

                      Alternative 10: 46.5% accurate, 9.6× speedup?

                      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 7 \cdot 10^{-295}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                      D_m = (fabs.f64 D)
                      M_m = (fabs.f64 M)
                      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                      (FPCore (d h l M_m D_m)
                       :precision binary64
                       (if (<= l 7e-295)
                         (* (sqrt (/ 1.0 (* l h))) (- d))
                         (/ d (* (sqrt h) (sqrt l)))))
                      D_m = fabs(D);
                      M_m = fabs(M);
                      assert(d < h && h < l && l < M_m && M_m < D_m);
                      double code(double d, double h, double l, double M_m, double D_m) {
                      	double tmp;
                      	if (l <= 7e-295) {
                      		tmp = sqrt((1.0 / (l * h))) * -d;
                      	} else {
                      		tmp = d / (sqrt(h) * sqrt(l));
                      	}
                      	return tmp;
                      }
                      
                      D_m = abs(d)
                      M_m = abs(m)
                      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                      real(8) function code(d, h, l, m_m, d_m)
                          real(8), intent (in) :: d
                          real(8), intent (in) :: h
                          real(8), intent (in) :: l
                          real(8), intent (in) :: m_m
                          real(8), intent (in) :: d_m
                          real(8) :: tmp
                          if (l <= 7d-295) then
                              tmp = sqrt((1.0d0 / (l * h))) * -d
                          else
                              tmp = d / (sqrt(h) * sqrt(l))
                          end if
                          code = tmp
                      end function
                      
                      D_m = Math.abs(D);
                      M_m = Math.abs(M);
                      assert d < h && h < l && l < M_m && M_m < D_m;
                      public static double code(double d, double h, double l, double M_m, double D_m) {
                      	double tmp;
                      	if (l <= 7e-295) {
                      		tmp = Math.sqrt((1.0 / (l * h))) * -d;
                      	} else {
                      		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                      	}
                      	return tmp;
                      }
                      
                      D_m = math.fabs(D)
                      M_m = math.fabs(M)
                      [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                      def code(d, h, l, M_m, D_m):
                      	tmp = 0
                      	if l <= 7e-295:
                      		tmp = math.sqrt((1.0 / (l * h))) * -d
                      	else:
                      		tmp = d / (math.sqrt(h) * math.sqrt(l))
                      	return tmp
                      
                      D_m = abs(D)
                      M_m = abs(M)
                      d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                      function code(d, h, l, M_m, D_m)
                      	tmp = 0.0
                      	if (l <= 7e-295)
                      		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                      	else
                      		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                      	end
                      	return tmp
                      end
                      
                      D_m = abs(D);
                      M_m = abs(M);
                      d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                      function tmp_2 = code(d, h, l, M_m, D_m)
                      	tmp = 0.0;
                      	if (l <= 7e-295)
                      		tmp = sqrt((1.0 / (l * h))) * -d;
                      	else
                      		tmp = d / (sqrt(h) * sqrt(l));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      D_m = N[Abs[D], $MachinePrecision]
                      M_m = N[Abs[M], $MachinePrecision]
                      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                      code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, 7e-295], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      D_m = \left|D\right|
                      \\
                      M_m = \left|M\right|
                      \\
                      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\ell \leq 7 \cdot 10^{-295}:\\
                      \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if l < 6.99999999999999977e-295

                        1. Initial program 65.3%

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

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

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

                            \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                          3. rem-square-sqrtN/A

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

                            \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                          5. mul-1-negN/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                          6. lower-neg.f64N/A

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

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

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

                            \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                          10. lower-*.f6444.2

                            \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                        5. Applied rewrites44.2%

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

                        if 6.99999999999999977e-295 < l

                        1. Initial program 70.7%

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

                          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                          2. lower-*.f64N/A

                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                          3. lower-sqrt.f64N/A

                            \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                          4. lower-/.f64N/A

                            \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                          5. *-commutativeN/A

                            \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                          6. lower-*.f6444.1

                            \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                        5. Applied rewrites44.1%

                          \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                        6. Step-by-step derivation
                          1. Applied rewrites44.1%

                            \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                          2. Step-by-step derivation
                            1. Applied rewrites50.0%

                              \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                          3. Recombined 2 regimes into one program.
                          4. Final simplification47.4%

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

                          Alternative 11: 42.2% accurate, 10.3× speedup?

                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 10^{-188}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
                          D_m = (fabs.f64 D)
                          M_m = (fabs.f64 M)
                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                          (FPCore (d h l M_m D_m)
                           :precision binary64
                           (if (<= l 1e-188) (* (sqrt (/ 1.0 (* l h))) (- d)) (/ d (sqrt (* l h)))))
                          D_m = fabs(D);
                          M_m = fabs(M);
                          assert(d < h && h < l && l < M_m && M_m < D_m);
                          double code(double d, double h, double l, double M_m, double D_m) {
                          	double tmp;
                          	if (l <= 1e-188) {
                          		tmp = sqrt((1.0 / (l * h))) * -d;
                          	} else {
                          		tmp = d / sqrt((l * h));
                          	}
                          	return tmp;
                          }
                          
                          D_m = abs(d)
                          M_m = abs(m)
                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                          real(8) function code(d, h, l, m_m, d_m)
                              real(8), intent (in) :: d
                              real(8), intent (in) :: h
                              real(8), intent (in) :: l
                              real(8), intent (in) :: m_m
                              real(8), intent (in) :: d_m
                              real(8) :: tmp
                              if (l <= 1d-188) then
                                  tmp = sqrt((1.0d0 / (l * h))) * -d
                              else
                                  tmp = d / sqrt((l * h))
                              end if
                              code = tmp
                          end function
                          
                          D_m = Math.abs(D);
                          M_m = Math.abs(M);
                          assert d < h && h < l && l < M_m && M_m < D_m;
                          public static double code(double d, double h, double l, double M_m, double D_m) {
                          	double tmp;
                          	if (l <= 1e-188) {
                          		tmp = Math.sqrt((1.0 / (l * h))) * -d;
                          	} else {
                          		tmp = d / Math.sqrt((l * h));
                          	}
                          	return tmp;
                          }
                          
                          D_m = math.fabs(D)
                          M_m = math.fabs(M)
                          [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                          def code(d, h, l, M_m, D_m):
                          	tmp = 0
                          	if l <= 1e-188:
                          		tmp = math.sqrt((1.0 / (l * h))) * -d
                          	else:
                          		tmp = d / math.sqrt((l * h))
                          	return tmp
                          
                          D_m = abs(D)
                          M_m = abs(M)
                          d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                          function code(d, h, l, M_m, D_m)
                          	tmp = 0.0
                          	if (l <= 1e-188)
                          		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                          	else
                          		tmp = Float64(d / sqrt(Float64(l * h)));
                          	end
                          	return tmp
                          end
                          
                          D_m = abs(D);
                          M_m = abs(M);
                          d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                          function tmp_2 = code(d, h, l, M_m, D_m)
                          	tmp = 0.0;
                          	if (l <= 1e-188)
                          		tmp = sqrt((1.0 / (l * h))) * -d;
                          	else
                          		tmp = d / sqrt((l * h));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          D_m = N[Abs[D], $MachinePrecision]
                          M_m = N[Abs[M], $MachinePrecision]
                          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                          code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[l, 1e-188], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          D_m = \left|D\right|
                          \\
                          M_m = \left|M\right|
                          \\
                          [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;\ell \leq 10^{-188}:\\
                          \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if l < 9.9999999999999995e-189

                            1. Initial program 67.5%

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

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

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

                                \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                              3. rem-square-sqrtN/A

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

                                \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                              5. mul-1-negN/A

                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                              6. lower-neg.f64N/A

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

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

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

                                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                              10. lower-*.f6441.6

                                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                            5. Applied rewrites41.6%

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

                            if 9.9999999999999995e-189 < l

                            1. Initial program 69.2%

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

                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                              2. lower-*.f64N/A

                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                              3. lower-sqrt.f64N/A

                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                              4. lower-/.f64N/A

                                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                              5. *-commutativeN/A

                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                              6. lower-*.f6448.3

                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                            5. Applied rewrites48.3%

                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                            6. Step-by-step derivation
                              1. Applied rewrites48.3%

                                \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                            7. Recombined 2 regimes into one program.
                            8. Final simplification44.7%

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

                            Alternative 12: 26.2% accurate, 15.3× speedup?

                            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                            D_m = (fabs.f64 D)
                            M_m = (fabs.f64 M)
                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                            (FPCore (d h l M_m D_m) :precision binary64 (/ d (sqrt (* l h))))
                            D_m = fabs(D);
                            M_m = fabs(M);
                            assert(d < h && h < l && l < M_m && M_m < D_m);
                            double code(double d, double h, double l, double M_m, double D_m) {
                            	return d / sqrt((l * h));
                            }
                            
                            D_m = abs(d)
                            M_m = abs(m)
                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                            real(8) function code(d, h, l, m_m, d_m)
                                real(8), intent (in) :: d
                                real(8), intent (in) :: h
                                real(8), intent (in) :: l
                                real(8), intent (in) :: m_m
                                real(8), intent (in) :: d_m
                                code = d / sqrt((l * h))
                            end function
                            
                            D_m = Math.abs(D);
                            M_m = Math.abs(M);
                            assert d < h && h < l && l < M_m && M_m < D_m;
                            public static double code(double d, double h, double l, double M_m, double D_m) {
                            	return d / Math.sqrt((l * h));
                            }
                            
                            D_m = math.fabs(D)
                            M_m = math.fabs(M)
                            [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                            def code(d, h, l, M_m, D_m):
                            	return d / math.sqrt((l * h))
                            
                            D_m = abs(D)
                            M_m = abs(M)
                            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                            function code(d, h, l, M_m, D_m)
                            	return Float64(d / sqrt(Float64(l * h)))
                            end
                            
                            D_m = abs(D);
                            M_m = abs(M);
                            d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                            function tmp = code(d, h, l, M_m, D_m)
                            	tmp = d / sqrt((l * h));
                            end
                            
                            D_m = N[Abs[D], $MachinePrecision]
                            M_m = N[Abs[M], $MachinePrecision]
                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                            code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            D_m = \left|D\right|
                            \\
                            M_m = \left|M\right|
                            \\
                            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                            \\
                            \frac{d}{\sqrt{\ell \cdot h}}
                            \end{array}
                            
                            Derivation
                            1. Initial program 68.2%

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

                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                              2. lower-*.f64N/A

                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                              3. lower-sqrt.f64N/A

                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                              4. lower-/.f64N/A

                                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                              5. *-commutativeN/A

                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                              6. lower-*.f6427.5

                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                            5. Applied rewrites27.5%

                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                            6. Step-by-step derivation
                              1. Applied rewrites27.5%

                                \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                              2. Add Preprocessing

                              Reproduce

                              ?
                              herbie shell --seed 2024256 
                              (FPCore (d h l M D)
                                :name "Henrywood and Agarwal, Equation (12)"
                                :precision binary64
                                (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))