Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.0% → 83.4%
Time: 18.1s
Alternatives: 18
Speedup: 3.5×

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 18 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.0% 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: 83.4% accurate, 1.6× speedup?

\[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)\\ t_1 := \sqrt{-d}\\ t_2 := h \cdot \frac{M\_m}{d}\\ \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{\left(\frac{t\_1}{\sqrt{-\ell}} \cdot \mathsf{fma}\left(\frac{t\_0}{-\ell}, \left(0.25 \cdot D\_m\right) \cdot t\_2, 1\right)\right) \cdot t\_1}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 1.3 \cdot 10^{-74}:\\ \;\;\;\;\left(1 - \frac{\left(\left(D\_m \cdot 0.5\right) \cdot 0.5\right) \cdot \frac{M\_m}{d}}{{h}^{-1}} \cdot \frac{\left(D\_m \cdot \frac{0.5}{d}\right) \cdot M\_m}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \mathsf{fma}\left(\frac{t\_0}{\ell}, \left(-0.25\right) \cdot \left(t\_2 \cdot D\_m\right), 1\right)\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 (/ 0.5 d))))
        (t_1 (sqrt (- d)))
        (t_2 (* h (/ M_m d))))
   (if (<= l -4e-310)
     (/
      (*
       (* (/ t_1 (sqrt (- l))) (fma (/ t_0 (- l)) (* (* 0.25 D_m) t_2) 1.0))
       t_1)
      (sqrt (- h)))
     (if (<= l 1.3e-74)
       (*
        (-
         1.0
         (*
          (/ (* (* (* D_m 0.5) 0.5) (/ M_m d)) (pow h -1.0))
          (/ (* (* D_m (/ 0.5 d)) M_m) l)))
        (* (sqrt (/ d l)) (/ (sqrt d) (sqrt h))))
       (*
        (sqrt (/ d h))
        (*
         (/ (sqrt d) (sqrt l))
         (fma (/ t_0 l) (* (- 0.25) (* t_2 D_m)) 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 * (0.5 / d));
	double t_1 = sqrt(-d);
	double t_2 = h * (M_m / d);
	double tmp;
	if (l <= -4e-310) {
		tmp = (((t_1 / sqrt(-l)) * fma((t_0 / -l), ((0.25 * D_m) * t_2), 1.0)) * t_1) / sqrt(-h);
	} else if (l <= 1.3e-74) {
		tmp = (1.0 - (((((D_m * 0.5) * 0.5) * (M_m / d)) / pow(h, -1.0)) * (((D_m * (0.5 / d)) * M_m) / l))) * (sqrt((d / l)) * (sqrt(d) / sqrt(h)));
	} else {
		tmp = sqrt((d / h)) * ((sqrt(d) / sqrt(l)) * fma((t_0 / l), (-0.25 * (t_2 * D_m)), 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 * Float64(0.5 / d)))
	t_1 = sqrt(Float64(-d))
	t_2 = Float64(h * Float64(M_m / d))
	tmp = 0.0
	if (l <= -4e-310)
		tmp = Float64(Float64(Float64(Float64(t_1 / sqrt(Float64(-l))) * fma(Float64(t_0 / Float64(-l)), Float64(Float64(0.25 * D_m) * t_2), 1.0)) * t_1) / sqrt(Float64(-h)));
	elseif (l <= 1.3e-74)
		tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(Float64(D_m * 0.5) * 0.5) * Float64(M_m / d)) / (h ^ -1.0)) * Float64(Float64(Float64(D_m * Float64(0.5 / d)) * M_m) / l))) * Float64(sqrt(Float64(d / l)) * Float64(sqrt(d) / sqrt(h))));
	else
		tmp = Float64(sqrt(Float64(d / h)) * Float64(Float64(sqrt(d) / sqrt(l)) * fma(Float64(t_0 / l), Float64(Float64(-0.25) * Float64(t_2 * D_m)), 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 * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$2 = N[(h * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4e-310], N[(N[(N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / (-l)), $MachinePrecision] * N[(N[(0.25 * D$95$m), $MachinePrecision] * t$95$2), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.3e-74], N[(N[(1.0 - N[(N[(N[(N[(N[(D$95$m * 0.5), $MachinePrecision] * 0.5), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * M$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 / l), $MachinePrecision] * N[((-0.25) * N[(t$95$2 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $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 \left(M\_m \cdot \frac{0.5}{d}\right)\\
t_1 := \sqrt{-d}\\
t_2 := h \cdot \frac{M\_m}{d}\\
\mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\left(\frac{t\_1}{\sqrt{-\ell}} \cdot \mathsf{fma}\left(\frac{t\_0}{-\ell}, \left(0.25 \cdot D\_m\right) \cdot t\_2, 1\right)\right) \cdot t\_1}{\sqrt{-h}}\\

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

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


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

    1. Initial program 67.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. Applied rewrites72.7%

      \[\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 rewrites73.6%

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < l < 1.3e-74

    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 rewrites73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e-74 < l

    1. Initial program 55.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 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}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
      3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 60.5% accurate, 0.5× speedup?

\[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+15}:\\ \;\;\;\;\left(\frac{\left(\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot h\right) \cdot \frac{-0.125 \cdot \left(D\_m \cdot D\_m\right)}{\ell}}{d} \cdot t\_1\right) \cdot t\_2\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\ \;\;\;\;t\_1 \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
         (*
          (-
           1.0
           (* (/ h l) (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
          (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))))
        (t_1 (sqrt (/ d l)))
        (t_2 (sqrt (/ d h))))
   (if (<= t_0 -2e+15)
     (*
      (* (/ (* (* (* (/ M_m d) M_m) h) (/ (* -0.125 (* D_m D_m)) l)) d) t_1)
      t_2)
     (if (<= t_0 5e+296) (* t_1 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 = (1.0 - ((h / l) * (pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
	double t_1 = sqrt((d / l));
	double t_2 = sqrt((d / h));
	double tmp;
	if (t_0 <= -2e+15) {
		tmp = ((((((M_m / d) * M_m) * h) * ((-0.125 * (D_m * D_m)) / l)) / d) * t_1) * t_2;
	} else if (t_0 <= 5e+296) {
		tmp = t_1 * t_2;
	} 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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (1.0d0 - ((h / l) * ((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))
    t_1 = sqrt((d / l))
    t_2 = sqrt((d / h))
    if (t_0 <= (-2d+15)) then
        tmp = ((((((m_m / d) * m_m) * h) * (((-0.125d0) * (d_m * d_m)) / l)) / d) * t_1) * t_2
    else if (t_0 <= 5d+296) then
        tmp = t_1 * t_2
    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 t_0 = (1.0 - ((h / l) * (Math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
	double t_1 = Math.sqrt((d / l));
	double t_2 = Math.sqrt((d / h));
	double tmp;
	if (t_0 <= -2e+15) {
		tmp = ((((((M_m / d) * M_m) * h) * ((-0.125 * (D_m * D_m)) / l)) / d) * t_1) * t_2;
	} else if (t_0 <= 5e+296) {
		tmp = t_1 * t_2;
	} 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):
	t_0 = (1.0 - ((h / l) * (math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))
	t_1 = math.sqrt((d / l))
	t_2 = math.sqrt((d / h))
	tmp = 0
	if t_0 <= -2e+15:
		tmp = ((((((M_m / d) * M_m) * h) * ((-0.125 * (D_m * D_m)) / l)) / d) * t_1) * t_2
	elif t_0 <= 5e+296:
		tmp = t_1 * t_2
	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)
	t_0 = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
	t_1 = sqrt(Float64(d / l))
	t_2 = sqrt(Float64(d / h))
	tmp = 0.0
	if (t_0 <= -2e+15)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m / d) * M_m) * h) * Float64(Float64(-0.125 * Float64(D_m * D_m)) / l)) / d) * t_1) * t_2);
	elseif (t_0 <= 5e+296)
		tmp = Float64(t_1 * t_2);
	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)
	t_0 = (1.0 - ((h / l) * ((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)));
	t_1 = sqrt((d / l));
	t_2 = sqrt((d / h));
	tmp = 0.0;
	if (t_0 <= -2e+15)
		tmp = ((((((M_m / d) * M_m) * h) * ((-0.125 * (D_m * D_m)) / l)) / d) * t_1) * t_2;
	elseif (t_0 <= 5e+296)
		tmp = t_1 * t_2;
	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_] := Block[{t$95$0 = N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -2e+15], N[(N[(N[(N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] * h), $MachinePrecision] * N[(N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$0, 5e+296], N[(t$95$1 * 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 := \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+15}:\\
\;\;\;\;\left(\frac{\left(\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot h\right) \cdot \frac{-0.125 \cdot \left(D\_m \cdot D\_m\right)}{\ell}}{d} \cdot t\_1\right) \cdot t\_2\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;t\_1 \cdot t\_2\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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)))) < -2e15

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

        \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
      3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2e15 < (*.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)))) < 5.0000000000000001e296

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

        \[\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. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
        3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\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 {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
      5. Applied rewrites89.4%

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

        \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
      7. Step-by-step derivation
        1. lower-sqrt.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
        2. lower-/.f6486.9

          \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
      8. Applied rewrites86.9%

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

      if 5.0000000000000001e296 < (*.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 12.0%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 3: 59.5% accurate, 0.5× speedup?

        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+15}:\\ \;\;\;\;\left(\frac{\left(\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot h\right) \cdot \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right)}{d \cdot \ell} \cdot t\_1\right) \cdot t\_2\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\ \;\;\;\;t\_1 \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
                 (*
                  (-
                   1.0
                   (* (/ h l) (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
                  (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))))
                (t_1 (sqrt (/ d l)))
                (t_2 (sqrt (/ d h))))
           (if (<= t_0 -2e+15)
             (*
              (* (/ (* (* (* (/ M_m d) M_m) h) (* -0.125 (* D_m D_m))) (* d l)) t_1)
              t_2)
             (if (<= t_0 5e+296) (* t_1 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 = (1.0 - ((h / l) * (pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
        	double t_1 = sqrt((d / l));
        	double t_2 = sqrt((d / h));
        	double tmp;
        	if (t_0 <= -2e+15) {
        		tmp = ((((((M_m / d) * M_m) * h) * (-0.125 * (D_m * D_m))) / (d * l)) * t_1) * t_2;
        	} else if (t_0 <= 5e+296) {
        		tmp = t_1 * t_2;
        	} 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) :: t_0
            real(8) :: t_1
            real(8) :: t_2
            real(8) :: tmp
            t_0 = (1.0d0 - ((h / l) * ((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))
            t_1 = sqrt((d / l))
            t_2 = sqrt((d / h))
            if (t_0 <= (-2d+15)) then
                tmp = ((((((m_m / d) * m_m) * h) * ((-0.125d0) * (d_m * d_m))) / (d * l)) * t_1) * t_2
            else if (t_0 <= 5d+296) then
                tmp = t_1 * t_2
            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 t_0 = (1.0 - ((h / l) * (Math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
        	double t_1 = Math.sqrt((d / l));
        	double t_2 = Math.sqrt((d / h));
        	double tmp;
        	if (t_0 <= -2e+15) {
        		tmp = ((((((M_m / d) * M_m) * h) * (-0.125 * (D_m * D_m))) / (d * l)) * t_1) * t_2;
        	} else if (t_0 <= 5e+296) {
        		tmp = t_1 * t_2;
        	} 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):
        	t_0 = (1.0 - ((h / l) * (math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))
        	t_1 = math.sqrt((d / l))
        	t_2 = math.sqrt((d / h))
        	tmp = 0
        	if t_0 <= -2e+15:
        		tmp = ((((((M_m / d) * M_m) * h) * (-0.125 * (D_m * D_m))) / (d * l)) * t_1) * t_2
        	elif t_0 <= 5e+296:
        		tmp = t_1 * t_2
        	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)
        	t_0 = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
        	t_1 = sqrt(Float64(d / l))
        	t_2 = sqrt(Float64(d / h))
        	tmp = 0.0
        	if (t_0 <= -2e+15)
        		tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(M_m / d) * M_m) * h) * Float64(-0.125 * Float64(D_m * D_m))) / Float64(d * l)) * t_1) * t_2);
        	elseif (t_0 <= 5e+296)
        		tmp = Float64(t_1 * t_2);
        	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)
        	t_0 = (1.0 - ((h / l) * ((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)));
        	t_1 = sqrt((d / l));
        	t_2 = sqrt((d / h));
        	tmp = 0.0;
        	if (t_0 <= -2e+15)
        		tmp = ((((((M_m / d) * M_m) * h) * (-0.125 * (D_m * D_m))) / (d * l)) * t_1) * t_2;
        	elseif (t_0 <= 5e+296)
        		tmp = t_1 * t_2;
        	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_] := Block[{t$95$0 = N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -2e+15], N[(N[(N[(N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * M$95$m), $MachinePrecision] * h), $MachinePrecision] * N[(-0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$0, 5e+296], N[(t$95$1 * 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 := \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
        t_1 := \sqrt{\frac{d}{\ell}}\\
        t_2 := \sqrt{\frac{d}{h}}\\
        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+15}:\\
        \;\;\;\;\left(\frac{\left(\left(\frac{M\_m}{d} \cdot M\_m\right) \cdot h\right) \cdot \left(-0.125 \cdot \left(D\_m \cdot D\_m\right)\right)}{d \cdot \ell} \cdot t\_1\right) \cdot t\_2\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
        \;\;\;\;t\_1 \cdot t\_2\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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)))) < -2e15

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

              \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
            3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -2e15 < (*.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)))) < 5.0000000000000001e296

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

              \[\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. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
              3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\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 {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
            5. Applied rewrites89.4%

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

              \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
            7. Step-by-step derivation
              1. lower-sqrt.f64N/A

                \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
              2. lower-/.f6486.9

                \[\leadsto \sqrt{\color{blue}{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
            8. Applied rewrites86.9%

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

            if 5.0000000000000001e296 < (*.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 12.0%

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 4: 48.7% accurate, 0.5× speedup?

              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+25}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|} \cdot \left(\frac{M\_m \cdot M\_m}{d} \cdot \left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{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
                       (*
                        (-
                         1.0
                         (* (/ h l) (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
                        (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))))
                 (if (<= t_0 -5e+25)
                   (*
                    (/ (sqrt (/ h l)) (fabs l))
                    (* (/ (* M_m M_m) d) (* 0.125 (* D_m D_m))))
                   (if (<= t_0 5e+296)
                     (* (sqrt (/ d l)) (sqrt (/ 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 t_0 = (1.0 - ((h / l) * (pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)));
              	double tmp;
              	if (t_0 <= -5e+25) {
              		tmp = (sqrt((h / l)) / fabs(l)) * (((M_m * M_m) / d) * (0.125 * (D_m * D_m)));
              	} else if (t_0 <= 5e+296) {
              		tmp = sqrt((d / l)) * sqrt((d / 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) :: t_0
                  real(8) :: tmp
                  t_0 = (1.0d0 - ((h / l) * ((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0)))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))
                  if (t_0 <= (-5d+25)) then
                      tmp = (sqrt((h / l)) / abs(l)) * (((m_m * m_m) / d) * (0.125d0 * (d_m * d_m)))
                  else if (t_0 <= 5d+296) then
                      tmp = sqrt((d / l)) * sqrt((d / 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 t_0 = (1.0 - ((h / l) * (Math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)));
              	double tmp;
              	if (t_0 <= -5e+25) {
              		tmp = (Math.sqrt((h / l)) / Math.abs(l)) * (((M_m * M_m) / d) * (0.125 * (D_m * D_m)));
              	} else if (t_0 <= 5e+296) {
              		tmp = Math.sqrt((d / l)) * Math.sqrt((d / 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):
              	t_0 = (1.0 - ((h / l) * (math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))
              	tmp = 0
              	if t_0 <= -5e+25:
              		tmp = (math.sqrt((h / l)) / math.fabs(l)) * (((M_m * M_m) / d) * (0.125 * (D_m * D_m)))
              	elif t_0 <= 5e+296:
              		tmp = math.sqrt((d / l)) * math.sqrt((d / 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)
              	t_0 = Float64(Float64(1.0 - Float64(Float64(h / l) * Float64((Float64(Float64(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))))
              	tmp = 0.0
              	if (t_0 <= -5e+25)
              		tmp = Float64(Float64(sqrt(Float64(h / l)) / abs(l)) * Float64(Float64(Float64(M_m * M_m) / d) * Float64(0.125 * Float64(D_m * D_m))));
              	elseif (t_0 <= 5e+296)
              		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / 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)
              	t_0 = (1.0 - ((h / l) * ((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)));
              	tmp = 0.0;
              	if (t_0 <= -5e+25)
              		tmp = (sqrt((h / l)) / abs(l)) * (((M_m * M_m) / d) * (0.125 * (D_m * D_m)));
              	elseif (t_0 <= 5e+296)
              		tmp = sqrt((d / l)) * sqrt((d / 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_] := Block[{t$95$0 = N[(N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+25], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision] * N[(0.125 * N[(D$95$m * D$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+296], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $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 := \left(1 - \frac{h}{\ell} \cdot \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
              \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+25}:\\
              \;\;\;\;\frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|} \cdot \left(\frac{M\_m \cdot M\_m}{d} \cdot \left(0.125 \cdot \left(D\_m \cdot D\_m\right)\right)\right)\\
              
              \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
              \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{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)))) < -5.00000000000000024e25

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

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

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

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

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

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

                  if -5.00000000000000024e25 < (*.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)))) < 5.0000000000000001e296

                  1. Initial program 90.7%

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

                    \[\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. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                    2. lift-*.f64N/A

                      \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                    3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{\frac{d}{h}} \]
                  7. Step-by-step derivation
                    1. lower-sqrt.f64N/A

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

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

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

                  if 5.0000000000000001e296 < (*.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 12.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      1. Initial program 67.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. Applied rewrites72.7%

                        \[\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 rewrites73.6%

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

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

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

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

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

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

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

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

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

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

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

                      if -3.999999999999988e-310 < l

                      1. Initial program 60.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}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}} \]
                      4. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                        3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 6: 78.4% accurate, 3.0× speedup?

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

                      1. Initial program 67.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. Applied rewrites72.7%

                        \[\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. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                        3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -3.999999999999988e-310 < l

                      1. Initial program 60.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}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}} \]
                      4. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                        3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 7: 78.8% accurate, 3.0× speedup?

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

                      1. Initial program 67.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. Applied rewrites68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -4.999999999999985e-310 < h

                      1. Initial program 60.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}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}} \]
                      4. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                        3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 8: 77.7% accurate, 3.1× speedup?

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

                      1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -2.1e-303 < d

                      1. Initial program 60.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 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}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}} \]
                      4. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                        3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 9: 72.8% accurate, 3.1× speedup?

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

                      1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -1.4500000000000001e-125 < l < 4.2000000000000002e217

                      1. Initial program 69.6%

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

                        \[\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. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                        3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 4.2000000000000002e217 < l

                      1. Initial program 19.3%

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

                        \[\leadsto \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-*.f6461.2

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

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

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

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

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

                        Alternative 10: 69.5% accurate, 3.4× speedup?

                        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.2 \cdot 10^{+217}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(-0.25 \cdot D\_m\right) \cdot \left(h \cdot \frac{M\_m}{d}\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{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 4.2e+217)
                           (*
                            (*
                             (fma
                              (/ (* D_m (* M_m (/ 0.5 d))) l)
                              (* (* -0.25 D_m) (* h (/ M_m d)))
                              1.0)
                             (sqrt (/ d l)))
                            (sqrt (/ 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 (l <= 4.2e+217) {
                        		tmp = (fma(((D_m * (M_m * (0.5 / d))) / l), ((-0.25 * D_m) * (h * (M_m / d))), 1.0) * sqrt((d / l))) * sqrt((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 (l <= 4.2e+217)
                        		tmp = Float64(Float64(fma(Float64(Float64(D_m * Float64(M_m * Float64(0.5 / d))) / l), Float64(Float64(-0.25 * D_m) * Float64(h * Float64(M_m / d))), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(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[l, 4.2e+217], N[(N[(N[(N[(N[(D$95$m * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(-0.25 * D$95$m), $MachinePrecision] * N[(h * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        D_m = \left|D\right|
                        \\
                        M_m = \left|M\right|
                        \\
                        [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;\ell \leq 4.2 \cdot 10^{+217}:\\
                        \;\;\;\;\left(\mathsf{fma}\left(\frac{D\_m \cdot \left(M\_m \cdot \frac{0.5}{d}\right)}{\ell}, \left(-0.25 \cdot D\_m\right) \cdot \left(h \cdot \frac{M\_m}{d}\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if l < 4.2000000000000002e217

                          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. Applied rewrites38.5%

                            \[\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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                            3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 4.2000000000000002e217 < l

                          1. Initial program 19.3%

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

                            \[\leadsto \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-*.f6461.2

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

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

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

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

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

                            Alternative 11: 68.3% accurate, 3.4× speedup?

                            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 2.6 \cdot 10^{+214}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(D\_m \cdot \frac{0.5}{d}\right) \cdot M\_m, \frac{-0.25 \cdot \left(\left(h \cdot \frac{M\_m}{d}\right) \cdot D\_m\right)}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{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.6e+214)
                               (*
                                (*
                                 (fma
                                  (* (* D_m (/ 0.5 d)) M_m)
                                  (/ (* -0.25 (* (* h (/ M_m d)) D_m)) l)
                                  1.0)
                                 (sqrt (/ d l)))
                                (sqrt (/ 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 (l <= 2.6e+214) {
                            		tmp = (fma(((D_m * (0.5 / d)) * M_m), ((-0.25 * ((h * (M_m / d)) * D_m)) / l), 1.0) * sqrt((d / l))) * sqrt((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 (l <= 2.6e+214)
                            		tmp = Float64(Float64(fma(Float64(Float64(D_m * Float64(0.5 / d)) * M_m), Float64(Float64(-0.25 * Float64(Float64(h * Float64(M_m / d)) * D_m)) / l), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(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[l, 2.6e+214], N[(N[(N[(N[(N[(D$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * M$95$m), $MachinePrecision] * N[(N[(-0.25 * N[(N[(h * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            D_m = \left|D\right|
                            \\
                            M_m = \left|M\right|
                            \\
                            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\ell \leq 2.6 \cdot 10^{+214}:\\
                            \;\;\;\;\left(\mathsf{fma}\left(\left(D\_m \cdot \frac{0.5}{d}\right) \cdot M\_m, \frac{-0.25 \cdot \left(\left(h \cdot \frac{M\_m}{d}\right) \cdot D\_m\right)}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if l < 2.59999999999999993e214

                              1. Initial program 67.9%

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

                                \[\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. Step-by-step derivation
                                1. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                                2. lift-*.f64N/A

                                  \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                                3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 2.59999999999999993e214 < l

                              1. Initial program 17.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 12: 66.6% accurate, 3.5× speedup?

                                \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.2 \cdot 10^{+217}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M\_m \cdot 0.5\right) \cdot D\_m}{d \cdot \ell}, \left(-0.25\right) \cdot \left(\left(h \cdot \frac{M\_m}{d}\right) \cdot D\_m\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{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 4.2e+217)
                                   (*
                                    (*
                                     (fma
                                      (/ (* (* M_m 0.5) D_m) (* d l))
                                      (* (- 0.25) (* (* h (/ M_m d)) D_m))
                                      1.0)
                                     (sqrt (/ d l)))
                                    (sqrt (/ 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 (l <= 4.2e+217) {
                                		tmp = (fma((((M_m * 0.5) * D_m) / (d * l)), (-0.25 * ((h * (M_m / d)) * D_m)), 1.0) * sqrt((d / l))) * sqrt((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 (l <= 4.2e+217)
                                		tmp = Float64(Float64(fma(Float64(Float64(Float64(M_m * 0.5) * D_m) / Float64(d * l)), Float64(Float64(-0.25) * Float64(Float64(h * Float64(M_m / d)) * D_m)), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(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[l, 4.2e+217], N[(N[(N[(N[(N[(N[(M$95$m * 0.5), $MachinePrecision] * D$95$m), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[((-0.25) * N[(N[(h * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                D_m = \left|D\right|
                                \\
                                M_m = \left|M\right|
                                \\
                                [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;\ell \leq 4.2 \cdot 10^{+217}:\\
                                \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M\_m \cdot 0.5\right) \cdot D\_m}{d \cdot \ell}, \left(-0.25\right) \cdot \left(\left(h \cdot \frac{M\_m}{d}\right) \cdot D\_m\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if l < 4.2000000000000002e217

                                  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. Applied rewrites38.5%

                                    \[\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. Step-by-step derivation
                                    1. lift-/.f64N/A

                                      \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(\frac{-1}{2} \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}}} \]
                                    2. lift-*.f64N/A

                                      \[\leadsto \frac{\color{blue}{\left(\mathsf{fma}\left(\frac{-1}{2} \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}} \]
                                    3. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 4.2000000000000002e217 < l

                                  1. Initial program 19.3%

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

                                    \[\leadsto \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-*.f6461.2

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

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

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

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

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

                                    Alternative 13: 46.8% accurate, 6.1× speedup?

                                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.55 \cdot 10^{-291}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 1.8 \cdot 10^{-262}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(-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 (<= l -1.55e-291)
                                       (/ (* (sqrt (/ d l)) (sqrt (- d))) (sqrt (- h)))
                                       (if (<= l 1.8e-262)
                                         (/ (* (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 (l <= -1.55e-291) {
                                    		tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
                                    	} else if (l <= 1.8e-262) {
                                    		tmp = (sqrt((h / l)) * -d) / 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 <= (-1.55d-291)) then
                                            tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h)
                                        else if (l <= 1.8d-262) then
                                            tmp = (sqrt((h / l)) * -d) / 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 <= -1.55e-291) {
                                    		tmp = (Math.sqrt((d / l)) * Math.sqrt(-d)) / Math.sqrt(-h);
                                    	} else if (l <= 1.8e-262) {
                                    		tmp = (Math.sqrt((h / l)) * -d) / 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 <= -1.55e-291:
                                    		tmp = (math.sqrt((d / l)) * math.sqrt(-d)) / math.sqrt(-h)
                                    	elif l <= 1.8e-262:
                                    		tmp = (math.sqrt((h / l)) * -d) / 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 <= -1.55e-291)
                                    		tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(-d))) / sqrt(Float64(-h)));
                                    	elseif (l <= 1.8e-262)
                                    		tmp = Float64(Float64(sqrt(Float64(h / l)) * Float64(-d)) / 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 <= -1.55e-291)
                                    		tmp = (sqrt((d / l)) * sqrt(-d)) / sqrt(-h);
                                    	elseif (l <= 1.8e-262)
                                    		tmp = (sqrt((h / l)) * -d) / 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, -1.55e-291], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.8e-262], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * (-d)), $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 -1.55 \cdot 10^{-291}:\\
                                    \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \sqrt{-d}}{\sqrt{-h}}\\
                                    
                                    \mathbf{elif}\;\ell \leq 1.8 \cdot 10^{-262}:\\
                                    \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(-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 l < -1.55000000000000006e-291

                                      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. Applied rewrites72.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. Taylor expanded in h around 0

                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{-d}}{\sqrt{-h}} \]
                                      5. Step-by-step derivation
                                        1. lower-sqrt.f64N/A

                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \sqrt{-d}}{\sqrt{-h}} \]
                                        2. lower-/.f6447.3

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

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

                                      if -1.55000000000000006e-291 < l < 1.7999999999999999e-262

                                      1. Initial program 85.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 rewrites42.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. 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 rewrites58.5%

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

                                        if 1.7999999999999999e-262 < l

                                        1. Initial program 58.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}{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-*.f6442.2

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

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

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

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

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

                                          Alternative 14: 45.8% accurate, 8.0× speedup?

                                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.55 \cdot 10^{-291}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;\ell \leq 1.8 \cdot 10^{-262}:\\ \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(-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 (<= l -1.55e-291)
                                             (* (sqrt (/ 1.0 (* h l))) (- d))
                                             (if (<= l 1.8e-262)
                                               (/ (* (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 (l <= -1.55e-291) {
                                          		tmp = sqrt((1.0 / (h * l))) * -d;
                                          	} else if (l <= 1.8e-262) {
                                          		tmp = (sqrt((h / l)) * -d) / 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 <= (-1.55d-291)) then
                                                  tmp = sqrt((1.0d0 / (h * l))) * -d
                                              else if (l <= 1.8d-262) then
                                                  tmp = (sqrt((h / l)) * -d) / 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 <= -1.55e-291) {
                                          		tmp = Math.sqrt((1.0 / (h * l))) * -d;
                                          	} else if (l <= 1.8e-262) {
                                          		tmp = (Math.sqrt((h / l)) * -d) / 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 <= -1.55e-291:
                                          		tmp = math.sqrt((1.0 / (h * l))) * -d
                                          	elif l <= 1.8e-262:
                                          		tmp = (math.sqrt((h / l)) * -d) / 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 <= -1.55e-291)
                                          		tmp = Float64(sqrt(Float64(1.0 / Float64(h * l))) * Float64(-d));
                                          	elseif (l <= 1.8e-262)
                                          		tmp = Float64(Float64(sqrt(Float64(h / l)) * Float64(-d)) / 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 <= -1.55e-291)
                                          		tmp = sqrt((1.0 / (h * l))) * -d;
                                          	elseif (l <= 1.8e-262)
                                          		tmp = (sqrt((h / l)) * -d) / 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, -1.55e-291], N[(N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], If[LessEqual[l, 1.8e-262], N[(N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * (-d)), $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 -1.55 \cdot 10^{-291}:\\
                                          \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\
                                          
                                          \mathbf{elif}\;\ell \leq 1.8 \cdot 10^{-262}:\\
                                          \;\;\;\;\frac{\sqrt{\frac{h}{\ell}} \cdot \left(-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 l < -1.55000000000000006e-291

                                            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 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-*.f6446.9

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

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

                                            if -1.55000000000000006e-291 < l < 1.7999999999999999e-262

                                            1. Initial program 85.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 rewrites42.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. 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 rewrites58.5%

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

                                              if 1.7999999999999999e-262 < l

                                              1. Initial program 58.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}{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-*.f6442.2

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

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

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

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

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

                                                Alternative 15: 45.4% accurate, 9.6× speedup?

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

                                                  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. Taylor expanded in l around -inf

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if 4.80000000000000006e-248 < l

                                                  1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                    Alternative 16: 42.0% accurate, 10.3× speedup?

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

                                                      1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if -6.99999999999999941e-278 < l

                                                      1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \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-*.f6424.9

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

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

                                                      \[\leadsto \sqrt{\frac{1}{h \cdot \ell}} \cdot d \]
                                                    7. Add Preprocessing

                                                    Alternative 18: 25.2% accurate, 15.3× speedup?

                                                    \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \frac{d}{\sqrt{h \cdot \ell}} \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 (* h l))))
                                                    D_m = fabs(D);
                                                    M_m = fabs(M);
                                                    assert(d < h && h < l && l < M_m && M_m < D_m);
                                                    double code(double d, double h, double l, double M_m, double D_m) {
                                                    	return d / sqrt((h * l));
                                                    }
                                                    
                                                    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((h * l))
                                                    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((h * l));
                                                    }
                                                    
                                                    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((h * l))
                                                    
                                                    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(h * l)))
                                                    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((h * l));
                                                    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[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                    
                                                    \begin{array}{l}
                                                    D_m = \left|D\right|
                                                    \\
                                                    M_m = \left|M\right|
                                                    \\
                                                    [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                    \\
                                                    \frac{d}{\sqrt{h \cdot \ell}}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Initial program 64.3%

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

                                                      \[\leadsto \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-*.f6424.9

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

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

                                                        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                      2. Final simplification24.9%

                                                        \[\leadsto \frac{d}{\sqrt{h \cdot \ell}} \]
                                                      3. Add Preprocessing

                                                      Reproduce

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