Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.3% → 79.2%
Time: 15.8s
Alternatives: 16
Speedup: 1.9×

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 16 alternatives:

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

Initial Program: 66.3% 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: 79.2% 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} \mathbf{if}\;d \leq -9.2 \cdot 10^{-303}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{{\left(\frac{d}{M\_m} \cdot \frac{2}{D\_m}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 1\right)\\ \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\ \end{array} \end{array} \]
D_m = (fabs.f64 D)
M_m = (fabs.f64 M)
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
(FPCore (d h l M_m D_m)
 :precision binary64
 (if (<= d -9.2e-303)
   (*
    (* (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ d l)))
    (fma (/ (pow (* (/ d M_m) (/ 2.0 D_m)) -2.0) l) (/ -0.5 (pow h -1.0)) 1.0))
   (if (<= d 4.4e-216)
     (/
      (* (* (* D_m D_m) -0.125) (* (/ M_m l) (/ (* M_m (sqrt h)) d)))
      (sqrt l))
     (/
      (*
       (+
        (sqrt (pow h -1.0))
        (* (* -0.125 (sqrt h)) (* D_m (* D_m (/ (/ (/ (* M_m M_m) d) d) l)))))
       d)
      (sqrt l)))))
D_m = fabs(D);
M_m = fabs(M);
assert(d < h && h < l && l < M_m && M_m < D_m);
double code(double d, double h, double l, double M_m, double D_m) {
	double tmp;
	if (d <= -9.2e-303) {
		tmp = ((sqrt(-d) / sqrt(-h)) * sqrt((d / l))) * fma((pow(((d / M_m) * (2.0 / D_m)), -2.0) / l), (-0.5 / pow(h, -1.0)), 1.0);
	} else if (d <= 4.4e-216) {
		tmp = (((D_m * D_m) * -0.125) * ((M_m / l) * ((M_m * sqrt(h)) / d))) / sqrt(l);
	} else {
		tmp = ((sqrt(pow(h, -1.0)) + ((-0.125 * sqrt(h)) * (D_m * (D_m * ((((M_m * M_m) / d) / d) / l))))) * d) / sqrt(l);
	}
	return tmp;
}
D_m = abs(D)
M_m = abs(M)
d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
function code(d, h, l, M_m, D_m)
	tmp = 0.0
	if (d <= -9.2e-303)
		tmp = Float64(Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) * sqrt(Float64(d / l))) * fma(Float64((Float64(Float64(d / M_m) * Float64(2.0 / D_m)) ^ -2.0) / l), Float64(-0.5 / (h ^ -1.0)), 1.0));
	elseif (d <= 4.4e-216)
		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(M_m / l) * Float64(Float64(M_m * sqrt(h)) / d))) / sqrt(l));
	else
		tmp = Float64(Float64(Float64(sqrt((h ^ -1.0)) + Float64(Float64(-0.125 * sqrt(h)) * Float64(D_m * Float64(D_m * Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) / l))))) * d) / 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_] := If[LessEqual[d, -9.2e-303], N[(N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[N[(N[(d / M$95$m), $MachinePrecision] * N[(2.0 / D$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] / l), $MachinePrecision] * N[(-0.5 / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.4e-216], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(M$95$m / l), $MachinePrecision] * N[(N[(M$95$m * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(D$95$m * N[(D$95$m * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $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}
\mathbf{if}\;d \leq -9.2 \cdot 10^{-303}:\\
\;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{{\left(\frac{d}{M\_m} \cdot \frac{2}{D\_m}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 1\right)\\

\mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\
\;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if d < -9.19999999999999981e-303

    1. Initial program 70.4%

      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]
      2. sub-negN/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 \color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right)} \]
      3. +-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 \color{blue}{\left(\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right) + 1\right)} \]
      4. 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(\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right)\right) + 1\right) \]
      5. distribute-lft-neg-inN/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(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell}} + 1\right) \]
      6. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{h}{\ell}} + 1\right) \]
      7. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}} + 1\right) \]
      8. 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(\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\frac{\ell}{h}}} + 1\right) \]
      9. 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(\frac{\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
      10. *-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(\frac{\mathsf{neg}\left(\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
      11. distribute-rgt-neg-inN/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(\frac{\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\frac{\ell}{h}} + 1\right) \]
      12. 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(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{\color{blue}{\ell \cdot \frac{1}{h}}} + 1\right) \]
      13. 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(\color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell} \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\frac{1}{h}}} + 1\right) \]
    4. Applied rewrites73.8%

      \[\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}{\mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
      2. 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
      5. lower-sqrt.f6473.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.19999999999999981e-303 < d < 4.3999999999999998e-216

    1. Initial program 18.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. Applied rewrites26.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{\sqrt{h}}{d} \cdot \frac{\color{blue}{M \cdot M}}{\ell}\right)}{\sqrt{\ell}} \]
    6. Applied rewrites52.9%

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

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

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

      if 4.3999999999999998e-216 < d

      1. Initial program 71.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. Applied rewrites77.0%

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

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

        \[\leadsto \frac{\color{blue}{\left(\sqrt{\frac{1}{h}} - \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(\left(-D\right) \cdot \left(D \cdot \frac{\frac{\frac{M \cdot M}{d}}{d}}{\ell}\right)\right)\right) \cdot d}}{\sqrt{\ell}} \]
    9. Recombined 3 regimes into one program.
    10. Final simplification80.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -9.2 \cdot 10^{-303}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 1\right)\\ \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\ \;\;\;\;\frac{\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{M}{\ell} \cdot \frac{M \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D \cdot \left(D \cdot \frac{\frac{\frac{M \cdot M}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\ \end{array} \]
    11. Add Preprocessing

    Alternative 2: 72.6% 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 := D\_m \cdot \frac{M\_m}{d}\\ \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq \infty:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(\frac{h}{\ell} \cdot -0.125\right) \cdot t\_0, t\_0, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\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 (* D_m (/ M_m d))))
       (if (<=
            (*
             (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
             (-
              1.0
              (* (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
            INFINITY)
         (*
          (* (fma (* (* (/ h l) -0.125) t_0) t_0 1.0) (sqrt (/ d l)))
          (sqrt (/ d h)))
         (/
          (* (* (* D_m D_m) -0.125) (* (/ M_m l) (/ (* M_m (sqrt h)) d)))
          (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 = D_m * (M_m / d);
    	double tmp;
    	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= ((double) INFINITY)) {
    		tmp = (fma((((h / l) * -0.125) * t_0), t_0, 1.0) * sqrt((d / l))) * sqrt((d / h));
    	} else {
    		tmp = (((D_m * D_m) * -0.125) * ((M_m / l) * ((M_m * sqrt(h)) / d))) / 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_m * Float64(M_m / d))
    	tmp = 0.0
    	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= Inf)
    		tmp = Float64(Float64(fma(Float64(Float64(Float64(h / l) * -0.125) * t_0), t_0, 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h)));
    	else
    		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(M_m / l) * Float64(Float64(M_m * sqrt(h)) / d))) / 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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(h / l), $MachinePrecision] * -0.125), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(M$95$m / l), $MachinePrecision] * N[(N[(M$95$m * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $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 := D\_m \cdot \frac{M\_m}{d}\\
    \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq \infty:\\
    \;\;\;\;\left(\mathsf{fma}\left(\left(\frac{h}{\ell} \cdot -0.125\right) \cdot t\_0, t\_0, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0

      1. Initial program 84.4%

        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]
        2. sub-negN/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 \color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right)} \]
        3. +-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 \color{blue}{\left(\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right) + 1\right)} \]
        4. 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(\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right)\right) + 1\right) \]
        5. distribute-lft-neg-inN/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(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell}} + 1\right) \]
        6. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{h}{\ell}} + 1\right) \]
        7. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}} + 1\right) \]
        8. 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(\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\frac{\ell}{h}}} + 1\right) \]
        9. 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(\frac{\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
        10. *-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(\frac{\mathsf{neg}\left(\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
        11. distribute-rgt-neg-inN/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(\frac{\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\frac{\ell}{h}} + 1\right) \]
        12. 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(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{\color{blue}{\ell \cdot \frac{1}{h}}} + 1\right) \]
        13. 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(\color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell} \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\frac{1}{h}}} + 1\right) \]
      4. Applied rewrites84.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}{\mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
        2. 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
        5. lower-sqrt.f6484.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 0.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. Applied rewrites1.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot \frac{-1}{8}\right) \cdot \left(\frac{\sqrt{h}}{d} \cdot \frac{\color{blue}{M \cdot M}}{\ell}\right)}{\sqrt{\ell}} \]
        19. lower-*.f6425.9

          \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{\sqrt{h}}{d} \cdot \frac{\color{blue}{M \cdot M}}{\ell}\right)}{\sqrt{\ell}} \]
      6. Applied rewrites25.9%

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

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

          \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{M}{\ell} \cdot \color{blue}{\frac{M \cdot \sqrt{h}}{d}}\right)}{\sqrt{\ell}} \]
      9. Recombined 2 regimes into one program.
      10. Final simplification74.4%

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

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

        1. Initial program 89.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 -inf

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

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

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

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

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

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

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

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

          1. Initial program 58.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 d around inf

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

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

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

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

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

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

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

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

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

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

          Alternative 4: 78.2% accurate, 1.9× 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^{-310}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{d}{M\_m} \cdot \frac{2}{D\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\ \end{array} \end{array} \]
          D_m = (fabs.f64 D)
          M_m = (fabs.f64 M)
          NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
          (FPCore (d h l M_m D_m)
           :precision binary64
           (if (<= d -5e-310)
             (/
              (*
               (*
                (fma (* -0.5 (/ h l)) (pow (* (/ d M_m) (/ 2.0 D_m)) -2.0) 1.0)
                (sqrt (/ d l)))
               (sqrt (- d)))
              (sqrt (- h)))
             (if (<= d 4.4e-216)
               (/
                (* (* (* D_m D_m) -0.125) (* (/ M_m l) (/ (* M_m (sqrt h)) d)))
                (sqrt l))
               (/
                (*
                 (+
                  (sqrt (pow h -1.0))
                  (* (* -0.125 (sqrt h)) (* D_m (* D_m (/ (/ (/ (* M_m M_m) d) d) l)))))
                 d)
                (sqrt l)))))
          D_m = fabs(D);
          M_m = fabs(M);
          assert(d < h && h < l && l < M_m && M_m < D_m);
          double code(double d, double h, double l, double M_m, double D_m) {
          	double tmp;
          	if (d <= -5e-310) {
          		tmp = ((fma((-0.5 * (h / l)), pow(((d / M_m) * (2.0 / D_m)), -2.0), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
          	} else if (d <= 4.4e-216) {
          		tmp = (((D_m * D_m) * -0.125) * ((M_m / l) * ((M_m * sqrt(h)) / d))) / sqrt(l);
          	} else {
          		tmp = ((sqrt(pow(h, -1.0)) + ((-0.125 * sqrt(h)) * (D_m * (D_m * ((((M_m * M_m) / d) / d) / l))))) * d) / sqrt(l);
          	}
          	return tmp;
          }
          
          D_m = abs(D)
          M_m = abs(M)
          d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
          function code(d, h, l, M_m, D_m)
          	tmp = 0.0
          	if (d <= -5e-310)
          		tmp = Float64(Float64(Float64(fma(Float64(-0.5 * Float64(h / l)), (Float64(Float64(d / M_m) * Float64(2.0 / D_m)) ^ -2.0), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
          	elseif (d <= 4.4e-216)
          		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(M_m / l) * Float64(Float64(M_m * sqrt(h)) / d))) / sqrt(l));
          	else
          		tmp = Float64(Float64(Float64(sqrt((h ^ -1.0)) + Float64(Float64(-0.125 * sqrt(h)) * Float64(D_m * Float64(D_m * Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) / l))))) * d) / 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_] := If[LessEqual[d, -5e-310], N[(N[(N[(N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(d / M$95$m), $MachinePrecision] * N[(2.0 / D$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.4e-216], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(M$95$m / l), $MachinePrecision] * N[(N[(M$95$m * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(D$95$m * N[(D$95$m * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $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}
          \mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
          \;\;\;\;\frac{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{d}{M\_m} \cdot \frac{2}{D\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
          
          \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\
          \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if d < -4.999999999999985e-310

            1. Initial program 68.7%

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

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

            if -4.999999999999985e-310 < d < 4.3999999999999998e-216

            1. Initial program 20.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 4.3999999999999998e-216 < d

              1. Initial program 71.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. Applied rewrites77.0%

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

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

                \[\leadsto \frac{\color{blue}{\left(\sqrt{\frac{1}{h}} - \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(\left(-D\right) \cdot \left(D \cdot \frac{\frac{\frac{M \cdot M}{d}}{d}}{\ell}\right)\right)\right) \cdot d}}{\sqrt{\ell}} \]
            9. Recombined 3 regimes into one program.
            10. Final simplification78.4%

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

            Alternative 5: 78.4% accurate, 1.9× 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^{-310}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{h}{\ell} \cdot -0.5, 0.25 \cdot {\left(\frac{d}{D\_m \cdot M\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\ \end{array} \end{array} \]
            D_m = (fabs.f64 D)
            M_m = (fabs.f64 M)
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            (FPCore (d h l M_m D_m)
             :precision binary64
             (if (<= d -5e-310)
               (*
                (*
                 (fma (* (/ h l) -0.5) (* 0.25 (pow (/ d (* D_m M_m)) -2.0)) 1.0)
                 (sqrt (/ d l)))
                (/ (sqrt (- d)) (sqrt (- h))))
               (if (<= d 4.4e-216)
                 (/
                  (* (* (* D_m D_m) -0.125) (* (/ M_m l) (/ (* M_m (sqrt h)) d)))
                  (sqrt l))
                 (/
                  (*
                   (+
                    (sqrt (pow h -1.0))
                    (* (* -0.125 (sqrt h)) (* D_m (* D_m (/ (/ (/ (* M_m M_m) d) d) l)))))
                   d)
                  (sqrt l)))))
            D_m = fabs(D);
            M_m = fabs(M);
            assert(d < h && h < l && l < M_m && M_m < D_m);
            double code(double d, double h, double l, double M_m, double D_m) {
            	double tmp;
            	if (d <= -5e-310) {
            		tmp = (fma(((h / l) * -0.5), (0.25 * pow((d / (D_m * M_m)), -2.0)), 1.0) * sqrt((d / l))) * (sqrt(-d) / sqrt(-h));
            	} else if (d <= 4.4e-216) {
            		tmp = (((D_m * D_m) * -0.125) * ((M_m / l) * ((M_m * sqrt(h)) / d))) / sqrt(l);
            	} else {
            		tmp = ((sqrt(pow(h, -1.0)) + ((-0.125 * sqrt(h)) * (D_m * (D_m * ((((M_m * M_m) / d) / d) / l))))) * d) / sqrt(l);
            	}
            	return tmp;
            }
            
            D_m = abs(D)
            M_m = abs(M)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	tmp = 0.0
            	if (d <= -5e-310)
            		tmp = Float64(Float64(fma(Float64(Float64(h / l) * -0.5), Float64(0.25 * (Float64(d / Float64(D_m * M_m)) ^ -2.0)), 1.0) * sqrt(Float64(d / l))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))));
            	elseif (d <= 4.4e-216)
            		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(M_m / l) * Float64(Float64(M_m * sqrt(h)) / d))) / sqrt(l));
            	else
            		tmp = Float64(Float64(Float64(sqrt((h ^ -1.0)) + Float64(Float64(-0.125 * sqrt(h)) * Float64(D_m * Float64(D_m * Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) / l))))) * d) / 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_] := If[LessEqual[d, -5e-310], N[(N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[(0.25 * N[Power[N[(d / N[(D$95$m * M$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.4e-216], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(M$95$m / l), $MachinePrecision] * N[(N[(M$95$m * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(D$95$m * N[(D$95$m * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $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}
            \mathbf{if}\;d \leq -5 \cdot 10^{-310}:\\
            \;\;\;\;\left(\mathsf{fma}\left(\frac{h}{\ell} \cdot -0.5, 0.25 \cdot {\left(\frac{d}{D\_m \cdot M\_m}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
            
            \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\
            \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if d < -4.999999999999985e-310

              1. Initial program 68.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--.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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]
                2. sub-negN/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 \color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right)} \]
                3. +-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 \color{blue}{\left(\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right) + 1\right)} \]
                4. 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(\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right)\right) + 1\right) \]
                5. distribute-lft-neg-inN/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(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell}} + 1\right) \]
                6. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{h}{\ell}} + 1\right) \]
                7. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}} + 1\right) \]
                8. 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(\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\frac{\ell}{h}}} + 1\right) \]
                9. 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(\frac{\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
                10. *-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(\frac{\mathsf{neg}\left(\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
                11. distribute-rgt-neg-inN/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(\frac{\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\frac{\ell}{h}} + 1\right) \]
                12. 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(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{\color{blue}{\ell \cdot \frac{1}{h}}} + 1\right) \]
                13. 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(\color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell} \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\frac{1}{h}}} + 1\right) \]
              4. Applied rewrites72.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}{\mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
                2. 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
                5. lower-sqrt.f6472.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -4.999999999999985e-310 < d < 4.3999999999999998e-216

              1. Initial program 20.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 4.3999999999999998e-216 < d

                1. Initial program 71.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. Applied rewrites77.0%

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

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

                  \[\leadsto \frac{\color{blue}{\left(\sqrt{\frac{1}{h}} - \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(\left(-D\right) \cdot \left(D \cdot \frac{\frac{\frac{M \cdot M}{d}}{d}}{\ell}\right)\right)\right) \cdot d}}{\sqrt{\ell}} \]
              9. Recombined 3 regimes into one program.
              10. Final simplification78.4%

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

              Alternative 6: 73.7% accurate, 1.9× 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 -3.7 \cdot 10^{-296}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{-0.125 \cdot {\left(\frac{\frac{d}{M\_m}}{D\_m}\right)}^{-2}}{\ell}, h, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\ \end{array} \end{array} \]
              D_m = (fabs.f64 D)
              M_m = (fabs.f64 M)
              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
              (FPCore (d h l M_m D_m)
               :precision binary64
               (if (<= d -3.7e-296)
                 (*
                  (*
                   (fma (/ (* -0.125 (pow (/ (/ d M_m) D_m) -2.0)) l) h 1.0)
                   (sqrt (/ d h)))
                  (sqrt (/ d l)))
                 (if (<= d 4.4e-216)
                   (/
                    (* (* (* D_m D_m) -0.125) (* (/ M_m l) (/ (* M_m (sqrt h)) d)))
                    (sqrt l))
                   (/
                    (*
                     (+
                      (sqrt (pow h -1.0))
                      (* (* -0.125 (sqrt h)) (* D_m (* D_m (/ (/ (/ (* M_m M_m) d) d) l)))))
                     d)
                    (sqrt l)))))
              D_m = fabs(D);
              M_m = fabs(M);
              assert(d < h && h < l && l < M_m && M_m < D_m);
              double code(double d, double h, double l, double M_m, double D_m) {
              	double tmp;
              	if (d <= -3.7e-296) {
              		tmp = (fma(((-0.125 * pow(((d / M_m) / D_m), -2.0)) / l), h, 1.0) * sqrt((d / h))) * sqrt((d / l));
              	} else if (d <= 4.4e-216) {
              		tmp = (((D_m * D_m) * -0.125) * ((M_m / l) * ((M_m * sqrt(h)) / d))) / sqrt(l);
              	} else {
              		tmp = ((sqrt(pow(h, -1.0)) + ((-0.125 * sqrt(h)) * (D_m * (D_m * ((((M_m * M_m) / d) / d) / l))))) * d) / sqrt(l);
              	}
              	return tmp;
              }
              
              D_m = abs(D)
              M_m = abs(M)
              d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
              function code(d, h, l, M_m, D_m)
              	tmp = 0.0
              	if (d <= -3.7e-296)
              		tmp = Float64(Float64(fma(Float64(Float64(-0.125 * (Float64(Float64(d / M_m) / D_m) ^ -2.0)) / l), h, 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(d / l)));
              	elseif (d <= 4.4e-216)
              		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(M_m / l) * Float64(Float64(M_m * sqrt(h)) / d))) / sqrt(l));
              	else
              		tmp = Float64(Float64(Float64(sqrt((h ^ -1.0)) + Float64(Float64(-0.125 * sqrt(h)) * Float64(D_m * Float64(D_m * Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) / l))))) * d) / 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_] := If[LessEqual[d, -3.7e-296], N[(N[(N[(N[(N[(-0.125 * N[Power[N[(N[(d / M$95$m), $MachinePrecision] / D$95$m), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * h + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.4e-216], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(M$95$m / l), $MachinePrecision] * N[(N[(M$95$m * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(D$95$m * N[(D$95$m * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $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}
              \mathbf{if}\;d \leq -3.7 \cdot 10^{-296}:\\
              \;\;\;\;\left(\mathsf{fma}\left(\frac{-0.125 \cdot {\left(\frac{\frac{d}{M\_m}}{D\_m}\right)}^{-2}}{\ell}, h, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
              
              \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\
              \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if d < -3.70000000000000027e-296

                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--.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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]
                  2. sub-negN/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 \color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right)} \]
                  3. +-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 \color{blue}{\left(\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right) + 1\right)} \]
                  4. 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(\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right)\right) + 1\right) \]
                  5. distribute-lft-neg-inN/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(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell}} + 1\right) \]
                  6. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{h}{\ell}} + 1\right) \]
                  7. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}} + 1\right) \]
                  8. 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(\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\frac{\ell}{h}}} + 1\right) \]
                  9. 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(\frac{\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
                  10. *-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(\frac{\mathsf{neg}\left(\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
                  11. distribute-rgt-neg-inN/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(\frac{\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\frac{\ell}{h}} + 1\right) \]
                  12. 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(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{\color{blue}{\ell \cdot \frac{1}{h}}} + 1\right) \]
                  13. 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(\color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell} \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\frac{1}{h}}} + 1\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 \color{blue}{\mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
                  2. 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
                  5. lower-sqrt.f6474.4

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

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

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

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

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

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

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

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

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

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

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

                if -3.70000000000000027e-296 < d < 4.3999999999999998e-216

                1. Initial program 17.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. Applied rewrites25.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot \frac{-1}{8}\right) \cdot \left(\frac{\sqrt{h}}{d} \cdot \frac{\color{blue}{M \cdot M}}{\ell}\right)}{\sqrt{\ell}} \]
                  19. lower-*.f6450.7

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

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

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

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

                  if 4.3999999999999998e-216 < d

                  1. Initial program 71.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. Applied rewrites77.0%

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

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

                    \[\leadsto \frac{\color{blue}{\left(\sqrt{\frac{1}{h}} - \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(\left(-D\right) \cdot \left(D \cdot \frac{\frac{\frac{M \cdot M}{d}}{d}}{\ell}\right)\right)\right) \cdot d}}{\sqrt{\ell}} \]
                9. Recombined 3 regimes into one program.
                10. Final simplification76.0%

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

                Alternative 7: 73.7% accurate, 1.9× 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 := D\_m \cdot \frac{M\_m}{d}\\ \mathbf{if}\;d \leq -9.2 \cdot 10^{-303}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(\frac{h}{\ell} \cdot -0.125\right) \cdot t\_0, t\_0, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\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 (* D_m (/ M_m d))))
                   (if (<= d -9.2e-303)
                     (*
                      (* (fma (* (* (/ h l) -0.125) t_0) t_0 1.0) (sqrt (/ d l)))
                      (sqrt (/ d h)))
                     (if (<= d 4.4e-216)
                       (/
                        (* (* (* D_m D_m) -0.125) (* (/ M_m l) (/ (* M_m (sqrt h)) d)))
                        (sqrt l))
                       (/
                        (*
                         (+
                          (sqrt (pow h -1.0))
                          (*
                           (* -0.125 (sqrt h))
                           (* D_m (* D_m (/ (/ (/ (* M_m M_m) d) d) l)))))
                         d)
                        (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 = D_m * (M_m / d);
                	double tmp;
                	if (d <= -9.2e-303) {
                		tmp = (fma((((h / l) * -0.125) * t_0), t_0, 1.0) * sqrt((d / l))) * sqrt((d / h));
                	} else if (d <= 4.4e-216) {
                		tmp = (((D_m * D_m) * -0.125) * ((M_m / l) * ((M_m * sqrt(h)) / d))) / sqrt(l);
                	} else {
                		tmp = ((sqrt(pow(h, -1.0)) + ((-0.125 * sqrt(h)) * (D_m * (D_m * ((((M_m * M_m) / d) / d) / l))))) * d) / 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_m * Float64(M_m / d))
                	tmp = 0.0
                	if (d <= -9.2e-303)
                		tmp = Float64(Float64(fma(Float64(Float64(Float64(h / l) * -0.125) * t_0), t_0, 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h)));
                	elseif (d <= 4.4e-216)
                		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(M_m / l) * Float64(Float64(M_m * sqrt(h)) / d))) / sqrt(l));
                	else
                		tmp = Float64(Float64(Float64(sqrt((h ^ -1.0)) + Float64(Float64(-0.125 * sqrt(h)) * Float64(D_m * Float64(D_m * Float64(Float64(Float64(Float64(M_m * M_m) / d) / d) / l))))) * d) / 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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -9.2e-303], N[(N[(N[(N[(N[(N[(h / l), $MachinePrecision] * -0.125), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.4e-216], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(M$95$m / l), $MachinePrecision] * N[(N[(M$95$m * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] + N[(N[(-0.125 * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(D$95$m * N[(D$95$m * N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] / d), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $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 := D\_m \cdot \frac{M\_m}{d}\\
                \mathbf{if}\;d \leq -9.2 \cdot 10^{-303}:\\
                \;\;\;\;\left(\mathsf{fma}\left(\left(\frac{h}{\ell} \cdot -0.125\right) \cdot t\_0, t\_0, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
                
                \mathbf{elif}\;d \leq 4.4 \cdot 10^{-216}:\\
                \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\left(\sqrt{{h}^{-1}} + \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(D\_m \cdot \left(D\_m \cdot \frac{\frac{\frac{M\_m \cdot M\_m}{d}}{d}}{\ell}\right)\right)\right) \cdot d}{\sqrt{\ell}}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if d < -9.19999999999999981e-303

                  1. Initial program 70.4%

                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift--.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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]
                    2. sub-negN/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 \color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right)\right)} \]
                    3. +-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 \color{blue}{\left(\left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right) + 1\right)} \]
                    4. 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(\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}}\right)\right) + 1\right) \]
                    5. distribute-lft-neg-inN/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(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \frac{h}{\ell}} + 1\right) \]
                    6. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{h}{\ell}} + 1\right) \]
                    7. 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(\left(\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right) \cdot \color{blue}{\frac{1}{\frac{\ell}{h}}} + 1\right) \]
                    8. 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(\color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}{\frac{\ell}{h}}} + 1\right) \]
                    9. 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(\frac{\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
                    10. *-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(\frac{\mathsf{neg}\left(\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}}\right)}{\frac{\ell}{h}} + 1\right) \]
                    11. distribute-rgt-neg-inN/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(\frac{\color{blue}{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\frac{\ell}{h}} + 1\right) \]
                    12. 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(\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{\color{blue}{\ell \cdot \frac{1}{h}}} + 1\right) \]
                    13. 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(\color{blue}{\frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell} \cdot \frac{\mathsf{neg}\left(\frac{1}{2}\right)}{\frac{1}{h}}} + 1\right) \]
                  4. Applied rewrites73.8%

                    \[\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}{\mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{-0.5}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
                    2. 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 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 \mathsf{fma}\left(\frac{{\left(\frac{d}{M} \cdot \frac{2}{D}\right)}^{-2}}{\ell}, \frac{\frac{-1}{2}}{{h}^{-1}}, 1\right) \]
                    5. lower-sqrt.f6473.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -9.19999999999999981e-303 < d < 4.3999999999999998e-216

                  1. Initial program 18.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. Applied rewrites26.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{\sqrt{h}}{d} \cdot \frac{\color{blue}{M \cdot M}}{\ell}\right)}{\sqrt{\ell}} \]
                  6. Applied rewrites52.9%

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

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

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

                    if 4.3999999999999998e-216 < d

                    1. Initial program 71.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. Applied rewrites77.0%

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

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

                      \[\leadsto \frac{\color{blue}{\left(\sqrt{\frac{1}{h}} - \left(-0.125 \cdot \sqrt{h}\right) \cdot \left(\left(-D\right) \cdot \left(D \cdot \frac{\frac{\frac{M \cdot M}{d}}{d}}{\ell}\right)\right)\right) \cdot d}}{\sqrt{\ell}} \]
                  9. Recombined 3 regimes into one program.
                  10. Final simplification75.0%

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

                  Alternative 8: 64.3% accurate, 1.9× speedup?

                  \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{M\_m \cdot M\_m}{d}\\ \mathbf{if}\;d \leq -2.9 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{\sqrt{-d}}{\sqrt{-h}}}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;d \leq -8 \cdot 10^{-309}:\\ \;\;\;\;\left(\left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot t\_0\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-145}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{+151}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(D\_m \cdot D\_m\right) \cdot \left(\frac{t\_0}{\ell} \cdot -0.125\right), \sqrt{h}, \sqrt{{h}^{-1}} \cdot d\right)}{\sqrt{\ell}}\\ \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 (/ (* M_m M_m) d)))
                     (if (<= d -2.9e-52)
                       (/ (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ l d)))
                       (if (<= d -8e-309)
                         (* (* (* 0.125 (* D_m D_m)) t_0) (/ (sqrt (/ h l)) (fabs l)))
                         (if (<= d 9e-145)
                           (/
                            (* (* (* D_m D_m) -0.125) (* (/ M_m l) (/ (* M_m (sqrt h)) d)))
                            (sqrt l))
                           (if (<= d 3.5e+151)
                             (/
                              (fma
                               (* (* D_m D_m) (* (/ t_0 l) -0.125))
                               (sqrt h)
                               (* (sqrt (pow h -1.0)) d))
                              (sqrt l))
                             (/ 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 * M_m) / d;
                  	double tmp;
                  	if (d <= -2.9e-52) {
                  		tmp = (sqrt(-d) / sqrt(-h)) / sqrt((l / d));
                  	} else if (d <= -8e-309) {
                  		tmp = ((0.125 * (D_m * D_m)) * t_0) * (sqrt((h / l)) / fabs(l));
                  	} else if (d <= 9e-145) {
                  		tmp = (((D_m * D_m) * -0.125) * ((M_m / l) * ((M_m * sqrt(h)) / d))) / sqrt(l);
                  	} else if (d <= 3.5e+151) {
                  		tmp = fma(((D_m * D_m) * ((t_0 / l) * -0.125)), sqrt(h), (sqrt(pow(h, -1.0)) * d)) / sqrt(l);
                  	} 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 = Float64(Float64(M_m * M_m) / d)
                  	tmp = 0.0
                  	if (d <= -2.9e-52)
                  		tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) / sqrt(Float64(l / d)));
                  	elseif (d <= -8e-309)
                  		tmp = Float64(Float64(Float64(0.125 * Float64(D_m * D_m)) * t_0) * Float64(sqrt(Float64(h / l)) / abs(l)));
                  	elseif (d <= 9e-145)
                  		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(Float64(M_m / l) * Float64(Float64(M_m * sqrt(h)) / d))) / sqrt(l));
                  	elseif (d <= 3.5e+151)
                  		tmp = Float64(fma(Float64(Float64(D_m * D_m) * Float64(Float64(t_0 / l) * -0.125)), sqrt(h), Float64(sqrt((h ^ -1.0)) * d)) / sqrt(l));
                  	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[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[d, -2.9e-52], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -8e-309], N[(N[(N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 9e-145], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(M$95$m / l), $MachinePrecision] * N[(N[(M$95$m * N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 3.5e+151], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * N[(N[(t$95$0 / l), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision] * N[Sqrt[h], $MachinePrecision] + N[(N[Sqrt[N[Power[h, -1.0], $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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}
                  t_0 := \frac{M\_m \cdot M\_m}{d}\\
                  \mathbf{if}\;d \leq -2.9 \cdot 10^{-52}:\\
                  \;\;\;\;\frac{\frac{\sqrt{-d}}{\sqrt{-h}}}{\sqrt{\frac{\ell}{d}}}\\
                  
                  \mathbf{elif}\;d \leq -8 \cdot 10^{-309}:\\
                  \;\;\;\;\left(\left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot t\_0\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\
                  
                  \mathbf{elif}\;d \leq 9 \cdot 10^{-145}:\\
                  \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(\frac{M\_m}{\ell} \cdot \frac{M\_m \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\
                  
                  \mathbf{elif}\;d \leq 3.5 \cdot 10^{+151}:\\
                  \;\;\;\;\frac{\mathsf{fma}\left(\left(D\_m \cdot D\_m\right) \cdot \left(\frac{t\_0}{\ell} \cdot -0.125\right), \sqrt{h}, \sqrt{{h}^{-1}} \cdot d\right)}{\sqrt{\ell}}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 5 regimes
                  2. if d < -2.9000000000000002e-52

                    1. Initial program 80.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 d around inf

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

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

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

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

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

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

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

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

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

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

                        if -2.9000000000000002e-52 < d < -8.0000000000000003e-309

                        1. Initial program 53.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 -inf

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

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

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

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

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

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

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

                          if -8.0000000000000003e-309 < d < 9.0000000000000001e-145

                          1. Initial program 25.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. Applied rewrites31.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 9.0000000000000001e-145 < d < 3.5000000000000003e151

                            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. Applied rewrites77.1%

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

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

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

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

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

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

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

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

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

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

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

                            if 3.5000000000000003e151 < d

                            1. Initial program 78.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. Taylor expanded in d around inf

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.9 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{\sqrt{-d}}{\sqrt{-h}}}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;d \leq -8 \cdot 10^{-309}:\\ \;\;\;\;\left(\left(0.125 \cdot \left(D \cdot D\right)\right) \cdot \frac{M \cdot M}{d}\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-145}:\\ \;\;\;\;\frac{\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left(\frac{M}{\ell} \cdot \frac{M \cdot \sqrt{h}}{d}\right)}{\sqrt{\ell}}\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{+151}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(D \cdot D\right) \cdot \left(\frac{\frac{M \cdot M}{d}}{\ell} \cdot -0.125\right), \sqrt{h}, \sqrt{{h}^{-1}} \cdot d\right)}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                              5. Add Preprocessing

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

                                1. Initial program 68.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 l around -inf

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

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

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

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

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

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

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

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

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

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

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

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

                                if -4.999999999999985e-310 < d < 6.5e-176

                                1. Initial program 23.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 l around 0

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

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

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

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

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

                                  if 6.5e-176 < d

                                  1. Initial program 73.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 d around inf

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 10: 46.0% accurate, 3.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}\;d \leq 4.5 \cdot 10^{-173}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \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 4.5e-173)
                                       (* (- d) (sqrt (pow (* l h) -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 (d <= 4.5e-173) {
                                    		tmp = -d * sqrt(pow((l * h), -1.0));
                                    	} 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 <= 4.5d-173) then
                                            tmp = -d * sqrt(((l * h) ** (-1.0d0)))
                                        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 <= 4.5e-173) {
                                    		tmp = -d * Math.sqrt(Math.pow((l * h), -1.0));
                                    	} 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 <= 4.5e-173:
                                    		tmp = -d * math.sqrt(math.pow((l * h), -1.0))
                                    	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 <= 4.5e-173)
                                    		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                    	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 <= 4.5e-173)
                                    		tmp = -d * sqrt(((l * h) ^ -1.0));
                                    	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, 4.5e-173], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $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 4.5 \cdot 10^{-173}:\\
                                    \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if d < 4.50000000000000018e-173

                                      1. Initial program 60.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 4.50000000000000018e-173 < d

                                      1. Initial program 74.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 d around inf

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

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

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

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

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

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

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

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

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

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

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

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

                                          1. Initial program 75.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. Taylor expanded in l around -inf

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

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

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

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

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

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

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

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

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

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

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

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

                                          if -6.6e-210 < d

                                          1. Initial program 59.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 d around inf

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

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

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

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

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

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

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

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

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

                                        Alternative 12: 26.5% accurate, 3.4× speedup?

                                        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \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 (* (sqrt (pow (* l h) -1.0)) d))
                                        D_m = fabs(D);
                                        M_m = fabs(M);
                                        assert(d < h && h < l && l < M_m && M_m < D_m);
                                        double code(double d, double h, double l, double M_m, double D_m) {
                                        	return sqrt(pow((l * h), -1.0)) * d;
                                        }
                                        
                                        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 = sqrt(((l * h) ** (-1.0d0))) * d
                                        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 Math.sqrt(Math.pow((l * h), -1.0)) * d;
                                        }
                                        
                                        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 math.sqrt(math.pow((l * h), -1.0)) * d
                                        
                                        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(sqrt((Float64(l * h) ^ -1.0)) * d)
                                        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 = sqrt(((l * h) ^ -1.0)) * d;
                                        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[(N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * d), $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])\\
                                        \\
                                        \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d
                                        \end{array}
                                        
                                        Derivation
                                        1. Initial program 66.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 d around inf

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                        6. Final simplification31.3%

                                          \[\leadsto \sqrt{{\left(\ell \cdot h\right)}^{-1}} \cdot d \]
                                        7. Add Preprocessing

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

                                          1. Initial program 80.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 d around inf

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

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

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

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

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

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

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

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

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

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

                                              if -2.9000000000000002e-52 < d < -8.0000000000000003e-309

                                              1. Initial program 53.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 -inf

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

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

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

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

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

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

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

                                                if -8.0000000000000003e-309 < d < 1.3e-144

                                                1. Initial program 25.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. Applied rewrites31.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if 1.3e-144 < d

                                                  1. Initial program 75.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 d around inf

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

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

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

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

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

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

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

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

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

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

                                                    Alternative 14: 57.4% accurate, 4.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} \mathbf{if}\;d \leq -2.9 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{\sqrt{-d}}{\sqrt{-h}}}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;d \leq -8 \cdot 10^{-309}:\\ \;\;\;\;\left(\left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{M\_m \cdot M\_m}{d}\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\ \mathbf{elif}\;d \leq 1.3 \cdot 10^{-144}:\\ \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(M\_m \cdot \frac{\sqrt{h} \cdot M\_m}{\ell \cdot d}\right)}{\sqrt{\ell}}\\ \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 -2.9e-52)
                                                       (/ (/ (sqrt (- d)) (sqrt (- h))) (sqrt (/ l d)))
                                                       (if (<= d -8e-309)
                                                         (*
                                                          (* (* 0.125 (* D_m D_m)) (/ (* M_m M_m) d))
                                                          (/ (sqrt (/ h l)) (fabs l)))
                                                         (if (<= d 1.3e-144)
                                                           (/
                                                            (* (* (* D_m D_m) -0.125) (* M_m (/ (* (sqrt h) M_m) (* l d))))
                                                            (sqrt l))
                                                           (/ 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 <= -2.9e-52) {
                                                    		tmp = (sqrt(-d) / sqrt(-h)) / sqrt((l / d));
                                                    	} else if (d <= -8e-309) {
                                                    		tmp = ((0.125 * (D_m * D_m)) * ((M_m * M_m) / d)) * (sqrt((h / l)) / fabs(l));
                                                    	} else if (d <= 1.3e-144) {
                                                    		tmp = (((D_m * D_m) * -0.125) * (M_m * ((sqrt(h) * M_m) / (l * d)))) / sqrt(l);
                                                    	} 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 <= (-2.9d-52)) then
                                                            tmp = (sqrt(-d) / sqrt(-h)) / sqrt((l / d))
                                                        else if (d <= (-8d-309)) then
                                                            tmp = ((0.125d0 * (d_m * d_m)) * ((m_m * m_m) / d)) * (sqrt((h / l)) / abs(l))
                                                        else if (d <= 1.3d-144) then
                                                            tmp = (((d_m * d_m) * (-0.125d0)) * (m_m * ((sqrt(h) * m_m) / (l * d)))) / sqrt(l)
                                                        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 <= -2.9e-52) {
                                                    		tmp = (Math.sqrt(-d) / Math.sqrt(-h)) / Math.sqrt((l / d));
                                                    	} else if (d <= -8e-309) {
                                                    		tmp = ((0.125 * (D_m * D_m)) * ((M_m * M_m) / d)) * (Math.sqrt((h / l)) / Math.abs(l));
                                                    	} else if (d <= 1.3e-144) {
                                                    		tmp = (((D_m * D_m) * -0.125) * (M_m * ((Math.sqrt(h) * M_m) / (l * d)))) / Math.sqrt(l);
                                                    	} 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 <= -2.9e-52:
                                                    		tmp = (math.sqrt(-d) / math.sqrt(-h)) / math.sqrt((l / d))
                                                    	elif d <= -8e-309:
                                                    		tmp = ((0.125 * (D_m * D_m)) * ((M_m * M_m) / d)) * (math.sqrt((h / l)) / math.fabs(l))
                                                    	elif d <= 1.3e-144:
                                                    		tmp = (((D_m * D_m) * -0.125) * (M_m * ((math.sqrt(h) * M_m) / (l * d)))) / math.sqrt(l)
                                                    	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 <= -2.9e-52)
                                                    		tmp = Float64(Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))) / sqrt(Float64(l / d)));
                                                    	elseif (d <= -8e-309)
                                                    		tmp = Float64(Float64(Float64(0.125 * Float64(D_m * D_m)) * Float64(Float64(M_m * M_m) / d)) * Float64(sqrt(Float64(h / l)) / abs(l)));
                                                    	elseif (d <= 1.3e-144)
                                                    		tmp = Float64(Float64(Float64(Float64(D_m * D_m) * -0.125) * Float64(M_m * Float64(Float64(sqrt(h) * M_m) / Float64(l * d)))) / sqrt(l));
                                                    	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 <= -2.9e-52)
                                                    		tmp = (sqrt(-d) / sqrt(-h)) / sqrt((l / d));
                                                    	elseif (d <= -8e-309)
                                                    		tmp = ((0.125 * (D_m * D_m)) * ((M_m * M_m) / d)) * (sqrt((h / l)) / abs(l));
                                                    	elseif (d <= 1.3e-144)
                                                    		tmp = (((D_m * D_m) * -0.125) * (M_m * ((sqrt(h) * M_m) / (l * d)))) / sqrt(l);
                                                    	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, -2.9e-52], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -8e-309], N[(N[(N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.3e-144], N[(N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(M$95$m * N[(N[(N[Sqrt[h], $MachinePrecision] * M$95$m), $MachinePrecision] / N[(l * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $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 -2.9 \cdot 10^{-52}:\\
                                                    \;\;\;\;\frac{\frac{\sqrt{-d}}{\sqrt{-h}}}{\sqrt{\frac{\ell}{d}}}\\
                                                    
                                                    \mathbf{elif}\;d \leq -8 \cdot 10^{-309}:\\
                                                    \;\;\;\;\left(\left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{M\_m \cdot M\_m}{d}\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\
                                                    
                                                    \mathbf{elif}\;d \leq 1.3 \cdot 10^{-144}:\\
                                                    \;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(M\_m \cdot \frac{\sqrt{h} \cdot M\_m}{\ell \cdot d}\right)}{\sqrt{\ell}}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 4 regimes
                                                    2. if d < -2.9000000000000002e-52

                                                      1. Initial program 80.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 d around inf

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

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

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

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

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

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

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

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

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

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

                                                          if -2.9000000000000002e-52 < d < -8.0000000000000003e-309

                                                          1. Initial program 53.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 -inf

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

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

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

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

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

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

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

                                                            if -8.0000000000000003e-309 < d < 1.3e-144

                                                            1. Initial program 25.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. Applied rewrites31.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                if 1.3e-144 < d

                                                                1. Initial program 75.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 d around inf

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

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

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

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

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

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

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

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

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

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

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

                                                                    1. Initial program 68.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 d around inf

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

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

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

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

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

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

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

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

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

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

                                                                        if -4.999999999999985e-310 < d < 6.5e-176

                                                                        1. Initial program 23.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 l around 0

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

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

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

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

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

                                                                          if 6.5e-176 < d

                                                                          1. Initial program 73.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 d around inf

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

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

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

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

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

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

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

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

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

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

                                                                            Alternative 16: 26.5% 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 66.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 d around inf

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

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

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

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

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

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

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

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

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

                                                                              Reproduce

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