Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.9% → 82.2%
Time: 17.8s
Alternatives: 22
Speedup: 2.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 22 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 82.2% accurate, 1.2× speedup?

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

\mathbf{elif}\;d \leq 7.6 \cdot 10^{-211}:\\
\;\;\;\;\frac{\left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right) \cdot \left(t\_1 \cdot \left(t\_1 \cdot \left(\frac{M\_m}{d} \cdot M\_m\right)\right)\right)}{h}\\

\mathbf{elif}\;d \leq 4.1 \cdot 10^{+195}:\\
\;\;\;\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot t\_2\\

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


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

    1. Initial program 70.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. Applied rewrites81.4%

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

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

    if -4.2e-215 < d < 7.60000000000000023e-211

    1. Initial program 40.2%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
    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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
    5. Applied rewrites59.9%

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

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

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

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

            \[\leadsto \frac{\left(\left(D \cdot D\right) \cdot -0.125\right) \cdot \left({\left(\frac{\ell}{h}\right)}^{-0.75} \cdot \left({\left(\frac{\ell}{h}\right)}^{-0.75} \cdot \left(\frac{M}{d} \cdot M\right)\right)\right)}{h} \]

          if 7.60000000000000023e-211 < d < 4.1e195

          1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 4.1e195 < d

          1. Initial program 68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 2: 58.9% accurate, 0.3× speedup?

        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\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)\\ t_1 := \sqrt{\frac{h}{\ell}}\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-191} \lor \neg \left(t\_0 \leq \infty\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{h}{\ell} \cdot t\_1, t\_1 \cdot d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \end{array} \end{array} \]
        D_m = (fabs.f64 D)
        M_m = (fabs.f64 M)
        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
        (FPCore (d h l M_m D_m)
         :precision binary64
         (let* ((t_0
                 (*
                  (* (pow (/ 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)))))
                (t_1 (sqrt (/ h l))))
           (if (or (<= t_0 2e-191) (not (<= t_0 INFINITY)))
             (/
              (fma
               (* (* (* M_m M_m) -0.125) (/ (* D_m D_m) d))
               (* (/ h l) t_1)
               (* t_1 d))
              h)
             (* (sqrt (/ d l)) (sqrt (/ d h))))))
        D_m = fabs(D);
        M_m = fabs(M);
        assert(d < h && h < l && l < M_m && M_m < D_m);
        double code(double d, double h, double l, double M_m, double D_m) {
        	double t_0 = (pow((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 t_1 = sqrt((h / l));
        	double tmp;
        	if ((t_0 <= 2e-191) || !(t_0 <= ((double) INFINITY))) {
        		tmp = fma((((M_m * M_m) * -0.125) * ((D_m * D_m) / d)), ((h / l) * t_1), (t_1 * d)) / h;
        	} else {
        		tmp = sqrt((d / l)) * sqrt((d / h));
        	}
        	return tmp;
        }
        
        D_m = abs(D)
        M_m = abs(M)
        d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
        function code(d, h, l, M_m, D_m)
        	t_0 = Float64(Float64((Float64(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))))
        	t_1 = sqrt(Float64(h / l))
        	tmp = 0.0
        	if ((t_0 <= 2e-191) || !(t_0 <= Inf))
        		tmp = Float64(fma(Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(Float64(D_m * D_m) / d)), Float64(Float64(h / l) * t_1), Float64(t_1 * d)) / h);
        	else
        		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
        	end
        	return tmp
        end
        
        D_m = N[Abs[D], $MachinePrecision]
        M_m = N[Abs[M], $MachinePrecision]
        NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
        code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[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]}, Block[{t$95$1 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-191], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(t$95$1 * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / 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 := \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)\\
        t_1 := \sqrt{\frac{h}{\ell}}\\
        \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-191} \lor \neg \left(t\_0 \leq \infty\right):\\
        \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{h}{\ell} \cdot t\_1, t\_1 \cdot d\right)}{h}\\
        
        \mathbf{else}:\\
        \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
        
        
        \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)))) < 2e-191 or +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 53.1%

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

            \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
          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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
          5. Applied rewrites44.5%

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

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

            if 2e-191 < (*.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.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-*.f6444.4

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

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

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

              \[\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 2 \cdot 10^{-191} \lor \neg \left(\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\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{D \cdot D}{d}, \frac{h}{\ell} \cdot \sqrt{\frac{h}{\ell}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \end{array} \]
            9. Add Preprocessing

            Alternative 3: 59.0% accurate, 0.3× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}\\ t_1 := \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)\\ t_2 := \sqrt{\frac{h}{\ell}}\\ t_3 := t\_2 \cdot d\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-191}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, t\_3\right)}{h}\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, \frac{h}{\ell} \cdot t\_2, t\_3\right)}{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) -0.125) (/ (* D_m D_m) d)))
                    (t_1
                     (*
                      (* (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)))))
                    (t_2 (sqrt (/ h l)))
                    (t_3 (* t_2 d)))
               (if (<= t_1 2e-191)
                 (/ (fma t_0 (/ (/ h l) (sqrt (/ l h))) t_3) h)
                 (if (<= t_1 INFINITY)
                   (* (sqrt (/ d l)) (sqrt (/ d h)))
                   (/ (fma t_0 (* (/ h l) t_2) t_3) 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) * -0.125) * ((D_m * D_m) / d);
            	double t_1 = (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 t_2 = sqrt((h / l));
            	double t_3 = t_2 * d;
            	double tmp;
            	if (t_1 <= 2e-191) {
            		tmp = fma(t_0, ((h / l) / sqrt((l / h))), t_3) / h;
            	} else if (t_1 <= ((double) INFINITY)) {
            		tmp = sqrt((d / l)) * sqrt((d / h));
            	} else {
            		tmp = fma(t_0, ((h / l) * t_2), t_3) / h;
            	}
            	return tmp;
            }
            
            D_m = abs(D)
            M_m = abs(M)
            d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
            function code(d, h, l, M_m, D_m)
            	t_0 = Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(Float64(D_m * D_m) / d))
            	t_1 = 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))))
            	t_2 = sqrt(Float64(h / l))
            	t_3 = Float64(t_2 * d)
            	tmp = 0.0
            	if (t_1 <= 2e-191)
            		tmp = Float64(fma(t_0, Float64(Float64(h / l) / sqrt(Float64(l / h))), t_3) / h);
            	elseif (t_1 <= Inf)
            		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
            	else
            		tmp = Float64(fma(t_0, Float64(Float64(h / l) * t_2), t_3) / h);
            	end
            	return tmp
            end
            
            D_m = N[Abs[D], $MachinePrecision]
            M_m = N[Abs[M], $MachinePrecision]
            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
            code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * d), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-191], N[(N[(t$95$0 * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[(h / l), $MachinePrecision] * t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision] / h), $MachinePrecision]]]]]]]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            t_0 := \left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}\\
            t_1 := \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)\\
            t_2 := \sqrt{\frac{h}{\ell}}\\
            t_3 := t\_2 \cdot d\\
            \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-191}:\\
            \;\;\;\;\frac{\mathsf{fma}\left(t\_0, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, t\_3\right)}{h}\\
            
            \mathbf{elif}\;t\_1 \leq \infty:\\
            \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\mathsf{fma}\left(t\_0, \frac{h}{\ell} \cdot t\_2, t\_3\right)}{h}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e-191

              1. Initial program 78.4%

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

                \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
              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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
              5. Applied rewrites50.5%

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

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

                if 2e-191 < (*.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.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-*.f6444.4

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

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

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

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

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

                      \[\leadsto \frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{D \cdot D}{d}, \frac{h}{\ell} \cdot \sqrt{\frac{h}{\ell}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h} \]
                  7. Recombined 3 regimes into one program.
                  8. Final simplification63.5%

                    \[\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 2 \cdot 10^{-191}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{D \cdot D}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{elif}\;\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:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{D \cdot D}{d}, \frac{h}{\ell} \cdot \sqrt{\frac{h}{\ell}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 4: 81.6% accurate, 1.2× speedup?

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

                    1. Initial program 63.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 rewrites76.4%

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

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

                    if -4.999999999999985e-310 < l < 2.89999999999999993e-134

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 2.89999999999999993e-134 < l

                    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 5: 82.4% accurate, 1.2× speedup?

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

                    1. Initial program 70.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. Applied rewrites81.4%

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

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

                    if -3.79999999999999977e-215 < d < 6.0000000000000003e-210

                    1. Initial program 39.5%

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

                      \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                    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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                    5. Applied rewrites58.8%

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

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

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

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

                            \[\leadsto \frac{\left(\frac{M}{d} \cdot M\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right)}{h} \]

                          if 6.0000000000000003e-210 < d

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \mathsf{fma}\left(\frac{D}{2} \cdot \frac{M}{d}, \frac{\left(\frac{M}{d} \cdot D\right) \cdot \color{blue}{\left(\frac{-1}{2} \cdot h\right)}}{2 \cdot \ell}, 1\right) \]
                            14. lower-*.f6474.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 \mathsf{fma}\left(\frac{D}{2} \cdot \frac{M}{d}, \frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(-0.5 \cdot h\right)}{\color{blue}{2 \cdot \ell}}, 1\right) \]
                          7. Applied rewrites74.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 \mathsf{fma}\left(\frac{D}{2} \cdot \frac{M}{d}, \color{blue}{\frac{\left(\frac{M}{d} \cdot D\right) \cdot \left(-0.5 \cdot h\right)}{2 \cdot \ell}}, 1\right) \]
                          8. Step-by-step derivation
                            1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 6: 77.6% 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}\\ t_1 := \mathsf{fma}\left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25, \frac{h}{\ell} \cdot -0.5, 1\right)\\ t_2 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot t\_2\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.02 \cdot 10^{-241}:\\ \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\ \mathbf{elif}\;d \leq 5.3 \cdot 10^{-104}:\\ \;\;\;\;t\_1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{elif}\;d \leq 6.6 \cdot 10^{+146}:\\ \;\;\;\;\left(t\_1 \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_2\\ \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 (* D_m (/ M_m d)))
                                (t_1 (fma (* (pow (* (/ M_m d) D_m) 2.0) 0.25) (* (/ h l) -0.5) 1.0))
                                (t_2 (sqrt (/ d l))))
                           (if (<= d -3.8e-215)
                             (/
                              (*
                               (* (fma (/ (* 0.5 t_0) 2.0) (/ (* (* t_0 h) -0.5) l) 1.0) t_2)
                               (sqrt (- d)))
                              (sqrt (- h)))
                             (if (<= d 1.02e-241)
                               (/ (* (* (/ M_m d) M_m) (* (pow (/ h l) 1.5) (* (* D_m D_m) -0.125))) h)
                               (if (<= d 5.3e-104)
                                 (* t_1 (/ d (sqrt (* l h))))
                                 (if (<= d 6.6e+146)
                                   (* (* t_1 (sqrt (/ d h))) t_2)
                                   (/ 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 = D_m * (M_m / d);
                        	double t_1 = fma((pow(((M_m / d) * D_m), 2.0) * 0.25), ((h / l) * -0.5), 1.0);
                        	double t_2 = sqrt((d / l));
                        	double tmp;
                        	if (d <= -3.8e-215) {
                        		tmp = ((fma(((0.5 * t_0) / 2.0), (((t_0 * h) * -0.5) / l), 1.0) * t_2) * sqrt(-d)) / sqrt(-h);
                        	} else if (d <= 1.02e-241) {
                        		tmp = (((M_m / d) * M_m) * (pow((h / l), 1.5) * ((D_m * D_m) * -0.125))) / h;
                        	} else if (d <= 5.3e-104) {
                        		tmp = t_1 * (d / sqrt((l * h)));
                        	} else if (d <= 6.6e+146) {
                        		tmp = (t_1 * sqrt((d / h))) * t_2;
                        	} 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(D_m * Float64(M_m / d))
                        	t_1 = fma(Float64((Float64(Float64(M_m / d) * D_m) ^ 2.0) * 0.25), Float64(Float64(h / l) * -0.5), 1.0)
                        	t_2 = sqrt(Float64(d / l))
                        	tmp = 0.0
                        	if (d <= -3.8e-215)
                        		tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 * t_0) / 2.0), Float64(Float64(Float64(t_0 * h) * -0.5) / l), 1.0) * t_2) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                        	elseif (d <= 1.02e-241)
                        		tmp = Float64(Float64(Float64(Float64(M_m / d) * M_m) * Float64((Float64(h / l) ^ 1.5) * Float64(Float64(D_m * D_m) * -0.125))) / h);
                        	elseif (d <= 5.3e-104)
                        		tmp = Float64(t_1 * Float64(d / sqrt(Float64(l * h))));
                        	elseif (d <= 6.6e+146)
                        		tmp = Float64(Float64(t_1 * sqrt(Float64(d / h))) * t_2);
                        	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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -3.8e-215], N[(N[(N[(N[(N[(N[(0.5 * t$95$0), $MachinePrecision] / 2.0), $MachinePrecision] * N[(N[(N[(t$95$0 * h), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.02e-241], N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] * N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 5.3e-104], N[(t$95$1 * N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.6e+146], N[(N[(t$95$1 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $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 := D\_m \cdot \frac{M\_m}{d}\\
                        t_1 := \mathsf{fma}\left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25, \frac{h}{\ell} \cdot -0.5, 1\right)\\
                        t_2 := \sqrt{\frac{d}{\ell}}\\
                        \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\
                        \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot t\_2\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                        
                        \mathbf{elif}\;d \leq 1.02 \cdot 10^{-241}:\\
                        \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\
                        
                        \mathbf{elif}\;d \leq 5.3 \cdot 10^{-104}:\\
                        \;\;\;\;t\_1 \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
                        
                        \mathbf{elif}\;d \leq 6.6 \cdot 10^{+146}:\\
                        \;\;\;\;\left(t\_1 \cdot \sqrt{\frac{d}{h}}\right) \cdot t\_2\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 5 regimes
                        2. if d < -3.79999999999999977e-215

                          1. Initial program 70.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. Applied rewrites81.4%

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

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

                          if -3.79999999999999977e-215 < d < 1.01999999999999994e-241

                          1. Initial program 40.2%

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

                            \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                          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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                          5. Applied rewrites59.0%

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

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

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

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

                                  \[\leadsto \frac{\left(\frac{M}{d} \cdot M\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right)}{h} \]

                                if 1.01999999999999994e-241 < d < 5.30000000000000018e-104

                                1. Initial program 49.3%

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

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

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

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

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

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

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

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

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

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

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

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

                                if 5.30000000000000018e-104 < d < 6.60000000000000032e146

                                1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left({\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2} \cdot h\right) \cdot 0.5}{\ell}}\right) \]
                                5. Applied rewrites86.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{D}{2} \cdot \frac{M}{d}, \left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), 1\right)} \]
                                6. Applied rewrites80.1%

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

                                if 6.60000000000000032e146 < d

                                1. Initial program 68.9%

                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                2. Add Preprocessing
                                3. 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-*.f6479.7

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

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

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

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

                                  Alternative 7: 80.1% 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}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot t\_1\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 6 \cdot 10^{-210}:\\ \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d} \cdot \left(\mathsf{fma}\left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot t\_1\right)}{\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 (* D_m (/ M_m d))) (t_1 (sqrt (/ d l))))
                                     (if (<= d -3.8e-215)
                                       (/
                                        (*
                                         (* (fma (/ (* 0.5 t_0) 2.0) (/ (* (* t_0 h) -0.5) l) 1.0) t_1)
                                         (sqrt (- d)))
                                        (sqrt (- h)))
                                       (if (<= d 6e-210)
                                         (/ (* (* (/ M_m d) M_m) (* (pow (/ h l) 1.5) (* (* D_m D_m) -0.125))) h)
                                         (/
                                          (*
                                           (sqrt d)
                                           (*
                                            (fma (* (pow (* (/ M_m d) D_m) 2.0) 0.25) (* (/ h l) -0.5) 1.0)
                                            t_1))
                                          (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 = D_m * (M_m / d);
                                  	double t_1 = sqrt((d / l));
                                  	double tmp;
                                  	if (d <= -3.8e-215) {
                                  		tmp = ((fma(((0.5 * t_0) / 2.0), (((t_0 * h) * -0.5) / l), 1.0) * t_1) * sqrt(-d)) / sqrt(-h);
                                  	} else if (d <= 6e-210) {
                                  		tmp = (((M_m / d) * M_m) * (pow((h / l), 1.5) * ((D_m * D_m) * -0.125))) / h;
                                  	} else {
                                  		tmp = (sqrt(d) * (fma((pow(((M_m / d) * D_m), 2.0) * 0.25), ((h / l) * -0.5), 1.0) * t_1)) / 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(D_m * Float64(M_m / d))
                                  	t_1 = sqrt(Float64(d / l))
                                  	tmp = 0.0
                                  	if (d <= -3.8e-215)
                                  		tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 * t_0) / 2.0), Float64(Float64(Float64(t_0 * h) * -0.5) / l), 1.0) * t_1) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                  	elseif (d <= 6e-210)
                                  		tmp = Float64(Float64(Float64(Float64(M_m / d) * M_m) * Float64((Float64(h / l) ^ 1.5) * Float64(Float64(D_m * D_m) * -0.125))) / h);
                                  	else
                                  		tmp = Float64(Float64(sqrt(d) * Float64(fma(Float64((Float64(Float64(M_m / d) * D_m) ^ 2.0) * 0.25), Float64(Float64(h / l) * -0.5), 1.0) * t_1)) / 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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -3.8e-215], N[(N[(N[(N[(N[(N[(0.5 * t$95$0), $MachinePrecision] / 2.0), $MachinePrecision] * N[(N[(N[(t$95$0 * h), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6e-210], N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] * N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] * N[(N[(N[(N[Power[N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 0.25), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]]]]]
                                  
                                  \begin{array}{l}
                                  D_m = \left|D\right|
                                  \\
                                  M_m = \left|M\right|
                                  \\
                                  [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                  \\
                                  \begin{array}{l}
                                  t_0 := D\_m \cdot \frac{M\_m}{d}\\
                                  t_1 := \sqrt{\frac{d}{\ell}}\\
                                  \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\
                                  \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot t\_1\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                  
                                  \mathbf{elif}\;d \leq 6 \cdot 10^{-210}:\\
                                  \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{\sqrt{d} \cdot \left(\mathsf{fma}\left({\left(\frac{M\_m}{d} \cdot D\_m\right)}^{2} \cdot 0.25, \frac{h}{\ell} \cdot -0.5, 1\right) \cdot t\_1\right)}{\sqrt{h}}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if d < -3.79999999999999977e-215

                                    1. Initial program 70.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. Applied rewrites81.4%

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

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

                                    if -3.79999999999999977e-215 < d < 6.0000000000000003e-210

                                    1. Initial program 39.5%

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

                                      \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                    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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                    5. Applied rewrites58.8%

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

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

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

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

                                            \[\leadsto \frac{\left(\frac{M}{d} \cdot M\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right)}{h} \]

                                          if 6.0000000000000003e-210 < d

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 8: 79.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} t_0 := D\_m \cdot \frac{M\_m}{d}\\ \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 3.9 \cdot 10^{-224}:\\ \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\ \mathbf{elif}\;d \leq 8.8 \cdot 10^{+126}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}} \cdot \mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, 0.25 \cdot {\left(\frac{\frac{d}{D\_m}}{M\_m}\right)}^{-2}, 1\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 (* D_m (/ M_m d))))
                                           (if (<= d -3.8e-215)
                                             (/
                                              (*
                                               (*
                                                (fma (/ (* 0.5 t_0) 2.0) (/ (* (* t_0 h) -0.5) l) 1.0)
                                                (sqrt (/ d l)))
                                               (sqrt (- d)))
                                              (sqrt (- h)))
                                             (if (<= d 3.9e-224)
                                               (/ (* (* (/ M_m d) M_m) (* (pow (/ h l) 1.5) (* (* D_m D_m) -0.125))) h)
                                               (if (<= d 8.8e+126)
                                                 (/
                                                  (*
                                                   (/ d (sqrt h))
                                                   (fma (* -0.5 (/ h l)) (* 0.25 (pow (/ (/ d D_m) M_m) -2.0)) 1.0))
                                                  (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 = D_m * (M_m / d);
                                        	double tmp;
                                        	if (d <= -3.8e-215) {
                                        		tmp = ((fma(((0.5 * t_0) / 2.0), (((t_0 * h) * -0.5) / l), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
                                        	} else if (d <= 3.9e-224) {
                                        		tmp = (((M_m / d) * M_m) * (pow((h / l), 1.5) * ((D_m * D_m) * -0.125))) / h;
                                        	} else if (d <= 8.8e+126) {
                                        		tmp = ((d / sqrt(h)) * fma((-0.5 * (h / l)), (0.25 * pow(((d / D_m) / M_m), -2.0)), 1.0)) / 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(D_m * Float64(M_m / d))
                                        	tmp = 0.0
                                        	if (d <= -3.8e-215)
                                        		tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 * t_0) / 2.0), Float64(Float64(Float64(t_0 * h) * -0.5) / l), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                        	elseif (d <= 3.9e-224)
                                        		tmp = Float64(Float64(Float64(Float64(M_m / d) * M_m) * Float64((Float64(h / l) ^ 1.5) * Float64(Float64(D_m * D_m) * -0.125))) / h);
                                        	elseif (d <= 8.8e+126)
                                        		tmp = Float64(Float64(Float64(d / sqrt(h)) * fma(Float64(-0.5 * Float64(h / l)), Float64(0.25 * (Float64(Float64(d / D_m) / M_m) ^ -2.0)), 1.0)) / 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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.8e-215], N[(N[(N[(N[(N[(N[(0.5 * t$95$0), $MachinePrecision] / 2.0), $MachinePrecision] * N[(N[(N[(t$95$0 * h), $MachinePrecision] * -0.5), $MachinePrecision] / l), $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, 3.9e-224], N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] * N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 8.8e+126], N[(N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(N[(-0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * N[(0.25 * N[Power[N[(N[(d / D$95$m), $MachinePrecision] / M$95$m), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $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 := D\_m \cdot \frac{M\_m}{d}\\
                                        \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\
                                        \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                        
                                        \mathbf{elif}\;d \leq 3.9 \cdot 10^{-224}:\\
                                        \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\
                                        
                                        \mathbf{elif}\;d \leq 8.8 \cdot 10^{+126}:\\
                                        \;\;\;\;\frac{\frac{d}{\sqrt{h}} \cdot \mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, 0.25 \cdot {\left(\frac{\frac{d}{D\_m}}{M\_m}\right)}^{-2}, 1\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 < -3.79999999999999977e-215

                                          1. Initial program 70.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. Applied rewrites81.4%

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

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

                                          if -3.79999999999999977e-215 < d < 3.8999999999999998e-224

                                          1. Initial program 39.7%

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

                                            \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                          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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                          5. Applied rewrites58.2%

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

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

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

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

                                                  \[\leadsto \frac{\left(\frac{M}{d} \cdot M\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right)}{h} \]

                                                if 3.8999999999999998e-224 < d < 8.79999999999999994e126

                                                1. Initial program 72.9%

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

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

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

                                                if 8.79999999999999994e126 < d

                                                1. Initial program 68.6%

                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                2. Add Preprocessing
                                                3. 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-*.f6478.6

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

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

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

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

                                                  Alternative 9: 75.8% accurate, 2.1× speedup?

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

                                                    1. Initial program 70.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. Applied rewrites81.4%

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

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

                                                    if -3.79999999999999977e-215 < d < 1.01999999999999994e-241

                                                    1. Initial program 40.2%

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

                                                      \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                    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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                    5. Applied rewrites59.0%

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

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

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

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

                                                            \[\leadsto \frac{\left(\frac{M}{d} \cdot M\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right)}{h} \]

                                                          if 1.01999999999999994e-241 < d < 1.0200000000000001e122

                                                          1. Initial program 70.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. Step-by-step derivation
                                                            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                          if 1.0200000000000001e122 < d

                                                          1. Initial program 69.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-*.f6479.2

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

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

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

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

                                                            Alternative 10: 74.2% accurate, 2.4× speedup?

                                                            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := D\_m \cdot \frac{M\_m}{d}\\ t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\ t_2 := D\_m \cdot \frac{0.5}{d}\\ \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.32 \cdot 10^{-207}:\\ \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_2\right), t\_2 \cdot M\_m, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                            D_m = (fabs.f64 D)
                                                            M_m = (fabs.f64 M)
                                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                            (FPCore (d h l M_m D_m)
                                                             :precision binary64
                                                             (let* ((t_0 (* D_m (/ M_m d)))
                                                                    (t_1 (/ d (sqrt (* l h))))
                                                                    (t_2 (* D_m (/ 0.5 d))))
                                                               (if (<= d -3.8e-215)
                                                                 (/
                                                                  (*
                                                                   (*
                                                                    (fma (/ (* 0.5 t_0) 2.0) (/ (* (* t_0 h) -0.5) l) 1.0)
                                                                    (sqrt (/ d l)))
                                                                   (sqrt (- d)))
                                                                  (sqrt (- h)))
                                                                 (if (<= d 1.32e-207)
                                                                   (/ (* (* (/ M_m d) M_m) (* (pow (/ h l) 1.5) (* (* D_m D_m) -0.125))) h)
                                                                   (if (<= d 1.6e+115)
                                                                     (fma (* t_1 (* (* (* (/ h l) -0.5) M_m) t_2)) (* t_2 M_m) t_1)
                                                                     (/ 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 = D_m * (M_m / d);
                                                            	double t_1 = d / sqrt((l * h));
                                                            	double t_2 = D_m * (0.5 / d);
                                                            	double tmp;
                                                            	if (d <= -3.8e-215) {
                                                            		tmp = ((fma(((0.5 * t_0) / 2.0), (((t_0 * h) * -0.5) / l), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
                                                            	} else if (d <= 1.32e-207) {
                                                            		tmp = (((M_m / d) * M_m) * (pow((h / l), 1.5) * ((D_m * D_m) * -0.125))) / h;
                                                            	} else if (d <= 1.6e+115) {
                                                            		tmp = fma((t_1 * ((((h / l) * -0.5) * M_m) * t_2)), (t_2 * M_m), t_1);
                                                            	} 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(D_m * Float64(M_m / d))
                                                            	t_1 = Float64(d / sqrt(Float64(l * h)))
                                                            	t_2 = Float64(D_m * Float64(0.5 / d))
                                                            	tmp = 0.0
                                                            	if (d <= -3.8e-215)
                                                            		tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 * t_0) / 2.0), Float64(Float64(Float64(t_0 * h) * -0.5) / l), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                                            	elseif (d <= 1.32e-207)
                                                            		tmp = Float64(Float64(Float64(Float64(M_m / d) * M_m) * Float64((Float64(h / l) ^ 1.5) * Float64(Float64(D_m * D_m) * -0.125))) / h);
                                                            	elseif (d <= 1.6e+115)
                                                            		tmp = fma(Float64(t_1 * Float64(Float64(Float64(Float64(h / l) * -0.5) * M_m) * t_2)), Float64(t_2 * M_m), t_1);
                                                            	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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.8e-215], N[(N[(N[(N[(N[(N[(0.5 * t$95$0), $MachinePrecision] / 2.0), $MachinePrecision] * N[(N[(N[(t$95$0 * h), $MachinePrecision] * -0.5), $MachinePrecision] / l), $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, 1.32e-207], N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] * N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 1.6e+115], N[(N[(t$95$1 * N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * M$95$m), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * M$95$m), $MachinePrecision] + t$95$1), $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 := D\_m \cdot \frac{M\_m}{d}\\
                                                            t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\
                                                            t_2 := D\_m \cdot \frac{0.5}{d}\\
                                                            \mathbf{if}\;d \leq -3.8 \cdot 10^{-215}:\\
                                                            \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                                            
                                                            \mathbf{elif}\;d \leq 1.32 \cdot 10^{-207}:\\
                                                            \;\;\;\;\frac{\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D\_m \cdot D\_m\right) \cdot -0.125\right)\right)}{h}\\
                                                            
                                                            \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\
                                                            \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_2\right), t\_2 \cdot M\_m, t\_1\right)\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 4 regimes
                                                            2. if d < -3.79999999999999977e-215

                                                              1. Initial program 70.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. Applied rewrites81.4%

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

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

                                                              if -3.79999999999999977e-215 < d < 1.32000000000000003e-207

                                                              1. Initial program 40.7%

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

                                                                \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                              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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                              5. Applied rewrites57.6%

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

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

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

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

                                                                      \[\leadsto \frac{\left(\frac{M}{d} \cdot M\right) \cdot \left({\left(\frac{h}{\ell}\right)}^{1.5} \cdot \left(\left(D \cdot D\right) \cdot -0.125\right)\right)}{h} \]

                                                                    if 1.32000000000000003e-207 < d < 1.6e115

                                                                    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left({\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2} \cdot h\right) \cdot 0.5}{\ell}}\right) \]
                                                                    5. Applied rewrites75.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{D}{2} \cdot \frac{M}{d}, \left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), 1\right)} \]
                                                                    6. Applied rewrites70.0%

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

                                                                    if 1.6e115 < d

                                                                    1. Initial program 69.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-*.f6479.2

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

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

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

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

                                                                      Alternative 11: 74.5% accurate, 2.4× speedup?

                                                                      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := D\_m \cdot \frac{M\_m}{d}\\ t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\ t_2 := D\_m \cdot \frac{0.5}{d}\\ \mathbf{if}\;d \leq -5.7 \cdot 10^{-214}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.32 \cdot 10^{-207}:\\ \;\;\;\;\frac{D\_m \cdot \left(D\_m \cdot \left(\left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right) \cdot \left(\frac{M\_m}{d} \cdot M\_m\right)\right)\right)}{h}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_2\right), t\_2 \cdot M\_m, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                      D_m = (fabs.f64 D)
                                                                      M_m = (fabs.f64 M)
                                                                      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                      (FPCore (d h l M_m D_m)
                                                                       :precision binary64
                                                                       (let* ((t_0 (* D_m (/ M_m d)))
                                                                              (t_1 (/ d (sqrt (* l h))))
                                                                              (t_2 (* D_m (/ 0.5 d))))
                                                                         (if (<= d -5.7e-214)
                                                                           (/
                                                                            (*
                                                                             (*
                                                                              (fma (/ (* 0.5 t_0) 2.0) (/ (* (* t_0 h) -0.5) l) 1.0)
                                                                              (sqrt (/ d l)))
                                                                             (sqrt (- d)))
                                                                            (sqrt (- h)))
                                                                           (if (<= d 1.32e-207)
                                                                             (/ (* D_m (* D_m (* (* -0.125 (pow (/ h l) 1.5)) (* (/ M_m d) M_m)))) h)
                                                                             (if (<= d 1.6e+115)
                                                                               (fma (* t_1 (* (* (* (/ h l) -0.5) M_m) t_2)) (* t_2 M_m) t_1)
                                                                               (/ 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 = D_m * (M_m / d);
                                                                      	double t_1 = d / sqrt((l * h));
                                                                      	double t_2 = D_m * (0.5 / d);
                                                                      	double tmp;
                                                                      	if (d <= -5.7e-214) {
                                                                      		tmp = ((fma(((0.5 * t_0) / 2.0), (((t_0 * h) * -0.5) / l), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
                                                                      	} else if (d <= 1.32e-207) {
                                                                      		tmp = (D_m * (D_m * ((-0.125 * pow((h / l), 1.5)) * ((M_m / d) * M_m)))) / h;
                                                                      	} else if (d <= 1.6e+115) {
                                                                      		tmp = fma((t_1 * ((((h / l) * -0.5) * M_m) * t_2)), (t_2 * M_m), t_1);
                                                                      	} 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(D_m * Float64(M_m / d))
                                                                      	t_1 = Float64(d / sqrt(Float64(l * h)))
                                                                      	t_2 = Float64(D_m * Float64(0.5 / d))
                                                                      	tmp = 0.0
                                                                      	if (d <= -5.7e-214)
                                                                      		tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 * t_0) / 2.0), Float64(Float64(Float64(t_0 * h) * -0.5) / l), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                                                      	elseif (d <= 1.32e-207)
                                                                      		tmp = Float64(Float64(D_m * Float64(D_m * Float64(Float64(-0.125 * (Float64(h / l) ^ 1.5)) * Float64(Float64(M_m / d) * M_m)))) / h);
                                                                      	elseif (d <= 1.6e+115)
                                                                      		tmp = fma(Float64(t_1 * Float64(Float64(Float64(Float64(h / l) * -0.5) * M_m) * t_2)), Float64(t_2 * M_m), t_1);
                                                                      	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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5.7e-214], N[(N[(N[(N[(N[(N[(0.5 * t$95$0), $MachinePrecision] / 2.0), $MachinePrecision] * N[(N[(N[(t$95$0 * h), $MachinePrecision] * -0.5), $MachinePrecision] / l), $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, 1.32e-207], N[(N[(D$95$m * N[(D$95$m * N[(N[(-0.125 * N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 1.6e+115], N[(N[(t$95$1 * N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * M$95$m), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * M$95$m), $MachinePrecision] + t$95$1), $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 := D\_m \cdot \frac{M\_m}{d}\\
                                                                      t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\
                                                                      t_2 := D\_m \cdot \frac{0.5}{d}\\
                                                                      \mathbf{if}\;d \leq -5.7 \cdot 10^{-214}:\\
                                                                      \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                                                      
                                                                      \mathbf{elif}\;d \leq 1.32 \cdot 10^{-207}:\\
                                                                      \;\;\;\;\frac{D\_m \cdot \left(D\_m \cdot \left(\left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right) \cdot \left(\frac{M\_m}{d} \cdot M\_m\right)\right)\right)}{h}\\
                                                                      
                                                                      \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\
                                                                      \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_2\right), t\_2 \cdot M\_m, t\_1\right)\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 4 regimes
                                                                      2. if d < -5.6999999999999996e-214

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

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

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

                                                                        if -5.6999999999999996e-214 < d < 1.32000000000000003e-207

                                                                        1. Initial program 39.2%

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

                                                                          \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                        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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                        5. Applied rewrites55.5%

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

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

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

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

                                                                                \[\leadsto \frac{D \cdot \left(D \cdot \left(\left(-0.125 \cdot {\left(\frac{h}{\ell}\right)}^{1.5}\right) \cdot \left(\frac{M}{d} \cdot M\right)\right)\right)}{h} \]

                                                                              if 1.32000000000000003e-207 < d < 1.6e115

                                                                              1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \color{blue}{\frac{\left({\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2} \cdot h\right) \cdot 0.5}{\ell}}\right) \]
                                                                              5. Applied rewrites75.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{D}{2} \cdot \frac{M}{d}, \left(\frac{D}{2} \cdot \frac{M}{d}\right) \cdot \left(-0.5 \cdot \frac{h}{\ell}\right), 1\right)} \]
                                                                              6. Applied rewrites70.0%

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

                                                                              if 1.6e115 < d

                                                                              1. Initial program 69.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-*.f6479.2

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

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

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

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

                                                                                Alternative 12: 63.2% accurate, 2.7× speedup?

                                                                                \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := D\_m \cdot \frac{0.5}{d}\\ t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;d \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;d \leq -1.5 \cdot 10^{-186}:\\ \;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(-0.125 \cdot \left(D\_m \cdot D\_m\right), h \cdot \frac{M\_m \cdot M\_m}{\ell}, d \cdot d\right)}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_0\right), t\_0 \cdot M\_m, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                D_m = (fabs.f64 D)
                                                                                M_m = (fabs.f64 M)
                                                                                NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                (FPCore (d h l M_m D_m)
                                                                                 :precision binary64
                                                                                 (let* ((t_0 (* D_m (/ 0.5 d))) (t_1 (/ d (sqrt (* l h)))))
                                                                                   (if (<= d -1.32e+154)
                                                                                     (* (- d) (sqrt (pow (* l h) -1.0)))
                                                                                     (if (<= d -1.5e-186)
                                                                                       (/
                                                                                        (*
                                                                                         (*
                                                                                          (/
                                                                                           (fma (* -0.125 (* D_m D_m)) (* h (/ (* M_m M_m) l)) (* d d))
                                                                                           (* d d))
                                                                                          (sqrt (/ d l)))
                                                                                         (sqrt (- d)))
                                                                                        (sqrt (- h)))
                                                                                       (if (<= d 1.1e-206)
                                                                                         (/
                                                                                          (fma
                                                                                           (* (* (* M_m M_m) -0.125) (/ (* D_m D_m) d))
                                                                                           (/ (/ h l) (sqrt (/ l h)))
                                                                                           (* (sqrt (/ h l)) d))
                                                                                          h)
                                                                                         (if (<= d 1.6e+115)
                                                                                           (fma (* t_1 (* (* (* (/ h l) -0.5) M_m) t_0)) (* t_0 M_m) t_1)
                                                                                           (/ 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 = D_m * (0.5 / d);
                                                                                	double t_1 = d / sqrt((l * h));
                                                                                	double tmp;
                                                                                	if (d <= -1.32e+154) {
                                                                                		tmp = -d * sqrt(pow((l * h), -1.0));
                                                                                	} else if (d <= -1.5e-186) {
                                                                                		tmp = (((fma((-0.125 * (D_m * D_m)), (h * ((M_m * M_m) / l)), (d * d)) / (d * d)) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
                                                                                	} else if (d <= 1.1e-206) {
                                                                                		tmp = fma((((M_m * M_m) * -0.125) * ((D_m * D_m) / d)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * d)) / h;
                                                                                	} else if (d <= 1.6e+115) {
                                                                                		tmp = fma((t_1 * ((((h / l) * -0.5) * M_m) * t_0)), (t_0 * M_m), t_1);
                                                                                	} 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(D_m * Float64(0.5 / d))
                                                                                	t_1 = Float64(d / sqrt(Float64(l * h)))
                                                                                	tmp = 0.0
                                                                                	if (d <= -1.32e+154)
                                                                                		tmp = Float64(Float64(-d) * sqrt((Float64(l * h) ^ -1.0)));
                                                                                	elseif (d <= -1.5e-186)
                                                                                		tmp = Float64(Float64(Float64(Float64(fma(Float64(-0.125 * Float64(D_m * D_m)), Float64(h * Float64(Float64(M_m * M_m) / l)), Float64(d * d)) / Float64(d * d)) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                                                                	elseif (d <= 1.1e-206)
                                                                                		tmp = Float64(fma(Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(Float64(D_m * D_m) / d)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * d)) / h);
                                                                                	elseif (d <= 1.6e+115)
                                                                                		tmp = fma(Float64(t_1 * Float64(Float64(Float64(Float64(h / l) * -0.5) * M_m) * t_0)), Float64(t_0 * M_m), t_1);
                                                                                	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[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1.32e+154], N[((-d) * N[Sqrt[N[Power[N[(l * h), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1.5e-186], N[(N[(N[(N[(N[(N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] * N[(h * N[(N[(M$95$m * M$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.1e-206], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 1.6e+115], N[(N[(t$95$1 * N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * M$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * M$95$m), $MachinePrecision] + t$95$1), $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 := D\_m \cdot \frac{0.5}{d}\\
                                                                                t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\
                                                                                \mathbf{if}\;d \leq -1.32 \cdot 10^{+154}:\\
                                                                                \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\
                                                                                
                                                                                \mathbf{elif}\;d \leq -1.5 \cdot 10^{-186}:\\
                                                                                \;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(-0.125 \cdot \left(D\_m \cdot D\_m\right), h \cdot \frac{M\_m \cdot M\_m}{\ell}, d \cdot d\right)}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                                                                
                                                                                \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\
                                                                                \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
                                                                                
                                                                                \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\
                                                                                \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_0\right), t\_0 \cdot M\_m, t\_1\right)\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 5 regimes
                                                                                2. if d < -1.31999999999999998e154

                                                                                  1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                  if -1.31999999999999998e154 < d < -1.5000000000000001e-186

                                                                                  1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                  if -1.5000000000000001e-186 < d < 1.0999999999999999e-206

                                                                                  1. Initial program 39.8%

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

                                                                                    \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                  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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                  5. Applied rewrites52.5%

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

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

                                                                                    if 1.0999999999999999e-206 < d < 1.6e115

                                                                                    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                    if 1.6e115 < d

                                                                                    1. Initial program 69.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-*.f6479.2

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

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

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

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

                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;d \leq -1.5 \cdot 10^{-186}:\\ \;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(-0.125 \cdot \left(D \cdot D\right), h \cdot \frac{M \cdot M}{\ell}, d \cdot d\right)}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{D \cdot D}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\right) \cdot \left(D \cdot \frac{0.5}{d}\right)\right), \left(D \cdot \frac{0.5}{d}\right) \cdot M, \frac{d}{\sqrt{\ell \cdot h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                                                      5. Add Preprocessing

                                                                                      Alternative 13: 63.1% accurate, 2.7× speedup?

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

                                                                                        1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                        if -1.31999999999999998e154 < d < -1.5000000000000001e-186

                                                                                        1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                        if -1.5000000000000001e-186 < d < 1.0999999999999999e-206

                                                                                        1. Initial program 39.8%

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

                                                                                          \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                        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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                        5. Applied rewrites52.5%

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

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

                                                                                          if 1.0999999999999999e-206 < d < 1.6e115

                                                                                          1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                          if 1.6e115 < d

                                                                                          1. Initial program 69.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-*.f6479.2

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

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

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

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

                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{{\left(\ell \cdot h\right)}^{-1}}\\ \mathbf{elif}\;d \leq -1.5 \cdot 10^{-186}:\\ \;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(-0.125 \cdot \left(D \cdot D\right), h \cdot \frac{M \cdot M}{\ell}, d \cdot d\right)}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M \cdot M\right) \cdot -0.125\right) \cdot \frac{D \cdot D}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(\frac{d}{\sqrt{\ell \cdot h}} \cdot \left(\left(D \cdot \frac{0.5}{d}\right) \cdot M\right), \left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\right) \cdot \left(D \cdot \frac{0.5}{d}\right), \frac{d}{\sqrt{\ell \cdot h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                                                                            5. Add Preprocessing

                                                                                            Alternative 14: 72.4% accurate, 2.8× speedup?

                                                                                            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := D\_m \cdot \frac{M\_m}{d}\\ t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\ t_2 := D\_m \cdot \frac{0.5}{d}\\ \mathbf{if}\;d \leq -5.5 \cdot 10^{-291}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_2\right), t\_2 \cdot M\_m, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                            D_m = (fabs.f64 D)
                                                                                            M_m = (fabs.f64 M)
                                                                                            NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                            (FPCore (d h l M_m D_m)
                                                                                             :precision binary64
                                                                                             (let* ((t_0 (* D_m (/ M_m d)))
                                                                                                    (t_1 (/ d (sqrt (* l h))))
                                                                                                    (t_2 (* D_m (/ 0.5 d))))
                                                                                               (if (<= d -5.5e-291)
                                                                                                 (/
                                                                                                  (*
                                                                                                   (*
                                                                                                    (fma (/ (* 0.5 t_0) 2.0) (/ (* (* t_0 h) -0.5) l) 1.0)
                                                                                                    (sqrt (/ d l)))
                                                                                                   (sqrt (- d)))
                                                                                                  (sqrt (- h)))
                                                                                                 (if (<= d 1.1e-206)
                                                                                                   (/
                                                                                                    (fma
                                                                                                     (* (* (* M_m M_m) -0.125) (/ (* D_m D_m) d))
                                                                                                     (/ (/ h l) (sqrt (/ l h)))
                                                                                                     (* (sqrt (/ h l)) d))
                                                                                                    h)
                                                                                                   (if (<= d 1.6e+115)
                                                                                                     (fma (* t_1 (* (* (* (/ h l) -0.5) M_m) t_2)) (* t_2 M_m) t_1)
                                                                                                     (/ 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 = D_m * (M_m / d);
                                                                                            	double t_1 = d / sqrt((l * h));
                                                                                            	double t_2 = D_m * (0.5 / d);
                                                                                            	double tmp;
                                                                                            	if (d <= -5.5e-291) {
                                                                                            		tmp = ((fma(((0.5 * t_0) / 2.0), (((t_0 * h) * -0.5) / l), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
                                                                                            	} else if (d <= 1.1e-206) {
                                                                                            		tmp = fma((((M_m * M_m) * -0.125) * ((D_m * D_m) / d)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * d)) / h;
                                                                                            	} else if (d <= 1.6e+115) {
                                                                                            		tmp = fma((t_1 * ((((h / l) * -0.5) * M_m) * t_2)), (t_2 * M_m), t_1);
                                                                                            	} 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(D_m * Float64(M_m / d))
                                                                                            	t_1 = Float64(d / sqrt(Float64(l * h)))
                                                                                            	t_2 = Float64(D_m * Float64(0.5 / d))
                                                                                            	tmp = 0.0
                                                                                            	if (d <= -5.5e-291)
                                                                                            		tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 * t_0) / 2.0), Float64(Float64(Float64(t_0 * h) * -0.5) / l), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                                                                            	elseif (d <= 1.1e-206)
                                                                                            		tmp = Float64(fma(Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(Float64(D_m * D_m) / d)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * d)) / h);
                                                                                            	elseif (d <= 1.6e+115)
                                                                                            		tmp = fma(Float64(t_1 * Float64(Float64(Float64(Float64(h / l) * -0.5) * M_m) * t_2)), Float64(t_2 * M_m), t_1);
                                                                                            	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[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5.5e-291], N[(N[(N[(N[(N[(N[(0.5 * t$95$0), $MachinePrecision] / 2.0), $MachinePrecision] * N[(N[(N[(t$95$0 * h), $MachinePrecision] * -0.5), $MachinePrecision] / l), $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, 1.1e-206], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 1.6e+115], N[(N[(t$95$1 * N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * M$95$m), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * M$95$m), $MachinePrecision] + t$95$1), $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 := D\_m \cdot \frac{M\_m}{d}\\
                                                                                            t_1 := \frac{d}{\sqrt{\ell \cdot h}}\\
                                                                                            t_2 := D\_m \cdot \frac{0.5}{d}\\
                                                                                            \mathbf{if}\;d \leq -5.5 \cdot 10^{-291}:\\
                                                                                            \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{0.5 \cdot t\_0}{2}, \frac{\left(t\_0 \cdot h\right) \cdot -0.5}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                                                                            
                                                                                            \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\
                                                                                            \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
                                                                                            
                                                                                            \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\
                                                                                            \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_2\right), t\_2 \cdot M\_m, t\_1\right)\\
                                                                                            
                                                                                            \mathbf{else}:\\
                                                                                            \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                            
                                                                                            
                                                                                            \end{array}
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Split input into 4 regimes
                                                                                            2. if d < -5.5000000000000002e-291

                                                                                              1. Initial program 64.4%

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

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

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

                                                                                              if -5.5000000000000002e-291 < d < 1.0999999999999999e-206

                                                                                              1. Initial program 46.6%

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

                                                                                                \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                              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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                              5. Applied rewrites62.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{{\left(\frac{h}{\ell}\right)}^{3}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}} \]
                                                                                              6. Step-by-step derivation
                                                                                                1. Applied rewrites69.1%

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

                                                                                                if 1.0999999999999999e-206 < d < 1.6e115

                                                                                                1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                if 1.6e115 < d

                                                                                                1. Initial program 69.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-*.f6479.2

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

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

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

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

                                                                                                  Alternative 15: 72.5% accurate, 2.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{d}{\sqrt{\ell \cdot h}}\\ t_1 := D\_m \cdot \frac{0.5}{d}\\ t_2 := D\_m \cdot \frac{M\_m}{d}\\ \mathbf{if}\;d \leq -5.5 \cdot 10^{-291}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\left(t\_2 \cdot h\right) \cdot -0.5, \frac{0.5}{\ell} \cdot \left(0.5 \cdot t\_2\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\ \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_1\right), t\_1 \cdot M\_m, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                                  D_m = (fabs.f64 D)
                                                                                                  M_m = (fabs.f64 M)
                                                                                                  NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                  (FPCore (d h l M_m D_m)
                                                                                                   :precision binary64
                                                                                                   (let* ((t_0 (/ d (sqrt (* l h))))
                                                                                                          (t_1 (* D_m (/ 0.5 d)))
                                                                                                          (t_2 (* D_m (/ M_m d))))
                                                                                                     (if (<= d -5.5e-291)
                                                                                                       (/
                                                                                                        (*
                                                                                                         (*
                                                                                                          (fma (* (* t_2 h) -0.5) (* (/ 0.5 l) (* 0.5 t_2)) 1.0)
                                                                                                          (sqrt (/ d l)))
                                                                                                         (sqrt (- d)))
                                                                                                        (sqrt (- h)))
                                                                                                       (if (<= d 1.1e-206)
                                                                                                         (/
                                                                                                          (fma
                                                                                                           (* (* (* M_m M_m) -0.125) (/ (* D_m D_m) d))
                                                                                                           (/ (/ h l) (sqrt (/ l h)))
                                                                                                           (* (sqrt (/ h l)) d))
                                                                                                          h)
                                                                                                         (if (<= d 1.6e+115)
                                                                                                           (fma (* t_0 (* (* (* (/ h l) -0.5) M_m) t_1)) (* t_1 M_m) t_0)
                                                                                                           (/ d (* (sqrt l) (sqrt h))))))))
                                                                                                  D_m = fabs(D);
                                                                                                  M_m = fabs(M);
                                                                                                  assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                                  double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                  	double t_0 = d / sqrt((l * h));
                                                                                                  	double t_1 = D_m * (0.5 / d);
                                                                                                  	double t_2 = D_m * (M_m / d);
                                                                                                  	double tmp;
                                                                                                  	if (d <= -5.5e-291) {
                                                                                                  		tmp = ((fma(((t_2 * h) * -0.5), ((0.5 / l) * (0.5 * t_2)), 1.0) * sqrt((d / l))) * sqrt(-d)) / sqrt(-h);
                                                                                                  	} else if (d <= 1.1e-206) {
                                                                                                  		tmp = fma((((M_m * M_m) * -0.125) * ((D_m * D_m) / d)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * d)) / h;
                                                                                                  	} else if (d <= 1.6e+115) {
                                                                                                  		tmp = fma((t_0 * ((((h / l) * -0.5) * M_m) * t_1)), (t_1 * M_m), t_0);
                                                                                                  	} else {
                                                                                                  		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                  	}
                                                                                                  	return tmp;
                                                                                                  }
                                                                                                  
                                                                                                  D_m = abs(D)
                                                                                                  M_m = abs(M)
                                                                                                  d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                                  function code(d, h, l, M_m, D_m)
                                                                                                  	t_0 = Float64(d / sqrt(Float64(l * h)))
                                                                                                  	t_1 = Float64(D_m * Float64(0.5 / d))
                                                                                                  	t_2 = Float64(D_m * Float64(M_m / d))
                                                                                                  	tmp = 0.0
                                                                                                  	if (d <= -5.5e-291)
                                                                                                  		tmp = Float64(Float64(Float64(fma(Float64(Float64(t_2 * h) * -0.5), Float64(Float64(0.5 / l) * Float64(0.5 * t_2)), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                                                                                  	elseif (d <= 1.1e-206)
                                                                                                  		tmp = Float64(fma(Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(Float64(D_m * D_m) / d)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * d)) / h);
                                                                                                  	elseif (d <= 1.6e+115)
                                                                                                  		tmp = fma(Float64(t_0 * Float64(Float64(Float64(Float64(h / l) * -0.5) * M_m) * t_1)), Float64(t_1 * M_m), t_0);
                                                                                                  	else
                                                                                                  		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                                  	end
                                                                                                  	return tmp
                                                                                                  end
                                                                                                  
                                                                                                  D_m = N[Abs[D], $MachinePrecision]
                                                                                                  M_m = N[Abs[M], $MachinePrecision]
                                                                                                  NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                  code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -5.5e-291], N[(N[(N[(N[(N[(N[(t$95$2 * h), $MachinePrecision] * -0.5), $MachinePrecision] * N[(N[(0.5 / l), $MachinePrecision] * N[(0.5 * t$95$2), $MachinePrecision]), $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, 1.1e-206], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 1.6e+115], N[(N[(t$95$0 * N[(N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * M$95$m), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * M$95$m), $MachinePrecision] + t$95$0), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  D_m = \left|D\right|
                                                                                                  \\
                                                                                                  M_m = \left|M\right|
                                                                                                  \\
                                                                                                  [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                                  \\
                                                                                                  \begin{array}{l}
                                                                                                  t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
                                                                                                  t_1 := D\_m \cdot \frac{0.5}{d}\\
                                                                                                  t_2 := D\_m \cdot \frac{M\_m}{d}\\
                                                                                                  \mathbf{if}\;d \leq -5.5 \cdot 10^{-291}:\\
                                                                                                  \;\;\;\;\frac{\left(\mathsf{fma}\left(\left(t\_2 \cdot h\right) \cdot -0.5, \frac{0.5}{\ell} \cdot \left(0.5 \cdot t\_2\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                                                                                  
                                                                                                  \mathbf{elif}\;d \leq 1.1 \cdot 10^{-206}:\\
                                                                                                  \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
                                                                                                  
                                                                                                  \mathbf{elif}\;d \leq 1.6 \cdot 10^{+115}:\\
                                                                                                  \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \left(\left(\left(\frac{h}{\ell} \cdot -0.5\right) \cdot M\_m\right) \cdot t\_1\right), t\_1 \cdot M\_m, t\_0\right)\\
                                                                                                  
                                                                                                  \mathbf{else}:\\
                                                                                                  \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                                  
                                                                                                  
                                                                                                  \end{array}
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Split input into 4 regimes
                                                                                                  2. if d < -5.5000000000000002e-291

                                                                                                    1. Initial program 64.4%

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

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

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

                                                                                                    if -5.5000000000000002e-291 < d < 1.0999999999999999e-206

                                                                                                    1. Initial program 46.6%

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

                                                                                                      \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                    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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                    5. Applied rewrites62.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{{\left(\frac{h}{\ell}\right)}^{3}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}} \]
                                                                                                    6. Step-by-step derivation
                                                                                                      1. Applied rewrites69.1%

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

                                                                                                      if 1.0999999999999999e-206 < d < 1.6e115

                                                                                                      1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                      if 1.6e115 < d

                                                                                                      1. Initial program 69.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-*.f6479.2

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

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

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

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

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

                                                                                                          1. Initial program 64.4%

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

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

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

                                                                                                          if -5.5000000000000002e-291 < d < 1.0999999999999999e-206

                                                                                                          1. Initial program 46.6%

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

                                                                                                            \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                          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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                          5. Applied rewrites62.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{{\left(\frac{h}{\ell}\right)}^{3}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}} \]
                                                                                                          6. Step-by-step derivation
                                                                                                            1. Applied rewrites69.1%

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

                                                                                                            if 1.0999999999999999e-206 < d < 1.6e115

                                                                                                            1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                            if 1.6e115 < d

                                                                                                            1. Initial program 69.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-*.f6479.2

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

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

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

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

                                                                                                              Alternative 17: 60.0% accurate, 3.0× speedup?

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

                                                                                                                1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                if -1.31999999999999998e154 < d < -1.5000000000000001e-186

                                                                                                                1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                if -1.5000000000000001e-186 < d < 4.69999999999999991e124

                                                                                                                1. Initial program 56.7%

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

                                                                                                                  \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                                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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                                5. Applied rewrites51.0%

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

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

                                                                                                                  if 4.69999999999999991e124 < d

                                                                                                                  1. Initial program 68.6%

                                                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                  2. Add Preprocessing
                                                                                                                  3. 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-*.f6478.6

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

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

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

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

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

                                                                                                                    Alternative 18: 56.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} \mathbf{if}\;d \leq -2.7 \cdot 10^{-78}:\\ \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{h}{\ell \cdot d}, \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{M\_m \cdot M\_m}{d}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{-d}}{\sqrt{-\ell}}\\ \mathbf{elif}\;d \leq 4.7 \cdot 10^{+124}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                                                    D_m = (fabs.f64 D)
                                                                                                                    M_m = (fabs.f64 M)
                                                                                                                    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                                    (FPCore (d h l M_m D_m)
                                                                                                                     :precision binary64
                                                                                                                     (if (<= d -2.7e-78)
                                                                                                                       (/
                                                                                                                        (*
                                                                                                                         (*
                                                                                                                          (fma (/ h (* l d)) (* (* -0.125 (* D_m D_m)) (/ (* M_m M_m) d)) 1.0)
                                                                                                                          (sqrt (/ d h)))
                                                                                                                         (sqrt (- d)))
                                                                                                                        (sqrt (- l)))
                                                                                                                       (if (<= d 4.7e+124)
                                                                                                                         (/
                                                                                                                          (fma
                                                                                                                           (* (* (* M_m M_m) -0.125) (/ (* D_m D_m) d))
                                                                                                                           (/ (/ h l) (sqrt (/ l h)))
                                                                                                                           (* (sqrt (/ h l)) d))
                                                                                                                          h)
                                                                                                                         (/ d (* (sqrt l) (sqrt h))))))
                                                                                                                    D_m = fabs(D);
                                                                                                                    M_m = fabs(M);
                                                                                                                    assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                                                    double code(double d, double h, double l, double M_m, double D_m) {
                                                                                                                    	double tmp;
                                                                                                                    	if (d <= -2.7e-78) {
                                                                                                                    		tmp = ((fma((h / (l * d)), ((-0.125 * (D_m * D_m)) * ((M_m * M_m) / d)), 1.0) * sqrt((d / h))) * sqrt(-d)) / sqrt(-l);
                                                                                                                    	} else if (d <= 4.7e+124) {
                                                                                                                    		tmp = fma((((M_m * M_m) * -0.125) * ((D_m * D_m) / d)), ((h / l) / sqrt((l / h))), (sqrt((h / l)) * d)) / h;
                                                                                                                    	} else {
                                                                                                                    		tmp = d / (sqrt(l) * sqrt(h));
                                                                                                                    	}
                                                                                                                    	return tmp;
                                                                                                                    }
                                                                                                                    
                                                                                                                    D_m = abs(D)
                                                                                                                    M_m = abs(M)
                                                                                                                    d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                                                    function code(d, h, l, M_m, D_m)
                                                                                                                    	tmp = 0.0
                                                                                                                    	if (d <= -2.7e-78)
                                                                                                                    		tmp = Float64(Float64(Float64(fma(Float64(h / Float64(l * d)), Float64(Float64(-0.125 * Float64(D_m * D_m)) * Float64(Float64(M_m * M_m) / d)), 1.0) * sqrt(Float64(d / h))) * sqrt(Float64(-d))) / sqrt(Float64(-l)));
                                                                                                                    	elseif (d <= 4.7e+124)
                                                                                                                    		tmp = Float64(fma(Float64(Float64(Float64(M_m * M_m) * -0.125) * Float64(Float64(D_m * D_m) / d)), Float64(Float64(h / l) / sqrt(Float64(l / h))), Float64(sqrt(Float64(h / l)) * d)) / h);
                                                                                                                    	else
                                                                                                                    		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                                                    	end
                                                                                                                    	return tmp
                                                                                                                    end
                                                                                                                    
                                                                                                                    D_m = N[Abs[D], $MachinePrecision]
                                                                                                                    M_m = N[Abs[M], $MachinePrecision]
                                                                                                                    NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                                                    code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[d, -2.7e-78], N[(N[(N[(N[(N[(h / N[(l * d), $MachinePrecision]), $MachinePrecision] * 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] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 4.7e+124], N[(N[(N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * -0.125), $MachinePrecision] * N[(N[(D$95$m * D$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(N[(h / l), $MachinePrecision] / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $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.7 \cdot 10^{-78}:\\
                                                                                                                    \;\;\;\;\frac{\left(\mathsf{fma}\left(\frac{h}{\ell \cdot d}, \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right) \cdot \frac{M\_m \cdot M\_m}{d}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{-d}}{\sqrt{-\ell}}\\
                                                                                                                    
                                                                                                                    \mathbf{elif}\;d \leq 4.7 \cdot 10^{+124}:\\
                                                                                                                    \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(M\_m \cdot M\_m\right) \cdot -0.125\right) \cdot \frac{D\_m \cdot D\_m}{d}, \frac{\frac{h}{\ell}}{\sqrt{\frac{\ell}{h}}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\
                                                                                                                    
                                                                                                                    \mathbf{else}:\\
                                                                                                                    \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                                                    
                                                                                                                    
                                                                                                                    \end{array}
                                                                                                                    \end{array}
                                                                                                                    
                                                                                                                    Derivation
                                                                                                                    1. Split input into 3 regimes
                                                                                                                    2. if d < -2.69999999999999994e-78

                                                                                                                      1. Initial program 78.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. Applied rewrites79.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                      if -2.69999999999999994e-78 < d < 4.69999999999999991e124

                                                                                                                      1. Initial program 56.5%

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

                                                                                                                        \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                                      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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                                      5. Applied rewrites50.2%

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

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

                                                                                                                        if 4.69999999999999991e124 < d

                                                                                                                        1. Initial program 68.6%

                                                                                                                          \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. 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-*.f6478.6

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

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

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

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

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

                                                                                                                            1. Initial program 60.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 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-*.f6445.2

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

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

                                                                                                                            if -2.50000000000000017e-139 < l < 5.8000000000000003e-298

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

                                                                                                                              \[\leadsto \color{blue}{\frac{\frac{-1}{8} \cdot \left(\frac{{D}^{2} \cdot {M}^{2}}{d} \cdot \sqrt{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                                            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{\frac{{h}^{3}}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{h}{\ell}}}{h}} \]
                                                                                                                            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{{\left(\frac{h}{\ell}\right)}^{3}}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}} \]
                                                                                                                            6. Taylor expanded in l around -inf

                                                                                                                              \[\leadsto \frac{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                                                                                                                            7. Step-by-step derivation
                                                                                                                              1. Applied rewrites44.9%

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

                                                                                                                              if 5.8000000000000003e-298 < l

                                                                                                                              1. Initial program 67.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-*.f6448.6

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

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

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

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

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

                                                                                                                                Alternative 20: 46.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 7.5 \cdot 10^{-208}:\\ \;\;\;\;\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 7.5e-208)
                                                                                                                                   (* (- 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 <= 7.5e-208) {
                                                                                                                                		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 <= 7.5d-208) 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 <= 7.5e-208) {
                                                                                                                                		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 <= 7.5e-208:
                                                                                                                                		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 <= 7.5e-208)
                                                                                                                                		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 <= 7.5e-208)
                                                                                                                                		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, 7.5e-208], 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 7.5 \cdot 10^{-208}:\\
                                                                                                                                \;\;\;\;\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 < 7.4999999999999999e-208

                                                                                                                                  1. Initial program 61.0%

                                                                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                  2. Add Preprocessing
                                                                                                                                  3. Taylor expanded in 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-*.f6436.3

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

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

                                                                                                                                  if 7.4999999999999999e-208 < d

                                                                                                                                  1. Initial program 72.1%

                                                                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                  2. Add Preprocessing
                                                                                                                                  3. 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-*.f6456.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                      if -9.99999999999999946e-202 < l

                                                                                                                                      1. Initial program 68.1%

                                                                                                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                                                      2. Add Preprocessing
                                                                                                                                      3. 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.7

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

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

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

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

                                                                                                                                      Alternative 22: 26.7% 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 65.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-*.f6427.9

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

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

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

                                                                                                                                        Reproduce

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