Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.4% → 82.0%
Time: 17.4s
Alternatives: 16
Speedup: 1.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 66.4% accurate, 1.0× speedup?

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

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

Alternative 1: 82.0% accurate, 1.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 := \left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\ t_1 := \frac{t\_0}{\ell}\\ \mathbf{if}\;d \leq -1.1 \cdot 10^{-267}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(t\_1 \cdot h\right) \cdot t\_0, -0.5, 1\right)}{\frac{\sqrt{-h}}{\sqrt{-d}}}\\ \mathbf{elif}\;d \leq 5.2 \cdot 10^{-185}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{h}{\frac{d}{\left(0.25 \cdot D\_m\right) \cdot M\_m}} \cdot t\_1\right) \cdot \left(\frac{\sqrt{d}}{\sqrt{h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\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 (* (* (/ 0.5 d) M_m) D_m)) (t_1 (/ t_0 l)))
   (if (<= d -1.1e-267)
     (/
      (* (sqrt (/ d l)) (fma (* (* t_1 h) t_0) -0.5 1.0))
      (/ (sqrt (- h)) (sqrt (- d))))
     (if (<= d 5.2e-185)
       (*
        (/ (fabs d) (sqrt (* l h)))
        (fma
         (/ (* -0.5 (/ (* D_m M_m) d)) l)
         (* (* D_m h) (* 0.25 (/ M_m d)))
         1.0))
       (*
        (- 1.0 (* (/ h (/ d (* (* 0.25 D_m) M_m))) t_1))
        (* (/ (sqrt d) (sqrt h)) (pow (/ d l) (/ 1.0 2.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 = ((0.5 / d) * M_m) * D_m;
	double t_1 = t_0 / l;
	double tmp;
	if (d <= -1.1e-267) {
		tmp = (sqrt((d / l)) * fma(((t_1 * h) * t_0), -0.5, 1.0)) / (sqrt(-h) / sqrt(-d));
	} else if (d <= 5.2e-185) {
		tmp = (fabs(d) / sqrt((l * h))) * fma(((-0.5 * ((D_m * M_m) / d)) / l), ((D_m * h) * (0.25 * (M_m / d))), 1.0);
	} else {
		tmp = (1.0 - ((h / (d / ((0.25 * D_m) * M_m))) * t_1)) * ((sqrt(d) / sqrt(h)) * pow((d / l), (1.0 / 2.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(Float64(Float64(0.5 / d) * M_m) * D_m)
	t_1 = Float64(t_0 / l)
	tmp = 0.0
	if (d <= -1.1e-267)
		tmp = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(t_1 * h) * t_0), -0.5, 1.0)) / Float64(sqrt(Float64(-h)) / sqrt(Float64(-d))));
	elseif (d <= 5.2e-185)
		tmp = Float64(Float64(abs(d) / sqrt(Float64(l * h))) * fma(Float64(Float64(-0.5 * Float64(Float64(D_m * M_m) / d)) / l), Float64(Float64(D_m * h) * Float64(0.25 * Float64(M_m / d))), 1.0));
	else
		tmp = Float64(Float64(1.0 - Float64(Float64(h / Float64(d / Float64(Float64(0.25 * D_m) * M_m))) * t_1)) * Float64(Float64(sqrt(d) / sqrt(h)) * (Float64(d / l) ^ Float64(1.0 / 2.0))));
	end
	return tmp
end
D_m = N[Abs[D], $MachinePrecision]
M_m = N[Abs[M], $MachinePrecision]
NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(0.5 / d), $MachinePrecision] * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / l), $MachinePrecision]}, If[LessEqual[d, -1.1e-267], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(t$95$1 * h), $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[(-h)], $MachinePrecision] / N[Sqrt[(-d)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5.2e-185], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(-0.5 * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * h), $MachinePrecision] * N[(0.25 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(h / N[(d / N[(N[(0.25 * D$95$m), $MachinePrecision] * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $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(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\
t_1 := \frac{t\_0}{\ell}\\
\mathbf{if}\;d \leq -1.1 \cdot 10^{-267}:\\
\;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(t\_1 \cdot h\right) \cdot t\_0, -0.5, 1\right)}{\frac{\sqrt{-h}}{\sqrt{-d}}}\\

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

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


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

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.09999999999999994e-267 < d < 5.1999999999999997e-185

    1. Initial program 23.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.1999999999999997e-185 < d

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.1% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-264}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_0 \leq 10^{+215}:\\
\;\;\;\;\left(1 \cdot t\_4\right) \cdot t\_3\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\sqrt{\frac{d}{\ell}}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - \frac{\frac{M \cdot D}{d} \cdot \frac{1}{2}}{\ell} \cdot \left(\left(\left(\frac{1}{4} \cdot D\right) \cdot h\right) \cdot \frac{M}{d}\right)\right) \]
      8. lift-sqrt.f6479.7

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000016e-134 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e-264 or 9.99999999999999907e214 < (*.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 28.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-264 < (*.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)))) < 9.99999999999999907e214

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification83.8%

      \[\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 -4 \cdot 10^{-134}:\\ \;\;\;\;\left(1 - \left(\left(\left(0.25 \cdot D\right) \cdot h\right) \cdot \frac{M}{d}\right) \cdot \frac{\frac{D \cdot M}{d} \cdot 0.5}{\ell}\right) \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\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 2 \cdot 10^{-264}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\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 10^{+215}:\\ \;\;\;\;\left(1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 81.6% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2e-264 < (*.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)))) < 9.99999999999999907e214

      1. Initial program 99.5%

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

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

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

          \[\leadsto \color{blue}{\left(1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification81.7%

        \[\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^{-264}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\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 10^{+215}:\\ \;\;\;\;\left(1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\right)\\ \end{array} \]
      7. Add Preprocessing

      Alternative 4: 82.5% accurate, 0.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 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\\ \mathbf{if}\;\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 t\_0 \leq 10^{+215}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\right) \cdot \frac{-h}{\ell}, \frac{M\_m}{d} \cdot \left(\left(0.5 \cdot D\_m\right) \cdot 0.5\right), 1\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (let* ((t_0 (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))))
         (if (<=
              (*
               (-
                1.0
                (* (/ h l) (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
               t_0)
              1e+215)
           (*
            (fma
             (* (* (* (/ 0.5 d) M_m) D_m) (/ (- h) l))
             (* (/ M_m d) (* (* 0.5 D_m) 0.5))
             1.0)
            t_0)
           (*
            (/ (fabs d) (sqrt (* l h)))
            (fma
             (/ (* -0.5 (/ (* D_m M_m) d)) l)
             (* (* D_m h) (* 0.25 (/ M_m d)))
             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 = pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0));
      	double tmp;
      	if (((1.0 - ((h / l) * (pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * t_0) <= 1e+215) {
      		tmp = fma(((((0.5 / d) * M_m) * D_m) * (-h / l)), ((M_m / d) * ((0.5 * D_m) * 0.5)), 1.0) * t_0;
      	} else {
      		tmp = (fabs(d) / sqrt((l * h))) * fma(((-0.5 * ((D_m * M_m) / d)) / l), ((D_m * h) * (0.25 * (M_m / d))), 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((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))
      	tmp = 0.0
      	if (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)))) * t_0) <= 1e+215)
      		tmp = Float64(fma(Float64(Float64(Float64(Float64(0.5 / d) * M_m) * D_m) * Float64(Float64(-h) / l)), Float64(Float64(M_m / d) * Float64(Float64(0.5 * D_m) * 0.5)), 1.0) * t_0);
      	else
      		tmp = Float64(Float64(abs(d) / sqrt(Float64(l * h))) * fma(Float64(Float64(-0.5 * Float64(Float64(D_m * M_m) / d)) / l), Float64(Float64(D_m * h) * Float64(0.25 * Float64(M_m / d))), 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[(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]}, If[LessEqual[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] * t$95$0), $MachinePrecision], 1e+215], N[(N[(N[(N[(N[(N[(0.5 / d), $MachinePrecision] * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision] * N[((-h) / l), $MachinePrecision]), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * N[(N[(0.5 * D$95$m), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(-0.5 * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * h), $MachinePrecision] * N[(0.25 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      t_0 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\\
      \mathbf{if}\;\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 t\_0 \leq 10^{+215}:\\
      \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\right) \cdot \frac{-h}{\ell}, \frac{M\_m}{d} \cdot \left(\left(0.5 \cdot D\_m\right) \cdot 0.5\right), 1\right) \cdot t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.99999999999999907e214

        1. Initial program 84.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 rewrites87.3%

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

        if 9.99999999999999907e214 < (*.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 26.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 10^{+215}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\frac{0.5}{d} \cdot M\right) \cdot D\right) \cdot \frac{-h}{\ell}, \frac{M}{d} \cdot \left(\left(0.5 \cdot D\right) \cdot 0.5\right), 1\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{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 5: 82.5% accurate, 0.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 := \left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\ t_1 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\\ \mathbf{if}\;\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 t\_1 \leq 10^{+215}:\\ \;\;\;\;\left(1 - \left(\left(0.5 \cdot \frac{h}{\ell}\right) \cdot t\_0\right) \cdot t\_0\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (let* ((t_0 (* (* (/ 0.5 d) M_m) D_m))
              (t_1 (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))))
         (if (<=
              (*
               (-
                1.0
                (* (/ h l) (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0))))
               t_1)
              1e+215)
           (* (- 1.0 (* (* (* 0.5 (/ h l)) t_0) t_0)) t_1)
           (*
            (/ (fabs d) (sqrt (* l h)))
            (fma
             (/ (* -0.5 (/ (* D_m M_m) d)) l)
             (* (* D_m h) (* 0.25 (/ M_m d)))
             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 = ((0.5 / d) * M_m) * D_m;
      	double t_1 = pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0));
      	double tmp;
      	if (((1.0 - ((h / l) * (pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)))) * t_1) <= 1e+215) {
      		tmp = (1.0 - (((0.5 * (h / l)) * t_0) * t_0)) * t_1;
      	} else {
      		tmp = (fabs(d) / sqrt((l * h))) * fma(((-0.5 * ((D_m * M_m) / d)) / l), ((D_m * h) * (0.25 * (M_m / d))), 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(Float64(Float64(0.5 / d) * M_m) * D_m)
      	t_1 = Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))
      	tmp = 0.0
      	if (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)))) * t_1) <= 1e+215)
      		tmp = Float64(Float64(1.0 - Float64(Float64(Float64(0.5 * Float64(h / l)) * t_0) * t_0)) * t_1);
      	else
      		tmp = Float64(Float64(abs(d) / sqrt(Float64(l * h))) * fma(Float64(Float64(-0.5 * Float64(Float64(D_m * M_m) / d)) / l), Float64(Float64(D_m * h) * Float64(0.25 * Float64(M_m / d))), 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[(N[(N[(0.5 / d), $MachinePrecision] * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[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] * t$95$1), $MachinePrecision], 1e+215], N[(N[(1.0 - N[(N[(N[(0.5 * N[(h / l), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(-0.5 * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * h), $MachinePrecision] * N[(0.25 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      t_0 := \left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\
      t_1 := {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\\
      \mathbf{if}\;\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 t\_1 \leq 10^{+215}:\\
      \;\;\;\;\left(1 - \left(\left(0.5 \cdot \frac{h}{\ell}\right) \cdot t\_0\right) \cdot t\_0\right) \cdot t\_1\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.99999999999999907e214

        1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

        if 9.99999999999999907e214 < (*.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 26.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 10^{+215}:\\ \;\;\;\;\left(1 - \left(\left(0.5 \cdot \frac{h}{\ell}\right) \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot D\right)\right) \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot D\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{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 6: 82.6% accurate, 0.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 := \left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\ \mathbf{if}\;\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) \leq 10^{+215}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(\frac{t\_0}{\ell} \cdot h\right) \cdot t\_0, -0.5, 1\right)}{\frac{1}{\sqrt{\frac{d}{h}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (let* ((t_0 (* (* (/ 0.5 d) M_m) D_m)))
         (if (<=
              (*
               (-
                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))))
              1e+215)
           (/
            (* (sqrt (/ d l)) (fma (* (* (/ t_0 l) h) t_0) -0.5 1.0))
            (/ 1.0 (sqrt (/ d h))))
           (*
            (/ (fabs d) (sqrt (* l h)))
            (fma
             (/ (* -0.5 (/ (* D_m M_m) d)) l)
             (* (* D_m h) (* 0.25 (/ M_m d)))
             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 = ((0.5 / d) * M_m) * D_m;
      	double tmp;
      	if (((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)))) <= 1e+215) {
      		tmp = (sqrt((d / l)) * fma((((t_0 / l) * h) * t_0), -0.5, 1.0)) / (1.0 / sqrt((d / h)));
      	} else {
      		tmp = (fabs(d) / sqrt((l * h))) * fma(((-0.5 * ((D_m * M_m) / d)) / l), ((D_m * h) * (0.25 * (M_m / d))), 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(Float64(Float64(0.5 / d) * M_m) * D_m)
      	tmp = 0.0
      	if (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)))) <= 1e+215)
      		tmp = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(t_0 / l) * h) * t_0), -0.5, 1.0)) / Float64(1.0 / sqrt(Float64(d / h))));
      	else
      		tmp = Float64(Float64(abs(d) / sqrt(Float64(l * h))) * fma(Float64(Float64(-0.5 * Float64(Float64(D_m * M_m) / d)) / l), Float64(Float64(D_m * h) * Float64(0.25 * Float64(M_m / d))), 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[(N[(N[(0.5 / d), $MachinePrecision] * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]}, If[LessEqual[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], 1e+215], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(t$95$0 / l), $MachinePrecision] * h), $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(-0.5 * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * h), $MachinePrecision] * N[(0.25 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      t_0 := \left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\
      \mathbf{if}\;\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) \leq 10^{+215}:\\
      \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(\frac{t\_0}{\ell} \cdot h\right) \cdot t\_0, -0.5, 1\right)}{\frac{1}{\sqrt{\frac{d}{h}}}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.99999999999999907e214

        1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 9.99999999999999907e214 < (*.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 26.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\frac{M \cdot D}{d} \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot 0.25\right) \cdot \left(h \cdot D\right), 1\right) \cdot \frac{\left|d\right|}{\sqrt{h \cdot \ell}}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification83.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 10^{+215}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot h\right) \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot D\right), -0.5, 1\right)}{\frac{1}{\sqrt{\frac{d}{h}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 82.1% accurate, 0.8× speedup?

      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\ \mathbf{if}\;\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) \leq 10^{+215}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(\frac{t\_0}{\ell} \cdot h\right) \cdot t\_0, -0.5, 1\right)}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (let* ((t_0 (* (* (/ 0.5 d) M_m) D_m)))
         (if (<=
              (*
               (-
                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))))
              1e+215)
           (/
            (* (sqrt (/ d l)) (fma (* (* (/ t_0 l) h) t_0) -0.5 1.0))
            (sqrt (/ h d)))
           (*
            (/ (fabs d) (sqrt (* l h)))
            (fma
             (/ (* -0.5 (/ (* D_m M_m) d)) l)
             (* (* D_m h) (* 0.25 (/ M_m d)))
             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 = ((0.5 / d) * M_m) * D_m;
      	double tmp;
      	if (((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)))) <= 1e+215) {
      		tmp = (sqrt((d / l)) * fma((((t_0 / l) * h) * t_0), -0.5, 1.0)) / sqrt((h / d));
      	} else {
      		tmp = (fabs(d) / sqrt((l * h))) * fma(((-0.5 * ((D_m * M_m) / d)) / l), ((D_m * h) * (0.25 * (M_m / d))), 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(Float64(Float64(0.5 / d) * M_m) * D_m)
      	tmp = 0.0
      	if (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)))) <= 1e+215)
      		tmp = Float64(Float64(sqrt(Float64(d / l)) * fma(Float64(Float64(Float64(t_0 / l) * h) * t_0), -0.5, 1.0)) / sqrt(Float64(h / d)));
      	else
      		tmp = Float64(Float64(abs(d) / sqrt(Float64(l * h))) * fma(Float64(Float64(-0.5 * Float64(Float64(D_m * M_m) / d)) / l), Float64(Float64(D_m * h) * Float64(0.25 * Float64(M_m / d))), 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[(N[(N[(0.5 / d), $MachinePrecision] * M$95$m), $MachinePrecision] * D$95$m), $MachinePrecision]}, If[LessEqual[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], 1e+215], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[(t$95$0 / l), $MachinePrecision] * h), $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(-0.5 * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * h), $MachinePrecision] * N[(0.25 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      t_0 := \left(\frac{0.5}{d} \cdot M\_m\right) \cdot D\_m\\
      \mathbf{if}\;\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) \leq 10^{+215}:\\
      \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(\frac{t\_0}{\ell} \cdot h\right) \cdot t\_0, -0.5, 1\right)}{\sqrt{\frac{h}{d}}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.99999999999999907e214

        1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 9.99999999999999907e214 < (*.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 26.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 10^{+215}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{\ell} \cdot h\right) \cdot \left(\left(\frac{0.5}{d} \cdot M\right) \cdot D\right), -0.5, 1\right)}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 81.8% accurate, 0.8× speedup?

      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{M\_m}{d} \cdot D\_m\\ \mathbf{if}\;\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) \leq 10^{+215}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(t\_0 \cdot \left(0.25 \cdot \frac{h}{\ell}\right)\right) \cdot t\_0, -0.5, 1\right) \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\ \end{array} \end{array} \]
      D_m = (fabs.f64 D)
      M_m = (fabs.f64 M)
      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
      (FPCore (d h l M_m D_m)
       :precision binary64
       (let* ((t_0 (* (/ M_m d) D_m)))
         (if (<=
              (*
               (-
                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))))
              1e+215)
           (/
            (* (fma (* (* t_0 (* 0.25 (/ h l))) t_0) -0.5 1.0) (sqrt (/ d l)))
            (sqrt (/ h d)))
           (*
            (/ (fabs d) (sqrt (* l h)))
            (fma
             (/ (* -0.5 (/ (* D_m M_m) d)) l)
             (* (* D_m h) (* 0.25 (/ M_m d)))
             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 = (M_m / d) * D_m;
      	double tmp;
      	if (((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)))) <= 1e+215) {
      		tmp = (fma(((t_0 * (0.25 * (h / l))) * t_0), -0.5, 1.0) * sqrt((d / l))) / sqrt((h / d));
      	} else {
      		tmp = (fabs(d) / sqrt((l * h))) * fma(((-0.5 * ((D_m * M_m) / d)) / l), ((D_m * h) * (0.25 * (M_m / d))), 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(Float64(M_m / d) * D_m)
      	tmp = 0.0
      	if (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)))) <= 1e+215)
      		tmp = Float64(Float64(fma(Float64(Float64(t_0 * Float64(0.25 * Float64(h / l))) * t_0), -0.5, 1.0) * sqrt(Float64(d / l))) / sqrt(Float64(h / d)));
      	else
      		tmp = Float64(Float64(abs(d) / sqrt(Float64(l * h))) * fma(Float64(Float64(-0.5 * Float64(Float64(D_m * M_m) / d)) / l), Float64(Float64(D_m * h) * Float64(0.25 * Float64(M_m / d))), 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[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision]}, If[LessEqual[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], 1e+215], N[(N[(N[(N[(N[(t$95$0 * N[(0.25 * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(-0.5 * N[(N[(D$95$m * M$95$m), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[(D$95$m * h), $MachinePrecision] * N[(0.25 * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      D_m = \left|D\right|
      \\
      M_m = \left|M\right|
      \\
      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
      \\
      \begin{array}{l}
      t_0 := \frac{M\_m}{d} \cdot D\_m\\
      \mathbf{if}\;\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) \leq 10^{+215}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\left(t\_0 \cdot \left(0.25 \cdot \frac{h}{\ell}\right)\right) \cdot t\_0, -0.5, 1\right) \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D\_m \cdot M\_m}{d}}{\ell}, \left(D\_m \cdot h\right) \cdot \left(0.25 \cdot \frac{M\_m}{d}\right), 1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.99999999999999907e214

        1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 9.99999999999999907e214 < (*.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 26.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 10^{+215}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(\frac{M}{d} \cdot D\right) \cdot \left(0.25 \cdot \frac{h}{\ell}\right)\right) \cdot \left(\frac{M}{d} \cdot D\right), -0.5, 1\right) \cdot \sqrt{\frac{d}{\ell}}}{\sqrt{\frac{h}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|d\right|}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\frac{-0.5 \cdot \frac{D \cdot M}{d}}{\ell}, \left(D \cdot h\right) \cdot \left(0.25 \cdot \frac{M}{d}\right), 1\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 9: 57.2% accurate, 3.8× speedup?

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

        1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
            12. lower-neg.f6449.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -4.999999999999985e-310 < d < 2.2000000000000001e138

          1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 2.2000000000000001e138 < d

          1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 10: 53.3% accurate, 3.9× speedup?

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

              1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                  12. lower-neg.f6449.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -4.999999999999985e-310 < d < 8.1999999999999993

                1. Initial program 43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \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) \]
                  12. unpow2N/A

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

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

                    \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \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) \]
                  15. unpow2N/A

                    \[\leadsto \left(\sqrt{\frac{1}{\ell \cdot h}} \cdot d\right) \cdot \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) \]
                  16. associate-/l*N/A

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

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

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

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

                if 8.1999999999999993 < d

                1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 50.4% accurate, 4.8× speedup?

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

                    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                        12. lower-neg.f6449.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -4.999999999999985e-310 < d

                      1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                              8. lower-/.f64N/A

                                \[\leadsto \left(\color{blue}{\frac{\sqrt{\mathsf{neg}\left(d\right)}}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                              9. lower-sqrt.f64N/A

                                \[\leadsto \left(\frac{\color{blue}{\sqrt{\mathsf{neg}\left(d\right)}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                              10. lower-neg.f64N/A

                                \[\leadsto \left(\frac{\sqrt{\color{blue}{-d}}}{\sqrt{\mathsf{neg}\left(h\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                              11. lower-sqrt.f64N/A

                                \[\leadsto \left(\frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(h\right)}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                              12. lower-neg.f6449.6

                                \[\leadsto \left(\frac{\sqrt{-d}}{\sqrt{\color{blue}{-h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                            3. Applied rewrites49.6%

                              \[\leadsto \left(\color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1 \]
                            4. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \color{blue}{\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot 1} \]
                              2. lift-*.f64N/A

                                \[\leadsto \color{blue}{\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot 1 \]
                              3. associate-*l*N/A

                                \[\leadsto \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot 1\right)} \]
                              4. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot 1\right) \]
                            5. Applied rewrites49.6%

                              \[\leadsto \color{blue}{\frac{\sqrt{-d} \cdot \left(1 \cdot \sqrt{\frac{d}{\ell}}\right)}{\sqrt{-h}}} \]

                            if -3.30000000000000008e-284 < h < 8.99999999999999925e-276

                            1. Initial program 55.8%

                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-pow.f64N/A

                                \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              2. lift-/.f64N/A

                                \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              3. clear-numN/A

                                \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              4. inv-powN/A

                                \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              5. pow-powN/A

                                \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              6. lift-/.f64N/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              7. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              8. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              9. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              10. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              11. lift-/.f64N/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              12. lower-pow.f64N/A

                                \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              13. lower-/.f64N/A

                                \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              14. lift-/.f64N/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              15. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              16. metadata-eval58.2

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                            4. Applied rewrites58.2%

                              \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                            5. 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}}} \]
                            6. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                              2. unpow2N/A

                                \[\leadsto \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                              3. rem-square-sqrtN/A

                                \[\leadsto \left(\color{blue}{-1} \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                              4. lower-*.f64N/A

                                \[\leadsto \color{blue}{\left(-1 \cdot d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                              5. mul-1-negN/A

                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(d\right)\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                              6. lower-neg.f64N/A

                                \[\leadsto \color{blue}{\left(-d\right)} \cdot \sqrt{\frac{1}{h \cdot \ell}} \]
                              7. lower-sqrt.f64N/A

                                \[\leadsto \left(-d\right) \cdot \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \]
                              8. lower-/.f64N/A

                                \[\leadsto \left(-d\right) \cdot \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \]
                              9. *-commutativeN/A

                                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                              10. lower-*.f6462.9

                                \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                            7. Applied rewrites62.9%

                              \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                            if 8.99999999999999925e-276 < h

                            1. Initial program 62.3%

                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-pow.f64N/A

                                \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              2. lift-/.f64N/A

                                \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              3. clear-numN/A

                                \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              4. inv-powN/A

                                \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              5. pow-powN/A

                                \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              6. lift-/.f64N/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              7. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              8. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              9. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              10. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              11. lift-/.f64N/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              12. lower-pow.f64N/A

                                \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              13. lower-/.f64N/A

                                \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              14. lift-/.f64N/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              15. metadata-evalN/A

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                              16. metadata-eval62.7

                                \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                            4. Applied rewrites62.7%

                              \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                            5. Taylor expanded in h around 0

                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                            6. 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-*.f6438.8

                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                            7. Applied rewrites38.8%

                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                            8. Step-by-step derivation
                              1. Applied rewrites38.8%

                                \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                              2. Step-by-step derivation
                                1. Applied rewrites47.1%

                                  \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                              3. Recombined 3 regimes into one program.
                              4. Final simplification49.2%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -3.3 \cdot 10^{-284}:\\ \;\;\;\;\frac{\left(1 \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 9 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 13: 45.0% 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}\;h \leq 9 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                              D_m = (fabs.f64 D)
                              M_m = (fabs.f64 M)
                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                              (FPCore (d h l M_m D_m)
                               :precision binary64
                               (if (<= h 9e-276)
                                 (* (sqrt (/ 1.0 (* l h))) (- d))
                                 (/ d (* (sqrt l) (sqrt h)))))
                              D_m = fabs(D);
                              M_m = fabs(M);
                              assert(d < h && h < l && l < M_m && M_m < D_m);
                              double code(double d, double h, double l, double M_m, double D_m) {
                              	double tmp;
                              	if (h <= 9e-276) {
                              		tmp = sqrt((1.0 / (l * h))) * -d;
                              	} else {
                              		tmp = d / (sqrt(l) * sqrt(h));
                              	}
                              	return tmp;
                              }
                              
                              D_m = abs(d)
                              M_m = abs(m)
                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                              real(8) function code(d, h, l, m_m, d_m)
                                  real(8), intent (in) :: d
                                  real(8), intent (in) :: h
                                  real(8), intent (in) :: l
                                  real(8), intent (in) :: m_m
                                  real(8), intent (in) :: d_m
                                  real(8) :: tmp
                                  if (h <= 9d-276) then
                                      tmp = sqrt((1.0d0 / (l * h))) * -d
                                  else
                                      tmp = d / (sqrt(l) * sqrt(h))
                                  end if
                                  code = tmp
                              end function
                              
                              D_m = Math.abs(D);
                              M_m = Math.abs(M);
                              assert d < h && h < l && l < M_m && M_m < D_m;
                              public static double code(double d, double h, double l, double M_m, double D_m) {
                              	double tmp;
                              	if (h <= 9e-276) {
                              		tmp = Math.sqrt((1.0 / (l * h))) * -d;
                              	} else {
                              		tmp = d / (Math.sqrt(l) * Math.sqrt(h));
                              	}
                              	return tmp;
                              }
                              
                              D_m = math.fabs(D)
                              M_m = math.fabs(M)
                              [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                              def code(d, h, l, M_m, D_m):
                              	tmp = 0
                              	if h <= 9e-276:
                              		tmp = math.sqrt((1.0 / (l * h))) * -d
                              	else:
                              		tmp = d / (math.sqrt(l) * math.sqrt(h))
                              	return tmp
                              
                              D_m = abs(D)
                              M_m = abs(M)
                              d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                              function code(d, h, l, M_m, D_m)
                              	tmp = 0.0
                              	if (h <= 9e-276)
                              		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                              	else
                              		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                              	end
                              	return tmp
                              end
                              
                              D_m = abs(D);
                              M_m = abs(M);
                              d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                              function tmp_2 = code(d, h, l, M_m, D_m)
                              	tmp = 0.0;
                              	if (h <= 9e-276)
                              		tmp = sqrt((1.0 / (l * h))) * -d;
                              	else
                              		tmp = d / (sqrt(l) * sqrt(h));
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              D_m = N[Abs[D], $MachinePrecision]
                              M_m = N[Abs[M], $MachinePrecision]
                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                              code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, 9e-276], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              D_m = \left|D\right|
                              \\
                              M_m = \left|M\right|
                              \\
                              [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;h \leq 9 \cdot 10^{-276}:\\
                              \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if h < 8.99999999999999925e-276

                                1. Initial program 70.4%

                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-pow.f64N/A

                                    \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  2. lift-/.f64N/A

                                    \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  3. clear-numN/A

                                    \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  4. inv-powN/A

                                    \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  5. pow-powN/A

                                    \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  6. lift-/.f64N/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  7. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  8. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  9. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  10. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  11. lift-/.f64N/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  12. lower-pow.f64N/A

                                    \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  13. lower-/.f64N/A

                                    \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  14. lift-/.f64N/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  15. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  16. metadata-eval69.9

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                4. Applied rewrites69.9%

                                  \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                5. 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}}} \]
                                6. 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-*.f6447.8

                                    \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                7. Applied rewrites47.8%

                                  \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                if 8.99999999999999925e-276 < h

                                1. Initial program 62.3%

                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-pow.f64N/A

                                    \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  2. lift-/.f64N/A

                                    \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  3. clear-numN/A

                                    \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  4. inv-powN/A

                                    \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  5. pow-powN/A

                                    \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  6. lift-/.f64N/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  7. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  8. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  9. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  10. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  11. lift-/.f64N/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  12. lower-pow.f64N/A

                                    \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  13. lower-/.f64N/A

                                    \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  14. lift-/.f64N/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  15. metadata-evalN/A

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  16. metadata-eval62.7

                                    \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                4. Applied rewrites62.7%

                                  \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                5. Taylor expanded in h around 0

                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                6. 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-*.f6438.8

                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                7. Applied rewrites38.8%

                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                8. Step-by-step derivation
                                  1. Applied rewrites38.8%

                                    \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites47.1%

                                      \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification47.5%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq 9 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 14: 41.6% 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}{\ell \cdot h}}\\ \mathbf{if}\;h \leq 9.5 \cdot 10^{-276}:\\ \;\;\;\;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 (* l h)))))
                                     (if (<= h 9.5e-276) (* 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 / (l * h)));
                                  	double tmp;
                                  	if (h <= 9.5e-276) {
                                  		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 / (l * h)))
                                      if (h <= 9.5d-276) 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 / (l * h)));
                                  	double tmp;
                                  	if (h <= 9.5e-276) {
                                  		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 / (l * h)))
                                  	tmp = 0
                                  	if h <= 9.5e-276:
                                  		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(l * h)))
                                  	tmp = 0.0
                                  	if (h <= 9.5e-276)
                                  		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 / (l * h)));
                                  	tmp = 0.0;
                                  	if (h <= 9.5e-276)
                                  		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[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, 9.5e-276], 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}{\ell \cdot h}}\\
                                  \mathbf{if}\;h \leq 9.5 \cdot 10^{-276}:\\
                                  \;\;\;\;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 h < 9.49999999999999929e-276

                                    1. Initial program 70.4%

                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    2. Add Preprocessing
                                    3. Step-by-step derivation
                                      1. lift-pow.f64N/A

                                        \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      2. lift-/.f64N/A

                                        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      3. clear-numN/A

                                        \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      4. inv-powN/A

                                        \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      5. pow-powN/A

                                        \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      6. lift-/.f64N/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      7. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      8. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      9. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      10. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      11. lift-/.f64N/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      12. lower-pow.f64N/A

                                        \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      13. lower-/.f64N/A

                                        \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      14. lift-/.f64N/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      15. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      16. metadata-eval69.9

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    4. Applied rewrites69.9%

                                      \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    5. 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}}} \]
                                    6. 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-*.f6447.8

                                        \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                    7. Applied rewrites47.8%

                                      \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                    if 9.49999999999999929e-276 < h

                                    1. Initial program 62.3%

                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    2. Add Preprocessing
                                    3. Step-by-step derivation
                                      1. lift-pow.f64N/A

                                        \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      2. lift-/.f64N/A

                                        \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      3. clear-numN/A

                                        \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      4. inv-powN/A

                                        \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      5. pow-powN/A

                                        \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      6. lift-/.f64N/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      7. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      8. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      9. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      10. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      11. lift-/.f64N/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      12. lower-pow.f64N/A

                                        \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      13. lower-/.f64N/A

                                        \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      14. lift-/.f64N/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      15. metadata-evalN/A

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                      16. metadata-eval62.7

                                        \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    4. Applied rewrites62.7%

                                      \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    5. Taylor expanded in h around 0

                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                    6. 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-*.f6438.8

                                        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                    7. Applied rewrites38.8%

                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification43.8%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq 9.5 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 15: 26.7% 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}{\ell \cdot h}} \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 (* l h))) d))
                                  D_m = fabs(D);
                                  M_m = fabs(M);
                                  assert(d < h && h < l && l < M_m && M_m < D_m);
                                  double code(double d, double h, double l, double M_m, double D_m) {
                                  	return sqrt((1.0 / (l * h))) * 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 / (l * h))) * 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 / (l * h))) * 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 / (l * h))) * 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(l * h))) * 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 / (l * h))) * 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[(l * h), $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}{\ell \cdot h}} \cdot d
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 66.8%

                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  2. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. lift-pow.f64N/A

                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    2. lift-/.f64N/A

                                      \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    3. clear-numN/A

                                      \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    4. inv-powN/A

                                      \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    5. pow-powN/A

                                      \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    6. lift-/.f64N/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    7. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    8. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    9. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    10. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    11. lift-/.f64N/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    12. lower-pow.f64N/A

                                      \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    13. lower-/.f64N/A

                                      \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    14. lift-/.f64N/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    15. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    16. metadata-eval66.7

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  4. Applied rewrites66.7%

                                    \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  5. Taylor expanded in h around 0

                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                  6. 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-*.f6422.1

                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                  7. Applied rewrites22.1%

                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                  8. Add Preprocessing

                                  Alternative 16: 26.6% accurate, 15.3× speedup?

                                  \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                                  D_m = (fabs.f64 D)
                                  M_m = (fabs.f64 M)
                                  NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                  (FPCore (d h l M_m D_m) :precision binary64 (/ d (sqrt (* l h))))
                                  D_m = fabs(D);
                                  M_m = fabs(M);
                                  assert(d < h && h < l && l < M_m && M_m < D_m);
                                  double code(double d, double h, double l, double M_m, double D_m) {
                                  	return d / sqrt((l * h));
                                  }
                                  
                                  D_m = abs(d)
                                  M_m = abs(m)
                                  NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                  real(8) function code(d, h, l, m_m, d_m)
                                      real(8), intent (in) :: d
                                      real(8), intent (in) :: h
                                      real(8), intent (in) :: l
                                      real(8), intent (in) :: m_m
                                      real(8), intent (in) :: d_m
                                      code = d / sqrt((l * h))
                                  end function
                                  
                                  D_m = Math.abs(D);
                                  M_m = Math.abs(M);
                                  assert d < h && h < l && l < M_m && M_m < D_m;
                                  public static double code(double d, double h, double l, double M_m, double D_m) {
                                  	return d / Math.sqrt((l * h));
                                  }
                                  
                                  D_m = math.fabs(D)
                                  M_m = math.fabs(M)
                                  [d, h, l, M_m, D_m] = sort([d, h, l, M_m, D_m])
                                  def code(d, h, l, M_m, D_m):
                                  	return d / math.sqrt((l * h))
                                  
                                  D_m = abs(D)
                                  M_m = abs(M)
                                  d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                  function code(d, h, l, M_m, D_m)
                                  	return Float64(d / sqrt(Float64(l * h)))
                                  end
                                  
                                  D_m = abs(D);
                                  M_m = abs(M);
                                  d, h, l, M_m, D_m = num2cell(sort([d, h, l, M_m, D_m])){:}
                                  function tmp = code(d, h, l, M_m, D_m)
                                  	tmp = d / sqrt((l * h));
                                  end
                                  
                                  D_m = N[Abs[D], $MachinePrecision]
                                  M_m = N[Abs[M], $MachinePrecision]
                                  NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                  code[d_, h_, l_, M$95$m_, D$95$m_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  D_m = \left|D\right|
                                  \\
                                  M_m = \left|M\right|
                                  \\
                                  [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                  \\
                                  \frac{d}{\sqrt{\ell \cdot h}}
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 66.8%

                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  2. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. lift-pow.f64N/A

                                      \[\leadsto \left(\color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    2. lift-/.f64N/A

                                      \[\leadsto \left({\color{blue}{\left(\frac{d}{h}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    3. clear-numN/A

                                      \[\leadsto \left({\color{blue}{\left(\frac{1}{\frac{h}{d}}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    4. inv-powN/A

                                      \[\leadsto \left({\color{blue}{\left({\left(\frac{h}{d}\right)}^{-1}\right)}}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    5. pow-powN/A

                                      \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    6. lift-/.f64N/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    7. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(-1 \cdot \color{blue}{\frac{1}{2}}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    8. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\frac{-1}{2}}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    9. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    10. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    11. lift-/.f64N/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    12. lower-pow.f64N/A

                                      \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    13. lower-/.f64N/A

                                      \[\leadsto \left({\color{blue}{\left(\frac{h}{d}\right)}}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    14. lift-/.f64N/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    15. metadata-evalN/A

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                    16. metadata-eval66.7

                                      \[\leadsto \left({\left(\frac{h}{d}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  4. Applied rewrites66.7%

                                    \[\leadsto \left(\color{blue}{{\left(\frac{h}{d}\right)}^{-0.5}} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                  5. Taylor expanded in h around 0

                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                  6. 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-*.f6422.1

                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                  7. Applied rewrites22.1%

                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                  8. Step-by-step derivation
                                    1. Applied rewrites21.7%

                                      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                    2. Add Preprocessing

                                    Reproduce

                                    ?
                                    herbie shell --seed 2024242 
                                    (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)))))