Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.3% → 85.9%
Time: 18.8s
Alternatives: 26
Speedup: 3.1×

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

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

Initial Program: 66.3% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;h \leq 2.85 \cdot 10^{+82}:\\
\;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_0, \left(\left(D\_m \cdot h\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot -0.5, {\left(\frac{d}{D\_m} \cdot \frac{2}{M\_m}\right)}^{-2}, 1\right)\right)}{\sqrt{h}}\\


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

    1. Initial program 65.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. 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. 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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < h < 2.85000000000000008e82

    1. Initial program 61.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. 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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.85000000000000008e82 < h

    1. Initial program 71.0%

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

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

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

Alternative 2: 75.1% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 10^{+248}:\\
\;\;\;\;t\_2 \cdot t\_3\\

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


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

    1. Initial program 81.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. 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) \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(M \cdot \frac{\frac{1}{2} \cdot D}{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot \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}} \]
      13. lift-neg.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(M \cdot \frac{\frac{1}{2} \cdot D}{\color{blue}{\left(-d\right)} \cdot \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}} \]
      14. lower-*.f6474.6

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

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

    if -4.9999999999999999e-161 < (*.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 or 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

      1. Initial program 98.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. 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. 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) \]
        3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

    Alternative 3: 70.0% accurate, 0.3× speedup?

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

      1. Initial program 76.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. 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) \]
        3. associate-*l*N/A

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

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

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

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

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

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

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

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

      1. Initial program 66.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. 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) \]
        3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      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)))) < 1.00000000000000005e248

      1. Initial program 98.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. 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. 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) \]
        3. associate-*l*N/A

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

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

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

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

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

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

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

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

      if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 70.5% accurate, 0.3× speedup?

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

        1. Initial program 77.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. 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) \]
          3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -9.99999999999999945e272 < (*.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 62.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. 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) \]
          3. associate-*l*N/A

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

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

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

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

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

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

        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)))) < 1.00000000000000005e248

        1. Initial program 98.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. 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. 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) \]
          3. associate-*l*N/A

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

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

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

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

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

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

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

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

        if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

        Alternative 5: 69.0% accurate, 0.3× speedup?

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

          1. Initial program 76.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. 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) \]
            3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 66.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. 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) \]
            3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          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)))) < 1.00000000000000005e248

          1. Initial program 98.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. 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. 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) \]
            3. associate-*l*N/A

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

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

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

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

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

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

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

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

          if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

          Alternative 6: 67.6% accurate, 0.3× speedup?

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

            1. Initial program 76.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. 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) \]
              3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\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}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
            9. Step-by-step derivation
              1. Applied rewrites61.1%

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

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

              1. Initial program 66.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. 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) \]
                3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              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)))) < 1.00000000000000005e248

              1. Initial program 98.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. 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. 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) \]
                3. associate-*l*N/A

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

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

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

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

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

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

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

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

              if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

              Alternative 7: 59.4% accurate, 0.3× speedup?

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

                1. Initial program 80.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. 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) \]
                  3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.99999999999999999e-73 < (*.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 or 1.00000000000000005e248 < (*.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 25.1%

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

                  \[\leadsto \color{blue}{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.1

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

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

                    \[\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)))) < 1.00000000000000005e248

                  1. Initial program 98.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. 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. 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) \]
                    3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

                Alternative 8: 58.5% accurate, 0.3× speedup?

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

                  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. 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) \]
                    3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -9.99999999999999955e126 < (*.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 or 1.00000000000000005e248 < (*.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 31.2%

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

                    \[\leadsto \color{blue}{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.1

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

                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                  6. Step-by-step derivation
                    1. Applied rewrites51.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)))) < 1.00000000000000005e248

                    1. Initial program 98.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. 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. 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) \]
                      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

                  Alternative 9: 54.5% accurate, 0.3× speedup?

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

                    1. Initial program 81.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. 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) \]
                      3. associate-*l*N/A

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

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

                        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                    4. Applied rewrites78.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}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                    5. Taylor expanded in l around -inf

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

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

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

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

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

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

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

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

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

                    if -4.9999999999999999e-161 < (*.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 or 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

                      1. Initial program 98.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. 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. 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) \]
                        3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

                    Alternative 10: 52.3% accurate, 0.3× speedup?

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

                      1. Initial program 80.8%

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

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

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

                      if -1.99999999999999999e-73 < (*.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 or 1.00000000000000005e248 < (*.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 25.1%

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

                        \[\leadsto \color{blue}{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.1

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

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

                          \[\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)))) < 1.00000000000000005e248

                        1. Initial program 98.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. 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. 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) \]
                          3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

                      Alternative 11: 49.9% accurate, 0.3× speedup?

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

                        1. Initial program 80.8%

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

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

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

                        if -1.99999999999999999e-73 < (*.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)))) < 2.00000000000000001e-150 or 1.00000000000000005e96 < (*.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 39.9%

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

                          \[\leadsto \color{blue}{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 rewrites61.0%

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

                          if 2.00000000000000001e-150 < (*.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.00000000000000005e96

                          1. Initial program 99.5%

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

                            \[\leadsto \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-*.f6438.8

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

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

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

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

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

                            Alternative 12: 76.0% accurate, 0.4× speedup?

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

                              1. Initial program 82.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. 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) \]
                                3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              1. Initial program 49.5%

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

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

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

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

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

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

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

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

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

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

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

                                1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 13: 61.4% accurate, 0.5× speedup?

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

                                1. Initial program 73.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. 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) \]
                                  3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                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)))) < 1.00000000000000005e248

                                1. Initial program 98.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. 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. 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) \]
                                  3. associate-*l*N/A

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

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

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

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

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

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

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

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

                                if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

                                Alternative 14: 57.2% accurate, 0.5× speedup?

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

                                  1. Initial program 73.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. 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) \]
                                    3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  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)))) < 1.00000000000000005e248

                                  1. Initial program 98.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. 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. 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) \]
                                    3. associate-*l*N/A

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

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

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

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

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

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

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

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

                                  if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                    1. Initial program 82.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. 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) \]
                                      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                      1. Initial program 82.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. 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) \]
                                        3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                        1. Initial program 82.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. 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) \]
                                          3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if 1.00000000000000005e248 < (*.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 23.4%

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 18: 45.9% accurate, 0.9× speedup?

                                        \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;\left(1 - \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -2 \cdot 10^{-73}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \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 (<=
                                              (*
                                               (- 1.0 (* (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0)) (/ h l)))
                                               (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
                                              -2e-73)
                                           (* (sqrt (/ 1.0 (* l h))) (- 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 (((1.0 - ((pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= -2e-73) {
                                        		tmp = sqrt((1.0 / (l * h))) * -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 (((1.0d0 - (((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0)) * (h / l))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))) <= (-2d-73)) then
                                                tmp = sqrt((1.0d0 / (l * h))) * -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 (((1.0 - ((Math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= -2e-73) {
                                        		tmp = Math.sqrt((1.0 / (l * h))) * -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 ((1.0 - ((math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= -2e-73:
                                        		tmp = math.sqrt((1.0 / (l * h))) * -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(1.0 - Float64(Float64((Float64(Float64(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)) * Float64(h / l))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= -2e-73)
                                        		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-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 (((1.0 - (((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)) * (h / l))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= -2e-73)
                                        		tmp = sqrt((1.0 / (l * h))) * -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[(1.0 - N[(N[(N[Power[N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-73], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $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(1 - \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -2 \cdot 10^{-73}:\\
                                        \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                                        
                                        \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)))) < -1.99999999999999999e-73

                                          1. Initial program 80.8%

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

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

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

                                          if -1.99999999999999999e-73 < (*.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 56.0%

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 19: 45.9% accurate, 0.9× speedup?

                                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \frac{d}{\sqrt{\ell \cdot h}}\\ \mathbf{if}\;\left(1 - \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -1 \cdot 10^{-41}:\\ \;\;\;\;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 (<=
                                                  (*
                                                   (-
                                                    1.0
                                                    (* (* (pow (/ (* D_m M_m) (* 2.0 d)) 2.0) (/ 1.0 2.0)) (/ h l)))
                                                   (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0))))
                                                  -1e-41)
                                               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 (((1.0 - ((pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0)))) <= -1e-41) {
                                          		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 (((1.0d0 - (((((d_m * m_m) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0)) * (h / l))) * (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0)))) <= (-1d-41)) 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 (((1.0 - ((Math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0)))) <= -1e-41) {
                                          		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 ((1.0 - ((math.pow(((D_m * M_m) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0)))) <= -1e-41:
                                          		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(1.0 - Float64(Float64((Float64(Float64(D_m * M_m) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)) * Float64(h / l))) * Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0)))) <= -1e-41)
                                          		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 (((1.0 - (((((D_m * M_m) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)) * (h / l))) * (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0)))) <= -1e-41)
                                          		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[(1.0 - N[(N[(N[Power[N[(N[(D$95$m * M$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-41], 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(1 - \left({\left(\frac{D\_m \cdot M\_m}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \leq -1 \cdot 10^{-41}:\\
                                          \;\;\;\;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)))) < -1.00000000000000001e-41

                                            1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

                                              if -1.00000000000000001e-41 < (*.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 56.3%

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 20: 87.0% accurate, 2.7× speedup?

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

                                                1. Initial program 65.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. 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. 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) \]
                                                  3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \]
                                                  4. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(h\right)}} \]
                                                  5. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{-d}{\color{blue}{-h}}} \]
                                                  6. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                  7. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{-h}} \]
                                                  8. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{-h}}} \]
                                                  9. lower-/.f6488.3

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                9. Applied rewrites88.3%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]

                                                if -4.999999999999985e-310 < h < 2.8e82

                                                1. Initial program 61.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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites61.8%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites71.5%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  3. associate-*l/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  4. associate-/l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  5. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  6. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right)} \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. associate-*l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot \left(M \cdot D\right)\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. metadata-evalN/A

                                                    \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{1}{2}}}{d} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  10. associate-/r*N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{1}{2 \cdot d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  11. associate-/r/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  12. clear-numN/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  13. lower-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites71.6%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(D \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{\left(\left(h \cdot \frac{M}{d}\right) \cdot D\right) \cdot 0.25}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Applied rewrites85.1%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{0.5}{d} \cdot M\right) \cdot D, \frac{-0.25}{\ell} \cdot \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

                                                if 2.8e82 < h

                                                1. Initial program 71.0%

                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-*.f64N/A

                                                    \[\leadsto \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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites68.9%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites62.7%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
                                                  3. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                                  4. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \]
                                                  5. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{{d}^{\frac{1}{2}}}{\color{blue}{{h}^{\frac{1}{2}}}} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{{d}^{\frac{1}{2}}}{{h}^{\frac{1}{2}}}} \]
                                                  7. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  8. lower-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  9. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                  10. lower-sqrt.f6480.8

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                7. Applied rewrites80.8%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                              3. Recombined 3 regimes into one program.
                                              4. Final simplification86.0%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot \frac{0.5}{d}\right) \cdot D}{-\ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\right)\\ \mathbf{elif}\;h \leq 2.8 \cdot 10^{+82}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D, \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot \frac{0.5}{d}\right) \cdot D}{-\ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\right)\\ \end{array} \]
                                              5. Add Preprocessing

                                              Alternative 21: 82.1% 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 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\ t_1 := \sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{t\_0}{-\ell}, \left(0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\ \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_1 \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 2.8 \cdot 10^{+82}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_0, \left(\left(D\_m \cdot h\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\\ \end{array} \end{array} \]
                                              D_m = (fabs.f64 D)
                                              M_m = (fabs.f64 M)
                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                              (FPCore (d h l M_m D_m)
                                               :precision binary64
                                               (let* ((t_0 (* (* M_m (/ 0.5 d)) D_m))
                                                      (t_1
                                                       (*
                                                        (sqrt (/ d l))
                                                        (fma (/ t_0 (- l)) (* (* 0.25 D_m) (* (/ M_m d) h)) 1.0))))
                                                 (if (<= h -5e-310)
                                                   (* t_1 (/ (sqrt (- d)) (sqrt (- h))))
                                                   (if (<= h 2.8e+82)
                                                     (*
                                                      (/ d (sqrt (* l h)))
                                                      (fma t_0 (* (* (* D_m h) (/ M_m d)) (/ -0.25 l)) 1.0))
                                                     (* (/ (sqrt d) (sqrt h)) t_1)))))
                                              D_m = fabs(D);
                                              M_m = fabs(M);
                                              assert(d < h && h < l && l < M_m && M_m < D_m);
                                              double code(double d, double h, double l, double M_m, double D_m) {
                                              	double t_0 = (M_m * (0.5 / d)) * D_m;
                                              	double t_1 = sqrt((d / l)) * fma((t_0 / -l), ((0.25 * D_m) * ((M_m / d) * h)), 1.0);
                                              	double tmp;
                                              	if (h <= -5e-310) {
                                              		tmp = t_1 * (sqrt(-d) / sqrt(-h));
                                              	} else if (h <= 2.8e+82) {
                                              		tmp = (d / sqrt((l * h))) * fma(t_0, (((D_m * h) * (M_m / d)) * (-0.25 / l)), 1.0);
                                              	} else {
                                              		tmp = (sqrt(d) / sqrt(h)) * t_1;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              D_m = abs(D)
                                              M_m = abs(M)
                                              d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                              function code(d, h, l, M_m, D_m)
                                              	t_0 = Float64(Float64(M_m * Float64(0.5 / d)) * D_m)
                                              	t_1 = Float64(sqrt(Float64(d / l)) * fma(Float64(t_0 / Float64(-l)), Float64(Float64(0.25 * D_m) * Float64(Float64(M_m / d) * h)), 1.0))
                                              	tmp = 0.0
                                              	if (h <= -5e-310)
                                              		tmp = Float64(t_1 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))));
                                              	elseif (h <= 2.8e+82)
                                              		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(t_0, Float64(Float64(Float64(D_m * h) * Float64(M_m / d)) * Float64(-0.25 / l)), 1.0));
                                              	else
                                              		tmp = Float64(Float64(sqrt(d) / sqrt(h)) * t_1);
                                              	end
                                              	return tmp
                                              end
                                              
                                              D_m = N[Abs[D], $MachinePrecision]
                                              M_m = N[Abs[M], $MachinePrecision]
                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                              code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$0 / (-l)), $MachinePrecision] * N[(N[(0.25 * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(t$95$1 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.8e+82], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[(N[(D$95$m * h), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(-0.25 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
                                              
                                              \begin{array}{l}
                                              D_m = \left|D\right|
                                              \\
                                              M_m = \left|M\right|
                                              \\
                                              [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                              \\
                                              \begin{array}{l}
                                              t_0 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
                                              t_1 := \sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{t\_0}{-\ell}, \left(0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right)\\
                                              \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
                                              \;\;\;\;t\_1 \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
                                              
                                              \mathbf{elif}\;h \leq 2.8 \cdot 10^{+82}:\\
                                              \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_0, \left(\left(D\_m \cdot h\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot t\_1\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if h < -4.999999999999985e-310

                                                1. Initial program 65.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. 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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites64.9%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites66.0%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
                                                  3. frac-2negN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \]
                                                  4. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(h\right)}} \]
                                                  5. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{-d}{\color{blue}{-h}}} \]
                                                  6. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                  7. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{-h}} \]
                                                  8. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{-h}}} \]
                                                  9. lower-/.f6477.6

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                7. Applied rewrites77.6%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]

                                                if -4.999999999999985e-310 < h < 2.8e82

                                                1. Initial program 61.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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites61.8%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites71.5%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  3. associate-*l/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  4. associate-/l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  5. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  6. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right)} \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. associate-*l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot \left(M \cdot D\right)\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. metadata-evalN/A

                                                    \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{1}{2}}}{d} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  10. associate-/r*N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{1}{2 \cdot d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  11. associate-/r/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  12. clear-numN/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  13. lower-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites71.6%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(D \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{\left(\left(h \cdot \frac{M}{d}\right) \cdot D\right) \cdot 0.25}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Applied rewrites85.1%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{0.5}{d} \cdot M\right) \cdot D, \frac{-0.25}{\ell} \cdot \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

                                                if 2.8e82 < h

                                                1. Initial program 71.0%

                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-*.f64N/A

                                                    \[\leadsto \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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites68.9%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites62.7%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
                                                  3. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                                  4. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \]
                                                  5. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{{d}^{\frac{1}{2}}}{\color{blue}{{h}^{\frac{1}{2}}}} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{{d}^{\frac{1}{2}}}{{h}^{\frac{1}{2}}}} \]
                                                  7. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  8. lower-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  9. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                  10. lower-sqrt.f6480.8

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                7. Applied rewrites80.8%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                              3. Recombined 3 regimes into one program.
                                              4. Final simplification80.4%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot \frac{0.5}{d}\right) \cdot D}{-\ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 2.8 \cdot 10^{+82}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D, \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot \frac{0.5}{d}\right) \cdot D}{-\ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\right)\\ \end{array} \]
                                              5. Add Preprocessing

                                              Alternative 22: 79.7% accurate, 2.9× speedup?

                                              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \left(0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right)\\ t_1 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\ t_2 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M\_m \cdot 0.5\right) \cdot D\_m}{\left(-d\right) \cdot \ell}, t\_0, 1\right) \cdot t\_2\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 2.8 \cdot 10^{+82}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_1, \left(\left(D\_m \cdot h\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{t\_1}{-\ell}, t\_0, 1\right)\right)\\ \end{array} \end{array} \]
                                              D_m = (fabs.f64 D)
                                              M_m = (fabs.f64 M)
                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                              (FPCore (d h l M_m D_m)
                                               :precision binary64
                                               (let* ((t_0 (* (* 0.25 D_m) (* (/ M_m d) h)))
                                                      (t_1 (* (* M_m (/ 0.5 d)) D_m))
                                                      (t_2 (sqrt (/ d l))))
                                                 (if (<= h -5e-310)
                                                   (*
                                                    (* (fma (/ (* (* M_m 0.5) D_m) (* (- d) l)) t_0 1.0) t_2)
                                                    (/ (sqrt (- d)) (sqrt (- h))))
                                                   (if (<= h 2.8e+82)
                                                     (*
                                                      (/ d (sqrt (* l h)))
                                                      (fma t_1 (* (* (* D_m h) (/ M_m d)) (/ -0.25 l)) 1.0))
                                                     (* (/ (sqrt d) (sqrt h)) (* t_2 (fma (/ t_1 (- l)) t_0 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.25 * D_m) * ((M_m / d) * h);
                                              	double t_1 = (M_m * (0.5 / d)) * D_m;
                                              	double t_2 = sqrt((d / l));
                                              	double tmp;
                                              	if (h <= -5e-310) {
                                              		tmp = (fma((((M_m * 0.5) * D_m) / (-d * l)), t_0, 1.0) * t_2) * (sqrt(-d) / sqrt(-h));
                                              	} else if (h <= 2.8e+82) {
                                              		tmp = (d / sqrt((l * h))) * fma(t_1, (((D_m * h) * (M_m / d)) * (-0.25 / l)), 1.0);
                                              	} else {
                                              		tmp = (sqrt(d) / sqrt(h)) * (t_2 * fma((t_1 / -l), t_0, 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.25 * D_m) * Float64(Float64(M_m / d) * h))
                                              	t_1 = Float64(Float64(M_m * Float64(0.5 / d)) * D_m)
                                              	t_2 = sqrt(Float64(d / l))
                                              	tmp = 0.0
                                              	if (h <= -5e-310)
                                              		tmp = Float64(Float64(fma(Float64(Float64(Float64(M_m * 0.5) * D_m) / Float64(Float64(-d) * l)), t_0, 1.0) * t_2) * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))));
                                              	elseif (h <= 2.8e+82)
                                              		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(t_1, Float64(Float64(Float64(D_m * h) * Float64(M_m / d)) * Float64(-0.25 / l)), 1.0));
                                              	else
                                              		tmp = Float64(Float64(sqrt(d) / sqrt(h)) * Float64(t_2 * fma(Float64(t_1 / Float64(-l)), t_0, 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.25 * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(N[(N[(N[(N[(N[(M$95$m * 0.5), $MachinePrecision] * D$95$m), $MachinePrecision] / N[((-d) * l), $MachinePrecision]), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.8e+82], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[(N[(D$95$m * h), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(-0.25 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * N[(N[(t$95$1 / (-l)), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
                                              
                                              \begin{array}{l}
                                              D_m = \left|D\right|
                                              \\
                                              M_m = \left|M\right|
                                              \\
                                              [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                              \\
                                              \begin{array}{l}
                                              t_0 := \left(0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right)\\
                                              t_1 := \left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m\\
                                              t_2 := \sqrt{\frac{d}{\ell}}\\
                                              \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
                                              \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M\_m \cdot 0.5\right) \cdot D\_m}{\left(-d\right) \cdot \ell}, t\_0, 1\right) \cdot t\_2\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
                                              
                                              \mathbf{elif}\;h \leq 2.8 \cdot 10^{+82}:\\
                                              \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(t\_1, \left(\left(D\_m \cdot h\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(t\_2 \cdot \mathsf{fma}\left(\frac{t\_1}{-\ell}, t\_0, 1\right)\right)\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if h < -4.999999999999985e-310

                                                1. Initial program 65.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. 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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites64.9%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites66.0%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}}, \left(\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}} \]
                                                  2. lift-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}}{-\ell}, \left(\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}} \]
                                                  3. associate-/l*N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot \frac{D}{-\ell}}, \left(\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}} \]
                                                  4. lift-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right)} \cdot \frac{D}{-\ell}, \left(\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}} \]
                                                  5. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \frac{D}{-\ell}, \left(\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. associate-*l/N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\frac{1}{2} \cdot M}{d}} \cdot \frac{D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. frac-timesN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(\frac{1}{2} \cdot M\right) \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. *-commutativeN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. metadata-evalN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\frac{1}{2}}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  10. div-invN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{M}{2}} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  11. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\frac{M}{2} \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  12. lower-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{M}{2} \cdot D}}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  13. div-invN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  14. metadata-evalN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\frac{1}{2}}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  15. lower-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  16. lower-*.f6462.0

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{\color{blue}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites62.0%

                                                  \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
                                                  3. frac-2negN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \]
                                                  4. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(h\right)}} \]
                                                  5. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{-d}{\color{blue}{-h}}} \]
                                                  6. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                  7. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{-h}} \]
                                                  8. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{-h}}} \]
                                                  9. lower-/.f6473.6

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                9. Applied rewrites73.6%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]

                                                if -4.999999999999985e-310 < h < 2.8e82

                                                1. Initial program 61.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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites61.8%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites71.5%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  3. associate-*l/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  4. associate-/l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  5. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  6. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right)} \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. associate-*l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot \left(M \cdot D\right)\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. metadata-evalN/A

                                                    \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{1}{2}}}{d} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  10. associate-/r*N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{1}{2 \cdot d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  11. associate-/r/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  12. clear-numN/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  13. lower-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites71.6%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(D \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{\left(\left(h \cdot \frac{M}{d}\right) \cdot D\right) \cdot 0.25}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Applied rewrites85.1%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{0.5}{d} \cdot M\right) \cdot D, \frac{-0.25}{\ell} \cdot \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

                                                if 2.8e82 < h

                                                1. Initial program 71.0%

                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-*.f64N/A

                                                    \[\leadsto \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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites68.9%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites62.7%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
                                                  3. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                                  4. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \]
                                                  5. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{{d}^{\frac{1}{2}}}{\color{blue}{{h}^{\frac{1}{2}}}} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{{d}^{\frac{1}{2}}}{{h}^{\frac{1}{2}}}} \]
                                                  7. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  8. lower-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  9. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                  10. lower-sqrt.f6480.8

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                7. Applied rewrites80.8%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                              3. Recombined 3 regimes into one program.
                                              4. Final simplification78.4%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{\left(-d\right) \cdot \ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 2.8 \cdot 10^{+82}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D, \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(\frac{\left(M \cdot \frac{0.5}{d}\right) \cdot D}{-\ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right)\right)\\ \end{array} \]
                                              5. Add Preprocessing

                                              Alternative 23: 79.1% accurate, 3.1× speedup?

                                              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{\left(M\_m \cdot 0.5\right) \cdot D\_m}{\left(-d\right) \cdot \ell}, \left(0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_0 \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 2.85 \cdot 10^{+82}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \left(\left(D\_m \cdot h\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \end{array} \end{array} \]
                                              D_m = (fabs.f64 D)
                                              M_m = (fabs.f64 M)
                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                              (FPCore (d h l M_m D_m)
                                               :precision binary64
                                               (let* ((t_0
                                                       (*
                                                        (fma
                                                         (/ (* (* M_m 0.5) D_m) (* (- d) l))
                                                         (* (* 0.25 D_m) (* (/ M_m d) h))
                                                         1.0)
                                                        (sqrt (/ d l)))))
                                                 (if (<= h -5e-310)
                                                   (* t_0 (/ (sqrt (- d)) (sqrt (- h))))
                                                   (if (<= h 2.85e+82)
                                                     (*
                                                      (/ d (sqrt (* l h)))
                                                      (fma
                                                       (* (* M_m (/ 0.5 d)) D_m)
                                                       (* (* (* D_m h) (/ M_m d)) (/ -0.25 l))
                                                       1.0))
                                                     (* t_0 (/ (sqrt d) (sqrt h)))))))
                                              D_m = fabs(D);
                                              M_m = fabs(M);
                                              assert(d < h && h < l && l < M_m && M_m < D_m);
                                              double code(double d, double h, double l, double M_m, double D_m) {
                                              	double t_0 = fma((((M_m * 0.5) * D_m) / (-d * l)), ((0.25 * D_m) * ((M_m / d) * h)), 1.0) * sqrt((d / l));
                                              	double tmp;
                                              	if (h <= -5e-310) {
                                              		tmp = t_0 * (sqrt(-d) / sqrt(-h));
                                              	} else if (h <= 2.85e+82) {
                                              		tmp = (d / sqrt((l * h))) * fma(((M_m * (0.5 / d)) * D_m), (((D_m * h) * (M_m / d)) * (-0.25 / l)), 1.0);
                                              	} else {
                                              		tmp = t_0 * (sqrt(d) / sqrt(h));
                                              	}
                                              	return tmp;
                                              }
                                              
                                              D_m = abs(D)
                                              M_m = abs(M)
                                              d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                                              function code(d, h, l, M_m, D_m)
                                              	t_0 = Float64(fma(Float64(Float64(Float64(M_m * 0.5) * D_m) / Float64(Float64(-d) * l)), Float64(Float64(0.25 * D_m) * Float64(Float64(M_m / d) * h)), 1.0) * sqrt(Float64(d / l)))
                                              	tmp = 0.0
                                              	if (h <= -5e-310)
                                              		tmp = Float64(t_0 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-h))));
                                              	elseif (h <= 2.85e+82)
                                              		tmp = Float64(Float64(d / sqrt(Float64(l * h))) * fma(Float64(Float64(M_m * Float64(0.5 / d)) * D_m), Float64(Float64(Float64(D_m * h) * Float64(M_m / d)) * Float64(-0.25 / l)), 1.0));
                                              	else
                                              		tmp = Float64(t_0 * Float64(sqrt(d) / sqrt(h)));
                                              	end
                                              	return tmp
                                              end
                                              
                                              D_m = N[Abs[D], $MachinePrecision]
                                              M_m = N[Abs[M], $MachinePrecision]
                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                              code[d_, h_, l_, M$95$m_, D$95$m_] := Block[{t$95$0 = N[(N[(N[(N[(N[(M$95$m * 0.5), $MachinePrecision] * D$95$m), $MachinePrecision] / N[((-d) * l), $MachinePrecision]), $MachinePrecision] * N[(N[(0.25 * D$95$m), $MachinePrecision] * N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[h, -5e-310], N[(t$95$0 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[h, 2.85e+82], N[(N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * D$95$m), $MachinePrecision] * N[(N[(N[(D$95$m * h), $MachinePrecision] * N[(M$95$m / d), $MachinePrecision]), $MachinePrecision] * N[(-0.25 / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                              
                                              \begin{array}{l}
                                              D_m = \left|D\right|
                                              \\
                                              M_m = \left|M\right|
                                              \\
                                              [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\
                                              \\
                                              \begin{array}{l}
                                              t_0 := \mathsf{fma}\left(\frac{\left(M\_m \cdot 0.5\right) \cdot D\_m}{\left(-d\right) \cdot \ell}, \left(0.25 \cdot D\_m\right) \cdot \left(\frac{M\_m}{d} \cdot h\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\\
                                              \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\
                                              \;\;\;\;t\_0 \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\
                                              
                                              \mathbf{elif}\;h \leq 2.85 \cdot 10^{+82}:\\
                                              \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M\_m \cdot \frac{0.5}{d}\right) \cdot D\_m, \left(\left(D\_m \cdot h\right) \cdot \frac{M\_m}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;t\_0 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if h < -4.999999999999985e-310

                                                1. Initial program 65.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. 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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites64.9%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites66.0%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}}, \left(\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}} \]
                                                  2. lift-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}}{-\ell}, \left(\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}} \]
                                                  3. associate-/l*N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot \frac{D}{-\ell}}, \left(\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}} \]
                                                  4. lift-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right)} \cdot \frac{D}{-\ell}, \left(\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}} \]
                                                  5. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \frac{D}{-\ell}, \left(\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. associate-*l/N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\frac{1}{2} \cdot M}{d}} \cdot \frac{D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. frac-timesN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(\frac{1}{2} \cdot M\right) \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. *-commutativeN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. metadata-evalN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\frac{1}{2}}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  10. div-invN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{M}{2}} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  11. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\frac{M}{2} \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  12. lower-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{M}{2} \cdot D}}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  13. div-invN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  14. metadata-evalN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\frac{1}{2}}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  15. lower-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  16. lower-*.f6462.0

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{\color{blue}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites62.0%

                                                  \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
                                                  3. frac-2negN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(h\right)}}} \]
                                                  4. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(h\right)}} \]
                                                  5. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{-d}{\color{blue}{-h}}} \]
                                                  6. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                  7. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{-h}} \]
                                                  8. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{-h}}} \]
                                                  9. lower-/.f6473.6

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]
                                                9. Applied rewrites73.6%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-h}}} \]

                                                if -4.999999999999985e-310 < h < 2.85000000000000008e82

                                                1. Initial program 61.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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites61.8%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites71.5%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}} \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right) + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  3. associate-*l/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \left(\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  4. associate-/l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  5. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  6. lift-*.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right)} \cdot D\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. associate-*l*N/A

                                                    \[\leadsto \left(\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot \left(M \cdot D\right)\right)} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. lift-/.f64N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. metadata-evalN/A

                                                    \[\leadsto \left(\left(\left(\frac{\color{blue}{\frac{1}{2}}}{d} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  10. associate-/r*N/A

                                                    \[\leadsto \left(\left(\left(\color{blue}{\frac{1}{2 \cdot d}} \cdot \left(M \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  11. associate-/r/N/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{1}{\frac{2 \cdot d}{M \cdot D}}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  12. clear-numN/A

                                                    \[\leadsto \left(\left(\color{blue}{\frac{M \cdot D}{2 \cdot d}} \cdot \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell} + 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  13. lower-fma.f64N/A

                                                    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{M \cdot D}{2 \cdot d}, \frac{\left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right)}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites71.6%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(D \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{\left(\left(h \cdot \frac{M}{d}\right) \cdot D\right) \cdot 0.25}{-\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Applied rewrites85.1%

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\frac{0.5}{d} \cdot M\right) \cdot D, \frac{-0.25}{\ell} \cdot \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right), 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}} \]

                                                if 2.85000000000000008e82 < h

                                                1. Initial program 71.0%

                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-*.f64N/A

                                                    \[\leadsto \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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites68.9%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites62.7%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}}, \left(\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}} \]
                                                  2. lift-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}}{-\ell}, \left(\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}} \]
                                                  3. associate-/l*N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot \frac{D}{-\ell}}, \left(\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}} \]
                                                  4. lift-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\left(\frac{\frac{1}{2}}{d} \cdot M\right)} \cdot \frac{D}{-\ell}, \left(\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}} \]
                                                  5. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\left(\color{blue}{\frac{\frac{1}{2}}{d}} \cdot M\right) \cdot \frac{D}{-\ell}, \left(\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. associate-*l/N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\frac{1}{2} \cdot M}{d}} \cdot \frac{D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. frac-timesN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(\frac{1}{2} \cdot M\right) \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. *-commutativeN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. metadata-evalN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\frac{1}{2}}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  10. div-invN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{M}{2}} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  11. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\frac{M}{2} \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  12. lower-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{M}{2} \cdot D}}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  13. div-invN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  14. metadata-evalN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \color{blue}{\frac{1}{2}}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  15. lower-*.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\left(M \cdot \frac{1}{2}\right)} \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  16. lower-*.f6462.7

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{\color{blue}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites62.7%

                                                  \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\sqrt{\frac{d}{h}}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\color{blue}{\frac{d}{h}}} \]
                                                  3. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                                  4. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{{d}^{\frac{1}{2}}}}{\sqrt{h}} \]
                                                  5. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{{d}^{\frac{1}{2}}}{\color{blue}{{h}^{\frac{1}{2}}}} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{{d}^{\frac{1}{2}}}{{h}^{\frac{1}{2}}}} \]
                                                  7. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  8. lower-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\color{blue}{\sqrt{d}}}{{h}^{\frac{1}{2}}} \]
                                                  9. pow1/2N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot \frac{1}{2}\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                  10. lower-sqrt.f6480.5

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\color{blue}{\sqrt{h}}} \]
                                                9. Applied rewrites80.5%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{d \cdot \left(-\ell\right)}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \]
                                              3. Recombined 3 regimes into one program.
                                              4. Final simplification78.3%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{\left(-d\right) \cdot \ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{-d}}{\sqrt{-h}}\\ \mathbf{elif}\;h \leq 2.85 \cdot 10^{+82}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}} \cdot \mathsf{fma}\left(\left(M \cdot \frac{0.5}{d}\right) \cdot D, \left(\left(D \cdot h\right) \cdot \frac{M}{d}\right) \cdot \frac{-0.25}{\ell}, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{\left(M \cdot 0.5\right) \cdot D}{\left(-d\right) \cdot \ell}, \left(0.25 \cdot D\right) \cdot \left(\frac{M}{d} \cdot h\right), 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \end{array} \]
                                              5. Add Preprocessing

                                              Alternative 24: 65.0% accurate, 3.4× speedup?

                                              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\left(1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\ \mathbf{elif}\;d \leq -1.6 \cdot 10^{-255}:\\ \;\;\;\;\left(\frac{\mathsf{fma}\left(\left(-0.125 \cdot D\_m\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\ell}, D\_m, d \cdot d\right)}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \left(M\_m \cdot \frac{0.5}{d}\right), \frac{-D\_m}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
                                              D_m = (fabs.f64 D)
                                              M_m = (fabs.f64 M)
                                              NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                              (FPCore (d h l M_m D_m)
                                               :precision binary64
                                               (let* ((t_0 (sqrt (/ d h))))
                                                 (if (<= d -1.35e+154)
                                                   (* (* 1.0 (/ (sqrt (- d)) (sqrt (- l)))) t_0)
                                                   (if (<= d -1.6e-255)
                                                     (*
                                                      (*
                                                       (/
                                                        (fma (* (* -0.125 D_m) (/ (* (* M_m M_m) h) l)) D_m (* d d))
                                                        (* d d))
                                                       (sqrt (/ d l)))
                                                      t_0)
                                                     (*
                                                      (fma
                                                       (* (* (* (* (/ M_m d) h) D_m) 0.25) (* M_m (/ 0.5 d)))
                                                       (/ (- D_m) l)
                                                       1.0)
                                                      (/ d (sqrt (* l h))))))))
                                              D_m = fabs(D);
                                              M_m = fabs(M);
                                              assert(d < h && h < l && l < M_m && M_m < D_m);
                                              double code(double d, double h, double l, double M_m, double D_m) {
                                              	double t_0 = sqrt((d / h));
                                              	double tmp;
                                              	if (d <= -1.35e+154) {
                                              		tmp = (1.0 * (sqrt(-d) / sqrt(-l))) * t_0;
                                              	} else if (d <= -1.6e-255) {
                                              		tmp = ((fma(((-0.125 * D_m) * (((M_m * M_m) * h) / l)), D_m, (d * d)) / (d * d)) * sqrt((d / l))) * t_0;
                                              	} else {
                                              		tmp = fma((((((M_m / d) * h) * D_m) * 0.25) * (M_m * (0.5 / d))), (-D_m / l), 1.0) * (d / 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)
                                              	t_0 = sqrt(Float64(d / h))
                                              	tmp = 0.0
                                              	if (d <= -1.35e+154)
                                              		tmp = Float64(Float64(1.0 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * t_0);
                                              	elseif (d <= -1.6e-255)
                                              		tmp = Float64(Float64(Float64(fma(Float64(Float64(-0.125 * D_m) * Float64(Float64(Float64(M_m * M_m) * h) / l)), D_m, Float64(d * d)) / Float64(d * d)) * sqrt(Float64(d / l))) * t_0);
                                              	else
                                              		tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(M_m / d) * h) * D_m) * 0.25) * Float64(M_m * Float64(0.5 / d))), Float64(Float64(-D_m) / l), 1.0) * Float64(d / sqrt(Float64(l * 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 / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[d, -1.35e+154], N[(N[(1.0 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[d, -1.6e-255], N[(N[(N[(N[(N[(N[(-0.125 * D$95$m), $MachinePrecision] * N[(N[(N[(M$95$m * M$95$m), $MachinePrecision] * h), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * D$95$m + N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-D$95$m) / l), $MachinePrecision] + 1.0), $MachinePrecision] * 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}
                                              t_0 := \sqrt{\frac{d}{h}}\\
                                              \mathbf{if}\;d \leq -1.35 \cdot 10^{+154}:\\
                                              \;\;\;\;\left(1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot t\_0\\
                                              
                                              \mathbf{elif}\;d \leq -1.6 \cdot 10^{-255}:\\
                                              \;\;\;\;\left(\frac{\mathsf{fma}\left(\left(-0.125 \cdot D\_m\right) \cdot \frac{\left(M\_m \cdot M\_m\right) \cdot h}{\ell}, D\_m, d \cdot d\right)}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot t\_0\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \left(M\_m \cdot \frac{0.5}{d}\right), \frac{-D\_m}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if d < -1.35000000000000003e154

                                                1. Initial program 75.9%

                                                  \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                2. Add Preprocessing
                                                3. 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. 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) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  5. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                4. Applied rewrites79.5%

                                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                5. Applied rewrites76.1%

                                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                6. Step-by-step derivation
                                                  1. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  2. lift-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\color{blue}{\frac{d}{\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  3. frac-2negN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  4. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(\ell\right)}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  5. lift-neg.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{-d}{\color{blue}{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  6. sqrt-divN/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. lift-sqrt.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. lower-/.f64N/A

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  9. lower-sqrt.f6489.4

                                                    \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                7. Applied rewrites89.4%

                                                  \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                8. Taylor expanded in h around 0

                                                  \[\leadsto \left(\color{blue}{1} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                9. Step-by-step derivation
                                                  1. Applied rewrites78.7%

                                                    \[\leadsto \left(\color{blue}{1} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]

                                                  if -1.35000000000000003e154 < d < -1.59999999999999996e-255

                                                  1. Initial program 68.0%

                                                    \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                  2. Add Preprocessing
                                                  3. Step-by-step derivation
                                                    1. lift-*.f64N/A

                                                      \[\leadsto \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. 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) \]
                                                    3. associate-*l*N/A

                                                      \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                    4. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                    5. lower-*.f64N/A

                                                      \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                  4. Applied rewrites66.9%

                                                    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                  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}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  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}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    2. associate-/l*N/A

                                                      \[\leadsto \left(\frac{\frac{-1}{8} \cdot \color{blue}{\left({D}^{2} \cdot \frac{{M}^{2} \cdot h}{\ell}\right)} + {d}^{2}}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    3. associate-*r*N/A

                                                      \[\leadsto \left(\frac{\color{blue}{\left(\frac{-1}{8} \cdot {D}^{2}\right) \cdot \frac{{M}^{2} \cdot h}{\ell}} + {d}^{2}}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    4. lower-fma.f64N/A

                                                      \[\leadsto \left(\frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{8} \cdot {D}^{2}, \frac{{M}^{2} \cdot h}{\ell}, {d}^{2}\right)}}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    5. lower-*.f64N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\color{blue}{\frac{-1}{8} \cdot {D}^{2}}, \frac{{M}^{2} \cdot h}{\ell}, {d}^{2}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    6. unpow2N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}, \frac{{M}^{2} \cdot h}{\ell}, {d}^{2}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    7. lower-*.f64N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \color{blue}{\left(D \cdot D\right)}, \frac{{M}^{2} \cdot h}{\ell}, {d}^{2}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    8. lower-/.f64N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \left(D \cdot D\right), \color{blue}{\frac{{M}^{2} \cdot h}{\ell}}, {d}^{2}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    9. lower-*.f64N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \left(D \cdot D\right), \frac{\color{blue}{{M}^{2} \cdot h}}{\ell}, {d}^{2}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    10. unpow2N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \left(D \cdot D\right), \frac{\color{blue}{\left(M \cdot M\right)} \cdot h}{\ell}, {d}^{2}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    11. lower-*.f64N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \left(D \cdot D\right), \frac{\color{blue}{\left(M \cdot M\right)} \cdot h}{\ell}, {d}^{2}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    12. unpow2N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \left(D \cdot D\right), \frac{\left(M \cdot M\right) \cdot h}{\ell}, \color{blue}{d \cdot d}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    13. lower-*.f64N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \left(D \cdot D\right), \frac{\left(M \cdot M\right) \cdot h}{\ell}, \color{blue}{d \cdot d}\right)}{{d}^{2}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    14. unpow2N/A

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{-1}{8} \cdot \left(D \cdot D\right), \frac{\left(M \cdot M\right) \cdot h}{\ell}, d \cdot d\right)}{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    15. lower-*.f6449.9

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(-0.125 \cdot \left(D \cdot D\right), \frac{\left(M \cdot M\right) \cdot h}{\ell}, d \cdot d\right)}{\color{blue}{d \cdot d}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  7. Applied rewrites49.9%

                                                    \[\leadsto \left(\color{blue}{\frac{\mathsf{fma}\left(-0.125 \cdot \left(D \cdot D\right), \frac{\left(M \cdot M\right) \cdot h}{\ell}, d \cdot d\right)}{d \cdot d}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                  8. Step-by-step derivation
                                                    1. Applied rewrites53.0%

                                                      \[\leadsto \left(\frac{\mathsf{fma}\left(\frac{\left(M \cdot M\right) \cdot h}{\ell} \cdot \left(-0.125 \cdot D\right), D, d \cdot d\right)}{\color{blue}{d} \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]

                                                    if -1.59999999999999996e-255 < d

                                                    1. Initial program 61.5%

                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. Add Preprocessing
                                                    3. Step-by-step derivation
                                                      1. lift-*.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. 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) \]
                                                      3. associate-*l*N/A

                                                        \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                      4. *-commutativeN/A

                                                        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                      5. lower-*.f64N/A

                                                        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                    4. Applied rewrites60.1%

                                                      \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                    5. Applied rewrites63.5%

                                                      \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    6. Applied rewrites68.1%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(h \cdot \frac{M}{d}\right) \cdot D\right) \cdot 0.25\right) \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{-D}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
                                                  9. Recombined 3 regimes into one program.
                                                  10. Final simplification63.8%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\left(1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;d \leq -1.6 \cdot 10^{-255}:\\ \;\;\;\;\left(\frac{\mathsf{fma}\left(\left(-0.125 \cdot D\right) \cdot \frac{\left(M \cdot M\right) \cdot h}{\ell}, D, d \cdot d\right)}{d \cdot d} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\frac{M}{d} \cdot h\right) \cdot D\right) \cdot 0.25\right) \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{-D}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
                                                  11. Add Preprocessing

                                                  Alternative 25: 59.8% accurate, 3.8× speedup?

                                                  \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} \mathbf{if}\;h \leq -1.35 \cdot 10^{-172}:\\ \;\;\;\;\left(1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \left(M\_m \cdot \frac{0.5}{d}\right), \frac{-D\_m}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \end{array} \]
                                                  D_m = (fabs.f64 D)
                                                  M_m = (fabs.f64 M)
                                                  NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                  (FPCore (d h l M_m D_m)
                                                   :precision binary64
                                                   (if (<= h -1.35e-172)
                                                     (* (* 1.0 (/ (sqrt (- d)) (sqrt (- l)))) (sqrt (/ d h)))
                                                     (if (<= h -5e-310)
                                                       (* (sqrt (/ 1.0 (* l h))) (- d))
                                                       (*
                                                        (fma
                                                         (* (* (* (* (/ M_m d) h) D_m) 0.25) (* M_m (/ 0.5 d)))
                                                         (/ (- D_m) l)
                                                         1.0)
                                                        (/ d (sqrt (* l h)))))))
                                                  D_m = fabs(D);
                                                  M_m = fabs(M);
                                                  assert(d < h && h < l && l < M_m && M_m < D_m);
                                                  double code(double d, double h, double l, double M_m, double D_m) {
                                                  	double tmp;
                                                  	if (h <= -1.35e-172) {
                                                  		tmp = (1.0 * (sqrt(-d) / sqrt(-l))) * sqrt((d / h));
                                                  	} else if (h <= -5e-310) {
                                                  		tmp = sqrt((1.0 / (l * h))) * -d;
                                                  	} else {
                                                  		tmp = fma((((((M_m / d) * h) * D_m) * 0.25) * (M_m * (0.5 / d))), (-D_m / l), 1.0) * (d / 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 (h <= -1.35e-172)
                                                  		tmp = Float64(Float64(1.0 * Float64(sqrt(Float64(-d)) / sqrt(Float64(-l)))) * sqrt(Float64(d / h)));
                                                  	elseif (h <= -5e-310)
                                                  		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                                                  	else
                                                  		tmp = Float64(fma(Float64(Float64(Float64(Float64(Float64(M_m / d) * h) * D_m) * 0.25) * Float64(M_m * Float64(0.5 / d))), Float64(Float64(-D_m) / l), 1.0) * Float64(d / sqrt(Float64(l * h))));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  D_m = N[Abs[D], $MachinePrecision]
                                                  M_m = N[Abs[M], $MachinePrecision]
                                                  NOTE: d, h, l, M_m, and D_m should be sorted in increasing order before calling this function.
                                                  code[d_, h_, l_, M$95$m_, D$95$m_] := If[LessEqual[h, -1.35e-172], N[(N[(1.0 * N[(N[Sqrt[(-d)], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[h, -5e-310], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(M$95$m / d), $MachinePrecision] * h), $MachinePrecision] * D$95$m), $MachinePrecision] * 0.25), $MachinePrecision] * N[(M$95$m * N[(0.5 / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-D$95$m) / l), $MachinePrecision] + 1.0), $MachinePrecision] * 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}\;h \leq -1.35 \cdot 10^{-172}:\\
                                                  \;\;\;\;\left(1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\
                                                  
                                                  \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\
                                                  \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\frac{M\_m}{d} \cdot h\right) \cdot D\_m\right) \cdot 0.25\right) \cdot \left(M\_m \cdot \frac{0.5}{d}\right), \frac{-D\_m}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if h < -1.35000000000000013e-172

                                                    1. Initial program 70.5%

                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. Add Preprocessing
                                                    3. 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. 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) \]
                                                      3. associate-*l*N/A

                                                        \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                      4. *-commutativeN/A

                                                        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                      5. lower-*.f64N/A

                                                        \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                    4. Applied rewrites68.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}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                    5. Applied rewrites70.4%

                                                      \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    6. Step-by-step derivation
                                                      1. lift-sqrt.f64N/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\sqrt{\frac{d}{\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      2. lift-/.f64N/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\color{blue}{\frac{d}{\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      3. frac-2negN/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\color{blue}{\frac{\mathsf{neg}\left(d\right)}{\mathsf{neg}\left(\ell\right)}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      4. lift-neg.f64N/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{\color{blue}{-d}}{\mathsf{neg}\left(\ell\right)}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      5. lift-neg.f64N/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \sqrt{\frac{-d}{\color{blue}{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      6. sqrt-divN/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      7. lift-sqrt.f64N/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \frac{\color{blue}{\sqrt{-d}}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      8. lower-/.f64N/A

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{\frac{1}{2}}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(\frac{1}{4} \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      9. lower-sqrt.f6478.1

                                                        \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \frac{\sqrt{-d}}{\color{blue}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    7. Applied rewrites78.1%

                                                      \[\leadsto \left(\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right) \cdot \color{blue}{\frac{\sqrt{-d}}{\sqrt{-\ell}}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    8. Taylor expanded in h around 0

                                                      \[\leadsto \left(\color{blue}{1} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                    9. Step-by-step derivation
                                                      1. Applied rewrites43.8%

                                                        \[\leadsto \left(\color{blue}{1} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]

                                                      if -1.35000000000000013e-172 < h < -4.999999999999985e-310

                                                      1. Initial program 46.6%

                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in 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-*.f6465.1

                                                          \[\leadsto \left(-d\right) \cdot \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \]
                                                      5. Applied rewrites65.1%

                                                        \[\leadsto \color{blue}{\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

                                                      if -4.999999999999985e-310 < h

                                                      1. Initial program 65.3%

                                                        \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                      2. Add Preprocessing
                                                      3. Step-by-step derivation
                                                        1. lift-*.f64N/A

                                                          \[\leadsto \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. 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) \]
                                                        3. associate-*l*N/A

                                                          \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right)} \]
                                                        4. *-commutativeN/A

                                                          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                        5. lower-*.f64N/A

                                                          \[\leadsto \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\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)\right) \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}} \]
                                                      4. Applied rewrites64.4%

                                                        \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot \frac{h}{\ell}, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                                      5. Applied rewrites68.3%

                                                        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\frac{\left(\frac{0.5}{d} \cdot M\right) \cdot D}{-\ell}, \left(\frac{M}{d} \cdot h\right) \cdot \left(0.25 \cdot D\right), 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                                      6. Applied rewrites74.2%

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(h \cdot \frac{M}{d}\right) \cdot D\right) \cdot 0.25\right) \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{-D}{\ell}, 1\right) \cdot \frac{d}{\sqrt{h \cdot \ell}}} \]
                                                    10. Recombined 3 regimes into one program.
                                                    11. Final simplification60.7%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;h \leq -1.35 \cdot 10^{-172}:\\ \;\;\;\;\left(1 \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\frac{M}{d} \cdot h\right) \cdot D\right) \cdot 0.25\right) \cdot \left(M \cdot \frac{0.5}{d}\right), \frac{-D}{\ell}, 1\right) \cdot \frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
                                                    12. Add Preprocessing

                                                    Alternative 26: 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 65.4%

                                                      \[\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in h around 0

                                                      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{1}{h \cdot \ell}}} \]
                                                    4. Step-by-step derivation
                                                      1. *-commutativeN/A

                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                      2. lower-*.f64N/A

                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}} \cdot d} \]
                                                      3. lower-sqrt.f64N/A

                                                        \[\leadsto \color{blue}{\sqrt{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                      4. lower-/.f64N/A

                                                        \[\leadsto \sqrt{\color{blue}{\frac{1}{h \cdot \ell}}} \cdot d \]
                                                      5. *-commutativeN/A

                                                        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                      6. lower-*.f6421.6

                                                        \[\leadsto \sqrt{\frac{1}{\color{blue}{\ell \cdot h}}} \cdot d \]
                                                    5. Applied rewrites21.6%

                                                      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites21.6%

                                                        \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
                                                      2. Add Preprocessing

                                                      Reproduce

                                                      ?
                                                      herbie shell --seed 2024276 
                                                      (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)))))