Henrywood and Agarwal, Equation (12)

Percentage Accurate: 67.3% → 77.7%
Time: 15.4s
Alternatives: 14
Speedup: 0.8×

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

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

\mathbf{elif}\;\ell \leq 2 \cdot 10^{+143}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{\sqrt{h}}{{\ell}^{1.5}}, \left(-0.125 \cdot \frac{M\_m}{d}\right) \cdot M\_m, \frac{{\left(h \cdot \ell\right)}^{-0.5}}{D\_m} \cdot \frac{d}{D\_m}\right) \cdot D\_m\right) \cdot D\_m\\

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


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

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l < 1.1e-32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e-32 < l < 2e143

    1. Initial program 61.6%

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

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

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

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

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

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

    if 2e143 < l

    1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{{h}^{-1}}}{\sqrt{\ell}} \cdot d \]
    7. Recombined 4 regimes into one program.
    8. Final simplification78.3%

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

    Alternative 2: 72.1% accurate, 0.2× speedup?

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

      1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
        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 \sqrt{\frac{d}{h}}} \]
      6. Applied rewrites86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.9999999999999993e-78 < (*.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 3.99999999999999982e283 < (*.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 22.4%

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

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

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

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

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

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

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

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

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

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

            \[\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)))) < 3.99999999999999982e283

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 3: 71.2% accurate, 0.2× speedup?

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

              1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
                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 \sqrt{\frac{d}{h}}} \]
              6. Applied rewrites86.3%

                \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(\frac{\frac{D}{d}}{2} \cdot M\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
              7. 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}} \]
              8. Step-by-step derivation
                1. div-addN/A

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

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

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

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

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

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

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

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

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

                if -2.00000000000000012e-9 < (*.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 3.99999999999999982e283 < (*.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.1%

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

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

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

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

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

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

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

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

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

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

                      \[\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)))) < 3.99999999999999982e283

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 4: 70.4% accurate, 0.2× speedup?

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

                        1. Initial program 87.3%

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
                          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 \sqrt{\frac{d}{h}}} \]
                        6. Applied rewrites86.3%

                          \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(\frac{\frac{D}{d}}{2} \cdot M\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                        7. 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}} \]
                        8. Step-by-step derivation
                          1. div-addN/A

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

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

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

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

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

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

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

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

                        if -2.00000000000000012e-9 < (*.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 3.99999999999999982e283 < (*.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.1%

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

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

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

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

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

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

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

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

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

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

                              \[\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)))) < 3.99999999999999982e283

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 5: 55.1% accurate, 0.2× speedup?

                              \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{-200}:\\ \;\;\;\;\left(-t\_0\right) \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq 0 \lor \neg \left(t\_2 \leq 4 \cdot 10^{+283}\right):\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{else}:\\ \;\;\;\;t\_0 \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 (sqrt (/ d l)))
                                      (t_1 (sqrt (/ d h)))
                                      (t_2
                                       (*
                                        (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                        (-
                                         1.0
                                         (*
                                          (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0))
                                          (/ h l))))))
                                 (if (<= t_2 -5e-200)
                                   (* (- t_0) t_1)
                                   (if (or (<= t_2 0.0) (not (<= t_2 4e+283)))
                                     (fabs (/ d (sqrt (* l h))))
                                     (* t_0 t_1)))))
                              D_m = fabs(D);
                              M_m = fabs(M);
                              assert(d < h && h < l && l < M_m && M_m < D_m);
                              double code(double d, double h, double l, double M_m, double D_m) {
                              	double t_0 = sqrt((d / l));
                              	double t_1 = sqrt((d / h));
                              	double t_2 = (pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                              	double tmp;
                              	if (t_2 <= -5e-200) {
                              		tmp = -t_0 * t_1;
                              	} else if ((t_2 <= 0.0) || !(t_2 <= 4e+283)) {
                              		tmp = fabs((d / sqrt((l * h))));
                              	} else {
                              		tmp = t_0 * t_1;
                              	}
                              	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 = sqrt((d / l))
                                  t_1 = sqrt((d / h))
                                  t_2 = (((d / h) ** (2.0d0 ** (-1.0d0))) * ((d / l) ** (2.0d0 ** (-1.0d0)))) * (1.0d0 - (((2.0d0 ** (-1.0d0)) * (((m_m * d_m) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
                                  if (t_2 <= (-5d-200)) then
                                      tmp = -t_0 * t_1
                                  else if ((t_2 <= 0.0d0) .or. (.not. (t_2 <= 4d+283))) then
                                      tmp = abs((d / sqrt((l * h))))
                                  else
                                      tmp = t_0 * t_1
                                  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.pow((d / h), Math.pow(2.0, -1.0)) * Math.pow((d / l), Math.pow(2.0, -1.0))) * (1.0 - ((Math.pow(2.0, -1.0) * Math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)));
                              	double tmp;
                              	if (t_2 <= -5e-200) {
                              		tmp = -t_0 * t_1;
                              	} else if ((t_2 <= 0.0) || !(t_2 <= 4e+283)) {
                              		tmp = Math.abs((d / Math.sqrt((l * h))));
                              	} else {
                              		tmp = t_0 * t_1;
                              	}
                              	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.pow((d / h), math.pow(2.0, -1.0)) * math.pow((d / l), math.pow(2.0, -1.0))) * (1.0 - ((math.pow(2.0, -1.0) * math.pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))
                              	tmp = 0
                              	if t_2 <= -5e-200:
                              		tmp = -t_0 * t_1
                              	elif (t_2 <= 0.0) or not (t_2 <= 4e+283):
                              		tmp = math.fabs((d / math.sqrt((l * h))))
                              	else:
                              		tmp = t_0 * t_1
                              	return tmp
                              
                              D_m = abs(D)
                              M_m = abs(M)
                              d, h, l, M_m, D_m = sort([d, h, l, M_m, D_m])
                              function code(d, h, l, M_m, D_m)
                              	t_0 = sqrt(Float64(d / l))
                              	t_1 = sqrt(Float64(d / h))
                              	t_2 = Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
                              	tmp = 0.0
                              	if (t_2 <= -5e-200)
                              		tmp = Float64(Float64(-t_0) * t_1);
                              	elseif ((t_2 <= 0.0) || !(t_2 <= 4e+283))
                              		tmp = abs(Float64(d / sqrt(Float64(l * h))));
                              	else
                              		tmp = Float64(t_0 * t_1);
                              	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 = (((d / h) ^ (2.0 ^ -1.0)) * ((d / l) ^ (2.0 ^ -1.0))) * (1.0 - (((2.0 ^ -1.0) * (((M_m * D_m) / (2.0 * d)) ^ 2.0)) * (h / l)));
                              	tmp = 0.0;
                              	if (t_2 <= -5e-200)
                              		tmp = -t_0 * t_1;
                              	elseif ((t_2 <= 0.0) || ~((t_2 <= 4e+283)))
                              		tmp = abs((d / sqrt((l * h))));
                              	else
                              		tmp = t_0 * t_1;
                              	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[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-200], N[((-t$95$0) * t$95$1), $MachinePrecision], If[Or[LessEqual[t$95$2, 0.0], N[Not[LessEqual[t$95$2, 4e+283]], $MachinePrecision]], N[Abs[N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$0 * 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 := \sqrt{\frac{d}{\ell}}\\
                              t_1 := \sqrt{\frac{d}{h}}\\
                              t_2 := \left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
                              \mathbf{if}\;t\_2 \leq -5 \cdot 10^{-200}:\\
                              \;\;\;\;\left(-t\_0\right) \cdot t\_1\\
                              
                              \mathbf{elif}\;t\_2 \leq 0 \lor \neg \left(t\_2 \leq 4 \cdot 10^{+283}\right):\\
                              \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_0 \cdot t\_1\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -4.99999999999999991e-200

                                1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
                                  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 \sqrt{\frac{d}{h}}} \]
                                6. Applied rewrites86.7%

                                  \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-0.5 \cdot {\left(\frac{\frac{D}{d}}{2} \cdot M\right)}^{2}, \frac{h}{\ell}, 1\right) \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}}} \]
                                7. 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}} \]
                                8. Step-by-step derivation
                                  1. div-addN/A

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

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

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

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

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

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

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

                                  \[\leadsto \left(\color{blue}{\mathsf{fma}\left(-0.125 \cdot \frac{\frac{D \cdot D}{d}}{d}, \frac{\left(M \cdot M\right) \cdot h}{\ell}, 1\right)} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \sqrt{\frac{d}{h}} \]
                                10. 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}} \]
                                11. 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-/.f6419.4

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

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

                                if -4.99999999999999991e-200 < (*.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 3.99999999999999982e283 < (*.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 20.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 d around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 6: 53.3% accurate, 0.2× speedup?

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

                                        1. Initial program 87.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. mul-1-negN/A

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

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

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

                                        if -4.99999999999999967e-89 < (*.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 3.99999999999999982e283 < (*.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 21.6%

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{1}{\sqrt{h \cdot \ell}} \cdot d \]
                                          2. 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)))) < 3.99999999999999982e283

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

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 7: 78.7% accurate, 0.3× speedup?

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

                                                1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
                                                  5. *-commutativeN/A

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

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

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

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

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

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

                                                if 3.99999999999999982e283 < (*.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 48.4%

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

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

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

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

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

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

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

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

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

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

                                                      \[\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. Applied rewrites0.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
                                                      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 \sqrt{\frac{d}{h}}} \]
                                                    6. Applied rewrites86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    if 3.99999999999999982e283 < (*.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 48.4%

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

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

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

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

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

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

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

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

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

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

                                                          \[\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. Applied rewrites0.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
                                                          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 \sqrt{\frac{d}{h}}} \]
                                                        6. Applied rewrites86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if 3.99999999999999982e283 < (*.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 48.4%

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

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

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

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

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

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

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

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

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

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

                                                              \[\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. Applied rewrites0.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          Alternative 10: 76.5% accurate, 0.5× speedup?

                                                          \[\begin{array}{l} D_m = \left|D\right| \\ M_m = \left|M\right| \\ [d, h, l, M_m, D_m] = \mathsf{sort}([d, h, l, M_m, D_m])\\ \\ \begin{array}{l} t_0 := M\_m \cdot \frac{\frac{D\_m}{d}}{2}\\ \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+283}:\\ \;\;\;\;\left(\mathsf{fma}\left(t\_0 \cdot \left(t\_0 \cdot -0.5\right), \frac{h}{\ell}, 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
                                                           (let* ((t_0 (* M_m (/ (/ D_m d) 2.0))))
                                                             (if (<=
                                                                  (*
                                                                   (* (pow (/ d h) (pow 2.0 -1.0)) (pow (/ d l) (pow 2.0 -1.0)))
                                                                   (-
                                                                    1.0
                                                                    (* (* (pow 2.0 -1.0) (pow (/ (* M_m D_m) (* 2.0 d)) 2.0)) (/ h l))))
                                                                  4e+283)
                                                               (*
                                                                (* (fma (* t_0 (* t_0 -0.5)) (/ h l) 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 t_0 = M_m * ((D_m / d) / 2.0);
                                                          	double tmp;
                                                          	if (((pow((d / h), pow(2.0, -1.0)) * pow((d / l), pow(2.0, -1.0))) * (1.0 - ((pow(2.0, -1.0) * pow(((M_m * D_m) / (2.0 * d)), 2.0)) * (h / l)))) <= 4e+283) {
                                                          		tmp = (fma((t_0 * (t_0 * -0.5)), (h / l), 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)
                                                          	t_0 = Float64(M_m * Float64(Float64(D_m / d) / 2.0))
                                                          	tmp = 0.0
                                                          	if (Float64(Float64((Float64(d / h) ^ (2.0 ^ -1.0)) * (Float64(d / l) ^ (2.0 ^ -1.0))) * Float64(1.0 - Float64(Float64((2.0 ^ -1.0) * (Float64(Float64(M_m * D_m) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) <= 4e+283)
                                                          		tmp = Float64(Float64(fma(Float64(t_0 * Float64(t_0 * -0.5)), Float64(h / l), 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_] := Block[{t$95$0 = N[(M$95$m * N[(N[(D$95$m / d), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Power[N[(d / h), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[Power[2.0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[2.0, -1.0], $MachinePrecision] * N[Power[N[(N[(M$95$m * D$95$m), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+283], N[(N[(N[(N[(t$95$0 * N[(t$95$0 * -0.5), $MachinePrecision]), $MachinePrecision] * N[(h / l), $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}
                                                          t_0 := M\_m \cdot \frac{\frac{D\_m}{d}}{2}\\
                                                          \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M\_m \cdot D\_m}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+283}:\\
                                                          \;\;\;\;\left(\mathsf{fma}\left(t\_0 \cdot \left(t\_0 \cdot -0.5\right), \frac{h}{\ell}, 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)))) < 3.99999999999999982e283

                                                            1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \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 \sqrt{\frac{d}{h}}} \]
                                                              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 \sqrt{\frac{d}{h}}} \]
                                                            6. Applied rewrites86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            if 3.99999999999999982e283 < (*.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 17.3%

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

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{\left({2}^{-1}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left({2}^{-1}\right)}\right) \cdot \left(1 - \left({2}^{-1} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 4 \cdot 10^{+283}:\\ \;\;\;\;\left(\mathsf{fma}\left(\left(M \cdot \frac{\frac{D}{d}}{2}\right) \cdot \left(\left(M \cdot \frac{\frac{D}{d}}{2}\right) \cdot -0.5\right), \frac{h}{\ell}, 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} \]
                                                              5. Add Preprocessing

                                                              Alternative 11: 46.6% accurate, 0.5× speedup?

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

                                                                1. Initial program 87.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. mul-1-negN/A

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

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

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

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

                                                                1. Initial program 54.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  Alternative 12: 46.1% accurate, 0.6× speedup?

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

                                                                    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        1. Initial program 54.9%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          Alternative 13: 46.9% accurate, 3.2× speedup?

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

                                                                            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. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

                                                                            if 2.44999999999999995e-284 < l

                                                                            1. Initial program 64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                Alternative 14: 26.5% 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 64.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 d around inf

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

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

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

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

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

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

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

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

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

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

                                                                                    Reproduce

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