Henrywood and Agarwal, Equation (12)

Percentage Accurate: 65.7% → 81.0%
Time: 15.9s
Alternatives: 17
Speedup: 3.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 65.7% accurate, 1.0× speedup?

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

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

Alternative 1: 81.0% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+212}:\\
\;\;\;\;\left(t\_1 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -1.14999999999999996e120

    1. Initial program 47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.14999999999999996e120 < l < -1.1499999999999999e-307

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999e-307 < l < 6.6e212

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6e212 < l

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 78.1% accurate, 0.2× speedup?

      \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{-0.5 \cdot \left(\frac{M\_m}{d} \cdot D\_m\right)}{\ell}\\ t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_2 := \sqrt{\frac{d}{h}}\\ t_3 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-191}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(t\_0 \cdot h\right) \cdot \frac{M\_m}{d}, 0.25 \cdot D\_m, 1\right) \cdot t\_2\right) \cdot t\_3\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+148}:\\ \;\;\;\;\left(\mathsf{fma}\left(0.25 \cdot \left(h \cdot \frac{M\_m}{d}\right), D\_m \cdot t\_0, 1\right) \cdot t\_3\right) \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-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 (/ (* -0.5 (* (/ M_m d) D_m)) l))
              (t_1
               (*
                (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                (-
                 1.0
                 (*
                  (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                  (/ h l)))))
              (t_2 (sqrt (/ d h)))
              (t_3 (sqrt (/ d l))))
         (if (<= t_1 -1e-191)
           (* (* (fma (* (* t_0 h) (/ M_m d)) (* 0.25 D_m) 1.0) t_2) t_3)
           (if (<= t_1 0.0)
             (fabs (/ d (sqrt (* l h))))
             (if (<= t_1 4e+148)
               (* (* (fma (* 0.25 (* h (/ M_m d))) (* D_m t_0) 1.0) t_3) t_2)
               (pow (/ (sqrt (* h l)) (fabs 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 * ((M_m / d) * D_m)) / l;
      	double t_1 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
      	double t_2 = sqrt((d / h));
      	double t_3 = sqrt((d / l));
      	double tmp;
      	if (t_1 <= -1e-191) {
      		tmp = (fma(((t_0 * h) * (M_m / d)), (0.25 * D_m), 1.0) * t_2) * t_3;
      	} else if (t_1 <= 0.0) {
      		tmp = fabs((d / sqrt((l * h))));
      	} else if (t_1 <= 4e+148) {
      		tmp = (fma((0.25 * (h * (M_m / d))), (D_m * t_0), 1.0) * t_3) * t_2;
      	} else {
      		tmp = pow((sqrt((h * l)) / fabs(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(-0.5 * Float64(Float64(M_m / d) * D_m)) / l)
      	t_1 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
      	t_2 = sqrt(Float64(d / h))
      	t_3 = sqrt(Float64(d / l))
      	tmp = 0.0
      	if (t_1 <= -1e-191)
      		tmp = Float64(Float64(fma(Float64(Float64(t_0 * h) * Float64(M_m / d)), Float64(0.25 * D_m), 1.0) * t_2) * t_3);
      	elseif (t_1 <= 0.0)
      		tmp = abs(Float64(d / sqrt(Float64(l * h))));
      	elseif (t_1 <= 4e+148)
      		tmp = Float64(Float64(fma(Float64(0.25 * Float64(h * Float64(M_m / d))), Float64(D_m * t_0), 1.0) * t_3) * t_2);
      	else
      		tmp = Float64(sqrt(Float64(h * l)) / abs(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[(-0.5 * N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -1e-191], N[(N[(N[(N[(N[(t$95$0 * h), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 4e+148], N[(N[(N[(N[(0.25 * N[(h * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m * t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$3), $MachinePrecision] * t$95$2), $MachinePrecision], N[Power[N[(N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision] / N[Abs[d], $MachinePrecision]), $MachinePrecision], -1.0], $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{-0.5 \cdot \left(\frac{M\_m}{d} \cdot D\_m\right)}{\ell}\\
      t_1 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
      t_2 := \sqrt{\frac{d}{h}}\\
      t_3 := \sqrt{\frac{d}{\ell}}\\
      \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-191}:\\
      \;\;\;\;\left(\mathsf{fma}\left(\left(t\_0 \cdot h\right) \cdot \frac{M\_m}{d}, 0.25 \cdot D\_m, 1\right) \cdot t\_2\right) \cdot t\_3\\
      
      \mathbf{elif}\;t\_1 \leq 0:\\
      \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
      
      \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+148}:\\
      \;\;\;\;\left(\mathsf{fma}\left(0.25 \cdot \left(h \cdot \frac{M\_m}{d}\right), D\_m \cdot t\_0, 1\right) \cdot t\_3\right) \cdot t\_2\\
      
      \mathbf{else}:\\
      \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-1}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1e-191

        1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

          1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

              \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
            2. Step-by-step derivation
              1. Applied rewrites58.0%

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

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

            Alternative 3: 75.6% accurate, 0.2× speedup?

            \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \left(\mathsf{fma}\left(0.25 \cdot \left(h \cdot \frac{M\_m}{d}\right), D\_m \cdot \frac{-0.5 \cdot \left(\frac{M\_m}{d} \cdot D\_m\right)}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-191}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-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
                     (*
                      (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                      (-
                       1.0
                       (*
                        (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                        (/ h l)))))
                    (t_1
                     (*
                      (*
                       (fma
                        (* 0.25 (* h (/ M_m d)))
                        (* D_m (/ (* -0.5 (* (/ M_m d) D_m)) l))
                        1.0)
                       (sqrt (/ d l)))
                      (sqrt (/ d h)))))
               (if (<= t_0 -1e-191)
                 t_1
                 (if (<= t_0 0.0)
                   (fabs (/ d (sqrt (* l h))))
                   (if (<= t_0 4e+148) t_1 (pow (/ (sqrt (* h l)) (fabs 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 / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
            	double t_1 = (fma((0.25 * (h * (M_m / d))), (D_m * ((-0.5 * ((M_m / d) * D_m)) / l)), 1.0) * sqrt((d / l))) * sqrt((d / h));
            	double tmp;
            	if (t_0 <= -1e-191) {
            		tmp = t_1;
            	} else if (t_0 <= 0.0) {
            		tmp = fabs((d / sqrt((l * h))));
            	} else if (t_0 <= 4e+148) {
            		tmp = t_1;
            	} else {
            		tmp = pow((sqrt((h * l)) / fabs(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(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
            	t_1 = Float64(Float64(fma(Float64(0.25 * Float64(h * Float64(M_m / d))), Float64(D_m * Float64(Float64(-0.5 * Float64(Float64(M_m / d) * D_m)) / l)), 1.0) * sqrt(Float64(d / l))) * sqrt(Float64(d / h)))
            	tmp = 0.0
            	if (t_0 <= -1e-191)
            		tmp = t_1;
            	elseif (t_0 <= 0.0)
            		tmp = abs(Float64(d / sqrt(Float64(l * h))));
            	elseif (t_0 <= 4e+148)
            		tmp = t_1;
            	else
            		tmp = Float64(sqrt(Float64(h * l)) / abs(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[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(0.25 * N[(h * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(D$95$m * N[(N[(-0.5 * N[(N[(M$95$m / d), $MachinePrecision] * D$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-191], t$95$1, If[LessEqual[t$95$0, 0.0], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+148], t$95$1, N[Power[N[(N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision] / N[Abs[d], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]]]
            
            \begin{array}{l}
            D_m = \left|D\right|
            \\
            M_m = \left|M\right|
            \\
            [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
            \\
            \begin{array}{l}
            t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
            t_1 := \left(\mathsf{fma}\left(0.25 \cdot \left(h \cdot \frac{M\_m}{d}\right), D\_m \cdot \frac{-0.5 \cdot \left(\frac{M\_m}{d} \cdot D\_m\right)}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
            \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-191}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t\_0 \leq 0:\\
            \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
            
            \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-1}\\
            
            
            \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)))) < -1e-191 or 0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 4.0000000000000002e148

              1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

                if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                  2. Step-by-step derivation
                    1. Applied rewrites58.0%

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

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

                  Alternative 4: 74.4% accurate, 0.2× speedup?

                  \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-134}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M\_m \cdot D\_m\right) \cdot -0.5}{d \cdot \ell}, \left(\frac{M\_m}{d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot t\_1\right) \cdot t\_2\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\ \;\;\;\;t\_2 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-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
                           (*
                            (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                            (-
                             1.0
                             (*
                              (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                              (/ h l)))))
                          (t_1 (sqrt (/ d h)))
                          (t_2 (sqrt (/ d l))))
                     (if (<= t_0 -5e-134)
                       (*
                        (*
                         (fma
                          (/ (* (* M_m D_m) -0.5) (* d l))
                          (* (* (/ M_m d) h) (* 0.25 D_m))
                          1.0)
                         t_1)
                        t_2)
                       (if (<= t_0 0.0)
                         (fabs (/ d (sqrt (* l h))))
                         (if (<= t_0 4e+148)
                           (* t_2 t_1)
                           (pow (/ (sqrt (* h l)) (fabs 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 / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                  	double t_1 = sqrt((d / h));
                  	double t_2 = sqrt((d / l));
                  	double tmp;
                  	if (t_0 <= -5e-134) {
                  		tmp = (fma((((M_m * D_m) * -0.5) / (d * l)), (((M_m / d) * h) * (0.25 * D_m)), 1.0) * t_1) * t_2;
                  	} else if (t_0 <= 0.0) {
                  		tmp = fabs((d / sqrt((l * h))));
                  	} else if (t_0 <= 4e+148) {
                  		tmp = t_2 * t_1;
                  	} else {
                  		tmp = pow((sqrt((h * l)) / fabs(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(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                  	t_1 = sqrt(Float64(d / h))
                  	t_2 = sqrt(Float64(d / l))
                  	tmp = 0.0
                  	if (t_0 <= -5e-134)
                  		tmp = Float64(Float64(fma(Float64(Float64(Float64(M_m * D_m) * -0.5) / Float64(d * l)), Float64(Float64(Float64(M_m / d) * h) * Float64(0.25 * D_m)), 1.0) * t_1) * t_2);
                  	elseif (t_0 <= 0.0)
                  		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                  	elseif (t_0 <= 4e+148)
                  		tmp = Float64(t_2 * t_1);
                  	else
                  		tmp = Float64(sqrt(Float64(h * l)) / abs(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[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -5e-134], N[(N[(N[(N[(N[(N[(M$95$m * D$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / N[(d * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+148], N[(t$95$2 * t$95$1), $MachinePrecision], N[Power[N[(N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision] / N[Abs[d], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]]]]
                  
                  \begin{array}{l}
                  D_m = \left|D\right|
                  \\
                  M_m = \left|M\right|
                  \\
                  [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                  \\
                  \begin{array}{l}
                  t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                  t_1 := \sqrt{\frac{d}{h}}\\
                  t_2 := \sqrt{\frac{d}{\ell}}\\
                  \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-134}:\\
                  \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M\_m \cdot D\_m\right) \cdot -0.5}{d \cdot \ell}, \left(\frac{M\_m}{d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right) \cdot t\_1\right) \cdot t\_2\\
                  
                  \mathbf{elif}\;t\_0 \leq 0:\\
                  \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                  
                  \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\
                  \;\;\;\;t\_2 \cdot t\_1\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-1}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.0000000000000003e-134

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -5.0000000000000003e-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)))) < 0.0

                    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

                      1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

                        if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                          2. Step-by-step derivation
                            1. Applied rewrites58.0%

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

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

                          Alternative 5: 68.0% accurate, 0.2× speedup?

                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-96}:\\ \;\;\;\;\left(\frac{\mathsf{fma}\left(M\_m, \left(-0.125 \cdot M\_m\right) \cdot \left(\frac{D\_m \cdot D\_m}{\ell} \cdot h\right), d \cdot d\right)}{d \cdot d} \cdot t\_1\right) \cdot t\_2\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\ \;\;\;\;t\_2 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-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
                                   (*
                                    (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                    (-
                                     1.0
                                     (*
                                      (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                                      (/ h l)))))
                                  (t_1 (sqrt (/ d h)))
                                  (t_2 (sqrt (/ d l))))
                             (if (<= t_0 -1e-96)
                               (*
                                (*
                                 (/ (fma M_m (* (* -0.125 M_m) (* (/ (* D_m D_m) l) h)) (* d d)) (* d d))
                                 t_1)
                                t_2)
                               (if (<= t_0 0.0)
                                 (fabs (/ d (sqrt (* l h))))
                                 (if (<= t_0 4e+148)
                                   (* t_2 t_1)
                                   (pow (/ (sqrt (* h l)) (fabs 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 / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                          	double t_1 = sqrt((d / h));
                          	double t_2 = sqrt((d / l));
                          	double tmp;
                          	if (t_0 <= -1e-96) {
                          		tmp = ((fma(M_m, ((-0.125 * M_m) * (((D_m * D_m) / l) * h)), (d * d)) / (d * d)) * t_1) * t_2;
                          	} else if (t_0 <= 0.0) {
                          		tmp = fabs((d / sqrt((l * h))));
                          	} else if (t_0 <= 4e+148) {
                          		tmp = t_2 * t_1;
                          	} else {
                          		tmp = pow((sqrt((h * l)) / fabs(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(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                          	t_1 = sqrt(Float64(d / h))
                          	t_2 = sqrt(Float64(d / l))
                          	tmp = 0.0
                          	if (t_0 <= -1e-96)
                          		tmp = Float64(Float64(Float64(fma(M_m, Float64(Float64(-0.125 * M_m) * Float64(Float64(Float64(D_m * D_m) / l) * h)), Float64(d * d)) / Float64(d * d)) * t_1) * t_2);
                          	elseif (t_0 <= 0.0)
                          		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                          	elseif (t_0 <= 4e+148)
                          		tmp = Float64(t_2 * t_1);
                          	else
                          		tmp = Float64(sqrt(Float64(h * l)) / abs(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[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -1e-96], N[(N[(N[(N[(M$95$m * N[(N[(-0.125 * M$95$m), $MachinePrecision] * N[(N[(N[(D$95$m * D$95$m), $MachinePrecision] / l), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+148], N[(t$95$2 * t$95$1), $MachinePrecision], N[Power[N[(N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision] / N[Abs[d], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]]]]
                          
                          \begin{array}{l}
                          D_m = \left|D\right|
                          \\
                          M_m = \left|M\right|
                          \\
                          [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                          \\
                          \begin{array}{l}
                          t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                          t_1 := \sqrt{\frac{d}{h}}\\
                          t_2 := \sqrt{\frac{d}{\ell}}\\
                          \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-96}:\\
                          \;\;\;\;\left(\frac{\mathsf{fma}\left(M\_m, \left(-0.125 \cdot M\_m\right) \cdot \left(\frac{D\_m \cdot D\_m}{\ell} \cdot h\right), d \cdot d\right)}{d \cdot d} \cdot t\_1\right) \cdot t\_2\\
                          
                          \mathbf{elif}\;t\_0 \leq 0:\\
                          \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                          
                          \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\
                          \;\;\;\;t\_2 \cdot t\_1\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-1}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 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.9999999999999991e-97

                            1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if -9.9999999999999991e-97 < (*.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)))) < 0.0

                              1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

                                1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

                                  if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites58.0%

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

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

                                    Alternative 6: 71.2% accurate, 0.2× speedup?

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

                                      1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if -9.9999999999999991e-97 < (*.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)))) < 0.0

                                      1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

                                        1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

                                          if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                            2. Step-by-step derivation
                                              1. Applied rewrites58.0%

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

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

                                            Alternative 7: 71.1% accurate, 0.2× speedup?

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

                                              1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if -9.9999999999999991e-97 < (*.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)))) < 0.0

                                                1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

                                                  1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

                                                    if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites58.0%

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

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

                                                      Alternative 8: 66.7% accurate, 0.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          if -5.0000000000000003e-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)))) < 0.0

                                                          1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

                                                            1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

                                                              if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                2. Step-by-step derivation
                                                                  1. Applied rewrites58.0%

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

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

                                                                Alternative 9: 60.0% accurate, 0.2× speedup?

                                                                \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-134}:\\ \;\;\;\;\left(\left(D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot M\_m\right)\right)\right) \cdot \frac{-0.125}{-d}\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-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
                                                                         (*
                                                                          (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                          (-
                                                                           1.0
                                                                           (*
                                                                            (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                                                                            (/ h l))))))
                                                                   (if (<= t_0 -5e-134)
                                                                     (*
                                                                      (* (* D_m (* D_m (* M_m M_m))) (/ -0.125 (- d)))
                                                                      (/ (sqrt (/ h l)) (fabs l)))
                                                                     (if (<= t_0 0.0)
                                                                       (fabs (/ d (sqrt (* l h))))
                                                                       (if (<= t_0 4e+148)
                                                                         (* (sqrt (/ d l)) (sqrt (/ d h)))
                                                                         (pow (/ (sqrt (* h l)) (fabs 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 / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                                                                	double tmp;
                                                                	if (t_0 <= -5e-134) {
                                                                		tmp = ((D_m * (D_m * (M_m * M_m))) * (-0.125 / -d)) * (sqrt((h / l)) / fabs(l));
                                                                	} else if (t_0 <= 0.0) {
                                                                		tmp = fabs((d / sqrt((l * h))));
                                                                	} else if (t_0 <= 4e+148) {
                                                                		tmp = sqrt((d / l)) * sqrt((d / h));
                                                                	} else {
                                                                		tmp = pow((sqrt((h * l)) / fabs(d)), -1.0);
                                                                	}
                                                                	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 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
                                                                    if (t_0 <= (-5d-134)) then
                                                                        tmp = ((d_m * (d_m * (m_m * m_m))) * ((-0.125d0) / -d)) * (sqrt((h / l)) / abs(l))
                                                                    else if (t_0 <= 0.0d0) then
                                                                        tmp = abs((d / sqrt((l * h))))
                                                                    else if (t_0 <= 4d+148) then
                                                                        tmp = sqrt((d / l)) * sqrt((d / h))
                                                                    else
                                                                        tmp = (sqrt((h * l)) / abs(d)) ** (-1.0d0)
                                                                    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.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                                                                	double tmp;
                                                                	if (t_0 <= -5e-134) {
                                                                		tmp = ((D_m * (D_m * (M_m * M_m))) * (-0.125 / -d)) * (Math.sqrt((h / l)) / Math.abs(l));
                                                                	} else if (t_0 <= 0.0) {
                                                                		tmp = Math.abs((d / Math.sqrt((l * h))));
                                                                	} else if (t_0 <= 4e+148) {
                                                                		tmp = Math.sqrt((d / l)) * Math.sqrt((d / h));
                                                                	} else {
                                                                		tmp = Math.pow((Math.sqrt((h * l)) / Math.abs(d)), -1.0);
                                                                	}
                                                                	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.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))
                                                                	tmp = 0
                                                                	if t_0 <= -5e-134:
                                                                		tmp = ((D_m * (D_m * (M_m * M_m))) * (-0.125 / -d)) * (math.sqrt((h / l)) / math.fabs(l))
                                                                	elif t_0 <= 0.0:
                                                                		tmp = math.fabs((d / math.sqrt((l * h))))
                                                                	elif t_0 <= 4e+148:
                                                                		tmp = math.sqrt((d / l)) * math.sqrt((d / h))
                                                                	else:
                                                                		tmp = math.pow((math.sqrt((h * l)) / math.fabs(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(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                                                                	tmp = 0.0
                                                                	if (t_0 <= -5e-134)
                                                                		tmp = Float64(Float64(Float64(D_m * Float64(D_m * Float64(M_m * M_m))) * Float64(-0.125 / Float64(-d))) * Float64(sqrt(Float64(h / l)) / abs(l)));
                                                                	elseif (t_0 <= 0.0)
                                                                		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                                                                	elseif (t_0 <= 4e+148)
                                                                		tmp = Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h)));
                                                                	else
                                                                		tmp = Float64(sqrt(Float64(h * l)) / abs(d)) ^ -1.0;
                                                                	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 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)));
                                                                	tmp = 0.0;
                                                                	if (t_0 <= -5e-134)
                                                                		tmp = ((D_m * (D_m * (M_m * M_m))) * (-0.125 / -d)) * (sqrt((h / l)) / abs(l));
                                                                	elseif (t_0 <= 0.0)
                                                                		tmp = abs((d / sqrt((l * h))));
                                                                	elseif (t_0 <= 4e+148)
                                                                		tmp = sqrt((d / l)) * sqrt((d / h));
                                                                	else
                                                                		tmp = (sqrt((h * l)) / abs(d)) ^ -1.0;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                D_m = N[Abs[D], $MachinePrecision]
                                                                M_m = N[Abs[M], $MachinePrecision]
                                                                NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-134], N[(N[(N[(D$95$m * N[(D$95$m * N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.125 / (-d)), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+148], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision] / N[Abs[d], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]]
                                                                
                                                                \begin{array}{l}
                                                                D_m = \left|D\right|
                                                                \\
                                                                M_m = \left|M\right|
                                                                \\
                                                                [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                \\
                                                                \begin{array}{l}
                                                                t_0 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                                                                \mathbf{if}\;t\_0 \leq -5 \cdot 10^{-134}:\\
                                                                \;\;\;\;\left(\left(D\_m \cdot \left(D\_m \cdot \left(M\_m \cdot M\_m\right)\right)\right) \cdot \frac{-0.125}{-d}\right) \cdot \frac{\sqrt{\frac{h}{\ell}}}{\left|\ell\right|}\\
                                                                
                                                                \mathbf{elif}\;t\_0 \leq 0:\\
                                                                \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                                                                
                                                                \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+148}:\\
                                                                \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;{\left(\frac{\sqrt{h \cdot \ell}}{\left|d\right|}\right)}^{-1}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 4 regimes
                                                                2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -5.0000000000000003e-134

                                                                  1. Initial program 79.5%

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                  6. Taylor expanded in h around -inf

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

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

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

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

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

                                                                    if -5.0000000000000003e-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)))) < 0.0

                                                                    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

                                                                      1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

                                                                        if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                                                                            \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                          2. Step-by-step derivation
                                                                            1. Applied rewrites58.0%

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

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

                                                                          Alternative 10: 50.7% accurate, 0.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                            if -5e9 < (*.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)))) < 0.0

                                                                            1. Initial program 49.1%

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]

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

                                                                              1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

                                                                                if 4.0000000000000002e148 < (*.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.3%

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

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

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

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

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

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

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

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

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

                                                                                    \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                  2. Step-by-step derivation
                                                                                    1. Applied rewrites58.0%

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

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

                                                                                  Alternative 11: 45.3% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                    if -5e9 < (*.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 55.0%

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

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

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

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

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

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

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

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

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

                                                                                        \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                    7. Recombined 2 regimes into one program.
                                                                                    8. Final simplification48.2%

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

                                                                                    Alternative 12: 46.0% accurate, 0.5× speedup?

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

                                                                                      1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

                                                                                      if -5.0000000000000003e-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))))

                                                                                      1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

                                                                                          \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                      7. Recombined 2 regimes into one program.
                                                                                      8. Final simplification47.4%

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

                                                                                      Alternative 13: 45.8% 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 := \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -5 \cdot 10^{-134}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left|t\_0\right|\\ \end{array} \end{array} \]
                                                                                      D_m = (fabs.f64 D)
                                                                                      M_m = (fabs.f64 M)
                                                                                      NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                      (FPCore (d h l M_m D_m)
                                                                                       :precision binary64
                                                                                       (let* ((t_0 (/ d (sqrt (* l h)))))
                                                                                         (if (<=
                                                                                              (*
                                                                                               (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                                               (-
                                                                                                1.0
                                                                                                (* (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
                                                                                              -5e-134)
                                                                                           t_0
                                                                                           (fabs t_0))))
                                                                                      D_m = fabs(D);
                                                                                      M_m = fabs(M);
                                                                                      assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                      double code(double d, double h, double l, double M_m, double D_m) {
                                                                                      	double t_0 = d / sqrt((l * h));
                                                                                      	double tmp;
                                                                                      	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-134) {
                                                                                      		tmp = t_0;
                                                                                      	} else {
                                                                                      		tmp = fabs(t_0);
                                                                                      	}
                                                                                      	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 = d / sqrt((l * h))
                                                                                          if (((((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))) <= (-5d-134)) then
                                                                                              tmp = t_0
                                                                                          else
                                                                                              tmp = abs(t_0)
                                                                                          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 = d / Math.sqrt((l * h));
                                                                                      	double tmp;
                                                                                      	if (((Math.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-134) {
                                                                                      		tmp = t_0;
                                                                                      	} else {
                                                                                      		tmp = Math.abs(t_0);
                                                                                      	}
                                                                                      	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 = d / math.sqrt((l * h))
                                                                                      	tmp = 0
                                                                                      	if ((math.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= -5e-134:
                                                                                      		tmp = t_0
                                                                                      	else:
                                                                                      		tmp = math.fabs(t_0)
                                                                                      	return tmp
                                                                                      
                                                                                      D_m = abs(D)
                                                                                      M_m = abs(M)
                                                                                      d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                      function code(d, h, l, M_m, D_m)
                                                                                      	t_0 = Float64(d / sqrt(Float64(l * h)))
                                                                                      	tmp = 0.0
                                                                                      	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= -5e-134)
                                                                                      		tmp = t_0;
                                                                                      	else
                                                                                      		tmp = abs(t_0);
                                                                                      	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 = d / sqrt((l * h));
                                                                                      	tmp = 0.0;
                                                                                      	if (((((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)))) <= -5e-134)
                                                                                      		tmp = t_0;
                                                                                      	else
                                                                                      		tmp = abs(t_0);
                                                                                      	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[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-134], t$95$0, N[Abs[t$95$0], $MachinePrecision]]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      D_m = \left|D\right|
                                                                                      \\
                                                                                      M_m = \left|M\right|
                                                                                      \\
                                                                                      [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\
                                                                                      \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -5 \cdot 10^{-134}:\\
                                                                                      \;\;\;\;t\_0\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\left|t\_0\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)))) < -5.0000000000000003e-134

                                                                                        1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

                                                                                          if -5.0000000000000003e-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))))

                                                                                          1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
                                                                                          7. Recombined 2 regimes into one program.
                                                                                          8. Final simplification47.0%

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

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

                                                                                            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-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            if -4.999999999999985e-310 < d < 1.75e-28

                                                                                            1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            if 1.75e-28 < d

                                                                                            1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                          Alternative 15: 81.0% accurate, 2.9× speedup?

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

                                                                                            1. Initial program 47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                            if -1.14999999999999996e120 < l < -1.1499999999999999e-307

                                                                                            1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              4. lift-neg.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(h\right)}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              5. lift-neg.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{-d}{\color{blue}{-h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              6. sqrt-divN/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              7. lift-sqrt.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{-h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              8. lift-sqrt.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{-h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              9. lower-/.f6481.7

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                            9. Applied rewrites81.7%

                                                                                              \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]

                                                                                            if -1.1499999999999999e-307 < l < 6.6e212

                                                                                            1. Initial program 72.2%

                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                            2. Add Preprocessing
                                                                                            3. Step-by-step derivation
                                                                                              1. lift-*.f64N/A

                                                                                                \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                              3. lift-*.f64N/A

                                                                                                \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                              4. associate-*r*N/A

                                                                                                \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                              5. lower-*.f64N/A

                                                                                                \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                            4. Applied rewrites67.9%

                                                                                              \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]
                                                                                            5. Step-by-step derivation
                                                                                              1. lift-*.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2}{M} \cdot \frac{d}{D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              2. lift-/.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\color{blue}{\frac{2}{M}} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              3. lift-/.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \color{blue}{\frac{d}{D}}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              4. frac-timesN/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              5. lower-/.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              6. lower-*.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\frac{\color{blue}{2 \cdot d}}{M \cdot D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              7. lower-*.f6472.2

                                                                                                \[\leadsto \left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2 \cdot d}{\color{blue}{M \cdot D}}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                            6. Applied rewrites72.2%

                                                                                              \[\leadsto \left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                            7. Applied rewrites73.3%

                                                                                              \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                            8. Step-by-step derivation
                                                                                              1. lift-sqrt.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              2. lift-/.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              3. sqrt-divN/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              4. pow1/2N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              5. metadata-evalN/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\color{blue}{\left(\frac{1}{2}\right)}}}{\sqrt{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              6. pow1/2N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\left(\frac{1}{2}\right)}}{\color{blue}{{h}^{\frac{1}{2}}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              7. metadata-evalN/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\left(\frac{1}{2}\right)}}{{h}^{\color{blue}{\left(\frac{1}{2}\right)}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              8. lower-/.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{{d}^{\left(\frac{1}{2}\right)}}{{h}^{\left(\frac{1}{2}\right)}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              9. metadata-evalN/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\color{blue}{\frac{1}{2}}}}{{h}^{\left(\frac{1}{2}\right)}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              10. pow1/2N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\left(\frac{1}{2}\right)}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              11. lower-sqrt.f64N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\left(\frac{1}{2}\right)}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              12. metadata-evalN/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{d}}{{h}^{\color{blue}{\frac{1}{2}}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              13. pow1/2N/A

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                              14. lower-sqrt.f6480.3

                                                                                                \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                            9. Applied rewrites80.3%

                                                                                              \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]

                                                                                            if 6.6e212 < l

                                                                                            1. Initial program 17.6%

                                                                                              \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                            2. Add Preprocessing
                                                                                            3. Taylor expanded in d around inf

                                                                                              \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                            4. Step-by-step derivation
                                                                                              1. *-commutativeN/A

                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                              2. lower-*.f64N/A

                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                              3. lower-sqrt.f64N/A

                                                                                                \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                              4. lower-/.f64N/A

                                                                                                \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                              5. *-commutativeN/A

                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                              6. lower-*.f6460.0

                                                                                                \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                            5. Applied rewrites60.0%

                                                                                              \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                            6. Step-by-step derivation
                                                                                              1. Applied rewrites59.8%

                                                                                                \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                                                              2. Step-by-step derivation
                                                                                                1. Applied rewrites70.8%

                                                                                                  \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                                                              3. Recombined 4 regimes into one program.
                                                                                              4. Add Preprocessing

                                                                                              Alternative 16: 77.7% accurate, 3.0× speedup?

                                                                                              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{\left(D\_m \cdot \frac{M\_m}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M\_m}{d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right)\\ \mathbf{if}\;\ell \leq -1.36 \cdot 10^{-291}:\\ \;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\ \mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+212}:\\ \;\;\;\;\left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \end{array} \]
                                                                                              D_m = (fabs.f64 D)
                                                                                              M_m = (fabs.f64 M)
                                                                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                              (FPCore (d h l M_m D_m)
                                                                                               :precision binary64
                                                                                               (let* ((t_0
                                                                                                       (fma
                                                                                                        (/ (* (* D_m (/ M_m d)) -0.5) l)
                                                                                                        (* (* (/ M_m d) h) (* 0.25 D_m))
                                                                                                        1.0)))
                                                                                                 (if (<= l -1.36e-291)
                                                                                                   (* (* t_0 (sqrt (/ d h))) (/ (sqrt (- d)) (sqrt (- l))))
                                                                                                   (if (<= l 6.6e+212)
                                                                                                     (* (* t_0 (/ (sqrt d) (sqrt h))) (sqrt (/ d l)))
                                                                                                     (/ d (* (sqrt l) (sqrt h)))))))
                                                                                              D_m = fabs(D);
                                                                                              M_m = fabs(M);
                                                                                              assert(d < h && h < l && l < M_m && M_m < D_m);
                                                                                              double code(double d, double h, double l, double M_m, double D_m) {
                                                                                              	double t_0 = fma((((D_m * (M_m / d)) * -0.5) / l), (((M_m / d) * h) * (0.25 * D_m)), 1.0);
                                                                                              	double tmp;
                                                                                              	if (l <= -1.36e-291) {
                                                                                              		tmp = (t_0 * sqrt((d / h))) * (sqrt(-d) / sqrt(-l));
                                                                                              	} else if (l <= 6.6e+212) {
                                                                                              		tmp = (t_0 * (sqrt(d) / sqrt(h))) * sqrt((d / l));
                                                                                              	} else {
                                                                                              		tmp = d / (sqrt(l) * sqrt(h));
                                                                                              	}
                                                                                              	return tmp;
                                                                                              }
                                                                                              
                                                                                              D_m = abs(D)
                                                                                              M_m = abs(M)
                                                                                              d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                                                                              function code(d, h, l, M_m, D_m)
                                                                                              	t_0 = fma(Float64(Float64(Float64(D_m * Float64(M_m / d)) * -0.5) / l), Float64(Float64(Float64(M_m / d) * h) * Float64(0.25 * D_m)), 1.0)
                                                                                              	tmp = 0.0
                                                                                              	if (l <= -1.36e-291)
                                                                                              		tmp = Float64(Float64(t_0 * sqrt(Float64(d / h))) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l))));
                                                                                              	elseif (l <= 6.6e+212)
                                                                                              		tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(h))) * sqrt(Float64(d / l)));
                                                                                              	else
                                                                                              		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
                                                                                              	end
                                                                                              	return tmp
                                                                                              end
                                                                                              
                                                                                              D_m = N[Abs[D], $MachinePrecision]
                                                                                              M_m = N[Abs[M], $MachinePrecision]
                                                                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                                                              code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(N[(D$95$m * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision] * N[(0.25 * D$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -1.36e-291], N[(N[(t$95$0 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6.6e+212], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                              
                                                                                              \begin{array}{l}
                                                                                              D_m = \left|D\right|
                                                                                              \\
                                                                                              M_m = \left|M\right|
                                                                                              \\
                                                                                              [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                                                                              \\
                                                                                              \begin{array}{l}
                                                                                              t_0 := \mathsf{fma}\left(\frac{\left(D\_m \cdot \frac{M\_m}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M\_m}{d} \cdot h\right) \cdot \left(0.25 \cdot D\_m\right), 1\right)\\
                                                                                              \mathbf{if}\;\ell \leq -1.36 \cdot 10^{-291}:\\
                                                                                              \;\;\;\;\left(t\_0 \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\\
                                                                                              
                                                                                              \mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+212}:\\
                                                                                              \;\;\;\;\left(t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                                                                              
                                                                                              \mathbf{else}:\\
                                                                                              \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\
                                                                                              
                                                                                              
                                                                                              \end{array}
                                                                                              \end{array}
                                                                                              
                                                                                              Derivation
                                                                                              1. Split input into 3 regimes
                                                                                              2. if l < -1.36000000000000007e-291

                                                                                                1. Initial program 61.7%

                                                                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                2. Add Preprocessing
                                                                                                3. Step-by-step derivation
                                                                                                  1. lift-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                                  3. lift-*.f64N/A

                                                                                                    \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                                  4. associate-*r*N/A

                                                                                                    \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                                  5. lower-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                                4. Applied rewrites62.2%

                                                                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]
                                                                                                5. Step-by-step derivation
                                                                                                  1. lift-*.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2}{M} \cdot \frac{d}{D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  2. lift-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\color{blue}{\frac{2}{M}} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  3. lift-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \color{blue}{\frac{d}{D}}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  4. frac-timesN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  5. lower-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  6. lower-*.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\frac{\color{blue}{2 \cdot d}}{M \cdot D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  7. lower-*.f6461.6

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2 \cdot d}{\color{blue}{M \cdot D}}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                6. Applied rewrites61.6%

                                                                                                  \[\leadsto \left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                7. Applied rewrites65.3%

                                                                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                8. Step-by-step derivation
                                                                                                  1. lift-sqrt.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\sqrt{\frac{d}{\ell}}} \]
                                                                                                  2. lift-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\color{blue}{\frac{d}{\ell}}} \]
                                                                                                  3. frac-2negN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}} \]
                                                                                                  4. lift-neg.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(\ell\right)}} \]
                                                                                                  5. sqrt-divN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{\mathsf{neg}\left(\ell\right)}}} \]
                                                                                                  6. lift-sqrt.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{\mathsf{neg}\left(\ell\right)}} \]
                                                                                                  7. lower-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{\mathsf{neg}\left(\ell\right)}}} \]
                                                                                                  8. lower-sqrt.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}} \]
                                                                                                  9. lower-neg.f6473.5

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{\color{blue}{-\ell}}} \]
                                                                                                9. Applied rewrites73.5%

                                                                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}} \]

                                                                                                if -1.36000000000000007e-291 < l < 6.6e212

                                                                                                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. Step-by-step derivation
                                                                                                  1. lift-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \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 \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                                  3. lift-*.f64N/A

                                                                                                    \[\leadsto \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \color{blue}{\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]
                                                                                                  4. associate-*r*N/A

                                                                                                    \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                                  5. lower-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                                                                4. Applied rewrites67.2%

                                                                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}}} \]
                                                                                                5. Step-by-step derivation
                                                                                                  1. lift-*.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2}{M} \cdot \frac{d}{D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  2. lift-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\color{blue}{\frac{2}{M}} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  3. lift-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \color{blue}{\frac{d}{D}}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  4. frac-timesN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  5. lower-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  6. lower-*.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{h}{\ell}, {\left(\frac{\color{blue}{2 \cdot d}}{M \cdot D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  7. lower-*.f6471.4

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2 \cdot d}{\color{blue}{M \cdot D}}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                6. Applied rewrites71.4%

                                                                                                  \[\leadsto \left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\color{blue}{\left(\frac{2 \cdot d}{M \cdot D}\right)}}^{-2}, 1\right) \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                7. Applied rewrites72.5%

                                                                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                8. Step-by-step derivation
                                                                                                  1. lift-sqrt.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  2. lift-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  3. sqrt-divN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  4. pow1/2N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  5. metadata-evalN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\color{blue}{\left(\frac{1}{2}\right)}}}{\sqrt{h}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  6. pow1/2N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\left(\frac{1}{2}\right)}}{\color{blue}{{h}^{\frac{1}{2}}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  7. metadata-evalN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\left(\frac{1}{2}\right)}}{{h}^{\color{blue}{\left(\frac{1}{2}\right)}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  8. lower-/.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{{d}^{\left(\frac{1}{2}\right)}}{{h}^{\left(\frac{1}{2}\right)}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  9. metadata-evalN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{{d}^{\color{blue}{\frac{1}{2}}}}{{h}^{\left(\frac{1}{2}\right)}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  10. pow1/2N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\left(\frac{1}{2}\right)}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  11. lower-sqrt.f64N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\left(\frac{1}{2}\right)}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  12. metadata-evalN/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{d}}{{h}^{\color{blue}{\frac{1}{2}}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  13. pow1/2N/A

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot \frac{-1}{2}}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                  14. lower-sqrt.f6479.5

                                                                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]
                                                                                                9. Applied rewrites79.5%

                                                                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(D \cdot \frac{M}{d}\right) \cdot -0.5}{\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}}\right) \cdot \sqrt{\frac{d}{\ell}} \]

                                                                                                if 6.6e212 < l

                                                                                                1. Initial program 17.6%

                                                                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in d around inf

                                                                                                  \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. *-commutativeN/A

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                  2. lower-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                  3. lower-sqrt.f64N/A

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                  4. lower-/.f64N/A

                                                                                                    \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                  5. *-commutativeN/A

                                                                                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                  6. lower-*.f6460.0

                                                                                                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                5. Applied rewrites60.0%

                                                                                                  \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                6. Step-by-step derivation
                                                                                                  1. Applied rewrites59.8%

                                                                                                    \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                                                                  2. Step-by-step derivation
                                                                                                    1. Applied rewrites70.8%

                                                                                                      \[\leadsto \frac{d}{\sqrt{\ell} \cdot \color{blue}{\sqrt{h}}} \]
                                                                                                  3. Recombined 3 regimes into one program.
                                                                                                  4. Add Preprocessing

                                                                                                  Alternative 17: 26.2% accurate, 15.3× speedup?

                                                                                                  \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \frac{d}{\sqrt{\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 62.4%

                                                                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                                                                  2. Add Preprocessing
                                                                                                  3. Taylor expanded in d around inf

                                                                                                    \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. *-commutativeN/A

                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                    2. lower-*.f64N/A

                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                                                                    3. lower-sqrt.f64N/A

                                                                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                    4. lower-/.f64N/A

                                                                                                      \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                                                                    5. *-commutativeN/A

                                                                                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                    6. lower-*.f6426.9

                                                                                                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                                                                  5. Applied rewrites26.9%

                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                                                                  6. Step-by-step derivation
                                                                                                    1. Applied rewrites26.8%

                                                                                                      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                                                                    2. Add Preprocessing

                                                                                                    Reproduce

                                                                                                    ?
                                                                                                    herbie shell --seed 2024315 
                                                                                                    (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)))))