Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.6% → 81.5%
Time: 17.8s
Alternatives: 17
Speedup: 3.8×

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 17 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.6% 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: 81.5% 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 := 1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}\\ t_1 := \frac{{\left(-d\right)}^{0.25}}{{\left(-\ell\right)}^{0.25}}\\ \mathbf{if}\;h \leq -1.02 \cdot 10^{+80}:\\ \;\;\;\;t\_0 \cdot \left(\left(t\_1 \cdot t\_1\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_0\\ \mathbf{elif}\;h \leq 1.15 \cdot 10^{-70}:\\ \;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}} \cdot \mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)}{\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
 (let* ((t_0
         (-
          1.0
          (*
           (/ (* (/ M_m d) (* (* D_m 0.5) 0.5)) (pow h -1.0))
           (/ (* D_m (* M_m (/ 0.5 d))) l))))
        (t_1 (/ (pow (- d) 0.25) (pow (- l) 0.25))))
   (if (<= h -1.02e+80)
     (* t_0 (* (* t_1 t_1) (pow (/ d h) (/ 1.0 2.0))))
     (if (<= h -5e-310)
       (* (* (sqrt (/ 1.0 (* l h))) (- d)) t_0)
       (if (<= h 1.15e-70)
         (* (* (pow (/ d l) (/ 1.0 2.0)) (/ (sqrt d) (sqrt h))) t_0)
         (/
          (*
           (/ d (sqrt h))
           (fma
            (* (* (* (* (/ M_m d) h) D_m) 0.25) (/ M_m d))
            (/ (* -0.5 D_m) l)
            1.0))
          (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 t_0 = 1.0 - ((((M_m / d) * ((D_m * 0.5) * 0.5)) / pow(h, -1.0)) * ((D_m * (M_m * (0.5 / d))) / l));
	double t_1 = pow(-d, 0.25) / pow(-l, 0.25);
	double tmp;
	if (h <= -1.02e+80) {
		tmp = t_0 * ((t_1 * t_1) * pow((d / h), (1.0 / 2.0)));
	} else if (h <= -5e-310) {
		tmp = (sqrt((1.0 / (l * h))) * -d) * t_0;
	} else if (h <= 1.15e-70) {
		tmp = (pow((d / l), (1.0 / 2.0)) * (sqrt(d) / sqrt(h))) * t_0;
	} else {
		tmp = ((d / sqrt(h)) * fma((((((M_m / d) * h) * D_m) * 0.25) * (M_m / d)), ((-0.5 * D_m) / l), 1.0)) / 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)
	t_0 = Float64(1.0 - Float64(Float64(Float64(Float64(M_m / d) * Float64(Float64(D_m * 0.5) * 0.5)) / (h ^ -1.0)) * Float64(Float64(D_m * Float64(M_m * Float64(0.5 / d))) / l)))
	t_1 = Float64((Float64(-d) ^ 0.25) / (Float64(-l) ^ 0.25))
	tmp = 0.0
	if (h <= -1.02e+80)
		tmp = Float64(t_0 * Float64(Float64(t_1 * t_1) * (Float64(d / h) ^ Float64(1.0 / 2.0))));
	elseif (h <= -5e-310)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * t_0);
	elseif (h <= 1.15e-70)
		tmp = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * Float64(sqrt(d) / sqrt(h))) * t_0);
	else
		tmp = Float64(Float64(Float64(d / sqrt(h)) * fma(Float64(Float64(Float64(Float64(Float64(M_m / d) * h) * D_m) * 0.25) * Float64(M_m / d)), Float64(Float64(-0.5 * D_m) / l), 1.0)) / sqrt(l));
	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[(1.0 - N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[(-d), 0.25], $MachinePrecision] / N[Power[(-l), 0.25], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -1.02e+80], N[(t$95$0 * N[(N[(t$95$1 * t$95$1), $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[h, 1.15e-70], N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * D$95$m), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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 := 1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}\\
t_1 := \frac{{\left(-d\right)}^{0.25}}{{\left(-\ell\right)}^{0.25}}\\
\mathbf{if}\;h \leq -1.02 \cdot 10^{+80}:\\
\;\;\;\;t\_0 \cdot \left(\left(t\_1 \cdot t\_1\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\

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

\mathbf{elif}\;h \leq 1.15 \cdot 10^{-70}:\\
\;\;\;\;\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -1.02e80

    1. Initial program 67.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites74.4%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\right) \]
    5. Step-by-step derivation
      1. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      2. metadata-eval74.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02e80 < h < -4.999999999999985e-310

    1. Initial program 75.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites77.2%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\right) \]
    5. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
    6. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      6. lower-neg.f64N/A

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

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

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

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

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

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

    if -4.999999999999985e-310 < h < 1.15e-70

    1. Initial program 72.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites79.9%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\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 {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      2. metadata-eval79.9

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e-70 < h

    1. Initial program 59.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6464.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval64.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites64.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites69.3%

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

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

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

Alternative 2: 81.1% accurate, 1.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 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\ t_1 := 1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}\\ \mathbf{if}\;h \leq -9.5 \cdot 10^{+196}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\sqrt{\frac{-1}{h}} \cdot \sqrt{-d}\right) \cdot t\_0\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_1\\ \mathbf{elif}\;h \leq 1.15 \cdot 10^{-70}:\\ \;\;\;\;\left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}} \cdot \mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)}{\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
 (let* ((t_0 (pow (/ d l) (/ 1.0 2.0)))
        (t_1
         (-
          1.0
          (*
           (/ (* (/ M_m d) (* (* D_m 0.5) 0.5)) (pow h -1.0))
           (/ (* D_m (* M_m (/ 0.5 d))) l)))))
   (if (<= h -9.5e+196)
     (*
      (- 1.0 (* (/ h l) (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
      (* (* (sqrt (/ -1.0 h)) (sqrt (- d))) t_0))
     (if (<= h -5e-310)
       (* (* (sqrt (/ 1.0 (* l h))) (- d)) t_1)
       (if (<= h 1.15e-70)
         (* (* t_0 (/ (sqrt d) (sqrt h))) t_1)
         (/
          (*
           (/ d (sqrt h))
           (fma
            (* (* (* (* (/ M_m d) h) D_m) 0.25) (/ M_m d))
            (/ (* -0.5 D_m) l)
            1.0))
          (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 t_0 = pow((d / l), (1.0 / 2.0));
	double t_1 = 1.0 - ((((M_m / d) * ((D_m * 0.5) * 0.5)) / pow(h, -1.0)) * ((D_m * (M_m * (0.5 / d))) / l));
	double tmp;
	if (h <= -9.5e+196) {
		tmp = (1.0 - ((h / l) * (pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * ((sqrt((-1.0 / h)) * sqrt(-d)) * t_0);
	} else if (h <= -5e-310) {
		tmp = (sqrt((1.0 / (l * h))) * -d) * t_1;
	} else if (h <= 1.15e-70) {
		tmp = (t_0 * (sqrt(d) / sqrt(h))) * t_1;
	} else {
		tmp = ((d / sqrt(h)) * fma((((((M_m / d) * h) * D_m) * 0.25) * (M_m / d)), ((-0.5 * D_m) / l), 1.0)) / 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)
	t_0 = Float64(d / l) ^ Float64(1.0 / 2.0)
	t_1 = Float64(1.0 - Float64(Float64(Float64(Float64(M_m / d) * Float64(Float64(D_m * 0.5) * 0.5)) / (h ^ -1.0)) * Float64(Float64(D_m * Float64(M_m * Float64(0.5 / d))) / l)))
	tmp = 0.0
	if (h <= -9.5e+196)
		tmp = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64(Float64(sqrt(Float64(-1.0 / h)) * sqrt(Float64(-d))) * t_0));
	elseif (h <= -5e-310)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * t_1);
	elseif (h <= 1.15e-70)
		tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(h))) * t_1);
	else
		tmp = Float64(Float64(Float64(d / sqrt(h)) * fma(Float64(Float64(Float64(Float64(Float64(M_m / d) * h) * D_m) * 0.25) * Float64(M_m / d)), Float64(Float64(-0.5 * D_m) / l), 1.0)) / sqrt(l));
	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[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -9.5e+196], N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[h, 1.15e-70], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * D$95$m), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\\
t_1 := 1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}\\
\mathbf{if}\;h \leq -9.5 \cdot 10^{+196}:\\
\;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\sqrt{\frac{-1}{h}} \cdot \sqrt{-d}\right) \cdot t\_0\right)\\

\mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot t\_1\\

\mathbf{elif}\;h \leq 1.15 \cdot 10^{-70}:\\
\;\;\;\;\left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if h < -9.5000000000000004e196

    1. Initial program 62.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(\color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\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) \]
      3. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \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) \]
      4. unpow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \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) \]
      5. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \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) \]
      6. frac-2negN/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\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) \]
      7. div-invN/A

        \[\leadsto \left(\sqrt{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{1}{\mathsf{neg}\left(h\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) \]
      8. sqrt-prodN/A

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      9. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      10. lower-sqrt.f64N/A

        \[\leadsto \left(\left(\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(\left(\sqrt{\color{blue}{-d}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      12. lower-sqrt.f64N/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}}\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) \]
      13. neg-mul-1N/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\frac{1}{\color{blue}{-1 \cdot h}}}\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) \]
      14. associate-/r*N/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\color{blue}{\frac{\frac{1}{-1}}{h}}}\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) \]
      15. metadata-evalN/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\frac{\color{blue}{-1}}{h}}\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) \]
      16. lower-/.f6475.3

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\color{blue}{\frac{-1}{h}}}\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) \]
    4. Applied rewrites75.3%

      \[\leadsto \left(\color{blue}{\left(\sqrt{-d} \cdot \sqrt{\frac{-1}{h}}\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) \]

    if -9.5000000000000004e196 < h < -4.999999999999985e-310

    1. Initial program 74.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites76.3%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\right) \]
    5. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
    6. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      6. lower-neg.f64N/A

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

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

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

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

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

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

    if -4.999999999999985e-310 < h < 1.15e-70

    1. Initial program 72.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites79.9%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\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 {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      2. metadata-eval79.9

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e-70 < h

    1. Initial program 59.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6464.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval64.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites64.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites69.3%

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

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

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

Alternative 3: 80.8% accurate, 1.2× 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}\;h \leq -9.5 \cdot 10^{+196}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\sqrt{\frac{-1}{h}} \cdot \sqrt{-d}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot \left(1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5, \left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25\right) \cdot \frac{h}{\ell}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{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 (<= h -9.5e+196)
   (*
    (- 1.0 (* (/ h l) (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
    (* (* (sqrt (/ -1.0 h)) (sqrt (- d))) (pow (/ d l) (/ 1.0 2.0))))
   (if (<= h -5e-310)
     (*
      (* (sqrt (/ 1.0 (* l h))) (- d))
      (-
       1.0
       (*
        (/ (* (/ M_m d) (* (* D_m 0.5) 0.5)) (pow h -1.0))
        (/ (* D_m (* M_m (/ 0.5 d))) l))))
     (/
      (/
       (* (fma -0.5 (* (* (pow (* (/ M_m d) D_m) 2.0) 0.25) (/ h l)) 1.0) d)
       (sqrt l))
      (sqrt 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 (h <= -9.5e+196) {
		tmp = (1.0 - ((h / l) * (pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * ((sqrt((-1.0 / h)) * sqrt(-d)) * pow((d / l), (1.0 / 2.0)));
	} else if (h <= -5e-310) {
		tmp = (sqrt((1.0 / (l * h))) * -d) * (1.0 - ((((M_m / d) * ((D_m * 0.5) * 0.5)) / pow(h, -1.0)) * ((D_m * (M_m * (0.5 / d))) / l)));
	} else {
		tmp = ((fma(-0.5, ((pow(((M_m / d) * D_m), 2.0) * 0.25) * (h / l)), 1.0) * d) / sqrt(l)) / sqrt(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 (h <= -9.5e+196)
		tmp = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64(Float64(sqrt(Float64(-1.0 / h)) * sqrt(Float64(-d))) * (Float64(d / l) ^ Float64(1.0 / 2.0))));
	elseif (h <= -5e-310)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * Float64(1.0 - Float64(Float64(Float64(Float64(M_m / d) * Float64(Float64(D_m * 0.5) * 0.5)) / (h ^ -1.0)) * Float64(Float64(D_m * Float64(M_m * Float64(0.5 / d))) / l))));
	else
		tmp = Float64(Float64(Float64(fma(-0.5, Float64(Float64((Float64(Float64(M_m / d) * D_m) ^ 2.0) * 0.25) * Float64(h / l)), 1.0) * d) / sqrt(l)) / sqrt(h));
	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_] := If[LessEqual[h, -9.5e+196], N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.5 * N[(N[(N[Power[N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $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}\;h \leq -9.5 \cdot 10^{+196}:\\
\;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left(\left(\sqrt{\frac{-1}{h}} \cdot \sqrt{-d}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -9.5000000000000004e196

    1. Initial program 62.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(\color{blue}{{\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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\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) \]
      3. metadata-evalN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{\frac{1}{2}}} \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) \]
      4. unpow1/2N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \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) \]
      5. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \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) \]
      6. frac-2negN/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\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) \]
      7. div-invN/A

        \[\leadsto \left(\sqrt{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \frac{1}{\mathsf{neg}\left(h\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) \]
      8. sqrt-prodN/A

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      9. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\sqrt{\mathsf{neg}\left(d\right)} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      10. lower-sqrt.f64N/A

        \[\leadsto \left(\left(\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      11. lower-neg.f64N/A

        \[\leadsto \left(\left(\sqrt{\color{blue}{-d}} \cdot \sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}\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) \]
      12. lower-sqrt.f64N/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \color{blue}{\sqrt{\frac{1}{\mathsf{neg}\left(h\right)}}}\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) \]
      13. neg-mul-1N/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\frac{1}{\color{blue}{-1 \cdot h}}}\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) \]
      14. associate-/r*N/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\color{blue}{\frac{\frac{1}{-1}}{h}}}\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) \]
      15. metadata-evalN/A

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\frac{\color{blue}{-1}}{h}}\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) \]
      16. lower-/.f6475.3

        \[\leadsto \left(\left(\sqrt{-d} \cdot \sqrt{\color{blue}{\frac{-1}{h}}}\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) \]
    4. Applied rewrites75.3%

      \[\leadsto \left(\color{blue}{\left(\sqrt{-d} \cdot \sqrt{\frac{-1}{h}}\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) \]

    if -9.5000000000000004e196 < h < -4.999999999999985e-310

    1. Initial program 74.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites76.3%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\right) \]
    5. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
    6. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      6. lower-neg.f64N/A

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

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

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

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

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

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

    if -4.999999999999985e-310 < h

    1. Initial program 64.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6468.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval68.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites68.5%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. sqrt-divN/A

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-sqrt.f64N/A

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d}} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d} \cdot \color{blue}{\sqrt{d}}}{\sqrt{h} \cdot \sqrt{\ell}} \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. rem-square-sqrtN/A

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \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. Applied rewrites64.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \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 rewrites80.9%

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

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

Alternative 4: 81.1% accurate, 1.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} t_0 := {\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25\\ \mathbf{if}\;h \leq -2.15 \cdot 10^{+67}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t\_0 \cdot -0.5}{\ell}, h, 1\right) \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot \left(1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5, t\_0 \cdot \frac{h}{\ell}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{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
 (let* ((t_0 (* (pow (* (/ M_m d) D_m) 2.0) 0.25)))
   (if (<= h -2.15e+67)
     (*
      (fma (/ (* t_0 -0.5) l) h 1.0)
      (* (/ (sqrt (- d)) (sqrt (- l))) (pow (/ d h) (/ 1.0 2.0))))
     (if (<= h -5e-310)
       (*
        (* (sqrt (/ 1.0 (* l h))) (- d))
        (-
         1.0
         (*
          (/ (* (/ M_m d) (* (* D_m 0.5) 0.5)) (pow h -1.0))
          (/ (* D_m (* M_m (/ 0.5 d))) l))))
       (/ (/ (* (fma -0.5 (* t_0 (/ h l)) 1.0) d) (sqrt l)) (sqrt 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 t_0 = pow(((M_m / d) * D_m), 2.0) * 0.25;
	double tmp;
	if (h <= -2.15e+67) {
		tmp = fma(((t_0 * -0.5) / l), h, 1.0) * ((sqrt(-d) / sqrt(-l)) * pow((d / h), (1.0 / 2.0)));
	} else if (h <= -5e-310) {
		tmp = (sqrt((1.0 / (l * h))) * -d) * (1.0 - ((((M_m / d) * ((D_m * 0.5) * 0.5)) / pow(h, -1.0)) * ((D_m * (M_m * (0.5 / d))) / l)));
	} else {
		tmp = ((fma(-0.5, (t_0 * (h / l)), 1.0) * d) / sqrt(l)) / sqrt(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)
	t_0 = Float64((Float64(Float64(M_m / d) * D_m) ^ 2.0) * 0.25)
	tmp = 0.0
	if (h <= -2.15e+67)
		tmp = Float64(fma(Float64(Float64(t_0 * -0.5) / l), h, 1.0) * Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))) * (Float64(d / h) ^ Float64(1.0 / 2.0))));
	elseif (h <= -5e-310)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * Float64(1.0 - Float64(Float64(Float64(Float64(M_m / d) * Float64(Float64(D_m * 0.5) * 0.5)) / (h ^ -1.0)) * Float64(Float64(D_m * Float64(M_m * Float64(0.5 / d))) / l))));
	else
		tmp = Float64(Float64(Float64(fma(-0.5, Float64(t_0 * Float64(h / l)), 1.0) * d) / sqrt(l)) / sqrt(h));
	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[Power[N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[h, -2.15e+67], N[(N[(N[(N[(t$95$0 * -0.5), $MachinePrecision] / l), $MachinePrecision] * h + 1.0), $MachinePrecision] * N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.5 * N[(t$95$0 * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $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(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25\\
\mathbf{if}\;h \leq -2.15 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0 \cdot -0.5}{\ell}, h, 1\right) \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -2.1500000000000001e67

    1. Initial program 68.6%

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

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. frac-2negN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\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) \]
      7. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(\ell\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) \]
      8. lower-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(\ell\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) \]
      9. lower-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(\ell\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) \]
      10. lower-neg.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{\color{blue}{-d}}}{\sqrt{\mathsf{neg}\left(\ell\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) \]
      11. lower-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\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) \]
      12. lower-neg.f6473.1

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{-d}}{\sqrt{\color{blue}{-\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.1%

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

    if -2.1500000000000001e67 < h < -4.999999999999985e-310

    1. Initial program 75.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites76.9%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\right) \]
    5. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
    6. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      6. lower-neg.f64N/A

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

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

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

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

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

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

    if -4.999999999999985e-310 < h

    1. Initial program 64.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6468.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval68.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites68.5%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. sqrt-divN/A

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-sqrt.f64N/A

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d}} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d} \cdot \color{blue}{\sqrt{d}}}{\sqrt{h} \cdot \sqrt{\ell}} \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. rem-square-sqrtN/A

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \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. Applied rewrites64.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \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 rewrites80.9%

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

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

Alternative 5: 79.7% 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} \mathbf{if}\;h \leq -1.9 \cdot 10^{+182}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right) \cdot \left(1 - \frac{\frac{M\_m}{d} \cdot \left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5, \left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25\right) \cdot \frac{h}{\ell}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{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 (<= h -1.9e+182)
   (*
    (sqrt (/ d l))
    (*
     (sqrt (/ d h))
     (fma
      (* (* (* (* (/ M_m d) h) D_m) 0.25) (/ M_m d))
      (/ (* -0.5 D_m) l)
      1.0)))
   (if (<= h -5e-310)
     (*
      (* (sqrt (/ 1.0 (* l h))) (- d))
      (-
       1.0
       (*
        (/ (* (/ M_m d) (* (* D_m 0.5) 0.5)) (pow h -1.0))
        (/ (* D_m (* M_m (/ 0.5 d))) l))))
     (/
      (/
       (* (fma -0.5 (* (* (pow (* (/ M_m d) D_m) 2.0) 0.25) (/ h l)) 1.0) d)
       (sqrt l))
      (sqrt 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 (h <= -1.9e+182) {
		tmp = sqrt((d / l)) * (sqrt((d / h)) * fma((((((M_m / d) * h) * D_m) * 0.25) * (M_m / d)), ((-0.5 * D_m) / l), 1.0));
	} else if (h <= -5e-310) {
		tmp = (sqrt((1.0 / (l * h))) * -d) * (1.0 - ((((M_m / d) * ((D_m * 0.5) * 0.5)) / pow(h, -1.0)) * ((D_m * (M_m * (0.5 / d))) / l)));
	} else {
		tmp = ((fma(-0.5, ((pow(((M_m / d) * D_m), 2.0) * 0.25) * (h / l)), 1.0) * d) / sqrt(l)) / sqrt(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 (h <= -1.9e+182)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(Float64(Float64(M_m / d) * h) * D_m) * 0.25) * Float64(M_m / d)), Float64(Float64(-0.5 * D_m) / l), 1.0)));
	elseif (h <= -5e-310)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)) * Float64(1.0 - Float64(Float64(Float64(Float64(M_m / d) * Float64(Float64(D_m * 0.5) * 0.5)) / (h ^ -1.0)) * Float64(Float64(D_m * Float64(M_m * Float64(0.5 / d))) / l))));
	else
		tmp = Float64(Float64(Float64(fma(-0.5, Float64(Float64((Float64(Float64(M_m / d) * D_m) ^ 2.0) * 0.25) * Float64(h / l)), 1.0) * d) / sqrt(l)) / sqrt(h));
	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_] := If[LessEqual[h, -1.9e+182], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * D$95$m), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.5 * N[(N[(N[Power[N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $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}\;h \leq -1.9 \cdot 10^{+182}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.90000000000000006e182

    1. Initial program 61.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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 \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right)} \]
      2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.90000000000000006e182 < h < -4.999999999999985e-310

    1. Initial program 74.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-*.f64N/A

        \[\leadsto \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 - \color{blue}{\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)}^{\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 \color{blue}{\frac{h}{\ell}}\right) \]
      3. clear-numN/A

        \[\leadsto \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 \color{blue}{\frac{1}{\frac{\ell}{h}}}\right) \]
      4. un-div-invN/A

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

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

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

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

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

        \[\leadsto \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 - \frac{\color{blue}{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}}{\frac{\ell}{h}}\right) \]
      10. div-invN/A

        \[\leadsto \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 - \frac{\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}\right)}{\color{blue}{\ell \cdot \frac{1}{h}}}\right) \]
      11. times-fracN/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
      12. lower-*.f64N/A

        \[\leadsto \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 - \color{blue}{\frac{\frac{M \cdot D}{2 \cdot d}}{\ell} \cdot \frac{\frac{M \cdot D}{2 \cdot d} \cdot \frac{1}{2}}{\frac{1}{h}}}\right) \]
    4. Applied rewrites76.0%

      \[\leadsto \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 - \color{blue}{\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(0.5 \cdot \left(D \cdot 0.5\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}}\right) \]
    5. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
    6. 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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\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 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-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 \left(1 - \frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{\ell} \cdot \frac{\left(\frac{1}{2} \cdot \left(D \cdot \frac{1}{2}\right)\right) \cdot \frac{M}{d}}{{h}^{-1}}\right) \]
      6. lower-neg.f64N/A

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

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

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

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

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

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

    if -4.999999999999985e-310 < h

    1. Initial program 64.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6468.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval68.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites68.5%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. sqrt-divN/A

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-sqrt.f64N/A

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d}} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d} \cdot \color{blue}{\sqrt{d}}}{\sqrt{h} \cdot \sqrt{\ell}} \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. rem-square-sqrtN/A

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \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. Applied rewrites64.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \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 rewrites80.9%

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

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

Alternative 6: 79.2% 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 := \frac{M\_m}{d} \cdot h\\ \mathbf{if}\;h \leq -1.9 \cdot 10^{+182}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\left(\left(t\_0 \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot t\_0, 1\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-0.5, \left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25\right) \cdot \frac{h}{\ell}, 1\right) \cdot d}{\sqrt{\ell}}}{\sqrt{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
 (let* ((t_0 (* (/ M_m d) h)))
   (if (<= h -1.9e+182)
     (*
      (sqrt (/ d l))
      (*
       (sqrt (/ d h))
       (fma (* (* (* t_0 D_m) 0.25) (/ M_m d)) (/ (* -0.5 D_m) l) 1.0)))
     (if (<= h -5e-310)
       (*
        (fma (/ (* (* -0.5 D_m) (/ M_m d)) l) (* (* D_m 0.25) t_0) 1.0)
        (* (sqrt (/ 1.0 (* l h))) (- d)))
       (/
        (/
         (* (fma -0.5 (* (* (pow (* (/ M_m d) D_m) 2.0) 0.25) (/ h l)) 1.0) d)
         (sqrt l))
        (sqrt 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 t_0 = (M_m / d) * h;
	double tmp;
	if (h <= -1.9e+182) {
		tmp = sqrt((d / l)) * (sqrt((d / h)) * fma((((t_0 * D_m) * 0.25) * (M_m / d)), ((-0.5 * D_m) / l), 1.0));
	} else if (h <= -5e-310) {
		tmp = fma((((-0.5 * D_m) * (M_m / d)) / l), ((D_m * 0.25) * t_0), 1.0) * (sqrt((1.0 / (l * h))) * -d);
	} else {
		tmp = ((fma(-0.5, ((pow(((M_m / d) * D_m), 2.0) * 0.25) * (h / l)), 1.0) * d) / sqrt(l)) / sqrt(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)
	t_0 = Float64(Float64(M_m / d) * h)
	tmp = 0.0
	if (h <= -1.9e+182)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(Float64(t_0 * D_m) * 0.25) * Float64(M_m / d)), Float64(Float64(-0.5 * D_m) / l), 1.0)));
	elseif (h <= -5e-310)
		tmp = Float64(fma(Float64(Float64(Float64(-0.5 * D_m) * Float64(M_m / d)) / l), Float64(Float64(D_m * 0.25) * t_0), 1.0) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)));
	else
		tmp = Float64(Float64(Float64(fma(-0.5, Float64(Float64((Float64(Float64(M_m / d) * D_m) ^ 2.0) * 0.25) * Float64(h / l)), 1.0) * d) / sqrt(l)) / sqrt(h));
	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 / d), $MachinePrecision] * h), $MachinePrecision]}, If[LessEqual[h, -1.9e+182], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(t$95$0 * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * D$95$m), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[(N[(N[(-0.5 * D$95$m), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * 0.25), $MachinePrecision] * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-0.5 * N[(N[(N[Power[N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * d), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $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 := \frac{M\_m}{d} \cdot h\\
\mathbf{if}\;h \leq -1.9 \cdot 10^{+182}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\left(\left(t\_0 \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.90000000000000006e182

    1. Initial program 61.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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 \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right)} \]
      2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.90000000000000006e182 < h < -4.999999999999985e-310

    1. Initial program 74.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
      10. lower-*.f6485.5

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

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

    if -4.999999999999985e-310 < h

    1. Initial program 64.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6468.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval68.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites68.5%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. sqrt-divN/A

        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-sqrt.f64N/A

        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{d}} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}} \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. lift-sqrt.f64N/A

        \[\leadsto \frac{\sqrt{d} \cdot \color{blue}{\sqrt{d}}}{\sqrt{h} \cdot \sqrt{\ell}} \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. rem-square-sqrtN/A

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

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

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

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

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

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

        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \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. Applied rewrites64.2%

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \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 rewrites80.9%

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

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

Alternative 7: 78.8% accurate, 3.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} t_0 := \frac{M\_m}{d} \cdot h\\ t_1 := \mathsf{fma}\left(\left(\left(t\_0 \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)\\ \mathbf{if}\;h \leq -1.9 \cdot 10^{+182}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot t\_0, 1\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}} \cdot t\_1}{\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
 (let* ((t_0 (* (/ M_m d) h))
        (t_1 (fma (* (* (* t_0 D_m) 0.25) (/ M_m d)) (/ (* -0.5 D_m) l) 1.0)))
   (if (<= h -1.9e+182)
     (* (sqrt (/ d l)) (* (sqrt (/ d h)) t_1))
     (if (<= h -5e-310)
       (*
        (fma (/ (* (* -0.5 D_m) (/ M_m d)) l) (* (* D_m 0.25) t_0) 1.0)
        (* (sqrt (/ 1.0 (* l h))) (- d)))
       (/ (* (/ d (sqrt h)) t_1) (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 t_0 = (M_m / d) * h;
	double t_1 = fma((((t_0 * D_m) * 0.25) * (M_m / d)), ((-0.5 * D_m) / l), 1.0);
	double tmp;
	if (h <= -1.9e+182) {
		tmp = sqrt((d / l)) * (sqrt((d / h)) * t_1);
	} else if (h <= -5e-310) {
		tmp = fma((((-0.5 * D_m) * (M_m / d)) / l), ((D_m * 0.25) * t_0), 1.0) * (sqrt((1.0 / (l * h))) * -d);
	} else {
		tmp = ((d / sqrt(h)) * t_1) / 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)
	t_0 = Float64(Float64(M_m / d) * h)
	t_1 = fma(Float64(Float64(Float64(t_0 * D_m) * 0.25) * Float64(M_m / d)), Float64(Float64(-0.5 * D_m) / l), 1.0)
	tmp = 0.0
	if (h <= -1.9e+182)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(sqrt(Float64(d / h)) * t_1));
	elseif (h <= -5e-310)
		tmp = Float64(fma(Float64(Float64(Float64(-0.5 * D_m) * Float64(M_m / d)) / l), Float64(Float64(D_m * 0.25) * t_0), 1.0) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)));
	else
		tmp = Float64(Float64(Float64(d / sqrt(h)) * t_1) / sqrt(l));
	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 / d), $MachinePrecision] * h), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(t$95$0 * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * D$95$m), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[h, -1.9e+182], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[(N[(N[(N[(-0.5 * D$95$m), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * 0.25), $MachinePrecision] * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Sqrt[l], $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 := \frac{M\_m}{d} \cdot h\\
t_1 := \mathsf{fma}\left(\left(\left(t\_0 \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)\\
\mathbf{if}\;h \leq -1.9 \cdot 10^{+182}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot t\_1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if h < -1.90000000000000006e182

    1. Initial program 61.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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 \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right)} \]
      2. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.90000000000000006e182 < h < -4.999999999999985e-310

    1. Initial program 74.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
      10. lower-*.f6485.5

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

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

    if -4.999999999999985e-310 < h

    1. Initial program 64.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6468.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval68.5

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites68.5%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites73.3%

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

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

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

Alternative 8: 77.4% accurate, 3.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 := \mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{elif}\;\ell \leq 1.02 \cdot 10^{+124}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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
 (let* ((t_0
         (fma
          (/ (* (* -0.5 D_m) (/ M_m d)) l)
          (* (* D_m 0.25) (* (/ M_m d) h))
          1.0)))
   (if (<= l -5e-310)
     (* t_0 (* (sqrt (/ 1.0 (* l h))) (- d)))
     (if (<= l 1.02e+124)
       (* (/ 1.0 (/ (sqrt (* l h)) d)) t_0)
       (/ d (* (sqrt l) (sqrt 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 t_0 = fma((((-0.5 * D_m) * (M_m / d)) / l), ((D_m * 0.25) * ((M_m / d) * h)), 1.0);
	double tmp;
	if (l <= -5e-310) {
		tmp = t_0 * (sqrt((1.0 / (l * h))) * -d);
	} else if (l <= 1.02e+124) {
		tmp = (1.0 / (sqrt((l * h)) / d)) * t_0;
	} else {
		tmp = d / (sqrt(l) * sqrt(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)
	t_0 = fma(Float64(Float64(Float64(-0.5 * D_m) * Float64(M_m / d)) / l), Float64(Float64(D_m * 0.25) * Float64(Float64(M_m / d) * h)), 1.0)
	tmp = 0.0
	if (l <= -5e-310)
		tmp = Float64(t_0 * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)));
	elseif (l <= 1.02e+124)
		tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(l * h)) / d)) * t_0);
	else
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	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[(N[(-0.5 * D$95$m), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * 0.25), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(t$95$0 * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.02e+124], N[(N[(1.0 / N[(N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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}
t_0 := \mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0 \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\

\mathbf{elif}\;\ell \leq 1.02 \cdot 10^{+124}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot h}}{d}} \cdot t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -4.999999999999985e-310

    1. Initial program 72.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

      \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
      10. lower-*.f6478.1

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

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

    if -4.999999999999985e-310 < l < 1.01999999999999994e124

    1. Initial program 68.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. lift-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6472.8

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites72.8%

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval72.8

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f6472.8

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites72.8%

      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.01999999999999994e124 < l

    1. Initial program 52.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
    4. Step-by-step derivation
      1. Applied rewrites53.1%

        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
      2. Taylor expanded in h around 0

        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
      3. 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-*.f6455.2

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
      4. Applied rewrites55.2%

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

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

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

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

        Alternative 9: 79.2% accurate, 3.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 := \frac{M\_m}{d} \cdot h\\ \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot t\_0, 1\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}} \cdot \mathsf{fma}\left(\left(\left(t\_0 \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)}{\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
         (let* ((t_0 (* (/ M_m d) h)))
           (if (<= h -5e-310)
             (*
              (fma (/ (* (* -0.5 D_m) (/ M_m d)) l) (* (* D_m 0.25) t_0) 1.0)
              (* (sqrt (/ 1.0 (* l h))) (- d)))
             (/
              (*
               (/ d (sqrt h))
               (fma (* (* (* t_0 D_m) 0.25) (/ M_m d)) (/ (* -0.5 D_m) l) 1.0))
              (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 t_0 = (M_m / d) * h;
        	double tmp;
        	if (h <= -5e-310) {
        		tmp = fma((((-0.5 * D_m) * (M_m / d)) / l), ((D_m * 0.25) * t_0), 1.0) * (sqrt((1.0 / (l * h))) * -d);
        	} else {
        		tmp = ((d / sqrt(h)) * fma((((t_0 * D_m) * 0.25) * (M_m / d)), ((-0.5 * D_m) / l), 1.0)) / 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)
        	t_0 = Float64(Float64(M_m / d) * h)
        	tmp = 0.0
        	if (h <= -5e-310)
        		tmp = Float64(fma(Float64(Float64(Float64(-0.5 * D_m) * Float64(M_m / d)) / l), Float64(Float64(D_m * 0.25) * t_0), 1.0) * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)));
        	else
        		tmp = Float64(Float64(Float64(d / sqrt(h)) * fma(Float64(Float64(Float64(t_0 * D_m) * 0.25) * Float64(M_m / d)), Float64(Float64(-0.5 * D_m) / l), 1.0)) / sqrt(l));
        	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 / d), $MachinePrecision] * h), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(N[(N[(N[(N[(-0.5 * D$95$m), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * 0.25), $MachinePrecision] * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(t$95$0 * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * D$95$m), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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 := \frac{M\_m}{d} \cdot h\\
        \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot t\_0, 1\right) \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{d}{\sqrt{h}} \cdot \mathsf{fma}\left(\left(\left(t\_0 \cdot D\_m\right) \cdot 0.25\right) \cdot \frac{M\_m}{d}, \frac{-0.5 \cdot D\_m}{\ell}, 1\right)}{\sqrt{\ell}}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if h < -4.999999999999985e-310

          1. Initial program 72.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. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

            \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

            \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
            10. lower-*.f6478.1

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

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

          if -4.999999999999985e-310 < h

          1. Initial program 64.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. lift-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6468.5

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval68.5

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites68.5%

            \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites73.3%

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

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

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

        Alternative 10: 62.6% accurate, 3.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}\;d \leq -5 \cdot 10^{+60}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq -5.4 \cdot 10^{-244}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\ell} \cdot d} \cdot \mathsf{fma}\left(-0.125 \cdot \left(\frac{\frac{M\_m \cdot M\_m}{d}}{d} \cdot h\right), \frac{D\_m \cdot D\_m}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\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
         (if (<= d -5e+60)
           (* (sqrt (/ 1.0 (* l h))) (- d))
           (if (<= d -5.4e-244)
             (*
              (sqrt (* (/ (/ d h) l) d))
              (fma (* -0.125 (* (/ (/ (* M_m M_m) d) d) h)) (/ (* D_m D_m) l) 1.0))
             (*
              (/ d (sqrt (* l h)))
              (fma
               (/ (* (* -0.5 D_m) (/ M_m d)) l)
               (* (* D_m 0.25) (* (/ 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 tmp;
        	if (d <= -5e+60) {
        		tmp = sqrt((1.0 / (l * h))) * -d;
        	} else if (d <= -5.4e-244) {
        		tmp = sqrt((((d / h) / l) * d)) * fma((-0.125 * ((((M_m * M_m) / d) / d) * h)), ((D_m * D_m) / l), 1.0);
        	} else {
        		tmp = (d / sqrt((l * h))) * fma((((-0.5 * D_m) * (M_m / d)) / l), ((D_m * 0.25) * ((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)
        	tmp = 0.0
        	if (d <= -5e+60)
        		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
        	elseif (d <= -5.4e-244)
        		tmp = Float64(sqrt(Float64(Float64(Float64(d / h) / l) * d)) * fma(Float64(-0.125 * Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) * h)), Float64(Float64(D_m * D_m) / l), 1.0));
        	else
        		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(Float64(-0.5 * D_m) * Float64(M_m / d)) / l), Float64(Float64(D_m * 0.25) * 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_] := If[LessEqual[d, -5e+60], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[d, -5.4e-244], N[(N[Sqrt[N[(N[(N[(d / h), $MachinePrecision] / l), $MachinePrecision] * d), $MachinePrecision]], $MachinePrecision] * N[(N[(-0.125 * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(-0.5 * D$95$m), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * 0.25), $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}
        \mathbf{if}\;d \leq -5 \cdot 10^{+60}:\\
        \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
        
        \mathbf{elif}\;d \leq -5.4 \cdot 10^{-244}:\\
        \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\ell} \cdot d} \cdot \mathsf{fma}\left(-0.125 \cdot \left(\frac{\frac{M\_m \cdot M\_m}{d}}{d} \cdot h\right), \frac{D\_m \cdot D\_m}{\ell}, 1\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if d < -4.99999999999999975e60

          1. Initial program 75.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
          4. Step-by-step derivation
            1. Applied rewrites58.2%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
            2. 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}}} \]
            3. 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-*.f6471.8

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

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

            if -4.99999999999999975e60 < d < -5.3999999999999999e-244

            1. Initial program 71.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. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 rewrites48.2%

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

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

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

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

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

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

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

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

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

            if -5.3999999999999999e-244 < d

            1. Initial program 64.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. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6464.6

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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.6%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval64.6

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.6

                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites64.6%

              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 11: 77.5% accurate, 3.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{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\ \mathbf{elif}\;\ell \leq 1.02 \cdot 10^{+124}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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
           (let* ((t_0
                   (fma
                    (/ (* (* -0.5 D_m) (/ M_m d)) l)
                    (* (* D_m 0.25) (* (/ M_m d) h))
                    1.0)))
             (if (<= l -5e-310)
               (* t_0 (* (sqrt (/ 1.0 (* l h))) (- d)))
               (if (<= l 1.02e+124)
                 (* (/ d (sqrt (* l h))) t_0)
                 (/ d (* (sqrt l) (sqrt 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 t_0 = fma((((-0.5 * D_m) * (M_m / d)) / l), ((D_m * 0.25) * ((M_m / d) * h)), 1.0);
          	double tmp;
          	if (l <= -5e-310) {
          		tmp = t_0 * (sqrt((1.0 / (l * h))) * -d);
          	} else if (l <= 1.02e+124) {
          		tmp = (d / sqrt((l * h))) * t_0;
          	} else {
          		tmp = d / (sqrt(l) * sqrt(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)
          	t_0 = fma(Float64(Float64(Float64(-0.5 * D_m) * Float64(M_m / d)) / l), Float64(Float64(D_m * 0.25) * Float64(Float64(M_m / d) * h)), 1.0)
          	tmp = 0.0
          	if (l <= -5e-310)
          		tmp = Float64(t_0 * Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d)));
          	elseif (l <= 1.02e+124)
          		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * t_0);
          	else
          		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
          	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[(N[(-0.5 * D$95$m), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * 0.25), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(t$95$0 * N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.02e+124], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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}
          t_0 := \mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
          \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
          \;\;\;\;t\_0 \cdot \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\right)\\
          
          \mathbf{elif}\;\ell \leq 1.02 \cdot 10^{+124}:\\
          \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if l < -4.999999999999985e-310

            1. Initial program 72.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. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f640.0

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites0.0%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval0.0

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f640.0

                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites0.0%

              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites0.0%

              \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{\frac{M}{d} \cdot \left(-0.5 \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\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{\frac{M}{d} \cdot \left(\frac{-1}{2} \cdot D\right)}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \]
              10. lower-*.f6478.1

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

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

            if -4.999999999999985e-310 < l < 1.01999999999999994e124

            1. Initial program 68.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. lift-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6472.8

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites72.8%

              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval72.8

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f6472.8

                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites72.8%

              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 1.01999999999999994e124 < l

            1. Initial program 52.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
            4. Step-by-step derivation
              1. Applied rewrites53.1%

                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
              2. Taylor expanded in h around 0

                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
              3. 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-*.f6455.2

                  \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
              4. Applied rewrites55.2%

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

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

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

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

                Alternative 12: 51.3% accurate, 4.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} \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq 7.8 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\frac{D\_m \cdot D\_m}{d}}{d} \cdot \frac{-0.125 \cdot h}{\ell}, M\_m \cdot M\_m, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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 -5e-310)
                   (* (sqrt (/ 1.0 (* l h))) (- d))
                   (if (<= l 7.8e+112)
                     (*
                      (fma (* (/ (/ (* D_m D_m) d) d) (/ (* -0.125 h) l)) (* M_m M_m) 1.0)
                      (/ d (sqrt (* l h))))
                     (/ d (* (sqrt l) (sqrt 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 <= -5e-310) {
                		tmp = sqrt((1.0 / (l * h))) * -d;
                	} else if (l <= 7.8e+112) {
                		tmp = fma(((((D_m * D_m) / d) / d) * ((-0.125 * h) / l)), (M_m * M_m), 1.0) * (d / sqrt((l * h)));
                	} else {
                		tmp = d / (sqrt(l) * sqrt(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 <= -5e-310)
                		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                	elseif (l <= 7.8e+112)
                		tmp = Float64(fma(Float64(Float64(Float64(Float64(D_m * D_m) / d) / d) * Float64(Float64(-0.125 * h) / l)), Float64(M_m * M_m), 1.0) * Float64(d / sqrt(Float64(l * h))));
                	else
                		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                	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_] := If[LessEqual[l, -5e-310], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, 7.8e+112], N[(N[(N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * N[(N[(-0.125 * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(M$95$m * M$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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 -5 \cdot 10^{-310}:\\
                \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                
                \mathbf{elif}\;\ell \leq 7.8 \cdot 10^{+112}:\\
                \;\;\;\;\mathsf{fma}\left(\frac{\frac{D\_m \cdot D\_m}{d}}{d} \cdot \frac{-0.125 \cdot h}{\ell}, M\_m \cdot M\_m, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if l < -4.999999999999985e-310

                  1. Initial program 72.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. Taylor expanded in h around 0

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                  4. Step-by-step derivation
                    1. Applied rewrites44.5%

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                    2. 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}}} \]
                    3. 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-*.f6450.2

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

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

                    if -4.999999999999985e-310 < l < 7.79999999999999937e112

                    1. Initial program 72.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. lift-/.f64N/A

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6476.1

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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.1%

                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval76.1

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.1

                        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites76.1%

                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

                        \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

                        \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. sqrt-divN/A

                        \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-sqrt.f64N/A

                        \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. frac-timesN/A

                        \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}} \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. lift-sqrt.f64N/A

                        \[\leadsto \frac{\color{blue}{\sqrt{d}} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}} \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. lift-sqrt.f64N/A

                        \[\leadsto \frac{\sqrt{d} \cdot \color{blue}{\sqrt{d}}}{\sqrt{h} \cdot \sqrt{\ell}} \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. rem-square-sqrtN/A

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

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

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

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

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

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

                        \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \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. Applied rewrites72.3%

                      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in M around inf

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

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

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

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

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

                        \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \cdot \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\frac{1}{8} \cdot \frac{{D}^{2} \cdot h}{{d}^{2} \cdot \ell}\right), {M}^{2}, 1\right)} \]
                    11. Applied rewrites64.3%

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

                    if 7.79999999999999937e112 < l

                    1. Initial program 47.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                    4. Step-by-step derivation
                      1. Applied rewrites47.7%

                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                      2. Taylor expanded in h around 0

                        \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                      3. 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-*.f6451.3

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

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

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

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

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

                        Alternative 13: 47.9% accurate, 4.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} \mathbf{if}\;d \leq 1.55 \cdot 10^{-285}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-123}:\\ \;\;\;\;\left(\left(-0.125 \cdot \left(\frac{\frac{M\_m \cdot M\_m}{d}}{d} \cdot h\right)\right) \cdot \frac{D\_m \cdot D\_m}{\ell}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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 (<= d 1.55e-285)
                           (* (sqrt (/ 1.0 (* l h))) (- d))
                           (if (<= d 6.5e-123)
                             (*
                              (* (* -0.125 (* (/ (/ (* M_m M_m) d) d) h)) (/ (* D_m D_m) l))
                              (/ d (sqrt (* l h))))
                             (/ d (* (sqrt l) (sqrt 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 (d <= 1.55e-285) {
                        		tmp = sqrt((1.0 / (l * h))) * -d;
                        	} else if (d <= 6.5e-123) {
                        		tmp = ((-0.125 * ((((M_m * M_m) / d) / d) * h)) * ((D_m * D_m) / l)) * (d / sqrt((l * h)));
                        	} else {
                        		tmp = d / (sqrt(l) * sqrt(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 (d <= 1.55d-285) then
                                tmp = sqrt((1.0d0 / (l * h))) * -d
                            else if (d <= 6.5d-123) then
                                tmp = (((-0.125d0) * ((((m_m * m_m) / d) / d) * h)) * ((d_m * d_m) / l)) * (d / sqrt((l * h)))
                            else
                                tmp = d / (sqrt(l) * sqrt(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 (d <= 1.55e-285) {
                        		tmp = Math.sqrt((1.0 / (l * h))) * -d;
                        	} else if (d <= 6.5e-123) {
                        		tmp = ((-0.125 * ((((M_m * M_m) / d) / d) * h)) * ((D_m * D_m) / l)) * (d / Math.sqrt((l * h)));
                        	} else {
                        		tmp = d / (Math.sqrt(l) * Math.sqrt(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 d <= 1.55e-285:
                        		tmp = math.sqrt((1.0 / (l * h))) * -d
                        	elif d <= 6.5e-123:
                        		tmp = ((-0.125 * ((((M_m * M_m) / d) / d) * h)) * ((D_m * D_m) / l)) * (d / math.sqrt((l * h)))
                        	else:
                        		tmp = d / (math.sqrt(l) * math.sqrt(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 (d <= 1.55e-285)
                        		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                        	elseif (d <= 6.5e-123)
                        		tmp = Float64(Float64(Float64(-0.125 * Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) * h)) * Float64(Float64(D_m * D_m) / l)) * Float64(d / sqrt(Float64(l * h))));
                        	else
                        		tmp = Float64(d / Float64(sqrt(l) * sqrt(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 (d <= 1.55e-285)
                        		tmp = sqrt((1.0 / (l * h))) * -d;
                        	elseif (d <= 6.5e-123)
                        		tmp = ((-0.125 * ((((M_m * M_m) / d) / d) * h)) * ((D_m * D_m) / l)) * (d / sqrt((l * h)));
                        	else
                        		tmp = d / (sqrt(l) * sqrt(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[d, 1.55e-285], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[d, 6.5e-123], N[(N[(N[(-0.125 * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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}\;d \leq 1.55 \cdot 10^{-285}:\\
                        \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                        
                        \mathbf{elif}\;d \leq 6.5 \cdot 10^{-123}:\\
                        \;\;\;\;\left(\left(-0.125 \cdot \left(\frac{\frac{M\_m \cdot M\_m}{d}}{d} \cdot h\right)\right) \cdot \frac{D\_m \cdot D\_m}{\ell}\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if d < 1.55e-285

                          1. Initial program 72.6%

                            \[\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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                          4. Step-by-step derivation
                            1. Applied rewrites43.6%

                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                            2. 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}}} \]
                            3. 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-*.f6450.7

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

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

                            if 1.55e-285 < d < 6.49999999999999938e-123

                            1. Initial program 55.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. lift-/.f64N/A

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6461.9

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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 rewrites61.9%

                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval61.9

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.f6461.9

                                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites61.9%

                              \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

                                \[\leadsto \left(\sqrt{\frac{d}{h}} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                                \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-/.f64N/A

                                \[\leadsto \left(\sqrt{\color{blue}{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. sqrt-divN/A

                                \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. lift-sqrt.f64N/A

                                \[\leadsto \left(\frac{\color{blue}{\sqrt{d}}}{\sqrt{h}} \cdot \frac{\sqrt{d}}{\sqrt{\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. frac-timesN/A

                                \[\leadsto \color{blue}{\frac{\sqrt{d} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}}} \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. lift-sqrt.f64N/A

                                \[\leadsto \frac{\color{blue}{\sqrt{d}} \cdot \sqrt{d}}{\sqrt{h} \cdot \sqrt{\ell}} \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. lift-sqrt.f64N/A

                                \[\leadsto \frac{\sqrt{d} \cdot \color{blue}{\sqrt{d}}}{\sqrt{h} \cdot \sqrt{\ell}} \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. rem-square-sqrtN/A

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

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

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

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

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

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

                                \[\leadsto \frac{d}{\color{blue}{\sqrt{\ell \cdot h}}} \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. Applied rewrites64.7%

                              \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \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. Taylor expanded in h around inf

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{d}{\sqrt{\ell \cdot h}} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2}} \cdot \frac{1}{8}\right)\right) \cdot \frac{{D}^{2}}{\ell}\right)} \]
                            11. Applied rewrites44.0%

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

                            if 6.49999999999999938e-123 < d

                            1. Initial program 68.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 h around 0

                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                            4. Step-by-step derivation
                              1. Applied rewrites45.6%

                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                              2. Taylor expanded in h around 0

                                \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                              3. 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.6

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

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

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

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

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

                                Alternative 14: 59.7% accurate, 4.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} \mathbf{if}\;h \leq 5 \cdot 10^{-307}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\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
                                 (if (<= h 5e-307)
                                   (* (sqrt (/ 1.0 (* l h))) (- d))
                                   (*
                                    (/ d (sqrt (* l h)))
                                    (fma
                                     (/ (* (* -0.5 D_m) (/ M_m d)) l)
                                     (* (* D_m 0.25) (* (/ 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 tmp;
                                	if (h <= 5e-307) {
                                		tmp = sqrt((1.0 / (l * h))) * -d;
                                	} else {
                                		tmp = (d / sqrt((l * h))) * fma((((-0.5 * D_m) * (M_m / d)) / l), ((D_m * 0.25) * ((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)
                                	tmp = 0.0
                                	if (h <= 5e-307)
                                		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                                	else
                                		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(Float64(-0.5 * D_m) * Float64(M_m / d)) / l), Float64(Float64(D_m * 0.25) * 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_] := If[LessEqual[h, 5e-307], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(-0.5 * D$95$m), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * 0.25), $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}
                                \mathbf{if}\;h \leq 5 \cdot 10^{-307}:\\
                                \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{\left(-0.5 \cdot D\_m\right) \cdot \frac{M\_m}{d}}{\ell}, \left(D\_m \cdot 0.25\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if h < 5.00000000000000014e-307

                                  1. Initial program 73.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites44.2%

                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                    2. 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}}} \]
                                    3. 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-*.f6450.6

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

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

                                    if 5.00000000000000014e-307 < h

                                    1. Initial program 63.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. lift-/.f64N/A

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \sqrt{\color{blue}{\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. sqrt-divN/A

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-/.f64N/A

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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-sqrt.f64N/A

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\color{blue}{\sqrt{d}}}{\sqrt{\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. lower-sqrt.f6468.2

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{\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.2%

                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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-eval68.2

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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 \frac{\sqrt{d}}{\sqrt{\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.2

                                        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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 rewrites68.2%

                                      \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{h}}} \cdot \frac{\sqrt{d}}{\sqrt{\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. Applied rewrites73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 15: 46.3% 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 2.9 \cdot 10^{-265}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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 2.9e-265)
                                     (* (sqrt (/ 1.0 (* l h))) (- d))
                                     (/ d (* (sqrt l) (sqrt 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 <= 2.9e-265) {
                                  		tmp = sqrt((1.0 / (l * h))) * -d;
                                  	} else {
                                  		tmp = d / (sqrt(l) * sqrt(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 <= 2.9d-265) then
                                          tmp = sqrt((1.0d0 / (l * h))) * -d
                                      else
                                          tmp = d / (sqrt(l) * sqrt(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 <= 2.9e-265) {
                                  		tmp = Math.sqrt((1.0 / (l * h))) * -d;
                                  	} else {
                                  		tmp = d / (Math.sqrt(l) * Math.sqrt(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 <= 2.9e-265:
                                  		tmp = math.sqrt((1.0 / (l * h))) * -d
                                  	else:
                                  		tmp = d / (math.sqrt(l) * math.sqrt(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 <= 2.9e-265)
                                  		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                                  	else
                                  		tmp = Float64(d / Float64(sqrt(l) * sqrt(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 <= 2.9e-265)
                                  		tmp = sqrt((1.0 / (l * h))) * -d;
                                  	else
                                  		tmp = d / (sqrt(l) * sqrt(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, 2.9e-265], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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 2.9 \cdot 10^{-265}:\\
                                  \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if l < 2.89999999999999975e-265

                                    1. Initial program 71.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites40.6%

                                        \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                      2. 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}}} \]
                                      3. 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-*.f6449.2

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

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

                                      if 2.89999999999999975e-265 < l

                                      1. Initial program 64.6%

                                        \[\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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites40.5%

                                          \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                        2. Taylor expanded in h around 0

                                          \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                        3. 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-*.f6443.4

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

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

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

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

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

                                          Alternative 16: 42.4% 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 1.9 \cdot 10^{-264}:\\ \;\;\;\;\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 1.9e-264) (* (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 <= 1.9e-264) {
                                          		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 <= 1.9d-264) 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 <= 1.9e-264) {
                                          		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 <= 1.9e-264:
                                          		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 <= 1.9e-264)
                                          		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 <= 1.9e-264)
                                          		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, 1.9e-264], 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 1.9 \cdot 10^{-264}:\\
                                          \;\;\;\;\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 < 1.90000000000000007e-264

                                            1. Initial program 71.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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites40.6%

                                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                              2. 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}}} \]
                                              3. 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-*.f6449.2

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

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

                                              if 1.90000000000000007e-264 < l

                                              1. Initial program 64.6%

                                                \[\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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                              4. Step-by-step derivation
                                                1. Applied rewrites40.5%

                                                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                2. Taylor expanded in h around 0

                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                3. 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-*.f6443.4

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

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

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

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

                                                Alternative 17: 25.8% 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 \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                4. Step-by-step derivation
                                                  1. Applied rewrites40.5%

                                                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{1} \]
                                                  2. Taylor expanded in h around 0

                                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                  3. 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-*.f6426.1

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

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

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

                                                    Reproduce

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