Henrywood and Agarwal, Equation (12)

Percentage Accurate: 66.5% → 75.4%
Time: 17.3s
Alternatives: 14
Speedup: 1.3×

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: 66.5% 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: 75.4% accurate, 1.1× speedup?

\[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq -4.8 \cdot 10^{-208}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(h \cdot \left(-0.5 \cdot \left({\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25\right)\right), {\ell}^{-1}, 1\right)\right)}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq 1.35 \cdot 10^{-165}:\\ \;\;\;\;\frac{\mathsf{fma}\left({\left(\frac{h}{\ell}\right)}^{1.5}, \frac{{\left(M \cdot D\right)}^{2} \cdot -0.125}{d}, \sqrt{\frac{h}{\ell}} \cdot d\right)}{h}\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{+143}:\\ \;\;\;\;\left(1 - \frac{\frac{M}{d} \cdot \left(\left(0.5 \cdot D\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}\right) \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
(FPCore (d h l M D)
 :precision binary64
 (if (<= d -4.8e-208)
   (/
    (*
     (sqrt (- d))
     (*
      (sqrt (/ d l))
      (fma (* h (* -0.5 (* (pow (/ (/ d D) M) -2.0) 0.25))) (pow l -1.0) 1.0)))
    (sqrt (- h)))
   (if (<= d 1.35e-165)
     (/
      (fma
       (pow (/ h l) 1.5)
       (/ (* (pow (* M D) 2.0) -0.125) d)
       (* (sqrt (/ h l)) d))
      h)
     (if (<= d 2.4e+143)
       (*
        (-
         1.0
         (*
          (/ (* (/ M d) (* (* 0.5 D) 0.5)) (pow h -1.0))
          (/ (* (* (/ 0.5 d) D) M) l)))
        (* (/ 1.0 (sqrt (/ l d))) (pow (/ d h) (/ 1.0 2.0))))
       (/ d (* (sqrt h) (sqrt l)))))))
assert(d < h && h < l && l < M && M < D);
double code(double d, double h, double l, double M, double D) {
	double tmp;
	if (d <= -4.8e-208) {
		tmp = (sqrt(-d) * (sqrt((d / l)) * fma((h * (-0.5 * (pow(((d / D) / M), -2.0) * 0.25))), pow(l, -1.0), 1.0))) / sqrt(-h);
	} else if (d <= 1.35e-165) {
		tmp = fma(pow((h / l), 1.5), ((pow((M * D), 2.0) * -0.125) / d), (sqrt((h / l)) * d)) / h;
	} else if (d <= 2.4e+143) {
		tmp = (1.0 - ((((M / d) * ((0.5 * D) * 0.5)) / pow(h, -1.0)) * ((((0.5 / d) * D) * M) / l))) * ((1.0 / sqrt((l / d))) * pow((d / h), (1.0 / 2.0)));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	return tmp;
}
d, h, l, M, D = sort([d, h, l, M, D])
function code(d, h, l, M, D)
	tmp = 0.0
	if (d <= -4.8e-208)
		tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(sqrt(Float64(d / l)) * fma(Float64(h * Float64(-0.5 * Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25))), (l ^ -1.0), 1.0))) / sqrt(Float64(-h)));
	elseif (d <= 1.35e-165)
		tmp = Float64(fma((Float64(h / l) ^ 1.5), Float64(Float64((Float64(M * D) ^ 2.0) * -0.125) / d), Float64(sqrt(Float64(h / l)) * d)) / h);
	elseif (d <= 2.4e+143)
		tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(0.5 * D) * 0.5)) / (h ^ -1.0)) * Float64(Float64(Float64(Float64(0.5 / d) * D) * M) / l))) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * (Float64(d / h) ^ Float64(1.0 / 2.0))));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return tmp
end
NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.8e-208], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(h * N[(-0.5 * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[l, -1.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.35e-165], N[(N[(N[Power[N[(h / l), $MachinePrecision], 1.5], $MachinePrecision] * N[(N[(N[Power[N[(M * D), $MachinePrecision], 2.0], $MachinePrecision] * -0.125), $MachinePrecision] / d), $MachinePrecision] + N[(N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[d, 2.4e+143], N[(N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(0.5 * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
\\
\begin{array}{l}
\mathbf{if}\;d \leq -4.8 \cdot 10^{-208}:\\
\;\;\;\;\frac{\sqrt{-d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(h \cdot \left(-0.5 \cdot \left({\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25\right)\right), {\ell}^{-1}, 1\right)\right)}{\sqrt{-h}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -4.7999999999999998e-208

    1. Initial program 70.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. Applied rewrites78.6%

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

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

    if -4.7999999999999998e-208 < d < 1.3499999999999999e-165

    1. Initial program 39.4%

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

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

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

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

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

      if 1.3499999999999999e-165 < d < 2.3999999999999998e143

      1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.3999999999999998e143 < d

      1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 2: 69.8% accurate, 0.3× speedup?

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

          1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.00000000000000007e-37 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000012e-233 or 2.0000000000000001e231 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

          1. Initial program 26.2%

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

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

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

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

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

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

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

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

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

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

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

              if 5.00000000000000012e-233 < (*.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.0000000000000001e231

              1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

              Alternative 3: 58.4% accurate, 0.3× speedup?

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

                1. Initial program 85.5%

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

                  \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \color{blue}{\left(\frac{-1}{8} \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)} \]
                4. Step-by-step derivation
                  1. *-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 \color{blue}{\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \frac{-1}{8}\right)} \]
                  2. metadata-evalN/A

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{8}\right)\right)}\right) \]
                  3. distribute-rgt-neg-inN/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 \color{blue}{\left(\mathsf{neg}\left(\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell} \cdot \frac{1}{8}\right)\right)} \]
                  4. 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(\mathsf{neg}\left(\color{blue}{\frac{\left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right) \cdot \frac{1}{8}}{{d}^{2} \cdot \ell}}\right)\right) \]
                  5. *-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(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{8} \cdot \left({D}^{2} \cdot \left({M}^{2} \cdot h\right)\right)}}{{d}^{2} \cdot \ell}\right)\right) \]
                  6. *-commutativeN/A

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

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

                    \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{8} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \cdot \frac{{D}^{2}}{\ell}}\right)\right) \]
                  9. distribute-lft-neg-inN/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 \color{blue}{\left(\left(\mathsf{neg}\left(\frac{\frac{1}{8} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}\right)\right) \cdot \frac{{D}^{2}}{\ell}\right)} \]
                  10. *-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(\left(\mathsf{neg}\left(\frac{\color{blue}{\left({M}^{2} \cdot h\right) \cdot \frac{1}{8}}}{{d}^{2}}\right)\right) \cdot \frac{{D}^{2}}{\ell}\right) \]
                  11. 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(\left(\mathsf{neg}\left(\color{blue}{\frac{{M}^{2} \cdot h}{{d}^{2}} \cdot \frac{1}{8}}\right)\right) \cdot \frac{{D}^{2}}{\ell}\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 \color{blue}{\left(\left(\mathsf{neg}\left(\frac{{M}^{2} \cdot h}{{d}^{2}} \cdot \frac{1}{8}\right)\right) \cdot \frac{{D}^{2}}{\ell}\right)} \]
                5. Applied rewrites71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.00000000000000007e-37 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000012e-233 or 2.0000000000000001e231 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l))))

                1. Initial program 26.2%

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

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

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

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

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

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

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

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

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

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

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

                    if 5.00000000000000012e-233 < (*.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.0000000000000001e231

                    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 4: 55.5% accurate, 0.3× speedup?

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

                      1. Initial program 85.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 h around 0

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

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

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

                        \[\leadsto \frac{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                      7. Step-by-step derivation
                        1. Applied rewrites15.8%

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

                        if -9.99999999999999954e-213 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000012e-233 or 2.0000000000000001e231 < (*.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 24.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 h around 0

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

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

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

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

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

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

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

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

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

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

                            if 5.00000000000000012e-233 < (*.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.0000000000000001e231

                            1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 5: 51.6% accurate, 0.3× speedup?

                            \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{h}{\ell}}\\ t_1 := \frac{1}{\left|\frac{\sqrt{\ell \cdot h}}{d}\right|}\\ t_2 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-212}:\\ \;\;\;\;\frac{t\_0 \cdot \left(-d\right)}{h}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-233}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+231}:\\ \;\;\;\;\frac{t\_0 \cdot d}{h}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                            (FPCore (d h l M D)
                             :precision binary64
                             (let* ((t_0 (sqrt (/ h l)))
                                    (t_1 (/ 1.0 (fabs (/ (sqrt (* l h)) d))))
                                    (t_2
                                     (*
                                      (* (pow (/ d l) (/ 1.0 2.0)) (pow (/ d h) (/ 1.0 2.0)))
                                      (-
                                       1.0
                                       (* (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ 1.0 2.0)) (/ h l))))))
                               (if (<= t_2 -1e-212)
                                 (/ (* t_0 (- d)) h)
                                 (if (<= t_2 5e-233) t_1 (if (<= t_2 2e+231) (/ (* t_0 d) h) t_1)))))
                            assert(d < h && h < l && l < M && M < D);
                            double code(double d, double h, double l, double M, double D) {
                            	double t_0 = sqrt((h / l));
                            	double t_1 = 1.0 / fabs((sqrt((l * h)) / d));
                            	double t_2 = (pow((d / l), (1.0 / 2.0)) * pow((d / h), (1.0 / 2.0))) * (1.0 - ((pow(((M * D) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l)));
                            	double tmp;
                            	if (t_2 <= -1e-212) {
                            		tmp = (t_0 * -d) / h;
                            	} else if (t_2 <= 5e-233) {
                            		tmp = t_1;
                            	} else if (t_2 <= 2e+231) {
                            		tmp = (t_0 * d) / h;
                            	} else {
                            		tmp = t_1;
                            	}
                            	return tmp;
                            }
                            
                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                            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
                                real(8) :: t_0
                                real(8) :: t_1
                                real(8) :: t_2
                                real(8) :: tmp
                                t_0 = sqrt((h / l))
                                t_1 = 1.0d0 / abs((sqrt((l * h)) / d))
                                t_2 = (((d / l) ** (1.0d0 / 2.0d0)) * ((d / h) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((((m * d_1) / (2.0d0 * d)) ** 2.0d0) * (1.0d0 / 2.0d0)) * (h / l)))
                                if (t_2 <= (-1d-212)) then
                                    tmp = (t_0 * -d) / h
                                else if (t_2 <= 5d-233) then
                                    tmp = t_1
                                else if (t_2 <= 2d+231) then
                                    tmp = (t_0 * d) / h
                                else
                                    tmp = t_1
                                end if
                                code = tmp
                            end function
                            
                            assert d < h && h < l && l < M && M < D;
                            public static double code(double d, double h, double l, double M, double D) {
                            	double t_0 = Math.sqrt((h / l));
                            	double t_1 = 1.0 / Math.abs((Math.sqrt((l * h)) / d));
                            	double t_2 = (Math.pow((d / l), (1.0 / 2.0)) * Math.pow((d / h), (1.0 / 2.0))) * (1.0 - ((Math.pow(((M * D) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l)));
                            	double tmp;
                            	if (t_2 <= -1e-212) {
                            		tmp = (t_0 * -d) / h;
                            	} else if (t_2 <= 5e-233) {
                            		tmp = t_1;
                            	} else if (t_2 <= 2e+231) {
                            		tmp = (t_0 * d) / h;
                            	} else {
                            		tmp = t_1;
                            	}
                            	return tmp;
                            }
                            
                            [d, h, l, M, D] = sort([d, h, l, M, D])
                            def code(d, h, l, M, D):
                            	t_0 = math.sqrt((h / l))
                            	t_1 = 1.0 / math.fabs((math.sqrt((l * h)) / d))
                            	t_2 = (math.pow((d / l), (1.0 / 2.0)) * math.pow((d / h), (1.0 / 2.0))) * (1.0 - ((math.pow(((M * D) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l)))
                            	tmp = 0
                            	if t_2 <= -1e-212:
                            		tmp = (t_0 * -d) / h
                            	elif t_2 <= 5e-233:
                            		tmp = t_1
                            	elif t_2 <= 2e+231:
                            		tmp = (t_0 * d) / h
                            	else:
                            		tmp = t_1
                            	return tmp
                            
                            d, h, l, M, D = sort([d, h, l, M, D])
                            function code(d, h, l, M, D)
                            	t_0 = sqrt(Float64(h / l))
                            	t_1 = Float64(1.0 / abs(Float64(sqrt(Float64(l * h)) / d)))
                            	t_2 = Float64(Float64((Float64(d / l) ^ Float64(1.0 / 2.0)) * (Float64(d / h) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)) * Float64(h / l))))
                            	tmp = 0.0
                            	if (t_2 <= -1e-212)
                            		tmp = Float64(Float64(t_0 * Float64(-d)) / h);
                            	elseif (t_2 <= 5e-233)
                            		tmp = t_1;
                            	elseif (t_2 <= 2e+231)
                            		tmp = Float64(Float64(t_0 * d) / h);
                            	else
                            		tmp = t_1;
                            	end
                            	return tmp
                            end
                            
                            d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                            function tmp_2 = code(d, h, l, M, D)
                            	t_0 = sqrt((h / l));
                            	t_1 = 1.0 / abs((sqrt((l * h)) / d));
                            	t_2 = (((d / l) ^ (1.0 / 2.0)) * ((d / h) ^ (1.0 / 2.0))) * (1.0 - (((((M * D) / (2.0 * d)) ^ 2.0) * (1.0 / 2.0)) * (h / l)));
                            	tmp = 0.0;
                            	if (t_2 <= -1e-212)
                            		tmp = (t_0 * -d) / h;
                            	elseif (t_2 <= 5e-233)
                            		tmp = t_1;
                            	elseif (t_2 <= 2e+231)
                            		tmp = (t_0 * d) / h;
                            	else
                            		tmp = t_1;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                            code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Abs[N[(N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision] / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-212], N[(N[(t$95$0 * (-d)), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$2, 5e-233], t$95$1, If[LessEqual[t$95$2, 2e+231], N[(N[(t$95$0 * d), $MachinePrecision] / h), $MachinePrecision], t$95$1]]]]]]
                            
                            \begin{array}{l}
                            [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                            \\
                            \begin{array}{l}
                            t_0 := \sqrt{\frac{h}{\ell}}\\
                            t_1 := \frac{1}{\left|\frac{\sqrt{\ell \cdot h}}{d}\right|}\\
                            t_2 := \left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right)\\
                            \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-212}:\\
                            \;\;\;\;\frac{t\_0 \cdot \left(-d\right)}{h}\\
                            
                            \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-233}:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+231}:\\
                            \;\;\;\;\frac{t\_0 \cdot d}{h}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;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)))) < -9.99999999999999954e-213

                              1. Initial program 85.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 h around 0

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

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

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

                                \[\leadsto \frac{\left(d \cdot {\left(\sqrt{-1}\right)}^{2}\right) \cdot \sqrt{\frac{h}{\ell}}}{h} \]
                              7. Step-by-step derivation
                                1. Applied rewrites15.8%

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

                                if -9.99999999999999954e-213 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 5.00000000000000012e-233 or 2.0000000000000001e231 < (*.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 24.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 h around 0

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

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

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

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

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

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

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

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

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

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

                                    if 5.00000000000000012e-233 < (*.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.0000000000000001e231

                                    1. Initial program 98.0%

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

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

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

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

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

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

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

                                    Alternative 6: 48.7% accurate, 0.3× speedup?

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

                                      1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

                                        if -1e20 < (*.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.99999999999999992e-171 or 1.00000000000000005e149 < (*.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 38.5%

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

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

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

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

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

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

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

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

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

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

                                          if 4.99999999999999992e-171 < (*.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.00000000000000005e149

                                          1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 7: 46.1% accurate, 0.5× speedup?

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

                                            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                                if 5.00000000000000012e-233 < (*.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.0000000000000001e231

                                                1. Initial program 98.0%

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

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

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

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

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

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

                                                  if 2.0000000000000001e231 < (*.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.5%

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

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

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

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

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

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

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

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

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

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

                                                    Alternative 8: 46.1% accurate, 0.5× speedup?

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

                                                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

                                                          if 5.00000000000000012e-233 < (*.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.0000000000000001e231

                                                          1. Initial program 98.0%

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

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

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

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

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

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

                                                            if 2.0000000000000001e231 < (*.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.5%

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

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

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

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

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

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

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

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

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

                                                            Alternative 9: 76.4% accurate, 0.8× speedup?

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

                                                              1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              if 2.0000000000000001e231 < (*.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.5%

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

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

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

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

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

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

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

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

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

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

                                                                Alternative 10: 45.2% accurate, 0.9× speedup?

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

                                                                  1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

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

                                                                    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

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

                                                                    Alternative 11: 76.9% accurate, 1.2× speedup?

                                                                    \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(h \cdot \left(-0.5 \cdot \left({\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25\right)\right), {\ell}^{-1}, 1\right)\right)}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+16}:\\ \;\;\;\;t\_0 \cdot \left(1 - \frac{\frac{M}{d} \cdot \left(\left(0.5 \cdot D\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}\right)\\ \mathbf{elif}\;\ell \leq 2.15 \cdot 10^{+74}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{M \cdot M}{d} \cdot -0.125\right) \cdot \left(D \cdot D\right), \sqrt{\frac{h}{{\ell}^{3}}}, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\ \end{array} \end{array} \]
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    (FPCore (d h l M D)
                                                                     :precision binary64
                                                                     (let* ((t_0 (* (sqrt (/ 1.0 (* l h))) d)))
                                                                       (if (<= l -5e-310)
                                                                         (/
                                                                          (*
                                                                           (sqrt (- d))
                                                                           (*
                                                                            (sqrt (/ d l))
                                                                            (fma
                                                                             (* h (* -0.5 (* (pow (/ (/ d D) M) -2.0) 0.25)))
                                                                             (pow l -1.0)
                                                                             1.0)))
                                                                          (sqrt (- h)))
                                                                         (if (<= l 1.32e+16)
                                                                           (*
                                                                            t_0
                                                                            (-
                                                                             1.0
                                                                             (*
                                                                              (/ (* (/ M d) (* (* 0.5 D) 0.5)) (pow h -1.0))
                                                                              (/ (* (* (/ 0.5 d) D) M) l))))
                                                                           (if (<= l 2.15e+74)
                                                                             (fma
                                                                              (* (* (/ (* M M) d) -0.125) (* D D))
                                                                              (sqrt (/ h (pow l 3.0)))
                                                                              t_0)
                                                                             (*
                                                                              (- 1.0 (* (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ 1.0 2.0)) (/ h l)))
                                                                              (* (/ (sqrt d) (sqrt l)) (pow (/ d h) (/ 1.0 2.0)))))))))
                                                                    assert(d < h && h < l && l < M && M < D);
                                                                    double code(double d, double h, double l, double M, double D) {
                                                                    	double t_0 = sqrt((1.0 / (l * h))) * d;
                                                                    	double tmp;
                                                                    	if (l <= -5e-310) {
                                                                    		tmp = (sqrt(-d) * (sqrt((d / l)) * fma((h * (-0.5 * (pow(((d / D) / M), -2.0) * 0.25))), pow(l, -1.0), 1.0))) / sqrt(-h);
                                                                    	} else if (l <= 1.32e+16) {
                                                                    		tmp = t_0 * (1.0 - ((((M / d) * ((0.5 * D) * 0.5)) / pow(h, -1.0)) * ((((0.5 / d) * D) * M) / l)));
                                                                    	} else if (l <= 2.15e+74) {
                                                                    		tmp = fma(((((M * M) / d) * -0.125) * (D * D)), sqrt((h / pow(l, 3.0))), t_0);
                                                                    	} else {
                                                                    		tmp = (1.0 - ((pow(((M * D) / (2.0 * d)), 2.0) * (1.0 / 2.0)) * (h / l))) * ((sqrt(d) / sqrt(l)) * pow((d / h), (1.0 / 2.0)));
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    d, h, l, M, D = sort([d, h, l, M, D])
                                                                    function code(d, h, l, M, D)
                                                                    	t_0 = Float64(sqrt(Float64(1.0 / Float64(l * h))) * d)
                                                                    	tmp = 0.0
                                                                    	if (l <= -5e-310)
                                                                    		tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(sqrt(Float64(d / l)) * fma(Float64(h * Float64(-0.5 * Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25))), (l ^ -1.0), 1.0))) / sqrt(Float64(-h)));
                                                                    	elseif (l <= 1.32e+16)
                                                                    		tmp = Float64(t_0 * Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(0.5 * D) * 0.5)) / (h ^ -1.0)) * Float64(Float64(Float64(Float64(0.5 / d) * D) * M) / l))));
                                                                    	elseif (l <= 2.15e+74)
                                                                    		tmp = fma(Float64(Float64(Float64(Float64(M * M) / d) * -0.125) * Float64(D * D)), sqrt(Float64(h / (l ^ 3.0))), t_0);
                                                                    	else
                                                                    		tmp = Float64(Float64(1.0 - Float64(Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(1.0 / 2.0)) * Float64(h / l))) * Float64(Float64(sqrt(d) / sqrt(l)) * (Float64(d / h) ^ Float64(1.0 / 2.0))));
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(h * N[(-0.5 * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[l, -1.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.32e+16], N[(t$95$0 * N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(0.5 * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.15e+74], N[(N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(1.0 - N[(N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(1.0 / 2.0), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_0 := \sqrt{\frac{1}{\ell \cdot h}} \cdot d\\
                                                                    \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
                                                                    \;\;\;\;\frac{\sqrt{-d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(h \cdot \left(-0.5 \cdot \left({\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25\right)\right), {\ell}^{-1}, 1\right)\right)}{\sqrt{-h}}\\
                                                                    
                                                                    \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+16}:\\
                                                                    \;\;\;\;t\_0 \cdot \left(1 - \frac{\frac{M}{d} \cdot \left(\left(0.5 \cdot D\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}\right)\\
                                                                    
                                                                    \mathbf{elif}\;\ell \leq 2.15 \cdot 10^{+74}:\\
                                                                    \;\;\;\;\mathsf{fma}\left(\left(\frac{M \cdot M}{d} \cdot -0.125\right) \cdot \left(D \cdot D\right), \sqrt{\frac{h}{{\ell}^{3}}}, t\_0\right)\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\left(1 - \left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{1}{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot {\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)}\right)\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 4 regimes
                                                                    2. if l < -4.999999999999985e-310

                                                                      1. Initial program 66.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 rewrites76.4%

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

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

                                                                      if -4.999999999999985e-310 < l < 1.32e16

                                                                      1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if 1.32e16 < l < 2.15e74

                                                                      1. Initial program 40.1%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if 2.15e74 < l

                                                                      1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    Alternative 12: 77.1% accurate, 1.3× speedup?

                                                                    \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{-d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(h \cdot \left(-0.5 \cdot \left({\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25\right)\right), {\ell}^{-1}, 1\right)\right)}{\sqrt{-h}}\\ \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+16}:\\ \;\;\;\;t\_0 \cdot \left(1 - \frac{\frac{M}{d} \cdot \left(\left(0.5 \cdot D\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}\right)\\ \mathbf{elif}\;\ell \leq 2.15 \cdot 10^{+74}:\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{M \cdot M}{d} \cdot -0.125\right) \cdot \left(D \cdot D\right), \sqrt{\frac{h}{{\ell}^{3}}}, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{-0.5} \cdot \left(\left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot -0.5, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right)\right) \cdot \sqrt{d}\right)\\ \end{array} \end{array} \]
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    (FPCore (d h l M D)
                                                                     :precision binary64
                                                                     (let* ((t_0 (* (sqrt (/ 1.0 (* l h))) d)))
                                                                       (if (<= l -5e-310)
                                                                         (/
                                                                          (*
                                                                           (sqrt (- d))
                                                                           (*
                                                                            (sqrt (/ d l))
                                                                            (fma
                                                                             (* h (* -0.5 (* (pow (/ (/ d D) M) -2.0) 0.25)))
                                                                             (pow l -1.0)
                                                                             1.0)))
                                                                          (sqrt (- h)))
                                                                         (if (<= l 1.32e+16)
                                                                           (*
                                                                            t_0
                                                                            (-
                                                                             1.0
                                                                             (*
                                                                              (/ (* (/ M d) (* (* 0.5 D) 0.5)) (pow h -1.0))
                                                                              (/ (* (* (/ 0.5 d) D) M) l))))
                                                                           (if (<= l 2.15e+74)
                                                                             (fma
                                                                              (* (* (/ (* M M) d) -0.125) (* D D))
                                                                              (sqrt (/ h (pow l 3.0)))
                                                                              t_0)
                                                                             (*
                                                                              (pow l -0.5)
                                                                              (*
                                                                               (*
                                                                                (sqrt (/ d h))
                                                                                (fma (* (/ h l) -0.5) (pow (* (/ 2.0 M) (/ d D)) -2.0) 1.0))
                                                                               (sqrt d))))))))
                                                                    assert(d < h && h < l && l < M && M < D);
                                                                    double code(double d, double h, double l, double M, double D) {
                                                                    	double t_0 = sqrt((1.0 / (l * h))) * d;
                                                                    	double tmp;
                                                                    	if (l <= -5e-310) {
                                                                    		tmp = (sqrt(-d) * (sqrt((d / l)) * fma((h * (-0.5 * (pow(((d / D) / M), -2.0) * 0.25))), pow(l, -1.0), 1.0))) / sqrt(-h);
                                                                    	} else if (l <= 1.32e+16) {
                                                                    		tmp = t_0 * (1.0 - ((((M / d) * ((0.5 * D) * 0.5)) / pow(h, -1.0)) * ((((0.5 / d) * D) * M) / l)));
                                                                    	} else if (l <= 2.15e+74) {
                                                                    		tmp = fma(((((M * M) / d) * -0.125) * (D * D)), sqrt((h / pow(l, 3.0))), t_0);
                                                                    	} else {
                                                                    		tmp = pow(l, -0.5) * ((sqrt((d / h)) * fma(((h / l) * -0.5), pow(((2.0 / M) * (d / D)), -2.0), 1.0)) * sqrt(d));
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    d, h, l, M, D = sort([d, h, l, M, D])
                                                                    function code(d, h, l, M, D)
                                                                    	t_0 = Float64(sqrt(Float64(1.0 / Float64(l * h))) * d)
                                                                    	tmp = 0.0
                                                                    	if (l <= -5e-310)
                                                                    		tmp = Float64(Float64(sqrt(Float64(-d)) * Float64(sqrt(Float64(d / l)) * fma(Float64(h * Float64(-0.5 * Float64((Float64(Float64(d / D) / M) ^ -2.0) * 0.25))), (l ^ -1.0), 1.0))) / sqrt(Float64(-h)));
                                                                    	elseif (l <= 1.32e+16)
                                                                    		tmp = Float64(t_0 * Float64(1.0 - Float64(Float64(Float64(Float64(M / d) * Float64(Float64(0.5 * D) * 0.5)) / (h ^ -1.0)) * Float64(Float64(Float64(Float64(0.5 / d) * D) * M) / l))));
                                                                    	elseif (l <= 2.15e+74)
                                                                    		tmp = fma(Float64(Float64(Float64(Float64(M * M) / d) * -0.125) * Float64(D * D)), sqrt(Float64(h / (l ^ 3.0))), t_0);
                                                                    	else
                                                                    		tmp = Float64((l ^ -0.5) * Float64(Float64(sqrt(Float64(d / h)) * fma(Float64(Float64(h / l) * -0.5), (Float64(Float64(2.0 / M) * Float64(d / D)) ^ -2.0), 1.0)) * sqrt(d)));
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(N[(N[Sqrt[(-d)], $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(h * N[(-0.5 * N[(N[Power[N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision], -2.0], $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[l, -1.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.32e+16], N[(t$95$0 * N[(1.0 - N[(N[(N[(N[(M / d), $MachinePrecision] * N[(N[(0.5 * D), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / N[Power[h, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.5 / d), $MachinePrecision] * D), $MachinePrecision] * M), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.15e+74], N[(N[(N[(N[(N[(M * M), $MachinePrecision] / d), $MachinePrecision] * -0.125), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[Power[l, -0.5], $MachinePrecision] * N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] * N[Power[N[(N[(2.0 / M), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_0 := \sqrt{\frac{1}{\ell \cdot h}} \cdot d\\
                                                                    \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
                                                                    \;\;\;\;\frac{\sqrt{-d} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(h \cdot \left(-0.5 \cdot \left({\left(\frac{\frac{d}{D}}{M}\right)}^{-2} \cdot 0.25\right)\right), {\ell}^{-1}, 1\right)\right)}{\sqrt{-h}}\\
                                                                    
                                                                    \mathbf{elif}\;\ell \leq 1.32 \cdot 10^{+16}:\\
                                                                    \;\;\;\;t\_0 \cdot \left(1 - \frac{\frac{M}{d} \cdot \left(\left(0.5 \cdot D\right) \cdot 0.5\right)}{{h}^{-1}} \cdot \frac{\left(\frac{0.5}{d} \cdot D\right) \cdot M}{\ell}\right)\\
                                                                    
                                                                    \mathbf{elif}\;\ell \leq 2.15 \cdot 10^{+74}:\\
                                                                    \;\;\;\;\mathsf{fma}\left(\left(\frac{M \cdot M}{d} \cdot -0.125\right) \cdot \left(D \cdot D\right), \sqrt{\frac{h}{{\ell}^{3}}}, t\_0\right)\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;{\ell}^{-0.5} \cdot \left(\left(\sqrt{\frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot -0.5, {\left(\frac{2}{M} \cdot \frac{d}{D}\right)}^{-2}, 1\right)\right) \cdot \sqrt{d}\right)\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 4 regimes
                                                                    2. if l < -4.999999999999985e-310

                                                                      1. Initial program 66.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 rewrites76.4%

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

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

                                                                      if -4.999999999999985e-310 < l < 1.32e16

                                                                      1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if 1.32e16 < l < 2.15e74

                                                                      1. Initial program 40.1%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if 2.15e74 < l

                                                                      1. Initial program 61.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 rewrites68.6%

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

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

                                                                    Alternative 13: 46.0% accurate, 9.6× speedup?

                                                                    \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \begin{array}{l} \mathbf{if}\;d \leq 2.5 \cdot 10^{-268}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \end{array} \]
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    (FPCore (d h l M D)
                                                                     :precision binary64
                                                                     (if (<= d 2.5e-268)
                                                                       (* (sqrt (/ 1.0 (* l h))) (- d))
                                                                       (/ d (* (sqrt h) (sqrt l)))))
                                                                    assert(d < h && h < l && l < M && M < D);
                                                                    double code(double d, double h, double l, double M, double D) {
                                                                    	double tmp;
                                                                    	if (d <= 2.5e-268) {
                                                                    		tmp = sqrt((1.0 / (l * h))) * -d;
                                                                    	} else {
                                                                    		tmp = d / (sqrt(h) * sqrt(l));
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    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
                                                                        real(8) :: tmp
                                                                        if (d <= 2.5d-268) then
                                                                            tmp = sqrt((1.0d0 / (l * h))) * -d
                                                                        else
                                                                            tmp = d / (sqrt(h) * sqrt(l))
                                                                        end if
                                                                        code = tmp
                                                                    end function
                                                                    
                                                                    assert d < h && h < l && l < M && M < D;
                                                                    public static double code(double d, double h, double l, double M, double D) {
                                                                    	double tmp;
                                                                    	if (d <= 2.5e-268) {
                                                                    		tmp = Math.sqrt((1.0 / (l * h))) * -d;
                                                                    	} else {
                                                                    		tmp = d / (Math.sqrt(h) * Math.sqrt(l));
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                    def code(d, h, l, M, D):
                                                                    	tmp = 0
                                                                    	if d <= 2.5e-268:
                                                                    		tmp = math.sqrt((1.0 / (l * h))) * -d
                                                                    	else:
                                                                    		tmp = d / (math.sqrt(h) * math.sqrt(l))
                                                                    	return tmp
                                                                    
                                                                    d, h, l, M, D = sort([d, h, l, M, D])
                                                                    function code(d, h, l, M, D)
                                                                    	tmp = 0.0
                                                                    	if (d <= 2.5e-268)
                                                                    		tmp = Float64(sqrt(Float64(1.0 / Float64(l * h))) * Float64(-d));
                                                                    	else
                                                                    		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                    function tmp_2 = code(d, h, l, M, D)
                                                                    	tmp = 0.0;
                                                                    	if (d <= 2.5e-268)
                                                                    		tmp = sqrt((1.0 / (l * h))) * -d;
                                                                    	else
                                                                    		tmp = d / (sqrt(h) * sqrt(l));
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                    code[d_, h_, l_, M_, D_] := If[LessEqual[d, 2.5e-268], N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-d)), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                    
                                                                    \begin{array}{l}
                                                                    [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;d \leq 2.5 \cdot 10^{-268}:\\
                                                                    \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot \left(-d\right)\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if d < 2.5e-268

                                                                      1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if 2.5e-268 < d

                                                                      1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        Alternative 14: 26.0% accurate, 15.3× speedup?

                                                                        \[\begin{array}{l} [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\ \\ \frac{d}{\sqrt{\ell \cdot h}} \end{array} \]
                                                                        NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                        (FPCore (d h l M D) :precision binary64 (/ d (sqrt (* l h))))
                                                                        assert(d < h && h < l && l < M && M < D);
                                                                        double code(double d, double h, double l, double M, double D) {
                                                                        	return d / sqrt((l * h));
                                                                        }
                                                                        
                                                                        NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                        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 / sqrt((l * h))
                                                                        end function
                                                                        
                                                                        assert d < h && h < l && l < M && M < D;
                                                                        public static double code(double d, double h, double l, double M, double D) {
                                                                        	return d / Math.sqrt((l * h));
                                                                        }
                                                                        
                                                                        [d, h, l, M, D] = sort([d, h, l, M, D])
                                                                        def code(d, h, l, M, D):
                                                                        	return d / math.sqrt((l * h))
                                                                        
                                                                        d, h, l, M, D = sort([d, h, l, M, D])
                                                                        function code(d, h, l, M, D)
                                                                        	return Float64(d / sqrt(Float64(l * h)))
                                                                        end
                                                                        
                                                                        d, h, l, M, D = num2cell(sort([d, h, l, M, D])){:}
                                                                        function tmp = code(d, h, l, M, D)
                                                                        	tmp = d / sqrt((l * h));
                                                                        end
                                                                        
                                                                        NOTE: d, h, l, M, and D should be sorted in increasing order before calling this function.
                                                                        code[d_, h_, l_, M_, D_] := N[(d / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                                                                        
                                                                        \begin{array}{l}
                                                                        [d, h, l, M, D] = \mathsf{sort}([d, h, l, M, D])\\
                                                                        \\
                                                                        \frac{d}{\sqrt{\ell \cdot h}}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

                                                                          Reproduce

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